mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 10:18:46 +00:00
Fix NetBeans 8.x compile-on-save issue.
This commit is contained in:
1 parent
37434ba0cb
commit
0f23383e33
2 files changed
+11
-3
No files matched your search
@@ -173,7 +173,10 @@ public class LombokProcessor extends AbstractProcessor {
|
||||
filerFileManagerField.setAccessible(true);
|
||||
filerFileManagerField.set(javacFiler, newFilerManager);
|
||||
|
||||
replaceFileManagerJdk9(context, newFilerManager);
|
||||
if (lombok.javac.Javac.getJavaCompilerVersion() > 8
|
||||
&& !lombok.javac.handlers.JavacHandlerUtil.inNetbeansCompileOnSave(context)) {
|
||||
replaceFileManagerJdk9(context, newFilerManager);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw Lombok.sneakyThrow(e);
|
||||
|
||||
@@ -134,11 +134,16 @@ public class JavacHandlerUtil {
|
||||
return inNetbeansEditor(node.getContext());
|
||||
}
|
||||
|
||||
private static boolean inNetbeansEditor(Context context) {
|
||||
public static boolean inNetbeansEditor(Context context) {
|
||||
Options options = Options.instance(context);
|
||||
return (options.keySet().contains("ide") && !options.keySet().contains("backgroundCompilation"));
|
||||
}
|
||||
|
||||
|
||||
public static boolean inNetbeansCompileOnSave(Context context) {
|
||||
Options options = Options.instance(context);
|
||||
return (options.keySet().contains("ide") && options.keySet().contains("backgroundCompilation"));
|
||||
}
|
||||
|
||||
public static JCTree getGeneratedBy(JCTree node) {
|
||||
return JCTree_generatedNode.get(node);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user