Skip to content

Commit

Permalink
Correct handler for @AllArgsConstructorHandler
Browse files Browse the repository at this point in the history
The `onConstructor` parameter is specified as `onConstructor_` on Java 1.8+ (as in the case of `J.Modifier` for example).
  • Loading branch information
knutwannheden committed Nov 7, 2024
1 parent 1007940 commit 6b7d843
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public void handle(AnnotationValues<AllArgsConstructor> 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;
}
}
Expand Down

0 comments on commit 6b7d843

Please sign in to comment.