Skip to content

Commit c35b7d6

Browse files
Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent b38f90d commit c35b7d6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/org/openrewrite/java/migrate/lombok/ConvertGetter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import lombok.AccessLevel;
1919
import lombok.EqualsAndHashCode;
2020
import lombok.Value;
21+
import org.jspecify.annotations.Nullable;
2122
import org.openrewrite.ExecutionContext;
2223
import org.openrewrite.Recipe;
2324
import org.openrewrite.TreeVisitor;
@@ -91,7 +92,7 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex
9192
}
9293

9394
@Override
94-
public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, ExecutionContext ctx) {
95+
public @Nullable J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, ExecutionContext ctx) {
9596
assert method.getMethodType() != null;
9697

9798
if (LombokUtils.isEffectivelyGetter(method)) {

src/main/java/org/openrewrite/java/migrate/lombok/LombokUtils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ public static boolean isEffectivelyGetter(J.MethodDeclaration method) {
4242
if (returnExpression instanceof J.Identifier) {
4343
J.Identifier identifier = (J.Identifier) returnExpression;
4444
JavaType.Variable fieldType = identifier.getFieldType();
45-
boolean typeMatch = method.getType().equals(fieldType.getType());
46-
return typeMatch;
45+
return method.getType().equals(fieldType.getType());
4746
}
4847
}
4948
return false;

0 commit comments

Comments
 (0)