Merge pull request #35 from jlahoda/release20

Upgrading to NetBeans 20
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000..4ece384
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,68 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: NetBeans Jackpot 3.0
+
+on:
+  push:
+  pull_request:
+    # unlocked event is used as super secret restart button
+    types: [opened, synchronize, unlocked]
+
+# cancel other PR workflow run in the same head-base group if it exists (e.g. during PR syncs)
+# if this is not a PR run (no github.head_ref and github.base_ref defined), use an UID as group
+concurrency: 
+  group: ${{ github.head_ref || github.run_id }}-${{ github.base_ref }}
+  cancel-in-progress: true
+
+jobs:
+
+  base-build:
+    name: Build Jackpot 3.0
+    runs-on: ubuntu-latest
+    timeout-minutes: 60
+    steps:
+
+      - name: Checkout ${{ github.ref }} ( ${{ github.sha }} )
+        uses: actions/checkout@v3
+        with:
+          persist-credentials: false
+          submodules: false
+
+      - name: Set up Ubuntu dependencies
+        run: |
+            sudo apt install openjdk-11-jdk openjdk-17-jdk openjdk-21-jdk
+
+      - name: Set up NetBeans
+        run: |
+            wget -q 'https://archive.apache.org/dist/netbeans/netbeans/20/netbeans-20-bin.zip' -O /tmp/netbeans-20-bin.zip
+            (cd $HOME; unzip /tmp/netbeans-20-bin.zip)
+
+      - name: Run RAT
+        run: |
+            echo $PWD
+            ls -la $PWD
+            (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness rat)
+
+      - name: Do build Jackpot
+        run: |
+            export JDK11=/usr/lib/jvm/java-11-openjdk-amd64
+            export JDK17=/usr/lib/jvm/java-17-openjdk-amd64
+            export JDK21=/usr/lib/jvm/java-21-openjdk-amd64
+            export JAVA_HOME=$JDK11
+            export PATH=$JAVA_HOME/bin:$PATH
+            (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness -DNETBEANS_PLATFORM=$HOME/netbeans -DJDK11=$JDK11 -DJDK17=$JDK17 -DJDK21=$JDK21 build-and-test)
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 2555715..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-language: java
-dist: bionic
-addons:
-  apt:
-    packages:
-      - ant
-      - ant-optional
-      - openjdk-8-jdk
-      - openjdk-11-jdk
-      - openjdk-17-jdk
-jdk:
-  - openjdk8
-before_script:
-  - wget 'https://downloads.apache.org/netbeans/netbeans/13/netbeans-13-bin.zip' -O /tmp/netbeans-13-bin.zip
-  - (cd $HOME; unzip /tmp/netbeans-13-bin.zip)
-  - unset _JAVA_OPTIONS
-script:
-  - export JDK11=/usr/lib/jvm/java-11-openjdk-amd64
-  - export JDK17=/usr/lib/jvm/java-17-openjdk-amd64
-  - (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness rat)
-  - (cd cmdline; ant -Dnbplatform.default.harness.dir=$HOME/netbeans/harness -DNETBEANS_PLATFORM=$HOME/netbeans -DJDK11=$JDK11 -DJDK17=$JDK17 build-and-test)
diff --git a/cmdline/README.md b/cmdline/README.md
index 99a76a5..92918b8 100644
--- a/cmdline/README.md
+++ b/cmdline/README.md
@@ -27,22 +27,22 @@
 
 #### To Build
 
-* Apache NetBeans 13.0
-* JDK 8, JDK 11 and JDK 17
+* Apache NetBeans 20
+* JDK 11, JDK 17 and JDK 21
 * bash
 * Apache ant 1.9.9 or above
 * Apache Maven 3.3.9 or above
 
 #### To Run
 
