From cbaa53a9b54589f05a580d63dfc065be03bb4b88 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Wed, 21 Mar 2012 11:41:59 +0100 Subject: Implementation of @Accessors. --- src/core/lombok/eclipse/handlers/HandleSetter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/core/lombok/eclipse/handlers/HandleSetter.java') diff --git a/src/core/lombok/eclipse/handlers/HandleSetter.java b/src/core/lombok/eclipse/handlers/HandleSetter.java index ea81965b..810096ab 100644 --- a/src/core/lombok/eclipse/handlers/HandleSetter.java +++ b/src/core/lombok/eclipse/handlers/HandleSetter.java @@ -148,11 +148,15 @@ public class HandleSetter extends EclipseAnnotationHandler { FieldDeclaration field = (FieldDeclaration) fieldNode.get(); TypeReference fieldType = copyType(field.type, source); boolean isBoolean = nameEquals(fieldType.getTypeName(), "boolean") && fieldType.dimensions() == 0; - String setterName = TransformationsUtil.toSetterName(new String(field.name), isBoolean); + String setterName = toSetterName(fieldNode, isBoolean); + if (setterName == null) { + errorNode.addWarning("Not generating setter for this field: It does not fit your @Accessors prefix list."); + return; + } int modifier = toEclipseModifier(level) | (field.modifiers & ClassFileConstants.AccStatic); - for (String altName : TransformationsUtil.toAllSetterNames(new String(field.name), isBoolean)) { + for (String altName : toAllSetterNames(fieldNode, isBoolean)) { switch (methodExists(altName, fieldNode, false)) { case EXISTS_BY_LOMBOK: return; -- cgit