aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/apt/LombokFileObjects.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lombok/javac/apt/LombokFileObjects.java')
-rw-r--r--src/core/lombok/javac/apt/LombokFileObjects.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/lombok/javac/apt/LombokFileObjects.java b/src/core/lombok/javac/apt/LombokFileObjects.java
index aba10540..28d3c9fa 100644
--- a/src/core/lombok/javac/apt/LombokFileObjects.java
+++ b/src/core/lombok/javac/apt/LombokFileObjects.java
@@ -39,6 +39,7 @@ import javax.tools.JavaFileObject;
import javax.tools.JavaFileObject.Kind;
import lombok.core.DiagnosticsReceiver;
+import lombok.permit.Permit;
import com.sun.tools.javac.file.BaseFileManager;
@@ -87,16 +88,14 @@ final class LombokFileObjects {
}
static Method getDecoderMethod(String className) {
- Method m = null;
try {
- m = Class.forName(className).getDeclaredMethod("getDecoder", boolean.class);
- m.setAccessible(true);
+ return Permit.getMethod(Class.forName(className), "getDecoder", boolean.class);
} catch (NoSuchMethodException e) {
// Intentional fallthrough - getDecoder(boolean) is not always present.
} catch (ClassNotFoundException e) {
// Intentional fallthrough - getDecoder(boolean) is not always present.
}
- return m;
+ return null;
}
private LombokFileObjects() {}