From daf84dd00ed5059710acf9f40b4663ba7fed06e0 Mon Sep 17 00:00:00 2001 From: peichhorn Date: Mon, 30 May 2011 21:17:46 +0200 Subject: HandleDelegate did not remove the annotation @Delegate from javac's AST, so HandleDelegate was called multiple times for the same field resulting in an error saying the delegate method was already defined. Also added a test for @Delegate that uncovered this issue. --- src/core/lombok/javac/handlers/HandleDelegate.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/core/lombok/javac/handlers/HandleDelegate.java b/src/core/lombok/javac/handlers/HandleDelegate.java index 071aa3e4..e333daa3 100644 --- a/src/core/lombok/javac/handlers/HandleDelegate.java +++ b/src/core/lombok/javac/handlers/HandleDelegate.java @@ -21,6 +21,8 @@ */ package lombok.javac.handlers; +import static lombok.javac.handlers.JavacHandlerUtil.markAnnotationAsProcessed; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -90,6 +92,7 @@ public class HandleDelegate implements JavacAnnotationHandler { "finalize()")); @Override public boolean handle(AnnotationValues annotation, JCAnnotation ast, JavacNode annotationNode) { + markAnnotationAsProcessed(annotationNode, Delegate.class); if (annotationNode.up().getKind() != Kind.FIELD) { // As the annotation is legal on fields only, javac itself will take care of printing an error message for this. return false; -- cgit