Pretty crucial bugfix that stopped all lombok annotations on types from working with javac. Whoops.

This commit is contained in:
Reinier Zwitserloot committed 2009-11-27 11:45:09 +01:00
1 parent 7d63d03896
commit 003acffe45
1 file changed
+10 -1
@@ -77,8 +77,17 @@ public class JavacHandlerUtil {
JCMethodDecl method = (JCMethodDecl) parentNode.get();
method.mods.annotations = filterList(method.mods.annotations, annotation.get());
break;
case TYPE:
try {
JCClassDecl type = (JCClassDecl) parentNode.get();
type.mods.annotations = filterList(type.mods.annotations, annotation.get());
} catch (ClassCastException e) {
//something rather odd has been annotated. Better to just break only delombok instead of everything.
}
break;
default:
throw new IllegalStateException("Don't know how to remove annotations from: " + parentNode.getKind());
//This really shouldn't happen, but if it does, better just break delombok instead of breaking everything.
return;
}
parentNode.removeChild(annotation);