From ea7bd25f35822a1986bd8938c5adaced41d574c9 Mon Sep 17 00:00:00 2001 From: Jinbo Wang Date: Tue, 19 Nov 2024 16:32:41 +0800 Subject: [PATCH] Access Javac API from a standalone Javac jar insteadof the JDK --- org.eclipse.jdt.core.javac/.classpath | 6 +- .../.settings/org.eclipse.jdt.core.prefs | 6 +- .../META-INF/MANIFEST.MF | 9 +- org.eclipse.jdt.core.javac/META-INF/p2.inf | 61 +-------- org.eclipse.jdt.core.javac/build.properties | 4 +- org.eclipse.jdt.core.javac/pom.xml | 85 +++++++----- .../dom/JavacCompilationUnitResolver.java | 2 + .../org/eclipse/jdt/core/dom/JavacPatch.java | 79 +++++++++++ .../jdt/core/dom/JavadocConverter.java | 127 +++++++++--------- .../javac/CachingJDKPlatformArguments.java | 2 +- org.eclipse.jdt.core.tests.javac/.classpath | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 6 +- .../META-INF/MANIFEST.MF | 2 +- org.eclipse.jdt.core/META-INF/MANIFEST.MF | 11 +- 14 files changed, 230 insertions(+), 172 deletions(-) create mode 100644 org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacPatch.java diff --git a/org.eclipse.jdt.core.javac/.classpath b/org.eclipse.jdt.core.javac/.classpath index ee8c07610de..d29d4cbb801 100644 --- a/org.eclipse.jdt.core.javac/.classpath +++ b/org.eclipse.jdt.core.javac/.classpath @@ -2,11 +2,13 @@ - + - + + + diff --git a/org.eclipse.jdt.core.javac/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jdt.core.javac/.settings/org.eclipse.jdt.core.prefs index 9934205a305..914716030db 100644 --- a/org.eclipse.jdt.core.javac/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jdt.core.javac/.settings/org.eclipse.jdt.core.prefs @@ -1,9 +1,9 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=23 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=21 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=23 +org.eclipse.jdt.core.compiler.compliance=21 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -12,7 +12,7 @@ org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=23 +org.eclipse.jdt.core.compiler.source=21 org.eclipse.jdt.core.formatter.align_arrows_in_switch_on_columns=false org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 diff --git a/org.eclipse.jdt.core.javac/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.javac/META-INF/MANIFEST.MF index 2d7eb4e61bb..44ccccc0620 100644 --- a/org.eclipse.jdt.core.javac/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.core.javac/META-INF/MANIFEST.MF @@ -6,7 +6,12 @@ Bundle-SymbolicName: org.eclipse.jdt.core.javac;singleton:=true Bundle-Version: 1.0.0.qualifier Fragment-Host: org.eclipse.jdt.core Automatic-Module-Name: org.eclipse.jdt.core.javac -Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=23))" -Import-Package: org.eclipse.jdt.core.dom +Bundle-RequiredExecutionEnvironment: JavaSE-21 +Import-Package: org.eclipse.core.resources, + org.eclipse.core.runtime, + org.eclipse.jdt.core.dom Export-Package: org.eclipse.jdt.internal.javac;x-friends:="org.eclipse.jdt.core.tests.javac", org.eclipse.jdt.internal.javac.dom;x-friends:="org.eclipse.jdt.core.tests.javac" +Bundle-ClassPath: lib/nb-javac-jdk-23+35-api.jar, + lib/nb-javac-jdk-23+35.jar, + . diff --git a/org.eclipse.jdt.core.javac/META-INF/p2.inf b/org.eclipse.jdt.core.javac/META-INF/p2.inf index d9c9002f489..453c376541c 100644 --- a/org.eclipse.jdt.core.javac/META-INF/p2.inf +++ b/org.eclipse.jdt.core.javac/META-INF/p2.inf @@ -1,35 +1,5 @@ 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\ ---add-opens\n\ -jdk.compiler/com.sun.tools.javac.platform=ALL-UNNAMED\n\ ---add-opens\n\ -jdk.compiler/com.sun.tools.javac.resources=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\ @@ -37,36 +7,7 @@ jdk.compiler/com.sun.tools.javac.resources=ALL-UNNAMED\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\ ---add-opens\n\ -jdk.compiler/com.sun.tools.javac.platform=ALL-UNNAMED\n\ ---add-opens\n\ -jdk.compiler/com.sun.tools.javac.resources=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\ diff --git a/org.eclipse.jdt.core.javac/build.properties b/org.eclipse.jdt.core.javac/build.properties index e3023e14e99..7fe49b7240d 100644 --- a/org.eclipse.jdt.core.javac/build.properties +++ b/org.eclipse.jdt.core.javac/build.properties @@ -2,4 +2,6 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ - fragment.xml + fragment.xml,\ + lib/nb-javac-jdk-23+35.jar,\ + lib/nb-javac-jdk-23+35-api.jar diff --git a/org.eclipse.jdt.core.javac/pom.xml b/org.eclipse.jdt.core.javac/pom.xml index c677869bc0a..4b356cf6adb 100644 --- a/org.eclipse.jdt.core.javac/pom.xml +++ b/org.eclipse.jdt.core.javac/pom.xml @@ -20,41 +20,62 @@ - org.eclipse.tycho - tycho-compiler-plugin + org.apache.maven.plugins + maven-dependency-plugin - false - javac - - --add-exports - java.base/java.lang=ALL-UNNAMED - --add-exports - jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED - --add-exports - jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED - --add-exports - jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED - --add-exports - jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED - --add-exports - jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED - --add-exports - jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED - --add-exports - jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED - --add-exports - jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED - --add-exports - jdk.compiler/com.sun.tools.javac.platform=ALL-UNNAMED - --add-exports - jdk.compiler/com.sun.tools.javac.resources=ALL-UNNAMED - --add-exports - jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.taglets.snippet=ALL-UNNAMED - --add-exports - jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.taglets=ALL-UNNAMED - + + + com.dukescript.nbjavac + nb-javac + jdk-23+35 + + + com.dukescript.nbjavac + nb-javac + jdk-23+35 + api + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.8.1 + + + + get-libs + + copy + + validate + + + + false + ${basedir}/lib/ + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.4.0 + + + + ${basedir}/lib + + + + + + diff --git a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacCompilationUnitResolver.java b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacCompilationUnitResolver.java index c4a779eb048..8ebbaf9fd10 100644 --- a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacCompilationUnitResolver.java +++ b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacCompilationUnitResolver.java @@ -563,6 +563,8 @@ private Map cachedCtSym = new SoftReference<>(null); + + public static void loadVMWrapperPatch() { + try { + Field cachedCtSymField = VMWrapper.class.getDeclaredField("cachedCtSym"); + cachedCtSymField.setAccessible(true); + if (cachedCtSym.get() == null) { + cachedCtSym = new SoftReference<>(findCtSym()); + } + cachedCtSymField.set(null, cachedCtSym); + } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { + e.printStackTrace(); + } + } + + private static Path findCtSym() { + Path obj = cachedCtSym.get(); + if (obj instanceof Path) { + return obj; + } + try { + ClassLoader loader = VMWrapper.class.getClassLoader(); + if (loader == null) { + loader = ClassLoader.getSystemClassLoader(); + } + Enumeration en = loader.getResources("META-INF/services/com.sun.tools.javac.platform.PlatformProvider"); + URL res = en.hasMoreElements() ? en.nextElement() : null; + if (res == null) { + throw new IllegalStateException("Cannot find ct.sym"); + } + URL jar = FileLocator.resolve(res); + String jarFile = jar.getFile(); + int idx = jarFile.indexOf('!'); + if (idx >= 0) { + jarFile = jarFile.substring(0, idx); + } + Path path = Paths.get(URIUtil.fromString(jarFile)); + FileSystem fs = FileSystems.newFileSystem(path, (ClassLoader) null); + Path ctSym = fs.getPath("META-INF", "ct.sym"); + cachedCtSym = new SoftReference<>(ctSym); + return ctSym; + } catch (IOException | URISyntaxException ex) { + throw new IllegalStateException(ex); + } + } +} diff --git a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavadocConverter.java b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavadocConverter.java index 6d66f62e4c1..7cb51fd5a57 100644 --- a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavadocConverter.java +++ b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavadocConverter.java @@ -62,9 +62,6 @@ import com.sun.tools.javac.util.Convert; import com.sun.tools.javac.util.JCDiagnostic; -import jdk.javadoc.internal.doclets.formats.html.taglets.snippet.Attribute; -import jdk.javadoc.internal.doclets.formats.html.taglets.snippet.MarkupParser; - class JavadocConverter { // Both copied from jdk.javadoc.internal.doclets.formats.html.taglets.snippet.Parser @@ -329,7 +326,7 @@ private Optional convertBlockTag(DCTree javac) { } - + private Stream convertInlineTag(DCTree javac) { ArrayList collector = new ArrayList<>(); TagElement res = this.ast.newTagElement(); @@ -364,9 +361,9 @@ private Stream convertInlineTag(DCTree javac) { } else if (javac instanceof DCSnippet snippet) { res.setTagName(TagElement.TAG_SNIPPET); res.setProperty(TagProperty.TAG_PROPERTY_SNIPPET_IS_VALID, true); - res.fragments().addAll(splitLines(snippet.body, true) - .map(this::toSnippetFragment) - .toList()); +// res.fragments().addAll(splitLines(snippet.body, true) +// .map(this::toSnippetFragment) +// .toList()); } else if (javac instanceof DCUnknownInlineTag unknown) { res.fragments().add(toDefaultTextElement(unknown)); } else { @@ -498,64 +495,64 @@ private Stream splitLines(DCTree[] allPositions) { return Stream.empty(); } - private IDocElement /* TextElement or TagElement for highlight/link... */ toSnippetFragment(Region region) { - TextElement defaultElement = toTextElementPreserveWhitespace(region); - if (!defaultElement.getText().endsWith("\n")) { - defaultElement.setText(defaultElement.getText() + '\n'); - } - String line = region.getContents(); - Matcher markedUpLine = JAVA_COMMENT.matcher(line); - if (!markedUpLine.matches()) { - return defaultElement; - } - int markupStart = markedUpLine.start("markup"); - String markup = line.substring(markupStart); - MarkupParser markupParser = new MarkupParser(null); - try { - List tags = markupParser.parse(markup); - if (tags.isEmpty()) { - return defaultElement; - } - TextElement initialTextElement = this.ast.newTextElement(); - initialTextElement.setSourceRange(region.startOffset, markupStart - 2 /* 2 is length of `//` */); - initialTextElement.setText(line.substring(0, markupStart - 2) + '\n'); - IDocElement currentElement = initialTextElement; - Class tagClass = tags.getFirst().getClass(); - Field nameField = tagClass.getDeclaredField("name"); //$NON-NLS-1$ - nameField.setAccessible(true); - Field attributesFields = tagClass.getDeclaredField("attributes"); //$NON-NLS-1$ - attributesFields.setAccessible(true); - for (Object tag : tags) { - String name = (String)nameField.get(tag); - List attributes = (List)attributesFields.get(tag); - TagElement newElement = this.ast.newTagElement(); - newElement.setSourceRange(region.startOffset, region.length); - newElement.setTagName('@' + name); - newElement.setProperty(TagProperty.TAG_PROPERTY_SNIPPET_INLINE_TAG_COUNT, 1); // TODO what? - attributes.stream().map(this::toTagProperty).forEach(newElement.tagProperties()::add); - newElement.fragments().add(currentElement); - currentElement = newElement; - } - return currentElement; - } catch (Exception ex) { - ILog.get().error("While trying to build snippet line " + line + ": " + ex.getMessage(), ex); - } - return defaultElement; - } - private TagProperty toTagProperty(Attribute snippetMarkupAttribute) { - TagProperty res = this.ast.newTagProperty(); - try { - Field name = Attribute.class.getDeclaredField("name"); //$NON-NLS-1$ - name.setAccessible(true); - res.setName((String)name.get(snippetMarkupAttribute)); - Field value = snippetMarkupAttribute.getClass().getDeclaredField("value"); //$NON-NLS-1$ - value.setAccessible(true); - res.setStringValue((String)value.get(snippetMarkupAttribute)); - } catch (Exception ex) { - ILog.get().error(ex.getMessage(), ex); - } - return res; - } +// private IDocElement /* TextElement or TagElement for highlight/link... */ toSnippetFragment(Region region) { +// TextElement defaultElement = toTextElementPreserveWhitespace(region); +// if (!defaultElement.getText().endsWith("\n")) { +// defaultElement.setText(defaultElement.getText() + '\n'); +// } +// String line = region.getContents(); +// Matcher markedUpLine = JAVA_COMMENT.matcher(line); +// if (!markedUpLine.matches()) { +// return defaultElement; +// } +// int markupStart = markedUpLine.start("markup"); +// String markup = line.substring(markupStart); +// MarkupParser markupParser = new MarkupParser(null); +// try { +// List tags = markupParser.parse(markup); +// if (tags.isEmpty()) { +// return defaultElement; +// } +// TextElement initialTextElement = this.ast.newTextElement(); +// initialTextElement.setSourceRange(region.startOffset, markupStart - 2 /* 2 is length of `//` */); +// initialTextElement.setText(line.substring(0, markupStart - 2) + '\n'); +// IDocElement currentElement = initialTextElement; +// Class tagClass = tags.getFirst().getClass(); +// Field nameField = tagClass.getDeclaredField("name"); //$NON-NLS-1$ +// nameField.setAccessible(true); +// Field attributesFields = tagClass.getDeclaredField("attributes"); //$NON-NLS-1$ +// attributesFields.setAccessible(true); +// for (Object tag : tags) { +// String name = (String)nameField.get(tag); +// List attributes = (List)attributesFields.get(tag); +// TagElement newElement = this.ast.newTagElement(); +// newElement.setSourceRange(region.startOffset, region.length); +// newElement.setTagName('@' + name); +// newElement.setProperty(TagProperty.TAG_PROPERTY_SNIPPET_INLINE_TAG_COUNT, 1); // TODO what? +// attributes.stream().map(this::toTagProperty).forEach(newElement.tagProperties()::add); +// newElement.fragments().add(currentElement); +// currentElement = newElement; +// } +// return currentElement; +// } catch (Exception ex) { +// ILog.get().error("While trying to build snippet line " + line + ": " + ex.getMessage(), ex); +// } +// return defaultElement; +// } +// private TagProperty toTagProperty(Attribute snippetMarkupAttribute) { +// TagProperty res = this.ast.newTagProperty(); +// try { +// Field name = Attribute.class.getDeclaredField("name"); //$NON-NLS-1$ +// name.setAccessible(true); +// res.setName((String)name.get(snippetMarkupAttribute)); +// Field value = snippetMarkupAttribute.getClass().getDeclaredField("value"); //$NON-NLS-1$ +// value.setAccessible(true); +// res.setStringValue((String)value.get(snippetMarkupAttribute)); +// } catch (Exception ex) { +// ILog.get().error(ex.getMessage(), ex); +// } +// return res; +// } private Stream convertElementGroup(DCTree[] javac) { return splitLines(javac).filter(x -> x.length != 0).flatMap(this::toTextOrTag); diff --git a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/CachingJDKPlatformArguments.java b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/CachingJDKPlatformArguments.java index 1b1057ca169..72a6efa41be 100644 --- a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/CachingJDKPlatformArguments.java +++ b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/CachingJDKPlatformArguments.java @@ -93,7 +93,7 @@ private static PlatformDescription toReusable(PlatformDescription delegate) { return new PlatformDescription() { @Override public JavaFileManager getFileManager() { - return platformFMCache.computeIfAbsent(getSourceVersion(), _ -> new ForwardingJavaFileManager(delegate.getFileManager()) { + return platformFMCache.computeIfAbsent(getSourceVersion(), arg -> new ForwardingJavaFileManager(delegate.getFileManager()) { @Override public void close() { // do nothing, keep instance usable diff --git a/org.eclipse.jdt.core.tests.javac/.classpath b/org.eclipse.jdt.core.tests.javac/.classpath index 65b829b170e..c9bfedfe9ca 100644 --- a/org.eclipse.jdt.core.tests.javac/.classpath +++ b/org.eclipse.jdt.core.tests.javac/.classpath @@ -1,6 +1,6 @@ - + diff --git a/org.eclipse.jdt.core.tests.javac/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jdt.core.tests.javac/.settings/org.eclipse.jdt.core.prefs index f23daeba401..4eacc6ee51a 100644 --- a/org.eclipse.jdt.core.tests.javac/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jdt.core.tests.javac/.settings/org.eclipse.jdt.core.prefs @@ -19,9 +19,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable.secondary= org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=23 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=21 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=23 +org.eclipse.jdt.core.compiler.compliance=21 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -137,6 +137,6 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=23 +org.eclipse.jdt.core.compiler.source=21 org.eclipse.jdt.core.incompatibleJDKLevel=ignore org.eclipse.jdt.core.incompleteClasspath=error diff --git a/org.eclipse.jdt.core.tests.javac/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.tests.javac/META-INF/MANIFEST.MF index fa96f87c035..cd65e5485ee 100644 --- a/org.eclipse.jdt.core.tests.javac/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.core.tests.javac/META-INF/MANIFEST.MF @@ -16,7 +16,7 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)", org.eclipse.jdt.core.tests.compiler;bundle-version="[3.4.0,4.0.0)", org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.compiler.batch -Bundle-RequiredExecutionEnvironment: JavaSE-23 +Bundle-RequiredExecutionEnvironment: JavaSE-21 Eclipse-BundleShape: dir Bundle-Activator: org.eclipse.jdt.core.tests.Activator Bundle-ActivationPolicy: lazy diff --git a/org.eclipse.jdt.core/META-INF/MANIFEST.MF b/org.eclipse.jdt.core/META-INF/MANIFEST.MF index 0a624e97aa3..cd055019a5e 100644 --- a/org.eclipse.jdt.core/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.core/META-INF/MANIFEST.MF @@ -6,6 +6,16 @@ Bundle-Version: 3.40.0.qualifier Bundle-Activator: org.eclipse.jdt.core.JavaCore Bundle-Vendor: %providerName Bundle-Localization: plugin +Import-Package: org.eclipse.core.internal.runtime, + org.eclipse.core.runtime, + org.eclipse.core.runtime.content, + org.eclipse.core.runtime.jobs, + org.eclipse.core.runtime.preferences, + org.eclipse.equinox.app, + org.eclipse.osgi.service.debug, + org.eclipse.osgi.util, + org.osgi.framework, + org.osgi.service.prefs Export-Package: org.eclipse.jdt.core, org.eclipse.jdt.core.compiler, org.eclipse.jdt.core.dom, @@ -43,7 +53,6 @@ Export-Package: org.eclipse.jdt.core, org.eclipse.jdt.internal.formatter.linewrap;x-friends:="org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests", org.eclipse.jdt.internal.formatter.old;x-friends:="org.eclipse.jdt.core.tests.model, org.eclipse.jdt.core.tests.compiler, org.eclipse.jdt.core.tests.builder, org.eclipse.jdt.core.tests.performance, org.eclipse.jdt.ui.tests" Require-Bundle: org.eclipse.core.resources;bundle-version="[3.22.0,4.0.0)", - org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)", org.eclipse.core.filesystem;bundle-version="[1.11.0,2.0.0)", org.eclipse.text;bundle-version="[3.6.0,4.0.0)", org.eclipse.team.core;bundle-version="[3.1.0,4.0.0)";resolution:=optional,