diff --git a/rewrite-java-lombok/src/main/java/org/openrewrite/java/lombok/AllArgsConstructorHandler.java b/rewrite-java-lombok/src/main/java/org/openrewrite/java/lombok/AllArgsConstructorHandler.java index a8071ede4f7..b629bee724a 100644 --- a/rewrite-java-lombok/src/main/java/org/openrewrite/java/lombok/AllArgsConstructorHandler.java +++ b/rewrite-java-lombok/src/main/java/org/openrewrite/java/lombok/AllArgsConstructorHandler.java @@ -38,7 +38,9 @@ public void handle(AnnotationValues annotationValues, JCTree if (originalArg instanceof JCTree.JCAssign && ((JCTree.JCAssign) originalArg).getVariable() instanceof JCTree.JCIdent) { JCTree.JCAssign assign = (JCTree.JCAssign) originalArg; JCTree.JCIdent ident = (JCTree.JCIdent) assign.getVariable(); - if ("onConstructor".equals(ident.getName().toString())) { + String name = ident.getName().toString(); + if (name.equals("onConstructor") || name.equals("onConstructor_")) { + // In Java 1.8+ the parameter is `onConstructor_` continue; } }