mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 12:16:49 +00:00
No constructor entry should be made for assigned final fields
This commit is contained in:
1 parent
ffec3c35f3
commit
237c337ed1
2 files changed
+2
-2
No files matched your search
@@ -119,7 +119,7 @@ public class HandleData implements EclipseAnnotationHandler<Data> {
|
||||
if ( (fieldDecl.modifiers & ClassFileConstants.AccTransient) == 0 ) nodesForEquality.add(child);
|
||||
boolean isFinal = (fieldDecl.modifiers & ClassFileConstants.AccFinal) != 0;
|
||||
nodesForToString.add(child);
|
||||
if ( isFinal ) nodesForConstructor.add(child);
|
||||
if ( isFinal && fieldDecl.initialization == null ) nodesForConstructor.add(child);
|
||||
new HandleGetter().generateGetterForField(child, annotationNode.get());
|
||||
if ( !isFinal ) new HandleSetter().generateSetterForField(child, annotationNode.get());
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class HandleData implements JavacAnnotationHandler<Data> {
|
||||
if ( (fieldFlags & Flags.TRANSIENT) == 0 ) nodesForEquality = nodesForEquality.append(child);
|
||||
boolean isFinal = (fieldFlags & Flags.FINAL) != 0;
|
||||
nodesForToString = nodesForToString.append(child);
|
||||
if ( isFinal ) nodesForConstructor = nodesForConstructor.append(child);
|
||||
if ( isFinal && fieldDecl.init == null ) nodesForConstructor = nodesForConstructor.append(child);
|
||||
new HandleGetter().generateGetterForField(child, annotationNode.get());
|
||||
if ( !isFinal ) new HandleSetter().generateSetterForField(child, annotationNode.get());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user