From 3aace094f336393330ed275e1fb6d6c1f9187e14 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Fri, 13 Nov 2020 04:37:27 +0100 Subject: [refactor] reflection code streamlined by sending it through the Permit class --- src/core/lombok/javac/handlers/HandleDelegate.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/core/lombok/javac/handlers/HandleDelegate.java') 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 { 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 { 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; } -- cgit