aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac
diff options
context:
space:
mode:
authorBulgakov Alexander <buls@yandex.ru>2019-04-26 22:10:34 +0300
committerBulgakov Alexander <buls@yandex.ru>2019-04-28 22:45:43 +0300
commitce0a09177e577c0b4f42379c5cc7ce364f26c905 (patch)
tree497981f2c3668f2afc54ce340972f2fae6859b2a /src/core/lombok/javac
parent150be0a186d880503cb23d056ea4cf229ebc37e5 (diff)
downloadlombok-ce0a09177e577c0b4f42379c5cc7ce364f26c905.tar.gz
lombok-ce0a09177e577c0b4f42379c5cc7ce364f26c905.tar.bz2
lombok-ce0a09177e577c0b4f42379c5cc7ce364f26c905.zip
#1976. A handlers' order has been changed. The javac's HandleDelegate generates code before the HandleVal.
Diffstat (limited to 'src/core/lombok/javac')
-rw-r--r--src/core/lombok/javac/handlers/HandleDelegate.java3
-rw-r--r--src/core/lombok/javac/handlers/HandleVal.java3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/core/lombok/javac/handlers/HandleDelegate.java b/src/core/lombok/javac/handlers/HandleDelegate.java
index baff7912..367b2cff 100644
--- a/src/core/lombok/javac/handlers/HandleDelegate.java
+++ b/src/core/lombok/javac/handlers/HandleDelegate.java
@@ -82,7 +82,7 @@ import lombok.javac.JavacTreeMaker;
import lombok.javac.ResolutionResetNeeded;
@ProviderFor(JavacAnnotationHandler.class)
-@HandlerPriority(65536) //2^16; to make sure that we also delegate generated methods.
+@HandlerPriority(HandleDelegate.HANDLE_DELEGATE_PRIORITY) //2^16; to make sure that we also delegate generated methods.
@ResolutionResetNeeded
public class HandleDelegate extends JavacAnnotationHandler<Delegate> {
@@ -102,6 +102,7 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> {
private static final String LEGALITY_OF_DELEGATE = "@Delegate is legal only on instance fields or no-argument instance methods.";
private static final String RECURSION_NOT_ALLOWED = "@Delegate does not support recursion (delegating to a type that itself has @Delegate members). Member \"%s\" is @Delegate in type \"%s\"";
+ public static final int HANDLE_DELEGATE_PRIORITY = 65536;
@Override public void handle(AnnotationValues<Delegate> annotation, JCAnnotation ast, JavacNode annotationNode) {
diff --git a/src/core/lombok/javac/handlers/HandleVal.java b/src/core/lombok/javac/handlers/HandleVal.java
index 14130bc4..323bb337 100644
--- a/src/core/lombok/javac/handlers/HandleVal.java
+++ b/src/core/lombok/javac/handlers/HandleVal.java
@@ -22,6 +22,7 @@
package lombok.javac.handlers;
import static lombok.core.handlers.HandlerUtil.handleFlagUsage;
+import static lombok.javac.handlers.HandleDelegate.HANDLE_DELEGATE_PRIORITY;
import static lombok.javac.handlers.JavacHandlerUtil.*;
import lombok.ConfigurationKeys;
import lombok.val;
@@ -49,7 +50,7 @@ import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
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.
+@HandlerPriority(HANDLE_DELEGATE_PRIORITY + 100) // 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 {