=UTF-8
diff --git a/org.eclipse.jdt.core.tests.javac/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.jdt.core.tests.javac/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 00000000000..5a0ad22d2a7
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
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
new file mode 100644
index 00000000000..f23daeba401
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,142 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.annotationPath.allLocations=disabled
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,.svn/
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+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.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=23
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
+org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=warning
+org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+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.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/org.eclipse.jdt.core.tests.javac/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.jdt.core.tests.javac/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000000..cc05ab36053
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,56 @@
+#Thu Nov 04 13:38:45 EDT 2010
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=false
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=false
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.update_ibm_copyright_to_current_year=true
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/org.eclipse.jdt.core.tests.javac/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.tests.javac/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..6ddb6281dd8
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/META-INF/MANIFEST.MF
@@ -0,0 +1,32 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.jdt.core.tests.javac;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Export-Package: org.eclipse.jdt.core.tests.javac
+Import-Package: org.eclipse.jdt.internal.javac,
+ org.eclipse.jdt.internal.javac.dom
+Require-Bundle: org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
+ org.eclipse.jdt.core;bundle-version="[3.38.0,4.0.0)",
+ org.junit;bundle-version="3.8.1",
+ org.eclipse.test.performance;bundle-version="[3.1.0,4.0.0)",
+ org.eclipse.jdt.core.tests.compiler;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.jdt.compiler.apt.tests;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.jdt.core.tests.builder;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.jdt.launching;bundle-version="[3.10.0,4.0.0)",
+ org.eclipse.team.core;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.text;bundle-version="[3.2.0,4.0.0)",
+ com.ibm.icu;bundle-version="3.4.4",
+ org.eclipse.core.filesystem;bundle-version="[1.2.0,2.0.0)",
+ org.eclipse.jdt.annotation;bundle-version="[1.1.0,2.0.0)";resolution:=optional,
+ org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional,
+ org.eclipse.jdt.core.tests.model,
+ org.eclipse.jdt.core.compiler.batch
+Bundle-RequiredExecutionEnvironment: JavaSE-23
+Eclipse-BundleShape: dir
+Bundle-Activator: org.eclipse.jdt.core.tests.Activator
+Bundle-ActivationPolicy: lazy
+Automatic-Module-Name: org.eclipse.jdt.core.tests.javac
diff --git a/org.eclipse.jdt.core.tests.javac/META-INF/eclipse.inf b/org.eclipse.jdt.core.tests.javac/META-INF/eclipse.inf
new file mode 100644
index 00000000000..4ea66d6f8df
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/META-INF/eclipse.inf
@@ -0,0 +1,3 @@
+jarprocessor.exclude.pack=true
+
+jarprocessor.exclude.children=true
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/about.html b/org.eclipse.jdt.core.tests.javac/about.html
new file mode 100644
index 00000000000..ce1e7bca44e
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/about.html
@@ -0,0 +1,36 @@
+
+
+
+
+About
+
+
+ About This Content
+
+ April 25, 2024
+ License
+
+
+ The Eclipse Foundation makes available all content in this plug-in
+ ("Content"). Unless otherwise indicated below, the Content
+ is provided to you under the terms and conditions of the Eclipse
+ Public License Version 2.0 ("EPL"). A copy of the EPL is
+ available at http://www.eclipse.org/legal/epl-2.0.
+ For purposes of the EPL, "Program" will mean the Content.
+
+
+
+ If you did not receive this Content directly from the Eclipse
+ Foundation, the Content is being redistributed by another party
+ ("Redistributor") and different terms and conditions may
+ apply to your use of any object code in the Content. Check the
+ Redistributor's license that was provided with the Content. If no such
+ license exists, contact the Redistributor. Unless otherwise indicated
+ below, the terms and conditions of the EPL still apply to any source
+ code in the Content and such source code may be obtained at http://www.eclipse.org.
+
+
+
+
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/build.properties b/org.eclipse.jdt.core.tests.javac/build.properties
new file mode 100644
index 00000000000..c782210a64c
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/build.properties
@@ -0,0 +1,21 @@
+###############################################################################
+# Copyright (c) 2024 Red Hat Inc. and others.
+#
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Red Hat Inc. - initial API and implementation
+###############################################################################
+bin.includes = about.html,\
+ .,\
+ META-INF/,\
+ projects/,\
+ plugin.properties
+source.. = src/
+output.. = bin/
+src.includes = about.html
diff --git a/org.eclipse.jdt.core.tests.javac/plugin.properties b/org.eclipse.jdt.core.tests.javac/plugin.properties
new file mode 100644
index 00000000000..a85dfa7f4f2
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/plugin.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2024 Red Hat Inc. and others.
+#
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Red Hat Inc. - initial API and implementation
+###############################################################################
+providerName=Eclipse.org
+pluginName=Javac Feature Tests
diff --git a/org.eclipse.jdt.core.tests.javac/pom.xml b/org.eclipse.jdt.core.tests.javac/pom.xml
new file mode 100644
index 00000000000..f797ac2d6cb
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/pom.xml
@@ -0,0 +1,57 @@
+
+
+
+ 4.0.0
+
+ tests-pom
+ org.eclipse.jdt
+ 4.33.0-SNAPSHOT
+ ../tests-pom/
+
+ org.eclipse.jdt.core.tests.javac
+ 0.1.0-SNAPSHOT
+ eclipse-test-plugin
+
+
+ test-on-javase-23
+
+
+
+ org.apache.maven.plugins
+ maven-toolchains-plugin
+
+
+
+ JavaSE-23
+
+
+
+
+
+ org.eclipse.tycho
+ tycho-surefire-plugin
+
+
+ org/eclipse/jdt/core/tests/javac/RunConverterTestsJavac.class
+
+ ${tycho.surefire.argLine}
+
+
+
+
+
+ --add-modules ALL-SYSTEM -Dcompliance=21 -DCompilationUnit.DOM_BASED_OPERATIONS=true -DSourceIndexer.DOM_BASED_INDEXER=true --add-opens jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED -DICompilationUnitResolver=org.eclipse.jdt.core.dom.JavacCompilationUnitResolver -DAbstractImageBuilder.compiler=org.eclipse.jdt.internal.javac.JavacCompiler -DASTParser.compilationUnitResolver=org.eclipse.jdt.core.dom.JavacCompilationUnitResolver
+
+
+
+
diff --git a/org.eclipse.jdt.core.tests.javac/projects/dependent/.classpath b/org.eclipse.jdt.core.tests.javac/projects/dependent/.classpath
new file mode 100644
index 00000000000..e10e4369e75
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/dependent/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/org.eclipse.jdt.core.tests.javac/projects/dependent/.gitignore b/org.eclipse.jdt.core.tests.javac/projects/dependent/.gitignore
new file mode 100644
index 00000000000..ae3c1726048
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/dependent/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/org.eclipse.jdt.core.tests.javac/projects/dependent/.project b/org.eclipse.jdt.core.tests.javac/projects/dependent/.project
new file mode 100644
index 00000000000..20ed515782f
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/dependent/.project
@@ -0,0 +1,17 @@
+
+
+ dependent
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/org.eclipse.jdt.core.tests.javac/projects/dependent/src/D.java b/org.eclipse.jdt.core.tests.javac/projects/dependent/src/D.java
new file mode 100644
index 00000000000..5337ca30adf
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/dependent/src/D.java
@@ -0,0 +1,3 @@
+class D {
+ A a = null;
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/Ambiguous/Ambiguous.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/Ambiguous/Ambiguous.java
new file mode 100644
index 00000000000..343d9d7996d
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/Ambiguous/Ambiguous.java
@@ -0,0 +1,19 @@
+package Ambiguous;
+
+import Ambiguous.pkg1.*;
+import Ambiguous.pkg2.*;
+
+public class Ambiguous {
+ private void testAmbiguous1() {
+ // compiler.err.ref.ambiguous -> AmbiguousType(16777220)
+ A a;
+ // compiler.err.ref.ambiguous -> AmbiguousMethod(67108966)
+ method(1, 2);
+ }
+
+ void method(int i, double d) {
+ }
+
+ void method(double d, int m) {
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/Ambiguous/pkg1/A.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/Ambiguous/pkg1/A.java
new file mode 100644
index 00000000000..8bb7e0a6080
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/Ambiguous/pkg1/A.java
@@ -0,0 +1,5 @@
+package Ambiguous.pkg1;
+
+public class A {
+
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/Ambiguous/pkg2/A.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/Ambiguous/pkg2/A.java
new file mode 100644
index 00000000000..3fbbbc7dd39
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/Ambiguous/pkg2/A.java
@@ -0,0 +1,5 @@
+package Ambiguous.pkg2;
+
+public class A {
+
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/AnnotationMember.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/AnnotationMember.java
new file mode 100644
index 00000000000..d4bb143adee
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/AnnotationMember.java
@@ -0,0 +1,8 @@
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+// compiler.err.annotation.value.must.be.name.value -> UndefinedAnnotationMember(67109475)
+@Retention(RetentionPolicy.RUNTIME, "error")
+public @interface AnnotationMember {
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/BodyForAbstractMethod.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/BodyForAbstractMethod.java
new file mode 100644
index 00000000000..2b8585612ff
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/BodyForAbstractMethod.java
@@ -0,0 +1,7 @@
+
+public abstract class BodyForAbstractMethod {
+ // compiler.err.abstract.meth.cant.have.body -> BodyForAbstractMethod(603979889)
+ abstract void testBodyForAbstractMethod() {
+
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/CodeCannotBeReached.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/CodeCannotBeReached.java
new file mode 100644
index 00000000000..c101d7281b5
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/CodeCannotBeReached.java
@@ -0,0 +1,7 @@
+public class CodeCannotBeReached {
+ public void testCodeCannotBeReached() {
+ return;
+ // compiler.err.unreachable.stmt -> CodeCannotBeReached(536871073)
+ String reach = "";
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/File.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/File.java
new file mode 100644
index 00000000000..51d69c33678
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/File.java
@@ -0,0 +1,5 @@
+import java.io.File;
+// compiler.err.already.defined.this.unit -> ConflictingImport(268435841)
+public class File {
+
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/FileNameAndClassName.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/FileNameAndClassName.java
new file mode 100644
index 00000000000..7a13c247347
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/FileNameAndClassName.java
@@ -0,0 +1,4 @@
+
+// compiler.err.class.public.should.be.in.file -> PublicClassMustMatchFileName(16777541)
+public class ClassName {
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/IncompatibleExpInThrow/Sub.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/IncompatibleExpInThrow/Sub.java
new file mode 100644
index 00000000000..9c96295cf7b
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/IncompatibleExpInThrow/Sub.java
@@ -0,0 +1,9 @@
+package IncompatibleExpInThrow;
+
+// compiler.err.override.meth.doesnt.throw -> IncompatibleExceptionInThrowsClause(67109266)
+public class Sub extends Super {
+ @Override
+ void foo() throws Exception {
+
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/IncompatibleExpInThrow/Super.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/IncompatibleExpInThrow/Super.java
new file mode 100644
index 00000000000..6a4f71ecb62
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/IncompatibleExpInThrow/Super.java
@@ -0,0 +1,8 @@
+package IncompatibleExpInThrow;
+
+import java.io.IOException;
+
+public class Super {
+ void foo() throws IOException {
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/IncompatibleReturnType/Sub.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/IncompatibleReturnType/Sub.java
new file mode 100644
index 00000000000..9aec288019f
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/IncompatibleReturnType/Sub.java
@@ -0,0 +1,9 @@
+package IncompatibleReturnType;
+
+// compiler.err.override.incompatible.ret -> UndefinedAnnotationMember(67109475)
+public class Sub extends Super {
+ @Override
+ void foo() {
+
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/IncompatibleReturnType/Super.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/IncompatibleReturnType/Super.java
new file mode 100644
index 00000000000..bb0330e9d91
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/IncompatibleReturnType/Super.java
@@ -0,0 +1,9 @@
+package IncompatibleReturnType;
+
+import java.io.IOException;
+
+public class Super {
+ String foo() {
+ return "foo";
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/InvalidUnionTypeReferenceSequenceCatch.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/InvalidUnionTypeReferenceSequenceCatch.java
new file mode 100644
index 00000000000..d2226f76d05
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/InvalidUnionTypeReferenceSequenceCatch.java
@@ -0,0 +1,15 @@
+
+import java.io.File;
+import java.io.IOException;
+import java.io.FileNotFoundException;
+
+public class InvalidUnionTypeReferenceSequenceCatch {
+ public void testInvalidUnionTypeReferenceSequence() {
+ try {
+ boolean success = new File("f").createNewFile();
+ } catch (FileNotFoundException | IOException e) {
+ // compiler.err.multicatch.types.must.be.disjoint -> InvalidUnionTypeReferenceSequence(553649001)
+
+ }
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/MethodReturnsVoid.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/MethodReturnsVoid.java
new file mode 100644
index 00000000000..3c7b2981391
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/MethodReturnsVoid.java
@@ -0,0 +1,11 @@
+
+public class MethodReturnsVoid {
+ public void testVoidMethod() {
+
+ }
+
+ public String testMethodReturnsVoid() {
+ // compiler.err.prob.found.req -> MethodReturnsVoid(67108969)
+ return testVoidMethod();
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/MissingReturnType.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/MissingReturnType.java
new file mode 100644
index 00000000000..3f376bb9df6
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/MissingReturnType.java
@@ -0,0 +1,7 @@
+
+public class MissingReturnType {
+ // compiler.err.invalid.meth.decl.ret.type.req -> MissingReturnType(16777327)
+ public testMissingReturnType() {
+
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/MissingValueForAnnotationMember/A.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/MissingValueForAnnotationMember/A.java
new file mode 100644
index 00000000000..75422c36e0c
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/MissingValueForAnnotationMember/A.java
@@ -0,0 +1,9 @@
+package MissingValueForAnnotationMember;
+
+// compiler.err.annotation.missing.default.value -> MissingValueForAnnotationMember(16777825)
+public class A {
+ @CustomAnnotation
+ public void testMissingValueForAnnotationMember() {
+
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/MissingValueForAnnotationMember/CustomAnnotation.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/MissingValueForAnnotationMember/CustomAnnotation.java
new file mode 100644
index 00000000000..bc44ce9c145
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/MissingValueForAnnotationMember/CustomAnnotation.java
@@ -0,0 +1,5 @@
+package MissingValueForAnnotationMember;
+
+public @interface CustomAnnotation {
+ String name();
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NoMessageSendOnArrayType.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NoMessageSendOnArrayType.java
new file mode 100644
index 00000000000..a80ca40913d
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NoMessageSendOnArrayType.java
@@ -0,0 +1,8 @@
+
+public class NoMessageSendOnArrayType {
+ public void testNoMessageSendOnArrayType() {
+ String[] test = {"1", "2"};
+ // compiler.err.cant.resolve.location.args -> NoMessageSendOnArrayType(67108980)
+ int size = test.size();
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleConstructor/A.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleConstructor/A.java
new file mode 100644
index 00000000000..1a3255d660c
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleConstructor/A.java
@@ -0,0 +1,8 @@
+package NotVisibleConstructor;
+
+public class A {
+ private String a;
+ private A(String a) {
+ this.a = a;
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleConstructor/B.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleConstructor/B.java
new file mode 100644
index 00000000000..9e3fa1a9c49
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleConstructor/B.java
@@ -0,0 +1,8 @@
+package NotVisibleConstructor;
+
+public class B {
+ public void testNotVisibleConstructor() {
+ // compiler.err.report.access -> NotVisibleConstructor(134217859)
+ A a = new A("a");
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleConstructorInDefaultConstructor/Sub.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleConstructorInDefaultConstructor/Sub.java
new file mode 100644
index 00000000000..01931294a7f
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleConstructorInDefaultConstructor/Sub.java
@@ -0,0 +1,6 @@
+package NotVisibleConstructorInDefaultConstructor;
+
+// compiler.err.report.access -> NotVisibleConstructorInDefaultConstructor(134217869)
+public class Sub extends Super {
+
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleConstructorInDefaultConstructor/Super.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleConstructorInDefaultConstructor/Super.java
new file mode 100644
index 00000000000..ab18a17e3a3
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleConstructorInDefaultConstructor/Super.java
@@ -0,0 +1,7 @@
+package NotVisibleConstructorInDefaultConstructor;
+
+public class Super {
+ private Super() {
+
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleMethod/A.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleMethod/A.java
new file mode 100644
index 00000000000..b5d4b9b7d57
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleMethod/A.java
@@ -0,0 +1,7 @@
+package NotVisibleMethod;
+
+public class A {
+ private void a() {
+
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleMethod/B.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleMethod/B.java
new file mode 100644
index 00000000000..4260a390801
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleMethod/B.java
@@ -0,0 +1,9 @@
+package NotVisibleMethod;
+
+public class B {
+ public void testNotVisibleMethod() {
+ A a = new A();
+ // compiler.err.report.access -> NotVisibleMethod(67108965)
+ a.a();
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleType/A.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleType/A.java
new file mode 100644
index 00000000000..a4a6eb7ab7a
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleType/A.java
@@ -0,0 +1,7 @@
+package NotVisibleType;
+
+public class A {
+ private class Inner {
+
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleType/B.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleType/B.java
new file mode 100644
index 00000000000..ed5fa81a285
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/NotVisibleType/B.java
@@ -0,0 +1,8 @@
+package NotVisibleType;
+
+public class B {
+ public void testNotVisibleType() {
+ // compiler.err.report.access -> NotVisibleType(16777219)
+ A.Inner i = new A.Inner();
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/ParameterMismatch.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/ParameterMismatch.java
new file mode 100644
index 00000000000..d5a20ab22a6
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/ParameterMismatch.java
@@ -0,0 +1,22 @@
+
+public class ParameterMismatch {
+
+ private String message;
+
+ private void setMessage(String message) {
+ this.message = message;
+ }
+
+ private void testMethodParameterMatch() {
+ // compiler.err.cant.apply.symbol -> ParameterMismatch(67108979)
+ this.setMessage();
+ }
+
+ void m(int i1) {}
+ void m(int i1, int i2) {}
+
+ ParameterMismatch() {
+ // compiler.err.cant.apply.symbols -> ParameterMismatch(67108979)
+ this.m();
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/TypeMismatch.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/TypeMismatch.java
new file mode 100644
index 00000000000..e02347946fd
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/TypeMismatch.java
@@ -0,0 +1,29 @@
+
+import java.util.List;
+import java.util.ArrayList;
+
+public class TypeMismatch {
+ private void testTypeMismatch() {
+ // compiler.err.illegal.initializer.for.type -> TypeMismatch(16777233)
+ String a = { "a", "b" };
+ }
+
+ private void testTypeMismatch1() {
+ // compiler.err.prob.found.req -> TypeMismatch(16777233)
+ String a = new String[] { "a", "b" };
+ }
+
+ private String testReturnTypeMismatch() {
+ // compiler.err.prob.found.req -> ReturnTypeMismatch(16777235)
+ return new String[] { "a", "b" };
+ }
+
+
+ private void testIncompatibleTypesInForeach() {
+ List intList = new ArrayList<>();
+ // compiler.err.prob.found.req -> IncompatibleTypesInForeach(16777796)
+ for (String s : intList) {
+ s.hashCode();
+ }
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/Undefined.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/Undefined.java
new file mode 100644
index 00000000000..b4c073a9bde
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/Undefined.java
@@ -0,0 +1,46 @@
+
+import java.util.List;
+
+public class Undefined {
+ Undefined(Integer x) {}
+
+ private void testUndefinedConstructor1() {
+ // compiler.err.cant.apply.symbols -> UndefinedConstructor(134217858)
+ String l = new String("s", "t");
+ }
+
+ void testUndefinedConstructor2() {
+ // compiler.err.cant.resolve.args -> UndefinedConstructor(134217858)
+ new Undefined(""){};
+ }
+
+ private void testUndefinedType() {
+ // compiler.err.cant.resolve.location -> UndefinedType(16777218)
+ UndefinedType a = new UndefinedType();
+ }
+
+ private void testUndefinedMethod1() {
+ // compiler.err.cant.resolve.location.args -> UndefinedMethod(67108964)
+ test();
+ }
+
+ private void testUndefinedMethod2() {
+ // compiler.err.cant.resolve.args.params -> UndefinedMethod(67108964)
+ Object o = new Object() {
+ { this.m2(1, ""); }
+ };
+ }
+
+ private void testUndefinedMethod3() {
+ // compiler.err.cant.resolve.args -> UndefinedMethod(67108964)
+ new Runnable() {
+ { unknown(); }
+ public void run() { }
+ };
+ }
+
+ private void testUndefinedMethod4() {
+ // compiler.err.cant.resolve.location.args.params -> UndefinedMethod(67108964)
+ Object o = List.unknown();
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UndefinedConstructorInDefaultConstructor/Sub.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UndefinedConstructorInDefaultConstructor/Sub.java
new file mode 100644
index 00000000000..b6ed2188366
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UndefinedConstructorInDefaultConstructor/Sub.java
@@ -0,0 +1,5 @@
+package UndefinedConstructorInDefaultConstructor;
+
+// compiler.err.cant.apply.symbol -> UndefinedConstructorInDefaultConstructor(134217868)
+public class Sub extends Super {
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UndefinedConstructorInDefaultConstructor/Super.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UndefinedConstructorInDefaultConstructor/Super.java
new file mode 100644
index 00000000000..2ed456b91d1
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UndefinedConstructorInDefaultConstructor/Super.java
@@ -0,0 +1,7 @@
+package UndefinedConstructorInDefaultConstructor;
+
+public class Super {
+ Super(int a) {
+
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UnhandledException.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UnhandledException.java
new file mode 100644
index 00000000000..a8e387bf659
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UnhandledException.java
@@ -0,0 +1,22 @@
+
+import java.io.IOException;
+
+public class UnhandledException {
+ public void testUnhandledException() {
+ throw new IOException("IOExp");
+ }
+
+ public static class AutoCloseableClass implements AutoCloseable {
+ @Override
+ public void close() throws Exception {
+ System.out.println("close");
+ }
+ }
+
+ // compiler.err.unreported.exception.implicit.close -> UnhandledExceptionOnAutoClose(16778098)
+ public void testUnhandledExceptionOnAutoClose() {
+ try (AutoCloseableClass a = new AutoCloseableClass()) {
+ System.out.println("try-with-resource AutoCloseableClass");
+ }
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UnhandledExceptionInDefaultConstructor/Sub.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UnhandledExceptionInDefaultConstructor/Sub.java
new file mode 100644
index 00000000000..a9c0819fb86
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UnhandledExceptionInDefaultConstructor/Sub.java
@@ -0,0 +1,5 @@
+package UnhandledExceptionInDefaultConstructor;
+
+// compiler.err.unreported.exception.default.constructor -> UnhandledExceptionInDefaultConstructor(16777362)
+public class Sub extends Super {
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UnhandledExceptionInDefaultConstructor/Super.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UnhandledExceptionInDefaultConstructor/Super.java
new file mode 100644
index 00000000000..b12ea257478
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UnhandledExceptionInDefaultConstructor/Super.java
@@ -0,0 +1,7 @@
+package UnhandledExceptionInDefaultConstructor;
+
+public class Super {
+ Super() throws Exception {
+ throw new Exception("Exp");
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UnreachableCatch.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UnreachableCatch.java
new file mode 100644
index 00000000000..603f1554632
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UnreachableCatch.java
@@ -0,0 +1,26 @@
+
+import java.io.File;
+import java.io.IOException;
+import java.io.FileNotFoundException;
+
+public class UnreachableCatch {
+
+ public void testUnreachableCatch() {
+ try {
+ String a = "a";
+ } catch (IOException e) { // compiler.err.except.never.thrown.in.try -> UnreachableCatch(83886247)
+
+
+ }
+ }
+
+ public void testInvalidCatchBlockSequence() {
+ try {
+ boolean success = new File("f").createNewFile();
+ } catch (IOException e) {
+
+ } catch (FileNotFoundException e) { // compiler.err.except.already.caught -> InvalidCatchBlockSequence(553648315)
+
+ }
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/Unresolved.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/Unresolved.java
new file mode 100644
index 00000000000..7e94f7c6fac
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/Unresolved.java
@@ -0,0 +1,33 @@
+
+public class Unresolved {
+ private void testUndefinedField() {
+ // compiler.err.cant.resolve -> UndefinedField(33554502)
+ String test = this.str;
+
+ }
+
+ private void testUnresolvedVariable1() {
+ // compiler.err.cant.resolve.location -> UnresolvedVariable(33554515)
+ String test = str;
+
+ Object o = new Object() {
+ // compiler.err.cant.resolve -> UnresolvedVariable(33554515)
+ int i = f;
+ };
+ }
+
+ private void testUndefinedName() {
+ // compiler.err.cant.resolve.location -> UndefinedName(570425394)
+ String test = K.Strin();
+ }
+
+}
+
+@interface Anno {
+ String name() default "anon";
+ String address() default "here";
+}
+
+// compiler.err.cant.resolve -> UnresolvedVariable(33554515)
+@Anno(name == "fred", address = "there")
+class X { }
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UnterminatedString.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UnterminatedString.java
new file mode 100644
index 00000000000..0a85adccbda
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/UnterminatedString.java
@@ -0,0 +1,5 @@
+
+public class UnterminatedString {
+ // compiler.err.unclosed.str.lit -> UnterminatedString(1610612995)
+ private String test = "Test';
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/VoidMethodReturnsValue.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/VoidMethodReturnsValue.java
new file mode 100644
index 00000000000..3cc5413adaf
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/VoidMethodReturnsValue.java
@@ -0,0 +1,7 @@
+
+public class VoidMethodReturnsValue {
+ public void testVoidMethodReturnsValue() {
+ // compiler.err.prob.found.req -> VoidMethodReturnsValue(67108969)
+ return "VoidMethodReturnsValue";
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/notVisibleField/A.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/notVisibleField/A.java
new file mode 100644
index 00000000000..528134a13f6
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/notVisibleField/A.java
@@ -0,0 +1,5 @@
+package notVisibleField;
+
+public class A {
+ private int a;
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/projects/diagnostics/notVisibleField/B.java b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/notVisibleField/B.java
new file mode 100644
index 00000000000..091684b5a1f
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/diagnostics/notVisibleField/B.java
@@ -0,0 +1,9 @@
+package notVisibleField;
+
+public class B {
+ public void testNotVisibleField() {
+ A a = new A();
+ // compiler.err.report.access -> NotVisibleField(33554503)
+ a.a = 1;
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.tests.javac/projects/dummy/.classpath b/org.eclipse.jdt.core.tests.javac/projects/dummy/.classpath
new file mode 100644
index 00000000000..42735615714
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/dummy/.classpath
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/org.eclipse.jdt.core.tests.javac/projects/dummy/.gitignore b/org.eclipse.jdt.core.tests.javac/projects/dummy/.gitignore
new file mode 100644
index 00000000000..ae3c1726048
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/dummy/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/org.eclipse.jdt.core.tests.javac/projects/dummy/.project b/org.eclipse.jdt.core.tests.javac/projects/dummy/.project
new file mode 100644
index 00000000000..a9c18ef8308
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/dummy/.project
@@ -0,0 +1,17 @@
+
+
+ sandboxJava
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/org.eclipse.jdt.core.tests.javac/projects/dummy/src/A.java b/org.eclipse.jdt.core.tests.javac/projects/dummy/src/A.java
new file mode 100644
index 00000000000..e36dd8567a6
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/dummy/src/A.java
@@ -0,0 +1,10 @@
+public class A {
+ String method(Object element, int columnIndex) {
+ return element instanceof String data ?
+ switch (columnIndex) {
+ case 0 -> data;
+ case 1 -> data.toUpperCase();
+ default -> "";
+ } : "";
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/dummy/src/B.java b/org.eclipse.jdt.core.tests.javac/projects/dummy/src/B.java
new file mode 100644
index 00000000000..7d95eb64996
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/dummy/src/B.java
@@ -0,0 +1,2 @@
+class B {
+}
diff --git a/org.eclipse.jdt.core.tests.javac/projects/dummy/src/pack/Packaged.java b/org.eclipse.jdt.core.tests.javac/projects/dummy/src/pack/Packaged.java
new file mode 100644
index 00000000000..a3293b8c9ee
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/projects/dummy/src/pack/Packaged.java
@@ -0,0 +1,3 @@
+package pack;
+class Packaged {
+}
diff --git a/org.eclipse.jdt.core.tests.javac/src/org/eclipse/jdt/core/tests/javac/JavacASTConverterBugsTestJLS.java b/org.eclipse.jdt.core.tests.javac/src/org/eclipse/jdt/core/tests/javac/JavacASTConverterBugsTestJLS.java
new file mode 100644
index 00000000000..38abe696590
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/src/org/eclipse/jdt/core/tests/javac/JavacASTConverterBugsTestJLS.java
@@ -0,0 +1,171 @@
+/*******************************************************************************
+ * Copyright (c) 2024 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests.javac;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.stream.Stream;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.ILocalVariable;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.tests.dom.ASTConverterBugsTest;
+import org.eclipse.jdt.core.tests.dom.ASTConverterBugsTestSetup;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Test suite to verify that DOM/AST bugs are fixed.
+ *
+ * Note that only specific JLS8 tests are defined in this test suite, but when
+ * running it, all superclass {@link ASTConverterBugsTest} tests will be run
+ * as well.
+ */
+@SuppressWarnings("rawtypes")
+public class JavacASTConverterBugsTestJLS extends ASTConverterBugsTestSetup {
+ public JavacASTConverterBugsTestJLS(String name) {
+ super(name);
+ this.testLevel = AST.getJLSLatest();
+ }
+
+ public static Test suite() {
+ TestSuite suite = new Suite(JavacASTConverterBugsTestJLS.class.getName());
+ List tests = buildTestsList(JavacASTConverterBugsTestJLS.class, 1, 0/* do not sort*/);
+ for (int index=0, size=tests.size(); index "main".equals(method.getElementName())).findFirst().get();
+ ILocalVariable[] parameters = mainMethod.getParameters();
+ assertEquals(1, parameters.length);
+ } finally {
+ deleteProject("P");
+ }
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/src/org/eclipse/jdt/core/tests/javac/RegressionTests.java b/org.eclipse.jdt.core.tests.javac/src/org/eclipse/jdt/core/tests/javac/RegressionTests.java
new file mode 100644
index 00000000000..ad4cda712de
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/src/org/eclipse/jdt/core/tests/javac/RegressionTests.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2024, Red Hat, Inc. and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests.javac;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IWorkspaceDescription;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClassFile;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.WorkingCopyOwner;
+import org.eclipse.jdt.core.compiler.IProblem;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.internal.core.CompilationUnit;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class RegressionTests {
+
+ private static IProject project;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ project = importProject("projects/dummy");
+ }
+
+ @Test
+ public void testCheckBuild() throws Exception {
+ project.build(IncrementalProjectBuilder.FULL_BUILD, null);
+ assertEquals(Set.of("A.class", "B.class", "pack"),
+ new HashSet<>(Arrays.asList(new File(project.getLocation().toFile(), "bin").list())));
+ assertArrayEquals(new String[] { "Packaged.class" },
+ new File(project.getLocation().toFile(), "bin/pack").list());
+ }
+
+ @Test
+ public void testGetDOMForClassWithSource() throws Exception {
+ IJavaProject javaProject = JavaCore.create(project);
+ IType arrayList = javaProject.findType("java.util.ArrayList");
+ IClassFile classFile = (IClassFile)arrayList.getAncestor(IJavaElement.CLASS_FILE);
+ var unit = (CompilationUnit)classFile.getWorkingCopy((WorkingCopyOwner)null, null);
+ ASTParser parser = ASTParser.newParser(AST.getJLSLatest());
+ parser.setSource(unit);
+ parser.setProject(javaProject);
+ var domUnit = parser.createAST(null);
+ }
+
+ @Test
+ public void testBuildReferenceOtherProjectSource() throws Exception {
+ IWorkspaceDescription wsDesc = ResourcesPlugin.getWorkspace().getDescription();
+ wsDesc.setAutoBuilding(false);
+ ResourcesPlugin.getWorkspace().setDescription(wsDesc);
+ project.build(IncrementalProjectBuilder.CLEAN_BUILD, null);
+ IProject dependent = importProject("projects/dependent");
+ // at this stage, no .class file exists, so we test that resolution through sourcePath/referenced projects work
+ CompilationUnit unit = (CompilationUnit)JavaCore.create(dependent).findElement(Path.fromOSString("D.java"));
+ unit.becomeWorkingCopy(null);
+ var dom = unit.reconcile(AST.getJLSLatest(), true, unit.getOwner(), null);
+ assertArrayEquals(new IProblem[0], dom.getProblems());
+ }
+
+
+ static IProject importProject(String locationInBundle) throws URISyntaxException, IOException, CoreException {
+ File file = new File(FileLocator.toFileURL(RegressionTests.class.getResource("/" + locationInBundle + "/.project")).toURI());
+ IPath dotProjectPath = Path.fromOSString(file.getAbsolutePath());
+ IProjectDescription projectDescription = ResourcesPlugin.getWorkspace()
+ .loadProjectDescription(dotProjectPath);
+ projectDescription.setLocation(dotProjectPath.removeLastSegments(1));
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectDescription.getName());
+ project.create(projectDescription, null);
+ project.open(null);
+ return project;
+ }
+}
diff --git a/org.eclipse.jdt.core.tests.javac/src/org/eclipse/jdt/core/tests/javac/RunConverterTestsJavac.java b/org.eclipse.jdt.core.tests.javac/src/org/eclipse/jdt/core/tests/javac/RunConverterTestsJavac.java
new file mode 100644
index 00000000000..90c6b73dee3
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.javac/src/org/eclipse/jdt/core/tests/javac/RunConverterTestsJavac.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2024, Red Hat, Inc. and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests.javac;
+
+public class RunConverterTestsJavac extends org.eclipse.jdt.core.tests.dom.RunConverterTests {
+
+ public RunConverterTestsJavac(String name) {
+ super(name);
+ }
+
+}
diff --git a/org.eclipse.jdt.core.tests.model/pom.xml b/org.eclipse.jdt.core.tests.model/pom.xml
index 2c483c4671d..c91ab43e6bc 100644
--- a/org.eclipse.jdt.core.tests.model/pom.xml
+++ b/org.eclipse.jdt.core.tests.model/pom.xml
@@ -175,6 +175,27 @@
--add-modules ALL-SYSTEM -Dcompliance=1.8,17,21,22
+
+ test-on-javase-23
+
+
+
+ org.apache.maven.plugins
+ maven-toolchains-plugin
+
+
+
+ JavaSE-23
+
+
+
+
+
+
+
+ --add-modules ALL-SYSTEM -Dcompliance=1.8,17,21,23
+
+
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBugsTestSetup.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBugsTestSetup.java
new file mode 100644
index 00000000000..5d251cffe4b
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBugsTestSetup.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2024 IBM Corporation and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests.dom;
+
+import java.util.Map;
+
+import org.eclipse.jdt.core.IClassFile;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.WorkingCopyOwner;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.ASTRequestor;
+import org.eclipse.jdt.core.dom.IAnnotationBinding;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+
+import junit.framework.Test;
+
+@SuppressWarnings("rawtypes")
+public class ASTConverterBugsTestSetup extends ConverterTestSetup {
+
+@Override
+public void setUpSuite() throws Exception {
+// PROJECT_SETUP = true; // do not copy Converter* directories
+ super.setUpSuite();
+// setUpJCLClasspathVariables("1.5");
+ waitUntilIndexesReady();
+}
+
+public ASTConverterBugsTestSetup(String name) {
+ super(name);
+}
+
+public static Test suite() {
+ return buildModelTestSuite(ASTConverterBugsTestSetup.class);
+}
+
+protected void checkParameterAnnotations(String message, String expected, IMethodBinding methodBinding) {
+ ITypeBinding[] parameterTypes = methodBinding.getParameterTypes();
+ int size = parameterTypes == null ? 0 : parameterTypes.length;
+ StringBuilder buffer = new StringBuilder();
+ for (int i=0; i