From 003acffe45f5fb1b13c3ca92cb2f0822857fe437 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Fri, 27 Nov 2009 11:45:09 +0100 Subject: Pretty crucial bugfix that stopped all lombok annotations on types from working with javac. Whoops. --- src/core/lombok/javac/handlers/JavacHandlerUtil.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/core/lombok') 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); -- cgit