diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveRedundantDependencyVersions.java b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveRedundantDependencyVersions.java index 7e9c1a447f8..615bd042977 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveRedundantDependencyVersions.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveRedundantDependencyVersions.java @@ -173,9 +173,9 @@ && matchesGlob(d.getArtifactId(), exceptedArtifactId)) { } @Nullable - private static String getManagedPluginVersion(ResolvedPom resolvedPom, String groupId, String artifactId) { + private static String getManagedPluginVersion(ResolvedPom resolvedPom, @Nullable String groupId, String artifactId) { for (Plugin p : resolvedPom.getPluginManagement()) { - if (groupId.equals(p.getGroupId()) && artifactId.equals(p.getArtifactId())) { + if (p.getGroupId().equals(groupId) && p.getArtifactId().equals(artifactId)) { return resolvedPom.getValue(p.getVersion()); } }