aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/javac/handlers/HandleGetter.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/lombok/javac/handlers/HandleGetter.java')
-rw-r--r--src/lombok/javac/handlers/HandleGetter.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lombok/javac/handlers/HandleGetter.java b/src/lombok/javac/handlers/HandleGetter.java
index da1b7107..5cc2c108 100644
--- a/src/lombok/javac/handlers/HandleGetter.java
+++ b/src/lombok/javac/handlers/HandleGetter.java
@@ -24,10 +24,10 @@ import com.sun.tools.javac.util.Name;
@ProviderFor(JavacAnnotationHandler.class)
public class HandleGetter implements JavacAnnotationHandler<Getter> {
- @Override public void handle(AnnotationValues<Getter> annotation, JCAnnotation ast, JavacAST.Node annotationNode) {
+ @Override public boolean handle(AnnotationValues<Getter> annotation, JCAnnotation ast, JavacAST.Node annotationNode) {
if ( annotationNode.up().getKind() != Kind.FIELD ) {
annotationNode.addError("@Getter is only supported on a field.");
- return;
+ return false;
}
String methodName = toGetterName((JCVariableDecl) annotationNode.up().get());
@@ -35,7 +35,7 @@ public class HandleGetter implements JavacAnnotationHandler<Getter> {
if ( methodExists(methodName, annotationNode.up()) ) {
annotationNode.addWarning(
String.format("Not generating %s(): A method with that name already exists", methodName));
- return;
+ return false;
}
Getter getter = annotation.getInstance();
@@ -46,6 +46,7 @@ public class HandleGetter implements JavacAnnotationHandler<Getter> {
JCMethodDecl getterMethod = createGetter(access, annotationNode.up(), annotationNode.getTreeMaker());
javacClassTree.defs = javacClassTree.defs.append(getterMethod);
+ return true;
}
private JCMethodDecl createGetter(int access, JavacAST.Node field, TreeMaker treeMaker) {