From 555b53566c52bcf33da0a725fbc866bd36b6409f Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Thu, 22 Jan 2026 12:52:45 +0100 Subject: [PATCH 1/7] CI: bump lower bound to JDK 21 new test and build range: JDK 21-26 --- .github/workflows/main.yml | 80 +++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 41 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 706c88fdb4e5..d8792271efc7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -137,7 +137,7 @@ jobs: timeout-minutes: 40 strategy: matrix: - java: [ '17', '25', '26-ea' ] + java: [ '21', '25', '26-ea' ] exclude: - java: ${{ github.event_name == 'pull_request' && 'nothing' || '25' }} fail-fast: false @@ -167,11 +167,11 @@ jobs: run: ant $OPTS -quiet -Dcluster.config=$CLUSTER_CONFIG build-nozip - name: Prepare Artifact - if: ${{ matrix.java == '17' }} + if: ${{ matrix.java == '21' }} run: tar -I 'zstd -9 -T0' -cf /tmp/build.tar.zst --exclude ".git" . - name: Upload Workspace - if: ${{ (matrix.java == '17') && success() }} + if: ${{ (matrix.java == '21') && success() }} uses: actions/upload-artifact@v6 with: name: build @@ -181,11 +181,11 @@ jobs: if-no-files-found: error - name: Create Dev Build - if: ${{ matrix.java == '17' && contains(github.event.pull_request.labels.*.name, 'ci:dev-build') && success() }} + if: ${{ matrix.java == '21' && contains(github.event.pull_request.labels.*.name, 'ci:dev-build') && success() }} run: ant $OPTS -quiet -Dcluster.config=$CLUSTER_CONFIG zip-cluster-config - name: Upload Dev Build - if: ${{ matrix.java == '17' && contains(github.event.pull_request.labels.*.name, 'ci:dev-build') && success() }} + if: ${{ matrix.java == '21' && contains(github.event.pull_request.labels.*.name, 'ci:dev-build') && success() }} uses: actions/upload-artifact@v6 with: name: dev-build_${{github.event.pull_request.number || github.run_id}} @@ -239,7 +239,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - java: [ 17 ] + java: [ '21' ] include: - os: ubuntu-latest java: 26-ea @@ -273,7 +273,7 @@ jobs: run: tar --zstd -xf build.tar.zst - name: platform/masterfs - if: ${{ matrix.java == '17' }} + if: ${{ matrix.java == '21' }} run: .github/retry.sh ant $OPTS -f platform/masterfs test - name: Commit Validation tests @@ -301,7 +301,7 @@ jobs: ANT_OPTS: -Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json strategy: matrix: - java: [ '17' ] + java: [ '21' ] steps: - name: Check PR labels @@ -379,7 +379,7 @@ jobs: timeout-minutes: 100 strategy: matrix: - java: [ '17' ] + java: [ '21' ] fail-fast: false steps: @@ -473,7 +473,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '17' ] + java: [ '21' ] config: [ 'platform', 'release' ] fail-fast: false steps: @@ -519,7 +519,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '17' ] + java: [ '21' ] fail-fast: false steps: @@ -849,9 +849,9 @@ jobs: timeout-minutes: 50 strategy: matrix: - java: [ '17', '21', '25', '26-ea' ] + java: [ '21', '25', '26-ea' ] exclude: - - java: ${{ github.event_name == 'pull_request' && 'nothing' || '21' }} + - java: ${{ github.event_name == 'pull_request' && 'nothing' || '25' }} fail-fast: false steps: @@ -935,29 +935,27 @@ jobs: run: ant $OPTS -f java/gradle.test test - name: java/gradle.java - if: ${{ matrix.java == '17' || matrix.java == '21' || matrix.java == '25' }} + if: ${{ matrix.java == '21' || matrix.java == '25' }} run: .github/retry.sh ant $OPTS -f java/gradle.java test - name: extide/gradle - if: ${{ matrix.java == '17' || matrix.java == '21' || matrix.java == '25' }} + if: ${{ matrix.java == '21' || matrix.java == '25' }} run: ant $OPTS -f extide/gradle test - name: java/gradle.dependencies - if: ${{ matrix.java == '17' || matrix.java == '21' || matrix.java == '25' }} + if: ${{ matrix.java == '21' || matrix.java == '25' }} run: ant $OPTS -f java/gradle.dependencies test # TODO next are JDK 21 or 25 incompatibe steps - name: java/java.mx.project - if: ${{ matrix.java == '17' || matrix.java == '21' }} + if: ${{ matrix.java == '21' }} run: .github/retry.sh ant $OPTS -f java/java.mx.project test - - name: extide/o.apache.tools.ant.module - if: ${{ matrix.java == '17' }} - run: ant $OPTS -f extide/o.apache.tools.ant.module test - - - name: apisupport.ant - if: ${{ matrix.java == '17' }} - run: ant $OPTS -f apisupport/apisupport.ant test +# - name: extide/o.apache.tools.ant.module +# run: ant $OPTS -f extide/o.apache.tools.ant.module test +# +# - name: apisupport.ant +# run: ant $OPTS -f apisupport/apisupport.ant test - name: Create Test Summary uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4 @@ -975,7 +973,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '17' ] + java: [ '21' ] fail-fast: false steps: @@ -1138,7 +1136,7 @@ jobs: timeout-minutes: 90 strategy: matrix: - java: [ '17' ] + java: [ '21' ] fail-fast: false steps: @@ -1273,7 +1271,7 @@ jobs: timeout-minutes: 100 strategy: matrix: - java: [ '17' ] + java: [ '21' ] fail-fast: false steps: @@ -1459,7 +1457,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '17', '26-ea' ] + java: [ '21', '26-ea' ] config: [ 'batch1', 'batch2' ] exclude: - java: ${{ github.event_name == 'pull_request' && 'nothing' || '26-ea' }} @@ -1516,7 +1514,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '17', '25', '26-ea' ] + java: [ '21', '25', '26-ea' ] exclude: - java: ${{ github.event_name == 'pull_request' && 'nothing' || '25' }} fail-fast: false @@ -1578,7 +1576,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '17' ] + java: [ '21' ] fail-fast: false steps: @@ -1623,7 +1621,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '17' ] + java: [ '21' ] fail-fast: false steps: @@ -1801,7 +1799,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '17' ] + java: [ '21' ] fail-fast: false steps: @@ -1849,9 +1847,9 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '17', '21' ] - exclude: - - java: ${{ github.event_name == 'pull_request' && 'nothing' || '21' }} + java: [ '21' ] +# exclude: +# - java: ${{ github.event_name == 'pull_request' && 'nothing' || '21' }} fail-fast: false steps: @@ -1902,7 +1900,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '17' ] + java: [ '21' ] fail-fast: false steps: @@ -1950,7 +1948,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '17' ] + java: [ '21' ] fail-fast: false steps: @@ -2195,7 +2193,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '17' ] + java: [ '21' ] fail-fast: false steps: @@ -2278,7 +2276,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '17' ] + java: [ '21' ] fail-fast: false services: @@ -2340,7 +2338,7 @@ jobs: DISPLAY: ":99.0" strategy: matrix: - java: [ '17' ] + java: [ '21' ] os: [ 'windows-latest', 'ubuntu-latest' ] exclude: - os: ${{ github.event_name == 'pull_request' && 'nothing' || 'windows-latest' }} @@ -2496,7 +2494,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - java: [ '17' ] + java: [ '21' ] fail-fast: false steps: From 24a226452a16beb869131ce1a1a80f5012cc400a Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Thu, 22 Jan 2026 16:15:39 +0100 Subject: [PATCH 2/7] more ci --- .github/workflows/main.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d8792271efc7..6f12a10fa972 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -951,11 +951,20 @@ jobs: if: ${{ matrix.java == '21' }} run: .github/retry.sh ant $OPTS -f java/java.mx.project test -# - name: extide/o.apache.tools.ant.module -# run: ant $OPTS -f extide/o.apache.tools.ant.module test -# -# - name: apisupport.ant -# run: ant $OPTS -f apisupport/apisupport.ant test + - name: Set up JDK 17 for ant + uses: actions/setup-java@v5 + if: ${{ matrix.java == '21' }} + with: + java-version: 17 + distribution: ${{ env.DEFAULT_JAVA_DISTRIBUTION }} + + - name: extide/o.apache.tools.ant.module + if: ${{ matrix.java == '21' }} + run: ant $OPTS -f extide/o.apache.tools.ant.module test + + - name: apisupport.ant + if: ${{ matrix.java == '21' }} + run: ant $OPTS -f apisupport/apisupport.ant test - name: Create Test Summary uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4 From 643668bcb263f7af6639e39733fae30022b6516b Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Fri, 23 Jan 2026 23:52:03 +0100 Subject: [PATCH 3/7] Updated java.editor tests for JDK 21 and 25 added unimportant classes to the ignore list so that the test data doesn't have to be updated. --- .../java/editor/imports/ComputeImportsTest.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/java/java.editor/test/unit/src/org/netbeans/modules/java/editor/imports/ComputeImportsTest.java b/java/java.editor/test/unit/src/org/netbeans/modules/java/editor/imports/ComputeImportsTest.java index a43ef3f0b499..95c431526546 100644 --- a/java/java.editor/test/unit/src/org/netbeans/modules/java/editor/imports/ComputeImportsTest.java +++ b/java/java.editor/test/unit/src/org/netbeans/modules/java/editor/imports/ComputeImportsTest.java @@ -34,7 +34,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -68,7 +67,7 @@ */ public class ComputeImportsTest extends NbTestCase { - private static final Set IGNORE_CLASSES = new HashSet(Arrays.asList(new String[] { + private static final Set IGNORE_CLASSES = Set.of( "com.sun.tools.javac.util.List", "com.sun.tools.javac.code.Attribute.RetentionPolicy", "com.sun.tools.classfile.Opcode.Set", @@ -81,6 +80,8 @@ public class ComputeImportsTest extends NbTestCase { "com.sun.xml.internal.bind.v2.runtime.output.NamespaceContextImpl.Element", "com.sun.xml.internal.bind.v2.schemagen.xmlschema.Element", "sun.text.normalizer.RangeValueIterator.Element", + "jdk.internal.org.commonmark.node.Document", + "java.lang.StringTemplate.STR", "javax.xml.bind.Element", "javax.lang.model.element.Element", "com.sun.org.apache.xalan.internal.xsltc.runtime.AttributeList", @@ -90,13 +91,13 @@ public class ComputeImportsTest extends NbTestCase { "com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type.Element", "com.sun.xml.internal.ws.policy.privateutil.PolicyUtils.Collections", "com.azul.crs.client.service.JarLoadMonitor.ProcessedJarFiles.LRU.Element" - })); + ); - private static final List IGNORE_PATTERNS = Collections.unmodifiableList(Arrays.asList( + private static final List IGNORE_PATTERNS = List.of( Pattern.compile("jdk\\..*\\.internal\\..*"), Pattern.compile("org\\.graalvm\\..*"), Pattern.compile("com\\.azul\\.crs\\..*") // https://docs.azul.com/vulnerability-detection/detailed-information/configuration-options - )); + ); private FileObject testSource; private JavaSource js; From bae6cfcbc6215bf0835eb6c80d15ba5592365321 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Sat, 24 Jan 2026 02:17:14 +0100 Subject: [PATCH 4/7] Updated java.source tests for JDK 21 and 25 refactored file read interception from SecurityManager to JFR --- .../nbproject/project.properties | 4 +- .../api/java/source/TreePathHandleTest.java | 64 ++++++++----------- 2 files changed, 29 insertions(+), 39 deletions(-) diff --git a/java/java.source.base/nbproject/project.properties b/java/java.source.base/nbproject/project.properties index e74394ad6113..fb30a696ac6d 100644 --- a/java/java.source.base/nbproject/project.properties +++ b/java/java.source.base/nbproject/project.properties @@ -18,7 +18,7 @@ #javac.compilerargs=-Xlint:unchecked nbroot=../.. is.autoload=true -javac.release=17 +javac.release=21 javadoc.name=Java Source Base javadoc.title=Java Source Base javadoc.arch=${basedir}/arch.xml @@ -206,5 +206,5 @@ test.config.vanilla-javac.excludes=\ # remove default compiler JMS flags so that we don't get "Unknown module" warnings due to --limit-modules jms-compiler.flags.jvm= -test.jms.flags=--limit-modules=java.base,java.logging,java.xml,java.prefs,java.desktop,java.management,java.instrument,jdk.zipfs,java.scripting,java.naming +test.jms.flags=--limit-modules=java.base,java.logging,java.xml,java.prefs,java.desktop,java.management,java.instrument,jdk.zipfs,java.scripting,java.naming,jdk.jfr test.bootclasspath.prepend.args=-Dno.netbeans.bootclasspath.prepend.needed=true diff --git a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java index 950c9fa6afcf..dc3bd3db5476 100644 --- a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java +++ b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java @@ -26,10 +26,11 @@ import com.sun.source.util.TreePath; import java.io.File; import java.io.OutputStream; -import java.security.Permission; +import java.util.concurrent.atomic.AtomicBoolean; import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; import javax.lang.model.element.VariableElement; +import jdk.jfr.consumer.RecordingStream; import org.netbeans.api.java.source.JavaSource.Phase; import org.netbeans.core.startup.Main; import org.netbeans.junit.NbTestCase; @@ -51,6 +52,7 @@ public TreePathHandleTest(String testName) { private FileObject sourceRoot; + @Override protected void setUp() throws Exception { clearWorkDir(); @@ -170,29 +172,39 @@ public void test134457() throws Exception { public void testTreePathIsNotParsing() throws Exception { FileObject file = FileUtil.createData(sourceRoot, "test/test.java"); - writeIntoFile(file, "package test; public class test {}"); - writeIntoFile(FileUtil.createData(sourceRoot, "test/test2.java"), "package test; public class test2 {}"); + + FileObject file2 = FileUtil.createData(sourceRoot, "test/test2.java"); + writeIntoFile(file2, "package test; public class test2 {}"); JavaSource js = JavaSource.forFileObject(file); SourceUtilsTestUtil.compileRecursively(sourceRoot); - js.runUserActionTask(new Task() { - public void run(CompilationController parameter) throws Exception { - parameter.toPhase(Phase.RESOLVED); - - TypeElement string = parameter.getElements().getTypeElement("test.test2"); - - SecurityManager old = System.getSecurityManager(); - - System.setSecurityManager(new SecMan()); - + AtomicBoolean wasRead = new AtomicBoolean(); + + js.runUserActionTask(parameter -> { + parameter.toPhase(Phase.RESOLVED); + + TypeElement string = parameter.getElements().getTypeElement("test.test2"); + + try (RecordingStream rs = new RecordingStream()) { + rs.setMaxSize(Long.MAX_VALUE); + rs.enable("jdk.FileRead").withoutThreshold().withStackTrace(); + rs.onEvent("jdk.FileRead", e -> { + if (e.getString("path").endsWith("test2.java")) { + wasRead.set(true); + System.err.println(e); + } + }); + rs.startAsync(); +// file2.getInputStream().read(); // check: commenting this out should fail the test TreePathHandle.create(string, parameter); - - System.setSecurityManager(old); + rs.stop(); // flushes stream } }, true); + + assertFalse("file was read", wasRead.get()); } public void testEquals() throws Exception { @@ -454,26 +466,4 @@ public void testVarInstanceMember() throws Exception { assertNotNull(handle.getElementHandle()); JavacParser.DISABLE_SOURCE_LEVEL_DOWNGRADE = false; } - - private static final class SecMan extends SecurityManager { - - @Override - public void checkRead(String file) { - assertFalse(file.endsWith("test2.java")); - } - - @Override - public void checkRead(String file, Object context) { - assertFalse(file.endsWith("test2.java")); - } - - @Override - public void checkPermission(Permission perm) { - } - - @Override - public void checkPermission(Permission perm, Object context) { - } - - } } From 92955fb58be5889db0790853fc5df60322ed53d9 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Mon, 26 Jan 2026 14:47:35 +0100 Subject: [PATCH 5/7] Revert "Updated java.source tests for JDK 21 and 25" (chicken-egg problem) This reverts commit bae6cfcbc6215bf0835eb6c80d15ba5592365321. --- .../nbproject/project.properties | 4 +- .../api/java/source/TreePathHandleTest.java | 64 +++++++++++-------- 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/java/java.source.base/nbproject/project.properties b/java/java.source.base/nbproject/project.properties index fb30a696ac6d..e74394ad6113 100644 --- a/java/java.source.base/nbproject/project.properties +++ b/java/java.source.base/nbproject/project.properties @@ -18,7 +18,7 @@ #javac.compilerargs=-Xlint:unchecked nbroot=../.. is.autoload=true -javac.release=21 +javac.release=17 javadoc.name=Java Source Base javadoc.title=Java Source Base javadoc.arch=${basedir}/arch.xml @@ -206,5 +206,5 @@ test.config.vanilla-javac.excludes=\ # remove default compiler JMS flags so that we don't get "Unknown module" warnings due to --limit-modules jms-compiler.flags.jvm= -test.jms.flags=--limit-modules=java.base,java.logging,java.xml,java.prefs,java.desktop,java.management,java.instrument,jdk.zipfs,java.scripting,java.naming,jdk.jfr +test.jms.flags=--limit-modules=java.base,java.logging,java.xml,java.prefs,java.desktop,java.management,java.instrument,jdk.zipfs,java.scripting,java.naming test.bootclasspath.prepend.args=-Dno.netbeans.bootclasspath.prepend.needed=true diff --git a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java index dc3bd3db5476..950c9fa6afcf 100644 --- a/java/java.source.base/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java +++ b/java/java.source.base/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java @@ -26,11 +26,10 @@ import com.sun.source.util.TreePath; import java.io.File; import java.io.OutputStream; -import java.util.concurrent.atomic.AtomicBoolean; +import java.security.Permission; import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; import javax.lang.model.element.VariableElement; -import jdk.jfr.consumer.RecordingStream; import org.netbeans.api.java.source.JavaSource.Phase; import org.netbeans.core.startup.Main; import org.netbeans.junit.NbTestCase; @@ -52,7 +51,6 @@ public TreePathHandleTest(String testName) { private FileObject sourceRoot; - @Override protected void setUp() throws Exception { clearWorkDir(); @@ -172,39 +170,29 @@ public void test134457() throws Exception { public void testTreePathIsNotParsing() throws Exception { FileObject file = FileUtil.createData(sourceRoot, "test/test.java"); + writeIntoFile(file, "package test; public class test {}"); - - FileObject file2 = FileUtil.createData(sourceRoot, "test/test2.java"); - writeIntoFile(file2, "package test; public class test2 {}"); + writeIntoFile(FileUtil.createData(sourceRoot, "test/test2.java"), "package test; public class test2 {}"); JavaSource js = JavaSource.forFileObject(file); SourceUtilsTestUtil.compileRecursively(sourceRoot); - AtomicBoolean wasRead = new AtomicBoolean(); - - js.runUserActionTask(parameter -> { - parameter.toPhase(Phase.RESOLVED); - - TypeElement string = parameter.getElements().getTypeElement("test.test2"); - - try (RecordingStream rs = new RecordingStream()) { - rs.setMaxSize(Long.MAX_VALUE); - rs.enable("jdk.FileRead").withoutThreshold().withStackTrace(); - rs.onEvent("jdk.FileRead", e -> { - if (e.getString("path").endsWith("test2.java")) { - wasRead.set(true); - System.err.println(e); - } - }); - rs.startAsync(); -// file2.getInputStream().read(); // check: commenting this out should fail the test + js.runUserActionTask(new Task() { + public void run(CompilationController parameter) throws Exception { + parameter.toPhase(Phase.RESOLVED); + + TypeElement string = parameter.getElements().getTypeElement("test.test2"); + + SecurityManager old = System.getSecurityManager(); + + System.setSecurityManager(new SecMan()); + TreePathHandle.create(string, parameter); - rs.stop(); // flushes stream + + System.setSecurityManager(old); } }, true); - - assertFalse("file was read", wasRead.get()); } public void testEquals() throws Exception { @@ -466,4 +454,26 @@ public void testVarInstanceMember() throws Exception { assertNotNull(handle.getElementHandle()); JavacParser.DISABLE_SOURCE_LEVEL_DOWNGRADE = false; } + + private static final class SecMan extends SecurityManager { + + @Override + public void checkRead(String file) { + assertFalse(file.endsWith("test2.java")); + } + + @Override + public void checkRead(String file, Object context) { + assertFalse(file.endsWith("test2.java")); + } + + @Override + public void checkPermission(Permission perm) { + } + + @Override + public void checkPermission(Permission perm, Object context) { + } + + } } From 66a3781e06f7357556e130b123d86cacedc09e31 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Mon, 26 Jan 2026 01:25:43 +0100 Subject: [PATCH 6/7] Tests: Allow SM for now --- harness/apisupport.harness/nbproject/project.properties | 3 +++ ide/versioning/nbproject/project.properties | 3 +++ java/java.source/nbproject/project.properties | 3 ++- platform/masterfs/nbproject/project.properties | 3 +++ platform/openide.execution/nbproject/project.properties | 3 +++ platform/openide.filesystems/nbproject/project.properties | 3 +++ platform/openide.loaders/nbproject/project.properties | 3 +++ 7 files changed, 20 insertions(+), 1 deletion(-) diff --git a/harness/apisupport.harness/nbproject/project.properties b/harness/apisupport.harness/nbproject/project.properties index ca593b9ca344..ae967c22a652 100644 --- a/harness/apisupport.harness/nbproject/project.properties +++ b/harness/apisupport.harness/nbproject/project.properties @@ -97,3 +97,6 @@ test.unit.cp.extra=${netbeans.dest.dir}/harness/jnlp/jnlp-launcher.jar javadoc.arch=${basedir}/arch.xml test.config.stableBTD.includes=**/*Test.class + +# todo: needed for tests; remove with jnlp code +test.jms.flags=-Djava.security.manager=allow \ No newline at end of file diff --git a/ide/versioning/nbproject/project.properties b/ide/versioning/nbproject/project.properties index 41a90285112a..43018f90dade 100644 --- a/ide/versioning/nbproject/project.properties +++ b/ide/versioning/nbproject/project.properties @@ -43,3 +43,6 @@ test.config.stableBTD.excludes=\ **/GetAnnotatedOwnerTest.class,\ **/VCSContextTest.class,\ **/VersioningAnnotationProviderTest.class + +# todo remove SM usage in tests +test.jms.flags=-Djava.security.manager=allow diff --git a/java/java.source/nbproject/project.properties b/java/java.source/nbproject/project.properties index 0f35fd0fe22c..d91e9b1fc886 100644 --- a/java/java.source/nbproject/project.properties +++ b/java/java.source/nbproject/project.properties @@ -58,5 +58,6 @@ test.config.jet-main.includes=\ # remove default compiler JMS flags so that we don't get "Unknown module" warnings due to --limit-modules jms-compiler.flags.jvm= -test.jms.flags=--limit-modules=java.base,java.logging,java.xml,java.prefs,java.desktop,java.management,java.instrument,jdk.zipfs,java.scripting,java.naming +# TODO remove SM usage in tests including this flag +test.jms.flags=--limit-modules=java.base,java.logging,java.xml,java.prefs,java.desktop,java.management,java.instrument,jdk.zipfs,java.scripting,java.naming -Djava.security.manager=allow test.bootclasspath.prepend.args=-Dno.netbeans.bootclasspath.prepend.needed=true diff --git a/platform/masterfs/nbproject/project.properties b/platform/masterfs/nbproject/project.properties index b0188f8ed182..6660dae54fde 100644 --- a/platform/masterfs/nbproject/project.properties +++ b/platform/masterfs/nbproject/project.properties @@ -36,3 +36,6 @@ test.config.stableBTD.excludes=\ **/SlowRefreshSuspendableTest.class,\ **/StatFilesTest.class spec.version.base=2.87.0 + +# todo remove SM usage in tests +test.jms.flags=-Djava.security.manager=allow diff --git a/platform/openide.execution/nbproject/project.properties b/platform/openide.execution/nbproject/project.properties index 5861684c4e8a..f5929b90e320 100644 --- a/platform/openide.execution/nbproject/project.properties +++ b/platform/openide.execution/nbproject/project.properties @@ -26,3 +26,6 @@ javadoc.apichanges=${basedir}/apichanges.xml jnlp.verify.excludes=config/ModuleAutoDeps/org-openide-execution.xml test.config.stableBTD.includes=**/*Test.class + +# todo remove SM usage in tests +test.jms.flags=-Djava.security.manager=allow diff --git a/platform/openide.filesystems/nbproject/project.properties b/platform/openide.filesystems/nbproject/project.properties index 800dc69b22c0..41e58bba0941 100644 --- a/platform/openide.filesystems/nbproject/project.properties +++ b/platform/openide.filesystems/nbproject/project.properties @@ -42,3 +42,6 @@ test.config.stableBTD.excludes=\ **/StatFilesTest.class,\ **/URLMapperTestHidden.class,\ **/XMLFileSystemTest.class + +# todo remove SM usage in tests +test.jms.flags=-Djava.security.manager=allow diff --git a/platform/openide.loaders/nbproject/project.properties b/platform/openide.loaders/nbproject/project.properties index e6ae801dd818..e4209ea07f55 100644 --- a/platform/openide.loaders/nbproject/project.properties +++ b/platform/openide.loaders/nbproject/project.properties @@ -21,3 +21,6 @@ javac.release=17 javadoc.main.page=org/openide/loaders/doc-files/api.html javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml + +# todo remove SM usage in tests +test.jms.flags=-Djava.security.manager=allow From c161cef79d010c7eaf0b631ec514a6876f0f4a83 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Mon, 26 Jan 2026 04:20:38 +0100 Subject: [PATCH 7/7] disable JDK 21 incompatible tests (Thread.stop()) --- .github/workflows/main.yml | 5 +++-- .../test/unit/src/org/openide/nodes/ChildrenKeysTest.java | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6f12a10fa972..e1092081b10b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -420,8 +420,9 @@ jobs: - name: ergonomics/ide.ergonomics run: ant $OPTS -f ergonomics/ide.ergonomics test -Dtest.config=commit - - name: nb/deadlock.detector - run: ant $OPTS -f nb/deadlock.detector test + # TODO not JDK 21 compatible +# - name: nb/deadlock.detector +# run: ant $OPTS -f nb/deadlock.detector test - name: nb/ide.branding run: ant $OPTS -f nb/ide.branding test diff --git a/platform/openide.nodes/test/unit/src/org/openide/nodes/ChildrenKeysTest.java b/platform/openide.nodes/test/unit/src/org/openide/nodes/ChildrenKeysTest.java index e0487d6eec34..230bbe7739bc 100644 --- a/platform/openide.nodes/test/unit/src/org/openide/nodes/ChildrenKeysTest.java +++ b/platform/openide.nodes/test/unit/src/org/openide/nodes/ChildrenKeysTest.java @@ -137,12 +137,14 @@ public void run() { }//fail("Ok"); } - /** + /* * See #78519 * T1 has write access and gets preempted just before call to * getNodes() by another thread callig getNodes. * Other thread */ + // TODO uses Thread.stop(); rewrite or remove + /* public void testGetNodesFromWriteAccess() throws Exception { final String[] keys = { "Nenik", "Tulach" }; Keys o = new Keys (lazy(), keys); @@ -195,7 +197,8 @@ public void run() { assertTrue ("Preempted thread finished correctly", done[0]); assertTrue ("Other thread finished correctly", done[1]); } - + */ + public void testNodesCountDelegated() throws Exception { class K extends Children.Keys { int cnt;