diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-08-10 18:30:35 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-08-10 18:30:35 +0200 |
commit | 0dbc68a5cc2df113c22a72c78c39dedd1e1cb714 (patch) | |
tree | fdc7a3c836ac5a702ee5ff15062d1ac451a1c699 /src/core/lombok/javac/handlers | |
parent | b31ca9606b25839701194c5fca71c12c1a165565 (diff) | |
download | lombok-0dbc68a5cc2df113c22a72c78c39dedd1e1cb714.tar.gz lombok-0dbc68a5cc2df113c22a72c78c39dedd1e1cb714.tar.bz2 lombok-0dbc68a5cc2df113c22a72c78c39dedd1e1cb714.zip |
Added an optimization to javac: Don't force new resolution rounds if none of the handlers in the next priority level need it.
Diffstat (limited to 'src/core/lombok/javac/handlers')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleDelegate.java | 2 | ||||
-rw-r--r-- | src/core/lombok/javac/handlers/HandleVal.java | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/core/lombok/javac/handlers/HandleDelegate.java b/src/core/lombok/javac/handlers/HandleDelegate.java index b693a2a3..644b03fb 100644 --- a/src/core/lombok/javac/handlers/HandleDelegate.java +++ b/src/core/lombok/javac/handlers/HandleDelegate.java @@ -48,6 +48,7 @@ import lombok.javac.FindTypeVarScanner; import lombok.javac.JavacAnnotationHandler; import lombok.javac.JavacNode; import lombok.javac.JavacResolution; +import lombok.javac.ResolutionResetNeeded; import lombok.javac.JavacResolution.TypeNotConvertibleException; import org.mangosdk.spi.ProviderFor; @@ -76,6 +77,7 @@ import com.sun.tools.javac.util.Name; @ProviderFor(JavacAnnotationHandler.class) @HandlerPriority(65536) //2^16; to make sure that we also delegate generated methods. +@ResolutionResetNeeded public class HandleDelegate extends JavacAnnotationHandler<Delegate> { private static final List<String> METHODS_IN_OBJECT = Collections.unmodifiableList(Arrays.asList( "hashCode()", diff --git a/src/core/lombok/javac/handlers/HandleVal.java b/src/core/lombok/javac/handlers/HandleVal.java index 0ab9d783..d7a31708 100644 --- a/src/core/lombok/javac/handlers/HandleVal.java +++ b/src/core/lombok/javac/handlers/HandleVal.java @@ -29,6 +29,7 @@ import lombok.javac.JavacASTAdapter; import lombok.javac.JavacASTVisitor; import lombok.javac.JavacNode; import lombok.javac.JavacResolution; +import lombok.javac.ResolutionResetNeeded; import org.mangosdk.spi.ProviderFor; @@ -45,6 +46,7 @@ import com.sun.tools.javac.util.List; @ProviderFor(JavacASTVisitor.class) @HandlerPriority(65536) // 2^16; resolution needs to work, so if the RHS expression is i.e. a call to a generated getter, we have to run after that getter has been generated. +@ResolutionResetNeeded public class HandleVal extends JavacASTAdapter { @Override public void visitLocal(JavacNode localNode, JCVariableDecl local) { if (local.vartype == null || (!local.vartype.toString().equals("val") && !local.vartype.toString().equals("lombok.val"))) return; |