diff --git a/rewrite-core/src/main/java/org/openrewrite/FindParseFailures.java b/rewrite-core/src/main/java/org/openrewrite/FindParseFailures.java index 8dcc2c3294a..cb954922dae 100644 --- a/rewrite-core/src/main/java/org/openrewrite/FindParseFailures.java +++ b/rewrite-core/src/main/java/org/openrewrite/FindParseFailures.java @@ -21,6 +21,8 @@ import org.openrewrite.marker.Markup; import org.openrewrite.table.ParseFailures; +import java.util.Objects; + @Value @EqualsAndHashCode(callSuper = true) public class FindParseFailures extends Recipe { @@ -66,7 +68,7 @@ public TreeVisitor getVisitor() { public Tree postVisit(Tree tree, ExecutionContext ctx) { return tree.getMarkers().findFirst(ParseExceptionResult.class) .map(exceptionResult -> { - if (parserType != null && !exceptionResult.getParserType().equals(parserType)) { + if (parserType != null && !Objects.equals(exceptionResult.getParserType(), parserType)) { return tree; }