aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse/handlers/HandleSetter.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2012-03-21 11:41:59 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2012-03-21 11:41:59 +0100
commitcbaa53a9b54589f05a580d63dfc065be03bb4b88 (patch)
tree7285e222b281af312907e14dae2d1cff47c3d2af /src/core/lombok/eclipse/handlers/HandleSetter.java
parentfb76daf5e4320e31f19dcbd6c7a4036109d71ad7 (diff)
downloadlombok-cbaa53a9b54589f05a580d63dfc065be03bb4b88.tar.gz
lombok-cbaa53a9b54589f05a580d63dfc065be03bb4b88.tar.bz2
lombok-cbaa53a9b54589f05a580d63dfc065be03bb4b88.zip
Implementation of @Accessors.
Diffstat (limited to 'src/core/lombok/eclipse/handlers/HandleSetter.java')
-rw-r--r--src/core/lombok/eclipse/handlers/HandleSetter.java8
1 files changed, 6 insertions, 2 deletions
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<Setter> {
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;