Skip to content

Commit

Permalink
Avoid conflicts with the java.compiler module
Browse files Browse the repository at this point in the history
  • Loading branch information
testforstephen committed Nov 8, 2024
1 parent 2a3c437 commit e273f67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 55 deletions.
53 changes: 1 addition & 52 deletions org.eclipse.jdt.core.javac/META-INF/p2.inf
Original file line number Diff line number Diff line change
@@ -1,64 +1,13 @@
instructions.configure=\
org.eclipse.equinox.p2.touchpoint.eclipse.addJvmArg(jvmArg:\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED\n\
--add-opens\n\
jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.taglets.snippet=ALL-UNNAMED\n\
--add-opens\n\
jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.taglets=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED\n\
-DICompilationUnitResolver=org.eclipse.jdt.core.dom.JavacCompilationUnitResolver\n\
-DAbstractImageBuilder.compilerFactory=org.eclipse.jdt.internal.javac.JavacCompilerFactory\n\
-DCompilationUnit.DOM_BASED_OPERATIONS=true\n\
-DCompilationUnit.codeComplete.DOM_BASED_OPERATIONS=true_\n\
-DSourceIndexer.DOM_BASED_INDEXER=true);\

instructions.unconfigure=\
org.eclipse.equinox.p2.touchpoint.eclipse.removeJvmArg(jvmArg:--add-opens\n\
jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED\n\
--add-opens\n\
jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.taglets.snippet=ALL-UNNAMED\n\
--add-opens\n\
jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.taglets=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED\n\
--add-opens\n\
jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED\n\
org.eclipse.equinox.p2.touchpoint.eclipse.removeJvmArg(jvmArg:\
-DICompilationUnitResolver=org.eclipse.jdt.core.dom.JavacCompilationUnitResolver\n\
-DAbstractImageBuilder.compilerFactory=org.eclipse.jdt.internal.javac.JavacCompilerFactory\n\
-DCompilationUnit.DOM_BASED_OPERATIONS=true\n\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import javax.tools.JavaFileManager;
import javax.tools.JavaFileObject;
import javax.tools.StandardLocation;
import javax.tools.ToolProvider;
//import javax.tools.ToolProvider;

import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.ILog;
Expand Down Expand Up @@ -279,7 +279,8 @@ private void resolveRequestedBindingKeys(JavacBindingResolver bindingResolver, S
Map<String, IBinding> bindingMap,
IProgressMonitor monitor) {
if (bindingResolver == null) {
var compiler = ToolProvider.getSystemJavaCompiler();
// var compiler = ToolProvider.getSystemJavaCompiler();
var compiler = JavacTool.create();
var context = new Context();
JavacTask task = (JavacTask) compiler.getTask(null, null, null, List.of(), List.of(), List.of());
bindingResolver = new JavacBindingResolver(null, task, context, new JavacConverter(null, null, context, null, true, -1), null, null);
Expand Down Expand Up @@ -562,7 +563,10 @@ private Map<org.eclipse.jdt.internal.compiler.env.ICompilationUnit, CompilationU
if (sourceUnits.length == 0) {
return Collections.emptyMap();
}
var compiler = ToolProvider.getSystemJavaCompiler();

JavacPatch.patchVMWrapper();
// var compiler = ToolProvider.getSystemJavaCompiler();
var compiler = JavacTool.create();
Context context = new Context();
CachingJarsJavaFileManager.preRegister(context);
Map<org.eclipse.jdt.internal.compiler.env.ICompilationUnit, CompilationUnit> result = new HashMap<>(sourceUnits.length, 1.f);
Expand Down

0 comments on commit e273f67

Please sign in to comment.