aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2018-04-23 22:18:57 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2018-04-23 22:18:57 +0200
commit472d602693bdccde135ff084c44bfebd285a2101 (patch)
tree224206f6b9bd3012710882694523945aeaa29ae1 /src
parent44abd07764d2bd94e89a22d4569f6f97e343553d (diff)
downloadlombok-472d602693bdccde135ff084c44bfebd285a2101.tar.gz
lombok-472d602693bdccde135ff084c44bfebd285a2101.tar.bz2
lombok-472d602693bdccde135ff084c44bfebd285a2101.zip
[bugfix] onMethod_ in javac was broken; javac would throw an IllegalArgumentException.
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/javac/handlers/JavacHandlerUtil.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
index 1976548c..4b5c48dd 100644
--- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java
+++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
@@ -354,7 +354,7 @@ public class JavacHandlerUtil {
}
if (rhs instanceof JCNewArray) {
- List<JCExpression> elems = ((JCNewArray)rhs).elems;
+ List<JCExpression> elems = ((JCNewArray) rhs).elems;
for (JCExpression inner : elems) {
raws.add(inner.toString());
expressions.add(inner);
@@ -365,7 +365,7 @@ public class JavacHandlerUtil {
guesses.add(createAnnotation(innerClass, (JCAnnotation) inner, node));
} catch (ClassNotFoundException ex) {
- throw new IllegalStateException(ex);
+ guesses.add(calculateGuess(inner));
}
} else {
guesses.add(calculateGuess(inner));
@@ -375,7 +375,18 @@ public class JavacHandlerUtil {
} else {
raws.add(rhs.toString());
expressions.add(rhs);
- guesses.add(calculateGuess(rhs));
+ if (rhs instanceof JCAnnotation) {
+ try {
+ @SuppressWarnings("unchecked")
+ Class<A> innerClass = (Class<A>) Class.forName(rhs.type.toString());
+
+ guesses.add(createAnnotation(innerClass, (JCAnnotation) rhs, node));
+ } catch (ClassNotFoundException ex) {
+ guesses.add(calculateGuess(rhs));
+ }
+ } else {
+ guesses.add(calculateGuess(rhs));
+ }
positions.add(rhs.pos());
}