diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/SemanticallyEqual.java b/rewrite-java/src/main/java/org/openrewrite/java/search/SemanticallyEqual.java index 2b513f0fe88..30adccf6651 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/SemanticallyEqual.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/SemanticallyEqual.java @@ -875,7 +875,7 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, J j) J.MethodInvocation compareTo = (J.MethodInvocation) j; if (!method.getSimpleName().equals(compareTo.getSimpleName()) || !TypeUtils.isOfType(method.getMethodType(), compareTo.getMethodType()) || - !(static_ == compareTo.getMethodType().hasFlags(Flag.Static) || + !(static_ == (compareTo.getMethodType() != null && compareTo.getMethodType().hasFlags(Flag.Static)) || !nullMissMatch(method.getSelect(), compareTo.getSelect())) || method.getArguments().size() != compareTo.getArguments().size() || nullListSizeMissMatch(method.getTypeParameters(), compareTo.getTypeParameters())) {