aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2011-05-30 22:30:16 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2011-05-30 22:30:16 +0200
commit339b4a6ab18a5dc7a39ca68314fb906fc1dcf6c8 (patch)
treeeb1a32664526f9dd5a71634da8d6cdbd9aef36af /src/core/lombok/javac
parentaa8a627349bb68f376b98847b6f73c2c89e989fd (diff)
downloadlombok-339b4a6ab18a5dc7a39ca68314fb906fc1dcf6c8.tar.gz
lombok-339b4a6ab18a5dc7a39ca68314fb906fc1dcf6c8.tar.bz2
lombok-339b4a6ab18a5dc7a39ca68314fb906fc1dcf6c8.zip
Whoops, we broke @Delegate with the last update. Now the CAS check on handled is only done if we are -actually- going to call a handler.
Diffstat (limited to 'src/core/lombok/javac')
-rw-r--r--src/core/lombok/javac/HandlerLibrary.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core/lombok/javac/HandlerLibrary.java b/src/core/lombok/javac/HandlerLibrary.java
index 0c753c02..f0bd3442 100644
--- a/src/core/lombok/javac/HandlerLibrary.java
+++ b/src/core/lombok/javac/HandlerLibrary.java
@@ -170,8 +170,6 @@ public class HandlerLibrary {
* @param annotation 'node.get()' - convenience parameter.
*/
public void handleAnnotation(JCCompilationUnit unit, JavacNode node, JCAnnotation annotation) {
- if (!checkAndSetHandled(annotation)) return;
-
TypeResolver resolver = new TypeResolver(typeLibrary, node.getPackageDeclaration(), node.getImportStatements());
String rawType = annotation.annotationType.toString();
for (String fqn : resolver.findTypeMatches(node, rawType)) {
@@ -182,9 +180,15 @@ public class HandlerLibrary {
if (container == null) continue;
try {
- if (container.isResolutionBased() && phase == 1) container.handle(node);
- if (!container.isResolutionBased() && phase == 0) container.handle(node);
- if (container.annotationClass == PrintAST.class && phase == 2) container.handle(node);
+ if (container.isResolutionBased() && phase == 1) {
+ if (checkAndSetHandled(annotation)) container.handle(node);
+ }
+ if (!container.isResolutionBased() && phase == 0) {
+ if (checkAndSetHandled(annotation)) container.handle(node);
+ }
+ if (container.annotationClass == PrintAST.class && phase == 2) {
+ if (checkAndSetHandled(annotation)) container.handle(node);
+ }
} catch (AnnotationValueDecodeFail fail) {
fail.owner.setError(fail.getMessage(), fail.idx);
} catch (Throwable t) {