aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/eclipse/Eclipse.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@tipit.to>2009-07-26 17:02:40 +0200
committerReinier Zwitserloot <reinier@tipit.to>2009-07-26 17:02:40 +0200
commit3e03dcfac19901342a07f74b0dfd9d62dbb380f3 (patch)
tree343af6c7faa063e492935a47a1f13c8748d6cb62 /src/lombok/eclipse/Eclipse.java
parent15d77d473668335fd3dfe0f8f5a8d1f111c0ee44 (diff)
downloadlombok-3e03dcfac19901342a07f74b0dfd9d62dbb380f3.tar.gz
lombok-3e03dcfac19901342a07f74b0dfd9d62dbb380f3.tar.bz2
lombok-3e03dcfac19901342a07f74b0dfd9d62dbb380f3.zip
Fixed bugs with annotation handling: An array initializer with more than 1 entry now no longer causes ArrayIndexOutOfBoundsException, the setWarning method on a single item in an array initializer on eclipse
now generates the warning on just that node (like with errors), and the API of AnnotationValues has been updated to support setting errors/warning on any node.
Diffstat (limited to 'src/lombok/eclipse/Eclipse.java')
-rw-r--r--src/lombok/eclipse/Eclipse.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lombok/eclipse/Eclipse.java b/src/lombok/eclipse/Eclipse.java
index a52b8d86..cba2bd05 100644
--- a/src/lombok/eclipse/Eclipse.java
+++ b/src/lombok/eclipse/Eclipse.java
@@ -315,6 +315,19 @@ public class Eclipse {
annotationNode.addError(message, sourceStart, sourceEnd);
}
+
+ @Override public void setWarning(String message, int valueIdx) {
+ Expression ex;
+ if ( valueIdx == -1 ) ex = fullExpr;
+ else ex = exprs != null ? exprs[valueIdx] : null;
+
+ if ( ex == null ) ex = annotation;
+
+ int sourceStart = ex.sourceStart;
+ int sourceEnd = ex.sourceEnd;
+
+ annotationNode.addWarning(message, sourceStart, sourceEnd);
+ }
});
}