diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-06-15 23:58:52 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-06-15 23:58:52 +0200 |
commit | 12162391160713e67b5bee7d6b98cfbee54225b8 (patch) | |
tree | a2545495ea1d460e68c554cd94a1b06702c8869d /src/lombok/eclipse/TransformEclipseAST.java | |
parent | 92ab0e7971df9d1efc9345f17ad48355df95161a (diff) | |
download | lombok-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.java | 12 |
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(); } } |