diff options
-rw-r--r-- | src/core/lombok/javac/handlers/JavacHandlerUtil.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java index caa8a998..3aa45c97 100644 --- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java +++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java @@ -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); |