Skip to content

Commit 7f02a4c

Browse files
committed
Remove generic type
1 parent b8d4f68 commit 7f02a4c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/openrewrite/java/migrate/lang/ReplaceUnusedVariablesWithUnderscore.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,17 @@ public J.Lambda visitLambda(J.Lambda lambda, ExecutionContext ctx) {
8989
private void renameVariableIfUnusedInContext(J.VariableDeclarations.NamedVariable variable, J context) {
9090
if (!UNDERSCORE.equals(variable.getName().getSimpleName()) &&
9191
VariableReferences.findRhsReferences(context, variable.getName()).isEmpty() &&
92-
!usedInModifyingUnary(context, variable.getName())) {
92+
!usedInModifyingUnary(variable.getName(), context)) {
9393
doAfterVisit(new RenameVariable<>(variable, UNDERSCORE));
9494
}
9595
}
9696

97-
private <T extends J> boolean usedInModifyingUnary(J context, J.Identifier name) {
97+
private boolean usedInModifyingUnary(J.Identifier identifier, J context) {
9898
return new JavaIsoVisitor<AtomicBoolean>() {
9999
@Override
100100
public J.Unary visitUnary(J.Unary unary, AtomicBoolean atomicBoolean) {
101101
if (unary.getOperator().isModifying() &&
102-
SemanticallyEqual.areEqual(name, unary.getExpression())) {
102+
SemanticallyEqual.areEqual(identifier, unary.getExpression())) {
103103
atomicBoolean.set(true);
104104
}
105105
return super.visitUnary(unary, atomicBoolean);

0 commit comments

Comments
 (0)