diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-10-29 23:13:52 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-10-29 23:13:59 +0100 |
commit | eca219ee6433cd964f0549a114a791ca4eb9f0fa (patch) | |
tree | 20f6fed449504fbf5dbc52bd15ff3f2458dd90f8 /src/core/lombok/javac/Javac6BasedLombokOptions.java | |
parent | 182cb0cb9e8db6341fb4633c3849b5e90ba6d088 (diff) | |
download | lombok-eca219ee6433cd964f0549a114a791ca4eb9f0fa.tar.gz lombok-eca219ee6433cd964f0549a114a791ca4eb9f0fa.tar.bz2 lombok-eca219ee6433cd964f0549a114a791ca4eb9f0fa.zip |
eliminate ‘you are using private API’ warnings by streamlining all reflective access via a class that uses sun.misc.Unsafe to arrange access. From the nqzero permit-reflect library.
Diffstat (limited to 'src/core/lombok/javac/Javac6BasedLombokOptions.java')
-rw-r--r-- | src/core/lombok/javac/Javac6BasedLombokOptions.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/lombok/javac/Javac6BasedLombokOptions.java b/src/core/lombok/javac/Javac6BasedLombokOptions.java index cefb89ff..fc73181c 100644 --- a/src/core/lombok/javac/Javac6BasedLombokOptions.java +++ b/src/core/lombok/javac/Javac6BasedLombokOptions.java @@ -25,6 +25,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import lombok.Lombok; +import lombok.permit.Permit; import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.Options; @@ -36,8 +37,8 @@ public class Javac6BasedLombokOptions extends LombokOptions { static { try { Class<?> optionNameClass = Class.forName("com.sun.tools.javac.main.OptionName"); - optionName_valueOf = optionNameClass.getMethod("valueOf", String.class); - options_put = Class.forName("com.sun.tools.javac.util.Options").getMethod("put", optionNameClass, String.class); + optionName_valueOf = Permit.getMethod(optionNameClass, "valueOf", String.class); + options_put = Permit.getMethod(Class.forName("com.sun.tools.javac.util.Options"), "put", optionNameClass, String.class); } catch (Exception e) { throw new IllegalArgumentException("Can't initialize Javac6-based lombok options due to reflection issue.", e); } |