mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 16:17:34 +00:00
Issue 2552 - generate class initializer body only after field member injection
This commit is contained in:
1 parent
60a9799c24
commit
edbfdfe8c5
1 file changed
+6
-2
@@ -171,10 +171,10 @@ public class HandleFieldNameConstants extends EclipseAnnotationHandler<FieldName
|
||||
injectMethod(fieldsType, constructor);
|
||||
}
|
||||
|
||||
Clinit cli = null;
|
||||
if (genClinit) {
|
||||
Clinit cli = new Clinit(parent.compilationResult);
|
||||
cli = new Clinit(parent.compilationResult);
|
||||
injectMethod(fieldsType, cli);
|
||||
cli.traverse(generatedByVisitor, ((TypeDeclaration) fieldsType.get()).scope);
|
||||
}
|
||||
|
||||
for (EclipseNode fieldNode : fields) {
|
||||
@@ -202,5 +202,9 @@ public class HandleFieldNameConstants extends EclipseAnnotationHandler<FieldName
|
||||
injectField(fieldsType, constantField);
|
||||
constantField.traverse(generatedByVisitor, ((TypeDeclaration) fieldsType.get()).initializerScope);
|
||||
}
|
||||
|
||||
if (genClinit) {
|
||||
cli.traverse(generatedByVisitor, ((TypeDeclaration) fieldsType.get()).scope);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user