From 1bfe6ee1a54f225876afa7fb479a4f34ac338ade Mon Sep 17 00:00:00 2001 From: Philipp Eichhorn Date: Mon, 24 Jan 2011 08:37:51 +0100 Subject: In javac, @XArgsConstructor on enums was not forcing the generated constructor to be private (as all enum constructors have to be). Fixes issue #186 --- src/core/lombok/javac/handlers/HandleConstructor.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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 fields, boolean suppressConstructorProperties) { TreeMaker maker = typeNode.getTreeMaker(); + boolean isEnum = (((JCClassDecl) typeNode.get()).mods.flags & Flags.ENUM) != 0; + if (isEnum) level = AccessLevel.PRIVATE; + ListBuffer nullChecks = ListBuffer.lb(); ListBuffer assigns = ListBuffer.lb(); ListBuffer params = ListBuffer.lb(); -- cgit