mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 00:16:47 +00:00
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.
This commit is contained in:
1 parent
aa8a627349
commit
339b4a6ab1
2 files changed
+10
-8
No files matched your search
@@ -155,8 +155,6 @@ public class HandlerLibrary {
|
||||
* @param annotation 'node.get()' - convenience parameter.
|
||||
*/
|
||||
public void handleAnnotation(CompilationUnitDeclaration ast, EclipseNode annotationNode, org.eclipse.jdt.internal.compiler.ast.Annotation annotation) {
|
||||
if (!checkAndSetHandled(annotation)) return;
|
||||
|
||||
String pkgName = annotationNode.getPackageDeclaration();
|
||||
Collection<String> imports = annotationNode.getImportStatements();
|
||||
|
||||
@@ -171,7 +169,7 @@ public class HandlerLibrary {
|
||||
if (container == null) continue;
|
||||
|
||||
try {
|
||||
container.handle(annotation, annotationNode);
|
||||
if (checkAndSetHandled(annotation)) container.handle(annotation, annotationNode);
|
||||
} catch (AnnotationValueDecodeFail fail) {
|
||||
fail.owner.setError(fail.getMessage(), fail.idx);
|
||||
} catch (Throwable t) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user