delombok on most javacs would quit with a NoSuchFieldError if it contains <?> style wildcards anywhere in the source. No longer.

Fixes issue #134.
This commit is contained in:
Reinier Zwitserloot committed 2010-07-21 23:05:28 +02:00
1 parent 91bb3455da
commit 1a9f8f168a
2 files changed
+14 -1

No files matched your search

+4
View File
@@ -18,6 +18,10 @@ Lombok Changelog
* BUGFIX: While its discouraged, `import lombok.*;` is supposed to work in the vast majority of cases. In eclipse, however, it didn't. Now it does. [Issue #102](http://code.google.com/p/projectlombok/issues/detail?id=102)
* BUGFIX: When `@Getter` or `@Setter` is applied to a multiple field declaration, such as `@Getter int x, y;`, the annotation now applies to all fields, not just the first. [Issue #54](http://code.google.com/p/projectlombok/issues/detail?id=54)
* ENHANCEMENT: generated `toString`, `equals` and `hashCode` methods will now use `this.getX()` and `other.getX()` instead of `this.x` and `other.x` if a suitable getter is available. This behaviour is useful for proxied classes, such as the POJOs that hibernate makes. Usage of the getters can be suppressed with `@ToString/@EqualsAndHashCode(doNotUseGetters = true)`. [Issue #110](http://code.google.com/p/projectlombok/issues/detail?id=110)
* BUGFIX: delombok on most javacs would quit with a NoSuchFieldError if it contains <?> style wildcards anywhere in the source, as well as at least 1 lombok annotation. No longer. [Issue #134](http://code.google.com/p/projectlombok/issues/detail?id=134)
Fixes issue #134.
### v0.9.2 "Hailbunny" (December 15th, 2009)
* preliminary support for lombok on NetBeans! - thanks go to Jan Lahoda from NetBeans. [Issue #20](http://code.google.com/p/projectlombok/issues/detail?id=20)
@@ -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);
}
}