From 8e76a4328325255cc4b269d78b9a7be11f4f9ee9 Mon Sep 17 00:00:00 2001 From: Michael Keppler Date: Sun, 1 Oct 2023 10:56:33 +0200 Subject: [PATCH] Avoid NPE in SemanticallyEqual (#3586) Fixes #3585. --- .../java/org/openrewrite/java/search/SemanticallyEqual.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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())) {