aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/eclipse/TransformEclipseAST.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@tipit.to>2009-06-15 23:58:52 +0200
committerReinier Zwitserloot <reinier@tipit.to>2009-06-15 23:58:52 +0200
commit12162391160713e67b5bee7d6b98cfbee54225b8 (patch)
treea2545495ea1d460e68c554cd94a1b06702c8869d /src/lombok/eclipse/TransformEclipseAST.java
parent92ab0e7971df9d1efc9345f17ad48355df95161a (diff)
downloadlombok-12162391160713e67b5bee7d6b98cfbee54225b8.tar.gz
lombok-12162391160713e67b5bee7d6b98cfbee54225b8.tar.bz2
lombok-12162391160713e67b5bee7d6b98cfbee54225b8.zip
Propagated the fact that you get the Node object belonging to the annotation, and not the field/type/local/method it goes with, all the way, so that you can easily generate a warning on an annotation in a handler.
Diffstat (limited to 'src/lombok/eclipse/TransformEclipseAST.java')
-rw-r--r--src/lombok/eclipse/TransformEclipseAST.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lombok/eclipse/TransformEclipseAST.java b/src/lombok/eclipse/TransformEclipseAST.java
index afc4cdb3..6847fd94 100644
--- a/src/lombok/eclipse/TransformEclipseAST.java
+++ b/src/lombok/eclipse/TransformEclipseAST.java
@@ -113,22 +113,26 @@ public class TransformEclipseAST {
private static class AnnotationVisitor extends EclipseASTAdapter {
@Override public void visitAnnotationOnField(FieldDeclaration field, Node annotationNode, Annotation annotation) {
- handlers.handle((CompilationUnitDeclaration) annotationNode.top().node, annotationNode.up(), annotation);
+ if ( annotationNode.isHandled() ) return;
+ handlers.handle((CompilationUnitDeclaration) annotationNode.top().node, annotationNode, annotation);
annotationNode.setHandled();
}
@Override public void visitAnnotationOnLocal(LocalDeclaration local, Node annotationNode, Annotation annotation) {
- handlers.handle((CompilationUnitDeclaration) annotationNode.top().node, annotationNode.up(), annotation);
+ if ( annotationNode.isHandled() ) return;
+ handlers.handle((CompilationUnitDeclaration) annotationNode.top().node, annotationNode, annotation);
annotationNode.setHandled();
}
@Override public void visitAnnotationOnMethod(AbstractMethodDeclaration method, Node annotationNode, Annotation annotation) {
- handlers.handle((CompilationUnitDeclaration) annotationNode.top().node, annotationNode.up(), annotation);
+ if ( annotationNode.isHandled() ) return;
+ handlers.handle((CompilationUnitDeclaration) annotationNode.top().node, annotationNode, annotation);
annotationNode.setHandled();
}
@Override public void visitAnnotationOnType(TypeDeclaration type, Node annotationNode, Annotation annotation) {
- handlers.handle((CompilationUnitDeclaration) annotationNode.top().node, annotationNode.up(), annotation);
+ if ( annotationNode.isHandled() ) return;
+ handlers.handle((CompilationUnitDeclaration) annotationNode.top().node, annotationNode, annotation);
annotationNode.setHandled();
}
}