From ca24a4c3ec6c328463a07ce171c413f96be14d95 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 18 Nov 2010 20:47:58 +0100 Subject: Fixed @AllArgsConstructor screwing up with final fields that have been initialized. --- src/core/lombok/eclipse/handlers/HandleConstructor.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core/lombok/eclipse') diff --git a/src/core/lombok/eclipse/handlers/HandleConstructor.java b/src/core/lombok/eclipse/handlers/HandleConstructor.java index 826d4c1c..f5025b19 100644 --- a/src/core/lombok/eclipse/handlers/HandleConstructor.java +++ b/src/core/lombok/eclipse/handlers/HandleConstructor.java @@ -130,10 +130,12 @@ public class HandleConstructor { for (EclipseNode child : typeNode.down()) { if (child.getKind() != Kind.FIELD) continue; FieldDeclaration fieldDecl = (FieldDeclaration) child.get(); - //Skip fields that start with $ + // Skip fields that start with $ if (fieldDecl.name.length > 0 && fieldDecl.name[0] == '$') continue; - //Skip static fields. + // Skip static fields. if ((fieldDecl.modifiers & ClassFileConstants.AccStatic) != 0) continue; + // Skip initialized final fields. + if (((fieldDecl.modifiers & ClassFileConstants.AccFinal) != 0) && fieldDecl.initialization != null) continue; fields.add(child); } new HandleConstructor().generateConstructor(typeNode, level, fields, staticName, false, suppressConstructorProperties, ast); -- cgit