aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/eclipse/handlers
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@tipit.to>2009-07-11 11:12:47 +0200
committerReinier Zwitserloot <reinier@tipit.to>2009-07-11 11:12:47 +0200
commitf84f3a1bc8407160b82580300d2a58fd8c66aaa1 (patch)
treea2e58110a042c8ce6d0c2fe022692976b90fb16d /src/lombok/eclipse/handlers
parentbc44e76b7d45da2301a1bb7d28d4e7e8fec4b94b (diff)
downloadlombok-f84f3a1bc8407160b82580300d2a58fd8c66aaa1.tar.gz
lombok-f84f3a1bc8407160b82580300d2a58fd8c66aaa1.tar.bz2
lombok-f84f3a1bc8407160b82580300d2a58fd8c66aaa1.zip
The setter/getter handlers now mark themselves as not wanted to be called upon anymore when reporting errors.
They were logging 4 or more identical warnings per problem before this change.
Diffstat (limited to 'src/lombok/eclipse/handlers')
-rw-r--r--src/lombok/eclipse/handlers/HandleGetter.java4
-rw-r--r--src/lombok/eclipse/handlers/HandleSetter.java6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/lombok/eclipse/handlers/HandleGetter.java b/src/lombok/eclipse/handlers/HandleGetter.java
index 78b399c5..b69a43f3 100644
--- a/src/lombok/eclipse/handlers/HandleGetter.java
+++ b/src/lombok/eclipse/handlers/HandleGetter.java
@@ -90,7 +90,7 @@ public class HandleGetter implements EclipseAnnotationHandler<Getter> {
private boolean createGetterForField(AccessLevel level, Node fieldNode, Node errorNode, ASTNode pos, boolean whineIfExists) {
if ( fieldNode.getKind() != Kind.FIELD ) {
errorNode.addError("@Getter is only supported on a field.");
- return false;
+ return true;
}
FieldDeclaration field = (FieldDeclaration) fieldNode.get();
@@ -106,7 +106,7 @@ public class HandleGetter implements EclipseAnnotationHandler<Getter> {
case EXISTS_BY_USER:
if ( whineIfExists ) errorNode.addWarning(
String.format("Not generating %s(): A method with that name already exists", getterName));
- return false;
+ return true;
default:
case NOT_EXISTS:
//continue with creating the getter
diff --git a/src/lombok/eclipse/handlers/HandleSetter.java b/src/lombok/eclipse/handlers/HandleSetter.java
index 70eb855e..b08f298a 100644
--- a/src/lombok/eclipse/handlers/HandleSetter.java
+++ b/src/lombok/eclipse/handlers/HandleSetter.java
@@ -95,7 +95,7 @@ public class HandleSetter implements EclipseAnnotationHandler<Setter> {
private boolean createSetterForField(AccessLevel level, Node fieldNode, Node errorNode, ASTNode pos, boolean whineIfExists) {
if ( fieldNode.getKind() != Kind.FIELD ) {
errorNode.addError("@Setter is only supported on a field.");
- return false;
+ return true;
}
FieldDeclaration field = (FieldDeclaration) fieldNode.get();
@@ -110,7 +110,7 @@ public class HandleSetter implements EclipseAnnotationHandler<Setter> {
if ( whineIfExists ) errorNode.addWarning(
String.format("Not generating %s(%s %s): A method with that name already exists",
setterName, field.type, new String(field.name)));
- return false;
+ return true;
default:
case NOT_EXISTS:
//continue with creating the setter
@@ -121,7 +121,7 @@ public class HandleSetter implements EclipseAnnotationHandler<Setter> {
injectMethod(fieldNode.up(), method);
- return false;
+ return true;
}
private MethodDeclaration generateSetter(TypeDeclaration parent, FieldDeclaration field, String name,