aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r--src/core/lombok/eclipse/handlers/HandleFieldNameConstants.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleFieldNameConstants.java b/src/core/lombok/eclipse/handlers/HandleFieldNameConstants.java
index 91b7771b..9e81a068 100644
--- a/src/core/lombok/eclipse/handlers/HandleFieldNameConstants.java
+++ b/src/core/lombok/eclipse/handlers/HandleFieldNameConstants.java
@@ -132,8 +132,12 @@ public class HandleFieldNameConstants extends EclipseAnnotationHandler<FieldName
genClinit = asEnum;
} else {
TypeDeclaration builderTypeDeclaration = (TypeDeclaration) fieldsType.get();
- if ((builderTypeDeclaration.modifiers & (ClassFileConstants.AccEnum | ClassFileConstants.AccStatic)) == 0) {
- errorNode.addError("Existing " + innerTypeName + " must be declared as an 'enum' or a 'static class'.");
+ if (asEnum && (builderTypeDeclaration.modifiers & ClassFileConstants.AccEnum) == 0) {
+ errorNode.addError("Existing " + innerTypeName + " must be declared as an 'enum'.");
+ return;
+ }
+ if (!asEnum && (builderTypeDeclaration.modifiers & ClassFileConstants.AccStatic) == 0) {
+ errorNode.addError("Existing " + innerTypeName + " must be declared as a 'static class'.");
return;
}
genConstr = constructorExists(fieldsType) == MemberExistsResult.NOT_EXISTS;