-* JDK 8-17
+* JDK 11-21
 
 ### Building
 
 Build using:
 
 ```
-$ ant -DNETBEANS_PLATFORM=<path-to-NetBeans-13.0> -DJDK11=<path-to-JDK-11> -DJDK17=<path-to-JDK-17> build-and-test
+$ ant -DNETBEANS_PLATFORM=<path-to-NetBeans-20> -DJDK11=<path-to-JDK-11> -DJDK17=<path-to-JDK-17> -DJDK21=<path-to-JDK-21> build-and-test
 ```
 
 The built product is in tool/build/jackpot.
diff --git a/cmdline/build.xml b/cmdline/build.xml
index c11008a..9c7b4dc 100644
--- a/cmdline/build.xml
+++ b/cmdline/build.xml
@@ -52,7 +52,7 @@
     </target>
 
     <target name="build-and-test">
-        <property name="version" value="13.0" />
+        <property name="version" value="20.0" />
         <condition property="jackpot.root" value="${basedir}" else="${basedir}/..">
             <available file="${basedir}/LICENSE" />
         </condition>
@@ -62,7 +62,6 @@
             <property name="jackpot.root" location="${jackpot.root}" />
             <target name="clean" />
             <target name="build" />
-            <target name="test" />
         </ant>
         <ant dir="${basedir}" inheritAll="false" inheritRefs="false">
             <property name="nbplatform.default.harness.dir" value="${NETBEANS_PLATFORM}/harness" />
@@ -78,6 +77,13 @@
             <property name="jackpot.root" location="${jackpot.root}" />
             <target name="test" />
         </ant>
+        <ant dir="${basedir}" inheritAll="false" inheritRefs="false">
+            <property name="nbplatform.default.harness.dir" value="${NETBEANS_PLATFORM}/harness" />
+            <property name="nbplatform.default.netbeans.dest.dir" value="${NETBEANS_PLATFORM}" />
+            <property name="test.nbjdk.home" value="${JDK21}" />
+            <property name="jackpot.root" location="${jackpot.root}" />
+            <target name="test" />
+        </ant>
         <ant dir="${basedir}/tool" target="create-standalone-tool" inheritAll="false" inheritRefs="false">
             <property name="nbplatform.default.harness.dir" value="${NETBEANS_PLATFORM}/harness" />
             <property name="nbplatform.default.netbeans.dest.dir" value="${NETBEANS_PLATFORM}" />
@@ -95,6 +101,10 @@
             <env key="JAVA_HOME" path="${JDK17}" />
             <env key="PATH" path="${JDK17}/bin:${env.PATH}" />
         </exec>
+        <exec executable="build/test/scripted/run" dir="tool" failonerror="true">
+            <env key="JAVA_HOME" path="${JDK21}" />
+            <env key="PATH" path="${JDK21}/bin:${env.PATH}" />
+        </exec>
         <echo>Installing tool to the local maven repository:</echo>
         <exec dir="." executable="mvn" failonerror="true">
             <arg line="install:install-file -Dfile=tool/build/jackpot/jackpot.jar -DgroupId=org.apache.netbeans.modules.jackpot30 -DartifactId=tool -Dversion=${version} -Dpackaging=jar -DpomFile=tool/scripts/pom.xml" />
diff --git a/cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java b/cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java
index ce9bfa4..90e84a2 100644
--- a/cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java
+++ b/cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java
@@ -97,6 +97,8 @@
 import org.netbeans.spi.java.hints.Hint;
 import org.netbeans.spi.java.queries.CompilerOptionsQueryImplementation;
 import org.netbeans.spi.project.ProjectManagerImplementation;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
 import org.openide.filesystems.MIMEResolver;
 import org.openide.filesystems.Repository;
 import org.openide.util.NbCollections;
@@ -286,6 +288,7 @@
         registrations.add(new MetaInfRegistration(RulesManager.class.getName(), RulesManagerImpl.class.getName()));
         registrations.add(new MetaInfRegistration(EntityCatalog.class.getName(), EntityCatalogImpl.class.getName()));
         registrations.add(new MetaInfRegistration(CompileWorkerProvider.class.getName(), DefaultCompileWorkerProvider.class.getName()));
+        registrations.add(new MetaInfRegistration("com.sun.tools.javac.platform.PlatformProvider", escapeJavaxLang(info, "com.sun.tools.javac.platform.JDKPlatformProvider")));
 
         registrations.addAll(info.metaInf);
 
@@ -305,6 +308,17 @@
             addMETA_INFRegistration(out, info, e.getValue());
         }
 
+        URL ctSym = this.getClass().getClassLoader().getResource("META-INF/ct.sym");
+        FileObject ctSymFO = NBJRTURLMapper.findFileObject(ctSym);
+        FileObject root = ctSymFO.getParent().getParent();
+        Enumeration<? extends FileObject> children = ctSymFO.getChildren(true);
+        while (children.hasMoreElements()) {
+            FileObject file = children.nextElement();
+            if (file.isData()) {
+                out.put(FileUtil.getRelativePath(root, file), file.asBytes());
+            }
+        }
+
         try (JarOutputStream outStream = new JarOutputStream(new FileOutputStream(targetCompilerFile))) {
             Set<String> seenDirs = new HashSet<>();
             for (Entry<String, byte[]> e : out.entrySet()) {
@@ -532,7 +546,8 @@
             NBJRTURLMapper.class.getName(),
             VanillaJavacContextEnhancer.class.getName(),
             EntityCatalogImpl.class.getName(),
-            DefaultCompileWorkerProvider.class.getName()
+            DefaultCompileWorkerProvider.class.getName(),
+            "com.sun.tools.javac.platform.JDKPlatformProvider"
         ));
 
     private static final Set<String> COPY_REGISTRATION = new HashSet<String>(Arrays.<String>asList(
@@ -555,7 +570,9 @@
         "org/netbeans/modules/java/j2seproject/ui/resources/brokenProjectBadge.gif",
         "org/netbeans/modules/java/j2seproject/ui/resources/compileOnSaveDisabledBadge.gif",
         "org/netbeans/modules/parsing/impl/resources/error-badge.gif",
-        "org/netbeans/modules/editor/tools/storage/ToolConfiguration-1_0.dtd"
+        "org/netbeans/modules/editor/tools/storage/ToolConfiguration-1_0.dtd",
+        "com/sun/tools/javac/resources/compiler.properties",
+        "com/sun/tools/javac/resources/javac.properties"
     ));
 
     private static final Set<String> ALLOWED_DOMAINS = new HashSet<String>(Arrays.asList(
diff --git a/cmdline/maven/pom.xml b/cmdline/maven/pom.xml
index 1b7c813..3e5d543 100644
--- a/cmdline/maven/pom.xml
+++ b/cmdline/maven/pom.xml
@@ -21,7 +21,7 @@
 
   <groupId>org.apache.netbeans.modules.jackpot30</groupId>
   <artifactId>jackpot30-maven-plugin</artifactId>
-  <version>13.0</version>
+  <version>20.0</version>
   <packaging>maven-plugin</packaging>
 
   <name>Jackpot 3.0 Command Line Tool Maven Bridge</name>
@@ -112,7 +112,7 @@
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-plugin-plugin</artifactId>
-             <version>3.5.2</version>
+             <version>3.10.2</version>
          </plugin>
       </plugins>
   </build>
diff --git a/cmdline/maven/src/test/java/org/netbeans/modules/jackpot30/maven/RunJackpot30Test.java b/cmdline/maven/src/test/java/org/netbeans/modules/jackpot30/maven/RunJackpot30Test.java
index a1a7536..306007a 100644
--- a/cmdline/maven/src/test/java/org/netbeans/modules/jackpot30/maven/RunJackpot30Test.java
+++ b/cmdline/maven/src/test/java/org/netbeans/modules/jackpot30/maven/RunJackpot30Test.java
@@ -67,7 +67,7 @@
 
         Process p = Runtime.getRuntime().exec(new String[] {
             maven,
-            "-Djackpot.plugin.version=13.0",
+            "-Djackpot.plugin.version=20.0",
             "-q",
             "--batch-mode",
             "jackpot30:analyze"
diff --git a/cmdline/maven/tests/fail-on-warnings/golden b/cmdline/maven/tests/fail-on-warnings/golden
index bea3cf1..e78523f 100644
--- a/cmdline/maven/tests/fail-on-warnings/golden
+++ b/cmdline/maven/tests/fail-on-warnings/golden
@@ -1,7 +1,7 @@
 ${basedir}/src/main/java/test/App.java:24: warning: [Convert_to_Lambda_or_Member_Reference] This anonymous inner class creation can be turned into a lambda expression.
         Runnable r = new Runnable() { public void run() { } };
                          ^
-[ERROR] Failed to execute goal org.apache.netbeans.modules.jackpot30:jackpot30-maven-plugin:13.0:analyze (default-cli) on project maven-test: jackpo30 failed. -> [Help 1]
+[ERROR] Failed to execute goal org.apache.netbeans.modules.jackpot30:jackpot30-maven-plugin:20.0:analyze (default-cli) on project maven-test: jackpo30 failed. -> [Help 1]
 [ERROR] 
 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
diff --git a/cmdline/maven/tests/sl-failure/golden b/cmdline/maven/tests/sl-failure/golden
index 44933b4..6a4560d 100644
--- a/cmdline/maven/tests/sl-failure/golden
+++ b/cmdline/maven/tests/sl-failure/golden
@@ -1,5 +1,5 @@
 unrecognized source level specification: unparseable
-[ERROR] Failed to execute goal org.apache.netbeans.modules.jackpot30:jackpot30-maven-plugin:13.0:analyze (default-cli) on project maven-test: jackpo30 failed. -> [Help 1]
+[ERROR] Failed to execute goal org.apache.netbeans.modules.jackpot30:jackpot30-maven-plugin:20.0:analyze (default-cli) on project maven-test: jackpo30 failed. -> [Help 1]
 [ERROR] 
 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
diff --git a/cmdline/processor/build.xml b/cmdline/processor/build.xml
index 6224c52..06197a3 100644
--- a/cmdline/processor/build.xml
+++ b/cmdline/processor/build.xml
@@ -33,8 +33,8 @@
                    value="NOTHING">
             <not>
                 <or>
-                    <available classpath="${test.nbjdk.home}/lib/ct.sym" resource="H/java.base/java/lang/System.sig" />
-                    <available classpath="${test.nbjdk.home}/lib/ct.sym" resource="H/system-modules" />
+                    <available classpath="${test.nbjdk.home}/lib/ct.sym" resource="J/java.base/java/lang/System.sig" />
+                    <available classpath="${test.nbjdk.home}/lib/ct.sym" resource="J/system-modules" />
                 </or>
             </not>
         </condition>
diff --git a/cmdline/processor/nbproject/project.properties b/cmdline/processor/nbproject/project.properties
index e207bbc..bd2e263 100644
--- a/cmdline/processor/nbproject/project.properties
+++ b/cmdline/processor/nbproject/project.properties
@@ -13,7 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-javac.source=1.8
+javac.source=11
+javac.target=11
 javac.compilerargs=-Xlint -Xlint:-serial
 cp.extra=build/jopt-simple-3.2.jar:build/diffparser-1.4.jar:build/slf4j-api-1.7.25.jar:build/slf4j-nop-1.7.25.jar:${tools.jar}
 spec.version.base=1.16.0
diff --git a/cmdline/tool/build.xml b/cmdline/tool/build.xml
index e756ee1..715444a 100644
--- a/cmdline/tool/build.xml
+++ b/cmdline/tool/build.xml
@@ -112,14 +112,8 @@
     <target name="-setup.bootclasspath" depends="harness.build-init">
         <property name="test.nbjdk.home" location="${nbjdk.home}" />
         <!--<condition property="test.bootclasspath.prepend.args"-->
-        <condition property="test.run.args"
-                   value="--limit-modules=java.base,java.xml,java.prefs,java.management,java.logging,java.desktop,java.instrument,java.naming,jdk.zipfs --add-opens=java.base/java.net=ALL-UNNAMED"
-                   else="-Xbootclasspath/p:${nbplatform.active.dir}/java/modules/ext/nb-javac-jdk-17-api.jar:${nbplatform.active.dir}/java/modules/ext/nb-javac-jdk-17.jar">
-            <or>
-                <available classpath="${test.nbjdk.home}/lib/ct.sym" resource="B/java.base/java/lang/String.sig" />
-                <available classpath="${test.nbjdk.home}/lib/ct.sym" resource="B/system-modules" />
-            </or>
-        </condition>
+        <property name="test.run.args"
+                  value="--limit-modules=java.base,java.xml,java.prefs,java.management,java.logging,java.desktop,java.instrument,java.naming,jdk.zipfs --add-opens=java.base/java.net=ALL-UNNAMED" />
     </target>
 
 </project>
diff --git a/cmdline/tool/nbproject/project.properties b/cmdline/tool/nbproject/project.properties
index c3a07cf..ae1c338 100644
--- a/cmdline/tool/nbproject/project.properties
+++ b/cmdline/tool/nbproject/project.properties
@@ -13,7 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-javac.source=1.8
+javac.source=11
+javac.target=11
 javac.compilerargs=-Xlint -Xlint:-serial
 cp.extra=build/jopt-simple-3.2.jar:build/diffparser-1.4.jar:build/slf4j-api-1.7.25.jar:build/slf4j-nop-1.7.25.jar:${tools.jar}
 spec.version.base=1.16.0
diff --git a/cmdline/tool/scripts/pom.xml b/cmdline/tool/scripts/pom.xml
index 150b29e..8186a94 100644
--- a/cmdline/tool/scripts/pom.xml
+++ b/cmdline/tool/scripts/pom.xml
@@ -21,7 +21,7 @@
 
   <groupId>org.apache.netbeans.modules.jackpot30</groupId>
   <artifactId>jackpot30-maven-plugin</artifactId>
-  <version>13.0</version>
+  <version>20.0</version>
   <packaging>maven-plugin</packaging>
 
   <name>Jackpot 3.0 Command Line Tool</name>
diff --git a/cmdline/tool/src/org/netbeans/modules/jackpot30/cmdline/Main.java b/cmdline/tool/src/org/netbeans/modules/jackpot30/cmdline/Main.java
index b72e704..511ab15 100644
--- a/cmdline/tool/src/org/netbeans/modules/jackpot30/cmdline/Main.java
+++ b/cmdline/tool/src/org/netbeans/modules/jackpot30/cmdline/Main.java
@@ -34,6 +34,7 @@
 import java.io.PrintStream;
 import java.io.UncheckedIOException;
 import java.io.Writer;
+import java.lang.Runtime.Version;
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
 import java.net.URL;
@@ -138,9 +139,12 @@
 
     public static int compile(String... args) throws IOException, ClassNotFoundException {
         try {
-            Class.forName("javax.lang.model.element.ModuleElement");
-        } catch (ClassNotFoundException ex) {
-            System.err.println("Error: no suitable javac found, please run on JDK 11+.");
+            if (Runtime.version().feature() < 11) {
+                System.err.println("Error: this tool requires at least JDK 11.");
+                return 1;
+            }
+        } catch (LinkageError ex) {
+            System.err.println("Error: this tool requires at least JDK 11.");
             return 1;
         }
 
@@ -442,7 +446,19 @@
         WarningsAndErrors wae = new WarningsAndErrors();
 
         ProgressHandleWrapper progress = w.startNextPartWithEmbedding(1);
-        Preferences settings = globalConfig.configurationPreferences != null ? globalConfig.configurationPreferences : new MemoryPreferences();
+        Preferences settings = new MemoryPreferences();
+
+        settings.node("org.netbeans.modules.java.hints.bugs.Unused").putBoolean("enabled", false);
+        settings.node("org.netbeans.modules.java.hints.suggestions.Tiny.inlineRedundantVar").putBoolean("enabled", false);
+
+        if (globalConfig.configurationPreferences != null) {
+            try {
+                copyPreferences(globalConfig.configurationPreferences, settings);
+            } catch (BackingStoreException ex) {
+                throw new IOException(ex);
+            }
+        }
+
         HintsSettings hintSettings = HintsSettings.createPreferencesBasedHintsSettings(settings, globalConfig.useDefaultEnabledSetting, null);
 
         if (globalConfig.hint != null) {
@@ -1276,4 +1292,13 @@
             return new int[1];
         }
     }
+
+    private static void copyPreferences(Preferences from, Preferences to) throws BackingStoreException {
+        for (String key : from.keys()) {
+            to.put(key, from.get(key, null));
+        }
+        for (String child : from.childrenNames()) {
+            copyPreferences(from.node(child), to.node(child));
+        }
+    }
 }
diff --git a/cmdline/tool/test/unit/src/org/netbeans/modules/jackpot30/cmdline/CreateToolTest.java b/cmdline/tool/test/unit/src/org/netbeans/modules/jackpot30/cmdline/CreateToolTest.java
index 2cf29c3..3119a08 100644
--- a/cmdline/tool/test/unit/src/org/netbeans/modules/jackpot30/cmdline/CreateToolTest.java
+++ b/cmdline/tool/test/unit/src/org/netbeans/modules/jackpot30/cmdline/CreateToolTest.java
@@ -69,7 +69,9 @@
             outCopy.start();
             errCopy.start();
 
-            assertEquals(exitcode, p.waitFor());
+            int actualExitCode = p.waitFor();
+
+            assertEquals(exitcode, actualExitCode);
 
             outCopy.doJoin();
             errCopy.doJoin();
@@ -180,7 +182,7 @@
 //                }
             }
             protected void tearDown() {
-//                compiler.delete();
+                compiler.delete();
                 hintsList.delete();
                 compiler = null;
                 hintsList = null;
diff --git a/cmdline/tool/test/unit/src/org/netbeans/modules/jackpot30/cmdline/MainTest.java b/cmdline/tool/test/unit/src/org/netbeans/modules/jackpot30/cmdline/MainTest.java
index ccc4b17..a709ae6 100644
--- a/cmdline/tool/test/unit/src/org/netbeans/modules/jackpot30/cmdline/MainTest.java
+++ b/cmdline/tool/test/unit/src/org/netbeans/modules/jackpot30/cmdline/MainTest.java
@@ -42,6 +42,9 @@
 import org.junit.runner.Result;
 import org.netbeans.junit.NbTestCase;
 import org.netbeans.modules.jackpot30.cmdline.lib.TestUtils;
+import org.netbeans.modules.parsing.api.ParserManager;
+import org.netbeans.modules.parsing.api.ResultIterator;
+import org.netbeans.modules.parsing.api.UserTask;
 import org.openide.filesystems.FileObject;
 import org.openide.filesystems.FileUtil;
 
@@ -1154,6 +1157,10 @@
         try {
             int actualExit = Main.compile(params);
             assertEquals(exitcode, actualExit);
+            ParserManager.parseWhenScanFinished("text/x-java", new UserTask() {
+                @Override
+                public void run(ResultIterator resultIterator) throws Exception {}
+            });
         } finally {
             System.setProperty("user.dir", oldUserDir);
             System.out.close();