diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-01-30 18:17:00 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-01-30 18:17:00 +0100 |
commit | e5705f94cd3778a2e0d25060f1e013d0c33bfb90 (patch) | |
tree | 679dac4dce518d253c34f125a573b66aaf167f43 /src/core/lombok/eclipse | |
parent | 26b2fb5cd6d4d73b270be3787fa876cc1bfe80f2 (diff) | |
download | lombok-e5705f94cd3778a2e0d25060f1e013d0c33bfb90.tar.gz lombok-e5705f94cd3778a2e0d25060f1e013d0c33bfb90.tar.bz2 lombok-e5705f94cd3778a2e0d25060f1e013d0c33bfb90.zip |
* Added config key ‘lombok.addGeneratedAnnotation’.
* Added ‘format’ directive for tests.
* Updates tests to salt in some more format and config keys.
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r-- | src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java index 1b27fce5..23a5f4bc 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -1216,7 +1216,7 @@ public class EclipseHandlerUtil { */ public static EclipseNode injectFieldAndMarkGenerated(EclipseNode type, FieldDeclaration field) { field.annotations = addSuppressWarningsAll(field, field.annotations); - field.annotations = addGenerated(field, field.annotations); + field.annotations = addGenerated(type, field, field.annotations); return injectField(type, field); } @@ -1262,7 +1262,7 @@ public class EclipseHandlerUtil { */ public static EclipseNode injectMethod(EclipseNode type, AbstractMethodDeclaration method) { method.annotations = addSuppressWarningsAll(method, method.annotations); - method.annotations = addGenerated(method, method.annotations); + method.annotations = addGenerated(type, method, method.annotations); TypeDeclaration parent = (TypeDeclaration) type.get(); if (parent.methods == null) { @@ -1305,7 +1305,7 @@ public class EclipseHandlerUtil { */ public static EclipseNode injectType(final EclipseNode typeNode, final TypeDeclaration type) { type.annotations = addSuppressWarningsAll(type, type.annotations); - type.annotations = addGenerated(type, type.annotations); + type.annotations = addGenerated(typeNode, type, type.annotations); TypeDeclaration parent = (TypeDeclaration) typeNode.get(); if (parent.memberTypes == null) { @@ -1328,7 +1328,8 @@ public class EclipseHandlerUtil { return addAnnotation(source, originalAnnotationArray, TypeConstants.JAVA_LANG_SUPPRESSWARNINGS, new StringLiteral(ALL, 0, 0, 0)); } - public static Annotation[] addGenerated(ASTNode source, Annotation[] originalAnnotationArray) { + public static Annotation[] addGenerated(EclipseNode node, ASTNode source, Annotation[] originalAnnotationArray) { + if (Boolean.FALSE.equals(node.getAst().readConfiguration(ConfigurationKeys.ADD_GENERATED_ANNOTATIONS))) return originalAnnotationArray; return addAnnotation(source, originalAnnotationArray, JAVAX_ANNOTATION_GENERATED, new StringLiteral(LOMBOK, 0, 0, 0)); } |