diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-09-03 02:25:51 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-09-03 02:25:51 +0200 |
commit | 0b30a5695022649c0e9288b167fe15893e06887b (patch) | |
tree | 0fdbf015db81cd86d2e01cd1c739a092cf07f74b /src/lombok/core/AnnotationValues.java | |
parent | cfa9bef58d15bea474b83b3ce80c06f5af814711 (diff) | |
download | lombok-0b30a5695022649c0e9288b167fe15893e06887b.tar.gz lombok-0b30a5695022649c0e9288b167fe15893e06887b.tar.bz2 lombok-0b30a5695022649c0e9288b167fe15893e06887b.zip |
Fixed a problem in AnnotationValues where 'isExplicit' always returned true.
Diffstat (limited to 'src/lombok/core/AnnotationValues.java')
-rw-r--r-- | src/lombok/core/AnnotationValues.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lombok/core/AnnotationValues.java b/src/lombok/core/AnnotationValues.java index 15b4f3b7..663fb86b 100644 --- a/src/lombok/core/AnnotationValues.java +++ b/src/lombok/core/AnnotationValues.java @@ -50,6 +50,7 @@ public class AnnotationValues<A extends Annotation> { * likely be right. If not, it'll be wrong. */ public final List<Object> valueGuesses; private final AST<?>.Node node; + private final boolean isExplicit; /** * 'raw' should be the exact expression, for example '5+7', 'AccessLevel.PUBLIC', or 'int.class'. @@ -58,19 +59,21 @@ public class AnnotationValues<A extends Annotation> { * For classes, supply the class name (qualified or not) as a string.<br /> * For enums, supply the simple name part (everything after the last dot) as a string.<br /> */ - public AnnotationValue(AST<?>.Node node, String raw, Object valueGuess) { + public AnnotationValue(AST<?>.Node node, String raw, Object valueGuess, boolean isExplicit) { this.node = node; this.raws = Collections.singletonList(raw); this.valueGuesses = Collections.singletonList(valueGuess); + this.isExplicit = isExplicit; } /** * Like the other constructor, but used for when the annotation method is initialized with an array value. */ - public AnnotationValue(AST<?>.Node node, List<String> raws, List<Object> valueGuesses) { + public AnnotationValue(AST<?>.Node node, List<String> raws, List<Object> valueGuesses, boolean isExplicit) { this.node = node; this.raws = raws; this.valueGuesses = valueGuesses; + this.isExplicit = isExplicit; } /** @@ -101,6 +104,10 @@ public class AnnotationValues<A extends Annotation> { @Override public String toString() { return "raws: " + raws + " valueGuesses: " + valueGuesses; } + + public boolean isExplicit() { + return isExplicit; + } } /** @@ -299,7 +306,8 @@ public class AnnotationValues<A extends Annotation> { } public boolean isExplicit(String annotationMethodName) { - return values.get(annotationMethodName) != null; + AnnotationValue annotationValue = values.get(annotationMethodName); + return annotationValue != null && annotationValue.isExplicit(); } /** |