mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
disable ImportsCollector for jdk1.6 due to javac's undesirable side effects. (works fine for jdk 1.7)
This commit is contained in:
@@ -14,6 +14,7 @@ import java.util.*;
|
||||
* Date: 1/21/12
|
||||
*/
|
||||
public class JavacMain {
|
||||
private static final boolean IS_VM_6_VERSION = System.getProperty("java.version", "1.6").contains("1.6");
|
||||
private static final Set<String> FILTERED_OPTIONS = new HashSet<String>(Arrays.<String>asList(
|
||||
"-d", "-classpath", "-cp", "-bootclasspath"
|
||||
));
|
||||
@@ -69,8 +70,13 @@ public class JavacMain {
|
||||
final JavaCompiler.CompilationTask task = compiler.getTask(
|
||||
out, fileManager, outConsumer, _options, null, fileManager.toJavaFileObjects(sources)
|
||||
);
|
||||
final JavacASTAnalyser analyzer = new JavacASTAnalyser(outConsumer, shouldSuppressAnnotationProcessing(options));
|
||||
task.setProcessors(Collections.singleton(analyzer));
|
||||
|
||||
if (!IS_VM_6_VERSION) {
|
||||
// Do not add the processor for JDK 1.6 because of the bugs in javac
|
||||
// The processor's presence may lead to NPE and resolve bugs in compiler
|
||||
final JavacASTAnalyser analyzer = new JavacASTAnalyser(outConsumer, shouldSuppressAnnotationProcessing(options));
|
||||
task.setProcessors(Collections.singleton(analyzer));
|
||||
}
|
||||
return task.call();
|
||||
}
|
||||
catch(IllegalArgumentException e) {
|
||||
|
||||
Reference in New Issue
Block a user