Skip to content

UnnecessaryExplicitTypeArguments should work within lambdas too #670

@greg-at-moderne

Description

@greg-at-moderne

Problem statement

See org.openrewrite.staticanalysis.UnnecessaryExplicitTypeArgumentsTest#withinLambda.

rewriteRun(
//language=java
java(
"""
import java.util.function.Function;
class Test {
Function<Object, Object> f = (d1) -> {
return this.<Object>test();
};
<T> T test() {
return this.test();
}
}
""",
"""
import java.util.function.Function;
class Test {
Function<Object, Object> f = (d1) -> {
return this.test();
};
<T> T test() {
return this.test();
}
}
"""
)
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions