update jdt.core to I20221206-1800 for #592
diff --git a/org.eclipse.jdt.core.compiler.batch/.settings/.api_filters b/org.eclipse.jdt.core.compiler.batch/.settings/.api_filters
index a69e00e..4e45571 100644
--- a/org.eclipse.jdt.core.compiler.batch/.settings/.api_filters
+++ b/org.eclipse.jdt.core.compiler.batch/.settings/.api_filters
@@ -16,6 +16,14 @@
             </message_arguments>
         </filter>
     </resource>
+    <resource path="src/org/eclipse/jdt/core/JDTCompilerAdapter.java" type="org.eclipse.jdt.core.JDTCompilerAdapter">
+        <filter comment="See eclipse-pde/eclipse.pde#419 issue" id="305365105">
+            <message_arguments>
+                <message_argument value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
+                <message_argument value="org.eclipse.jdt.core.compiler.batch_3.33.0"/>
+            </message_arguments>
+        </filter>
+    </resource>
     <resource path="src/org/eclipse/jdt/core/compiler/batch/BatchCompiler.java" type="org.eclipse.jdt.core.compiler.batch.BatchCompiler">
         <filter id="1108344834">
             <message_arguments>
diff --git a/org.eclipse.jdt.core.compiler.batch/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.compiler.batch/META-INF/MANIFEST.MF
index efab1a2..39fb4d1 100644
--- a/org.eclipse.jdt.core.compiler.batch/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.core.compiler.batch/META-INF/MANIFEST.MF
@@ -10,7 +10,7 @@
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-11
 Require-Bundle: org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional;visibility:=reexport
-Export-Package: org.eclipse.jdt.core,
+Export-Package: META-INF.services,
  org.eclipse.jdt.core.compiler,
  org.eclipse.jdt.core.compiler.batch,
  org.eclipse.jdt.internal.antadapter;x-friends:="org.eclipse.jdt.core",
@@ -45,5 +45,4 @@
  org.eclipse.objectteams.otdt.internal.core.compiler.smap;x-friends:="org.eclipse.objectteams.otdt.tests",
  org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.copyinheritance;x-friends:="org.eclipse.objectteams.otdt.compiler.adaptor",
  org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.transformer;x-internal:=true,
- org.eclipse.objectteams.otdt.internal.core.compiler.util;x-internal:=true,
- META-INF.services
+ org.eclipse.objectteams.otdt.internal.core.compiler.util;x-internal:=true
diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/core/README.md b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/core/README.md
new file mode 100644
index 0000000..c5399cf
--- /dev/null
+++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/core/README.md
@@ -0,0 +1,74 @@
+## Notes for maintainers of the JDTCompilerAdapter (ant support) in ECJ.
+
+The org.eclipse.jdt.core.JDTCompilerAdapter class can be used by PDE/ant 
+via jdtCompilerAdapter.jar if running ant tasks from inside Eclipse or by ant
+directly (by adding org.eclipse.jdt.core.compiler.batch jar to ant classpath) 
+if running in a separated VM without OSGI.
+
+### Standalone ant use
+
+Using JDTCompilerAdapter class from standalone ant is straightforward - the 
+org.eclipse.jdt.core.compiler.batch jar should be added to the ant javac classpath
+in some way, like for example here:
+
+```
+<javac destdir="${temp.folder}/@dot.bin" failonerror="${javacFailOnError}" verbose="${javacVerbose}" 
+	debug="${javacDebugInfo}" includeAntRuntime="no" source="${javacSource}" target="${javacTarget}" encoding="UTF-8">
+	<compilerarg line="${compilerArg}" compiler="${build.compiler}"/>
+	<classpath refid="@dot.classpath" />
+	<src path="src/" />
+	<compilerarg line="-properties &apos;.settings/org.eclipse.jdt.core.prefs&apos;" compiler="org.eclipse.jdt.core.JDTCompilerAdapter" />
+	<compilerarg line="-log &apos;${temp.folder}/@dot.binnull&apos;" compiler="org.eclipse.jdt.core.JDTCompilerAdapter" />
+	<compilerarg line="-g -showversion -encoding UTF-8 -preserveAllLocals 
+		-enableJavadoc -nowarn:[src-gen] -nowarn:[.src-gen] -time" compiler="org.eclipse.jdt.core.JDTCompilerAdapter" />
+	<compilerclasspath>
+		<pathelement path="${ecjBatchCompilerJarLocation}"/>
+	</compilerclasspath>
+</javac>
+```
+
+### Eclipse (OSGI) embedded ant use
+
+Using JDTCompilerAdapter class from ant started from OSGI container (Eclipse) is 
+not trivial and has few pitfalls.
+
+First of all, org.eclipse.jdt.core.JDTCompilerAdapter class is packaged into a dedicated
+jdtCompilerAdapter.jar that is **not** part of org.eclipse.jdt.core.compiler.batch bundle!
+
+This jdtCompilerAdapter.jar is packaged **inside** org.eclipse.jdt.core bundle for some obscure reasons
+and is extracted at runtime in org.eclipse.ant.internal.ui.datatransfer.BuildFileCreator.addInitEclipseCompiler().
+
+Second most surprising point is: if the JDTCompilerAdapter code runs in OSGI environment, in order 
+to be properly loaded by ant which is started by PDE/ant.core bundle via
+org.eclipse.ant.core.AntRunner.run(Object), the org.eclipse.jdt.core.JDTCompilerAdapter class
+should **NOT** be found by classloaders of org.eclipse.jdt.core or org.eclipse.jdt.core.compiler.batch bundles!
+
+The reason is, that the JDTCompilerAdapter class itself needs ant classes for class initialization,
+but that must be **same** ant classes loaded by org.eclipse.ant.internal.core.AntClassLoader.
+If the ant classes needed by JDTCompilerAdapter class are loaded by OSGI bundle loaders,
+ant engine can't use them (even if they are coming from same jar)! From Java
+ runtime point of view they are different because loaded by a different classloader. 
+
+Therefore the code in org.eclipse.ant.internal.core.AntClassLoader.loadClassPlugins(String) 
+that goes over possible **bundle** classloaders that contribute ant tasks for Eclipse,
+**must** fail to load org.eclipse.jdt.core.JDTCompilerAdapter class and return *null*!
+
+This is surprising at least, and has some non trivial consequences.
+
+The main one is: org.eclipse.jdt.core.JDTCompilerAdapter should be "not visible" 
+for default OSGI class loading from org.eclipse.jdt.core bundle that contributes 
+extra ant classpath entry jdtCompilerAdapter.jar, 
+and therefore org.eclipse.jdt.core package should be **not exported** in MANIFEST.MF 
+by org.eclipse.jdt.core.compiler.batch!
+
+After failing to load JDTCompilerAdapter class in AntClassLoader.loadClassPlugins(String)
+the AntClassLoader code goes to the parent classloader (which is URLClassLoader) 
+and the parent walks over **extra** ant classpath entries contributed by plugins 
+via "org.eclipse.ant.core.extraClasspathEntries" extension point (see 
+org.eclipse.ant.core.AntCorePreferences.computeDefaultExtraClasspathEntries(List)).
+
+The URLClassLoader finally finds and loads JDTCompilerAdapter in jdtCompilerAdapter.jar 
+contributed by org.eclipse.jdt.core as an extra ant classpath entry
+(with all the required ant classes found by ant own classloader)! 
+The URLClassLoader (AntClassLoader) should be initialized with core ant libraries at the beginning, so
+it has no issues to satisfy all JDTCompilerAdapter ant dependencies.
\ No newline at end of file
diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
index 294ed27..1cee8d4 100644
--- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
+++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java
@@ -867,7 +867,7 @@
 						this.expression.computeConversion(upperScope, TypeBinding.INT, expressionType);
 						break checkType;
 					} else if (compilerOptions.complianceLevel >= ClassFileConstants.JDK1_7 && expressionType.id == TypeIds.T_JavaLangString) {
-						if (this.containsPatterns) {
+						if (this.containsPatterns || this.containsNull) {
 							isStringSwitch = !JavaFeature.PATTERN_MATCHING_IN_SWITCH.isSupported(compilerOptions);
 							this.isNonTraditional = true;
 							break checkType;
diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java
index 3c73001..16795f2 100644
--- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java
+++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java
@@ -113,6 +113,10 @@
 					ReferenceBinding enclosing = resolvedType.enclosingType();
 					if (enclosing != null) {
 						this.enclosingType = resolvedType.isStatic() ? enclosing : (ReferenceBinding) env.convertUnresolvedBinaryToRawType(enclosing); // needed when binding unresolved member type
+						if (this.enclosingType.getClass() == ParameterizedTypeBinding.class) {
+							throw new IllegalStateException("unexpected: resolved enclosing type of " //$NON-NLS-1$
+									+ new String(this.type.readableName(false)) + " is a ParameterizedTypeBinding"); //$NON-NLS-1$
+						}
 					}
 				}
 				if (this.arguments != null) {
@@ -147,6 +151,11 @@
 			public int hashCode() {
 				final int prime=31;
 				int hashCode = 1 + hash(this.type);
+				if (this.enclosingType != null && this.enclosingType.getClass() == ParameterizedTypeBinding.class) {
+					// Note: this works as in swapUnresolved, a null enclosingType is never replaced by a
+					// ParameterizedTypeBinding (just by a non-generic or RawTypeBinding)
+					hashCode = hashCode * prime + System.identityHashCode(this.enclosingType);
+				}
 				for (int i = 0, length = this.arguments == null ? 0 : this.arguments.length; i < length; i++) {
 					hashCode = hashCode * prime + hash(this.arguments[i]);
 				}
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchPatternTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchPatternTest.java
index 754fdf3..777fe4b 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchPatternTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchPatternTest.java
@@ -29,7 +29,7 @@
 	static {
 //		TESTS_NUMBERS = new int [] { 40 };
 //		TESTS_RANGE = new int[] { 1, -1 };
-//		TESTS_NAMES = new String[] { "testIssue449_001"};
+//		TESTS_NAMES = new String[] { "testIssue554_001"};
 	}
 
 	private static String previewLevel = "19";
@@ -5321,4 +5321,21 @@
 				},
 				"1");
 	}
+	public void testIssue554_001() {
+		runConformTest(
+				new String[] {
+					"X.java",
+					"public class X {\n"+
+					"  public static void main(String[] args) {\n"+
+					"    String obj = null;\n"+
+					"    var a = switch (obj) {\n"+
+					"        case null -> 1;\n"+
+					"        default   -> 2;\n"+
+					"    };\n"+
+					"    System.out.println(a);\n"+
+					"  }\n" +
+					"}"
+				},
+				"1");
+	}
 }
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/IndexManagerTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/IndexManagerTests.java
index c798224..de6c23f 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/IndexManagerTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/IndexManagerTests.java
@@ -166,6 +166,18 @@
 		assertEquals("Expected number of indexes are not found for binary.Deep", size - 1, indexNames.get().size());
 	}
 
+	public void testSearchMetaIndex_ForSourceTypeDeclarations() throws CoreException {
+		if (SKIP_TESTS)
+			return;
+
+		createFolder("/IndexProject/src/app");
+		createFile("/IndexProject/src/app/Q1.java", "package app;\n public class Q1 {\n" + "}");
+
+		Optional<Set<String>> indexNames = searchInMetaIndex("app.Q1");
+		assertTrue("No meta index", indexNames.isPresent());
+		assertEquals("No results found", 1, indexNames.get().size());
+	}
+
 	private void changeFile(String path, String content) {
 		IFile file = getFile(path);
 		if (!file.exists()) {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java
index f99d9a0..8311a2a 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java
@@ -56,9 +56,9 @@
 
 //{ObjectTeams: add a suffix for distinction:
 /* orig:
-public static final String SIGNATURE= "INDEX VERSION 1.131"; //$NON-NLS-1$
+public static final String SIGNATURE = "INDEX VERSION 1.132"; //$NON-NLS-1$
   :giro */
-public static final String SIGNATURE= "INDEX VERSION 1.131 OT2"; //$NON-NLS-1$
+public static final String SIGNATURE= "INDEX VERSION 1.132 OT1"; //$NON-NLS-1$
 // SH}
 private static final char[] SIGNATURE_CHARS = SIGNATURE.toCharArray();
 public static boolean DEBUG = false;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.java
index 3786ce4..7ecfcdb 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.java
@@ -292,9 +292,16 @@
 				packageName == null ? CharOperation.NO_CHAR : packageName);
 
 		addIndexEntry(TYPE_DECL, indexKey);
-		addIndexMetaQualification(
-				CharOperation.concat(packageName, '.', CharOperation.concatWith(enclosingTypeNames, '$'), '$', name),
-				false);
+		if (enclosingTypeNames != null && enclosingTypeNames.length > 0) {
+			addIndexMetaQualification(
+					CharOperation.concat(packageName, '.', CharOperation.concatWith(enclosingTypeNames, '$'), '$',
+							name),
+					false);
+		} else {
+			addIndexMetaQualification(
+					CharOperation.concat(packageName, name, '.'),
+					false);
+		}
 	}
 	public void addTypeReference(char[] typeName) {
 		addTypeReference(typeName, false);