aboutsummaryrefslogtreecommitdiff
path: root/src/utils/lombok/javac/java8/CommentCollectingParserFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/lombok/javac/java8/CommentCollectingParserFactory.java')
-rw-r--r--src/utils/lombok/javac/java8/CommentCollectingParserFactory.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/utils/lombok/javac/java8/CommentCollectingParserFactory.java b/src/utils/lombok/javac/java8/CommentCollectingParserFactory.java
index 2fdaddfe..0988ce6d 100644
--- a/src/utils/lombok/javac/java8/CommentCollectingParserFactory.java
+++ b/src/utils/lombok/javac/java8/CommentCollectingParserFactory.java
@@ -30,6 +30,8 @@ import com.sun.tools.javac.parser.ParserFactory;
import com.sun.tools.javac.parser.ScannerFactory;
import com.sun.tools.javac.util.Context;
+import lombok.permit.Permit;
+
public class CommentCollectingParserFactory extends ParserFactory {
private final Context context;
@@ -66,8 +68,7 @@ public class CommentCollectingParserFactory extends ParserFactory {
context.put(CommentCollectingParserFactory.key(), (ParserFactory) null);
Field field;
try {
- field = JavaCompiler.class.getDeclaredField("parserFactory");
- field.setAccessible(true);
+ field = Permit.getField(JavaCompiler.class, "parserFactory");
field.set(compiler, new CommentCollectingParserFactory(context));
} catch (Exception e) {
throw new IllegalStateException("Could not set comment sensitive parser in the compiler", e);