aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Eichhorn <peichhor@web.de>2011-01-24 08:37:51 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2011-01-24 08:37:51 +0100
commit1bfe6ee1a54f225876afa7fb479a4f34ac338ade (patch)
tree5383038cef13cbcf5254b0aae526c15771279def /src
parentc305e2c86f39f4cd0d80c39d0cc8ea9894eb6716 (diff)
downloadlombok-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.java3
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();