aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2010-07-21 23:05:28 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2010-07-21 23:05:28 +0200
commit1a9f8f168aa17f77c6e27d0a740b5f7614fb5c90 (patch)
tree80fdd22607123c6453828f479a5e3fd0a291093c /src
parent91bb3455da2913c81745d2a7f7e5b42839964f58 (diff)
downloadlombok-1a9f8f168aa17f77c6e27d0a740b5f7614fb5c90.tar.gz
lombok-1a9f8f168aa17f77c6e27d0a740b5f7614fb5c90.tar.bz2
lombok-1a9f8f168aa17f77c6e27d0a740b5f7614fb5c90.zip
delombok on most javacs would quit with a NoSuchFieldError if it contains <?> style wildcards anywhere in the source. No longer.
Fixes issue #134.
Diffstat (limited to 'src')
-rw-r--r--src/delombok/lombok/delombok/PrettyCommentsPrinter.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/delombok/lombok/delombok/PrettyCommentsPrinter.java b/src/delombok/lombok/delombok/PrettyCommentsPrinter.java
index a7c79f46..c96d2802 100644
--- a/src/delombok/lombok/delombok/PrettyCommentsPrinter.java
+++ b/src/delombok/lombok/delombok/PrettyCommentsPrinter.java
@@ -42,6 +42,7 @@ import lombok.delombok.Comment.EndConnection;
import lombok.delombok.Comment.StartConnection;
import com.sun.source.tree.Tree;
+import com.sun.tools.javac.code.BoundKind;
import com.sun.tools.javac.code.Flags;
import com.sun.tools.javac.code.Symbol;
import com.sun.tools.javac.code.TypeTags;
@@ -1386,12 +1387,20 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
@Override
public void visitWildcard(JCWildcard tree) {
try {
- print(tree.kind);
+ Object kind = tree.getClass().getField("kind").get(tree);
+ print(kind);
+ if (kind != null && kind.getClass().getSimpleName().equals("TypeBoundKind")) {
+ kind = kind.getClass().getField("kind").get(kind);
+ }
if (tree.getKind() != Tree.Kind.UNBOUNDED_WILDCARD)
printExpr(tree.inner);
} catch (IOException e) {
throw new UncheckedIOException(e);
+ } catch (NoSuchFieldException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
}
}