mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 06:17:44 +00:00
In javac, @XArgsConstructor on enums was not forcing the generated constructor to be private (as all enum constructors have to be).
Fixes issue #186
This commit is contained in:
1 parent
c305e2c86f
commit
1bfe6ee1a5
1 file changed
+3
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user