diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2020-11-13 04:37:27 +0100 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2020-11-13 04:44:39 +0100 |
commit | 3aace094f336393330ed275e1fb6d6c1f9187e14 (patch) | |
tree | 3c235a645f057a393194bf789fc4ce4bfaaef340 /src/core/lombok/javac/handlers/HandleDelegate.java | |
parent | 219bb4bea5035c370614474f630dac454cfe4223 (diff) | |
download | lombok-3aace094f336393330ed275e1fb6d6c1f9187e14.tar.gz lombok-3aace094f336393330ed275e1fb6d6c1f9187e14.tar.bz2 lombok-3aace094f336393330ed275e1fb6d6c1f9187e14.zip |
[refactor] reflection code streamlined by sending it through the Permit class
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleDelegate.java')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleDelegate.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/lombok/javac/handlers/HandleDelegate.java b/src/core/lombok/javac/handlers/HandleDelegate.java index d6e76ab1..ac414fbb 100644 --- a/src/core/lombok/javac/handlers/HandleDelegate.java +++ b/src/core/lombok/javac/handlers/HandleDelegate.java @@ -81,6 +81,7 @@ import lombok.javac.JavacResolution; import lombok.javac.JavacResolution.TypeNotConvertibleException; import lombok.javac.JavacTreeMaker; import lombok.javac.ResolutionResetNeeded; +import lombok.permit.Permit; @ProviderFor(JavacAnnotationHandler.class) @HandlerPriority(HandleDelegate.HANDLE_DELEGATE_PRIORITY) //2^16; to make sure that we also delegate generated methods. @@ -466,7 +467,7 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> { static { Method m = null; try { - m = Type.class.getDeclaredMethod("unannotatedType"); + m = Permit.getMethod(Type.class, "unannotatedType"); } catch (Exception e) {/* ignore */} unannotated = m; } @@ -474,7 +475,7 @@ public class HandleDelegate extends JavacAnnotationHandler<Delegate> { static Type unannotatedType(Type t) { if (unannotated == null) return t; try { - return (Type) unannotated.invoke(t); + return (Type) Permit.invoke(unannotated, t); } catch (Exception e) { return t; } |