aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2010-11-18 20:47:58 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2010-11-18 20:47:58 +0100
commitca24a4c3ec6c328463a07ce171c413f96be14d95 (patch)
tree0512a70fc2bae428944fc0ee77960d65e6d30a1d /src/core/lombok/javac
parentc86d0fcc37cee701d9781e255e5fc22dc9e2fa41 (diff)
downloadlombok-ca24a4c3ec6c328463a07ce171c413f96be14d95.tar.gz
lombok-ca24a4c3ec6c328463a07ce171c413f96be14d95.tar.bz2
lombok-ca24a4c3ec6c328463a07ce171c413f96be14d95.zip
Fixed @AllArgsConstructor screwing up with final fields that have been initialized.
Diffstat (limited to 'src/core/lombok/javac')
-rw-r--r--src/core/lombok/javac/handlers/HandleConstructor.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/lombok/javac/handlers/HandleConstructor.java b/src/core/lombok/javac/handlers/HandleConstructor.java
index 3370685e..7f0c2ba6 100644
--- a/src/core/lombok/javac/handlers/HandleConstructor.java
+++ b/src/core/lombok/javac/handlers/HandleConstructor.java
@@ -130,11 +130,13 @@ public class HandleConstructor {
for (JavacNode child : typeNode.down()) {
if (child.getKind() != Kind.FIELD) continue;
JCVariableDecl fieldDecl = (JCVariableDecl) child.get();
- //Skip fields that start with $
+ // Skip fields that start with $
if (fieldDecl.name.toString().startsWith("$")) continue;
long fieldFlags = fieldDecl.mods.flags;
- //Skip static fields.
+ // Skip static fields.
if ((fieldFlags & Flags.STATIC) != 0) continue;
+ // Skip initialized final fields.
+ if (((fieldFlags & Flags.FINAL) != 0) && fieldDecl.init != null) continue;
fields.append(child);
}
new HandleConstructor().generateConstructor(typeNode, level, fields.toList(), staticName, false, suppressConstructorProperties);