diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-03-26 20:09:10 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-03-26 20:09:10 +0200 |
commit | a514af4dcdd87cdae64e87b9d8a8d1a489a8e474 (patch) | |
tree | 1e5f487e4aee08fe89cbe5ae919dd86fdc498d58 /src/core/lombok/eclipse/handlers/HandleGetter.java | |
parent | aa5d3b8bb2cb2bf068f4b4728a9e765968c673d4 (diff) | |
parent | 0c927175af39f2b8d66d25b735ee0e5249107286 (diff) | |
download | lombok-a514af4dcdd87cdae64e87b9d8a8d1a489a8e474.tar.gz lombok-a514af4dcdd87cdae64e87b9d8a8d1a489a8e474.tar.bz2 lombok-a514af4dcdd87cdae64e87b9d8a8d1a489a8e474.zip |
Merge branch 'acc2' into accessors
Conflicts:
src/core/lombok/eclipse/handlers/HandleGetter.java
src/core/lombok/eclipse/handlers/HandleSetter.java
src/core/lombok/javac/handlers/HandleGetter.java
src/core/lombok/javac/handlers/HandleSetter.java
Diffstat (limited to 'src/core/lombok/eclipse/handlers/HandleGetter.java')
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleGetter.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleGetter.java b/src/core/lombok/eclipse/handlers/HandleGetter.java index c631e583..d53bf89b 100644 --- a/src/core/lombok/eclipse/handlers/HandleGetter.java +++ b/src/core/lombok/eclipse/handlers/HandleGetter.java @@ -198,7 +198,7 @@ public class HandleGetter extends EclipseAnnotationHandler<Getter> { int modifier = toEclipseModifier(level) | (field.modifiers & ClassFileConstants.AccStatic); for (String altName : toAllGetterNames(fieldNode, isBoolean)) { - switch (methodExists(altName, fieldNode, false)) { + switch (methodExists(altName, fieldNode, false, 0)) { case EXISTS_BY_LOMBOK: return; case EXISTS_BY_USER: @@ -216,14 +216,20 @@ public class HandleGetter extends EclipseAnnotationHandler<Getter> { } MethodDeclaration method = generateGetter((TypeDeclaration) fieldNode.up().get(), fieldNode, getterName, modifier, source, lazy); - Annotation[] copiedAnnotations = copyAnnotations(source, findAnnotations(field, TransformationsUtil.NON_NULL_PATTERN), findAnnotations(field, TransformationsUtil.NULLABLE_PATTERN), findDelegatesAndMarkAsHandled(fieldNode)); + + Annotation[] deprecated = null; + if (isFieldDeprecated(fieldNode)) { + deprecated = new Annotation[] { generateDeprecatedAnnotation(source) }; + } + + Annotation[] copiedAnnotations = copyAnnotations(source, findAnnotations(field, TransformationsUtil.NON_NULL_PATTERN), findAnnotations(field, TransformationsUtil.NULLABLE_PATTERN), findDelegatesAndMarkAsHandled(fieldNode), deprecated); if (copiedAnnotations.length != 0) { method.annotations = copiedAnnotations; } injectMethod(fieldNode.up(), method); } - + private static Annotation[] findDelegatesAndMarkAsHandled(EclipseNode fieldNode) { List<Annotation> delegates = new ArrayList<Annotation>(); for (EclipseNode child : fieldNode.down()) { |