From 5fef32c1f59403ef2978942ac2838731b1406413 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sun, 12 Jul 2009 00:35:17 +0200 Subject: More fixes to avoid erroneous "getter/setter is already there, not generating it" warnings when the getter/setter already there was in fact generated by lombok, and fixed a bug in eclipse where a boolean array's getter method would be called isFoo() instead of getFoo(). --- src/lombok/eclipse/handlers/HandleSetter.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/lombok/eclipse/handlers/HandleSetter.java') diff --git a/src/lombok/eclipse/handlers/HandleSetter.java b/src/lombok/eclipse/handlers/HandleSetter.java index b08f298a..95eb0210 100644 --- a/src/lombok/eclipse/handlers/HandleSetter.java +++ b/src/lombok/eclipse/handlers/HandleSetter.java @@ -66,23 +66,16 @@ public class HandleSetter implements EclipseAnnotationHandler { * be a warning if its already there. The default access level is used. */ public void generateSetterForField(Node fieldNode, ASTNode pos) { - AccessLevel level = AccessLevel.PUBLIC; - Node errorNode = fieldNode; - boolean whineIfExists = false; - for ( Node child : fieldNode.down() ) { if ( child.getKind() == Kind.ANNOTATION ) { if ( Eclipse.annotationTypeMatches(Setter.class, child) ) { - level = Eclipse.createAnnotation(Setter.class, child).getInstance().value(); - errorNode = child; - pos = child.get(); - whineIfExists = true; - break; + //The annotation will make it happen, so we can skip it. + return; } } } - createSetterForField(level, fieldNode, errorNode, pos, whineIfExists); + createSetterForField(AccessLevel.PUBLIC, fieldNode, fieldNode, pos, false); } public boolean handle(AnnotationValues annotation, Annotation ast, Node annotationNode) { -- cgit