diff options
author | Rawi01 <Rawi01@users.noreply.github.com> | 2020-04-25 19:20:23 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2020-05-14 21:58:32 +0200 |
commit | 265c56d229093a307ebf231baa191663f953cf1e (patch) | |
tree | 7b0cae00efab2d980f888a9326f5af3a57733e7d /src/core/lombok/eclipse | |
parent | 8ba6d4b0ea661fd6c701fed56212ecc9c4acabb2 (diff) | |
download | lombok-265c56d229093a307ebf231baa191663f953cf1e.tar.gz lombok-265c56d229093a307ebf231baa191663f953cf1e.tar.bz2 lombok-265c56d229093a307ebf231baa191663f953cf1e.zip |
[fixes #1969] Enum.values() requires enumConstantsCounter to be set
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleFieldNameConstants.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleFieldNameConstants.java b/src/core/lombok/eclipse/handlers/HandleFieldNameConstants.java index 2db7591c..9343011f 100644 --- a/src/core/lombok/eclipse/handlers/HandleFieldNameConstants.java +++ b/src/core/lombok/eclipse/handlers/HandleFieldNameConstants.java @@ -136,9 +136,8 @@ public class HandleFieldNameConstants extends EclipseAnnotationHandler<FieldName EclipseNode fieldsType = findInnerClass(typeNode, innerTypeName.getName()); boolean genConstr = false, genClinit = false; char[] name = innerTypeName.getCharArray(); - TypeDeclaration generatedInnerType = null; if (fieldsType == null) { - generatedInnerType = new TypeDeclaration(parent.compilationResult); + TypeDeclaration generatedInnerType = new TypeDeclaration(parent.compilationResult); generatedInnerType.bits |= Eclipse.ECLIPSE_DO_NOT_TOUCH_FLAG; generatedInnerType.modifiers = toEclipseModifier(level) | (asEnum ? ClassFileConstants.AccEnum : (ClassFileConstants.AccStatic | ClassFileConstants.AccFinal)); generatedInnerType.name = name; @@ -194,6 +193,7 @@ public class HandleFieldNameConstants extends EclipseAnnotationHandler<FieldName ac.sourceEnd = source.sourceEnd; constantField.initialization = ac; constantField.modifiers = 0; + ((TypeDeclaration) fieldsType.get()).enumConstantsCounter++; } else { constantField.type = new QualifiedTypeReference(TypeConstants.JAVA_LANG_STRING, new long[] {p, p, p}); constantField.initialization = new StringLiteral(field.name, pS, pE, 0); |