diff options
author | Philipp Eichhorn <peichhor@web.de> | 2011-01-24 08:37:51 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2011-01-24 08:37:51 +0100 |
commit | 1bfe6ee1a54f225876afa7fb479a4f34ac338ade (patch) | |
tree | 5383038cef13cbcf5254b0aae526c15771279def /src | |
parent | c305e2c86f39f4cd0d80c39d0cc8ea9894eb6716 (diff) | |
download | lombok-1bfe6ee1a54f225876afa7fb479a4f34ac338ade.tar.gz lombok-1bfe6ee1a54f225876afa7fb479a4f34ac338ade.tar.bz2 lombok-1bfe6ee1a54f225876afa7fb479a4f34ac338ade.zip |
In javac, @XArgsConstructor on enums was not forcing the generated constructor to be private (as all enum constructors have to be).
Fixes issue #186
Diffstat (limited to 'src')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleConstructor.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/lombok/javac/handlers/HandleConstructor.java b/src/core/lombok/javac/handlers/HandleConstructor.java index 3cb36c30..ecc7c744 100644 --- a/src/core/lombok/javac/handlers/HandleConstructor.java +++ b/src/core/lombok/javac/handlers/HandleConstructor.java @@ -208,6 +208,9 @@ public class HandleConstructor { private JCMethodDecl createConstructor(AccessLevel level, JavacNode typeNode, List<JavacNode> fields, boolean suppressConstructorProperties) { TreeMaker maker = typeNode.getTreeMaker(); + boolean isEnum = (((JCClassDecl) typeNode.get()).mods.flags & Flags.ENUM) != 0; + if (isEnum) level = AccessLevel.PRIVATE; + ListBuffer<JCStatement> nullChecks = ListBuffer.lb(); ListBuffer<JCStatement> assigns = ListBuffer.lb(); ListBuffer<JCVariableDecl> params = ListBuffer.lb(); |