From a4cf2579a553f44531c19bda76f27d4f58a76be0 Mon Sep 17 00:00:00 2001 From: idrissrio Date: Wed, 18 Mar 2026 15:34:59 +0100 Subject: [PATCH 1/4] Java: Accept new test results after JDK 26 extractor upgrade --- .../compact-source-files/CompactSourceAnalysis.expected | 2 +- .../compact-source-files/ImplicitClassDetection.expected | 2 +- .../compact-source-files/MethodInCompactSource.expected | 4 ++-- java/ql/test/library-tests/compact-source-files/options | 2 +- java/ql/test/library-tests/dataflow/kdf/options | 2 +- java/ql/test/library-tests/dataflow/scoped-values/options | 2 +- java/ql/test/library-tests/errorexpr/Test.java | 1 - java/ql/test/library-tests/flexible-constructors/options | 2 +- java/ql/test/library-tests/module-import-declarations/options | 2 +- 9 files changed, 9 insertions(+), 10 deletions(-) diff --git a/java/ql/test/library-tests/compact-source-files/CompactSourceAnalysis.expected b/java/ql/test/library-tests/compact-source-files/CompactSourceAnalysis.expected index 05db00aa26de..0e1dd647e411 100644 --- a/java/ql/test/library-tests/compact-source-files/CompactSourceAnalysis.expected +++ b/java/ql/test/library-tests/compact-source-files/CompactSourceAnalysis.expected @@ -1 +1 @@ -| Test.java:0:0:0:0 | Test | Test.java:1:1:1:1 | Test | Compact source file 'Test' contains implicit class 'Test' | +| Test.java:0:0:0:0 | Test | Test.java:1:1:29:1 | Test | Compact source file 'Test' contains implicit class 'Test' | diff --git a/java/ql/test/library-tests/compact-source-files/ImplicitClassDetection.expected b/java/ql/test/library-tests/compact-source-files/ImplicitClassDetection.expected index 61dcdd8a17ff..9bfaaecbbcb1 100644 --- a/java/ql/test/library-tests/compact-source-files/ImplicitClassDetection.expected +++ b/java/ql/test/library-tests/compact-source-files/ImplicitClassDetection.expected @@ -1,2 +1,2 @@ -| Test.java:1:1:1:1 | Test | implicit | +| Test.java:1:1:29:1 | Test | implicit | | Test.java:25:7:25:16 | NotCompact | not implicit | diff --git a/java/ql/test/library-tests/compact-source-files/MethodInCompactSource.expected b/java/ql/test/library-tests/compact-source-files/MethodInCompactSource.expected index 3c7b45f500ee..d4b41c614413 100644 --- a/java/ql/test/library-tests/compact-source-files/MethodInCompactSource.expected +++ b/java/ql/test/library-tests/compact-source-files/MethodInCompactSource.expected @@ -1,5 +1,5 @@ -| Test.java:1:1:1:1 | | in compact source | -| Test.java:1:1:1:1 | | in compact source | +| Test.java:1:1:29:1 | | in compact source | +| Test.java:1:1:29:1 | | in compact source | | Test.java:5:6:5:9 | main | in compact source | | Test.java:11:6:11:16 | processData | in compact source | | Test.java:16:14:16:31 | updatePrivateField | in compact source | diff --git a/java/ql/test/library-tests/compact-source-files/options b/java/ql/test/library-tests/compact-source-files/options index db1dc01e53b7..3d6e630aa73e 100644 --- a/java/ql/test/library-tests/compact-source-files/options +++ b/java/ql/test/library-tests/compact-source-files/options @@ -1 +1 @@ -//semmle-extractor-options: --javac-args --release 25 --enable-preview +//semmle-extractor-options: --javac-args --release 25 diff --git a/java/ql/test/library-tests/dataflow/kdf/options b/java/ql/test/library-tests/dataflow/kdf/options index f4edc64c0178..801b81e07526 100644 --- a/java/ql/test/library-tests/dataflow/kdf/options +++ b/java/ql/test/library-tests/dataflow/kdf/options @@ -1 +1 @@ -//semmle-extractor-options: --javac-args --enable-preview --release 25 \ No newline at end of file +//semmle-extractor-options: --javac-args --release 25 \ No newline at end of file diff --git a/java/ql/test/library-tests/dataflow/scoped-values/options b/java/ql/test/library-tests/dataflow/scoped-values/options index c793109355a5..2d42b8d2cd8d 100644 --- a/java/ql/test/library-tests/dataflow/scoped-values/options +++ b/java/ql/test/library-tests/dataflow/scoped-values/options @@ -1 +1 @@ -//semmle-extractor-options: --javac-args -source 25 -target 25 --enable-preview \ No newline at end of file +//semmle-extractor-options: --javac-args -source 25 -target 25 \ No newline at end of file diff --git a/java/ql/test/library-tests/errorexpr/Test.java b/java/ql/test/library-tests/errorexpr/Test.java index af314e5ced67..068690e7bb20 100644 --- a/java/ql/test/library-tests/errorexpr/Test.java +++ b/java/ql/test/library-tests/errorexpr/Test.java @@ -13,6 +13,5 @@ public int yieldWrapper(int x) { } // Diagnostic Matches: Erroneous node in tree: (ERROR) -// Diagnostic Matches: In file Test.java:8:15 no end location for JCMethodInvocation : yield(x) // Diagnostic Matches: 1 errors during annotation processing // Diagnostic Matches: Unknown or erroneous type for expression of kind ErrorExpr diff --git a/java/ql/test/library-tests/flexible-constructors/options b/java/ql/test/library-tests/flexible-constructors/options index db1dc01e53b7..3d6e630aa73e 100644 --- a/java/ql/test/library-tests/flexible-constructors/options +++ b/java/ql/test/library-tests/flexible-constructors/options @@ -1 +1 @@ -//semmle-extractor-options: --javac-args --release 25 --enable-preview +//semmle-extractor-options: --javac-args --release 25 diff --git a/java/ql/test/library-tests/module-import-declarations/options b/java/ql/test/library-tests/module-import-declarations/options index b510fdce0df9..801b81e07526 100644 --- a/java/ql/test/library-tests/module-import-declarations/options +++ b/java/ql/test/library-tests/module-import-declarations/options @@ -1 +1 @@ -//semmle-extractor-options: --javac-args --release 25 --enable-preview \ No newline at end of file +//semmle-extractor-options: --javac-args --release 25 \ No newline at end of file From 2ec58aa5e8998746a6776bb29150c6cc9ad4bb35 Mon Sep 17 00:00:00 2001 From: idrissrio Date: Fri, 20 Mar 2026 20:27:33 +0100 Subject: [PATCH 2/4] Java: Pin CWE-676 test to --release 20 Thread.stop() was removed in JDK 21. Pin the test to release 20 so the extractor can compile the test source with JDK 26. --- java/ql/test/query-tests/security/CWE-676/semmle/tests/options | 1 + 1 file changed, 1 insertion(+) create mode 100644 java/ql/test/query-tests/security/CWE-676/semmle/tests/options diff --git a/java/ql/test/query-tests/security/CWE-676/semmle/tests/options b/java/ql/test/query-tests/security/CWE-676/semmle/tests/options new file mode 100644 index 000000000000..a9e3a7a663f7 --- /dev/null +++ b/java/ql/test/query-tests/security/CWE-676/semmle/tests/options @@ -0,0 +1 @@ +//semmle-extractor-options: --javac-args --release 20 From 8074be2ef4e6183749d15e2298b90fae17f546d3 Mon Sep 17 00:00:00 2001 From: idrissrio Date: Fri, 20 Mar 2026 20:27:41 +0100 Subject: [PATCH 3/4] Java: Accept new test results for JDK 26 JDK 26 added ofLazy methods to List, Map, and Set collections. Update expected test output to include these new methods. --- .../test.expected | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/java/ql/test-kotlin1/library-tests/java-kotlin-collection-type-generic-methods/test.expected b/java/ql/test-kotlin1/library-tests/java-kotlin-collection-type-generic-methods/test.expected index a56980d10ac4..a55e73e283fa 100644 --- a/java/ql/test-kotlin1/library-tests/java-kotlin-collection-type-generic-methods/test.expected +++ b/java/ql/test-kotlin1/library-tests/java-kotlin-collection-type-generic-methods/test.expected @@ -196,6 +196,8 @@ methodWithDuplicate | List | listIterator | int | | List | of | E | | List | of | E[] | +| List | ofLazy | IntFunction | +| List | ofLazy | int | | List | remove | Object | | List | remove | int | | List | removeAll | Collection | @@ -222,6 +224,8 @@ methodWithDuplicate | List | listIterator | int | | List | of | E | | List | of | E[] | +| List | ofLazy | IntFunction | +| List | ofLazy | int | | List | remove | Object | | List | remove | int | | List | removeAll | Collection | @@ -248,6 +252,8 @@ methodWithDuplicate | List | listIterator | int | | List | of | E | | List | of | E[] | +| List | ofLazy | IntFunction | +| List | ofLazy | int | | List | remove | Object | | List | remove | int | | List | removeAll | Collection | @@ -280,6 +286,8 @@ methodWithDuplicate | Map | of | K | | Map | of | V | | Map | ofEntries | Entry[] | +| Map | ofLazy | Function | +| Map | ofLazy | Set | | Map | put | K | | Map | put | V | | Map | putAll | Map | @@ -310,6 +318,8 @@ methodWithDuplicate | Map | of | K | | Map | of | V | | Map | ofEntries | Entry[] | +| Map | ofLazy | Function | +| Map | ofLazy | Set | | Map | put | Identity | | Map | put | Object | | Map | putAll | Map | @@ -341,6 +351,8 @@ methodWithDuplicate | Map | of | K | | Map | of | V | | Map | ofEntries | Entry[] | +| Map | ofLazy | Function | +| Map | ofLazy | Set | | Map | put | K | | Map | put | V | | Map | putAll | Map | @@ -370,6 +382,8 @@ methodWithDuplicate | Map | of | K | | Map | of | V | | Map | ofEntries | Entry[] | +| Map | ofLazy | Function | +| Map | ofLazy | Set | | Map | put | Object | | Map | putAll | Map | | Map | putIfAbsent | Object | @@ -397,6 +411,8 @@ methodWithDuplicate | Map | of | K | | Map | of | V | | Map | ofEntries | Entry[] | +| Map | ofLazy | Function | +| Map | ofLazy | Set | | Map | put | String | | Map | putAll | Map | | Map | putIfAbsent | String | From 7662886f0b2720c41d7c5aa868bfa30999484bd8 Mon Sep 17 00:00:00 2001 From: idrissrio Date: Mon, 23 Mar 2026 09:03:46 +0100 Subject: [PATCH 4/4] Java: Accept new test results for JDK 26 Accept new ByteOrder.getEntries, List.ofLazy, and Map.ofLazy entries in kotlin2 test expected files. --- .../test.expected | 16 ++++++++++++++++ .../library-tests/reflection/reflection.expected | 1 + 2 files changed, 17 insertions(+) diff --git a/java/ql/test-kotlin2/library-tests/java-kotlin-collection-type-generic-methods/test.expected b/java/ql/test-kotlin2/library-tests/java-kotlin-collection-type-generic-methods/test.expected index 2495c1fc1572..3237c89c8c72 100644 --- a/java/ql/test-kotlin2/library-tests/java-kotlin-collection-type-generic-methods/test.expected +++ b/java/ql/test-kotlin2/library-tests/java-kotlin-collection-type-generic-methods/test.expected @@ -191,6 +191,8 @@ methodWithDuplicate | List | listIterator | int | | List | of | E | | List | of | E[] | +| List | ofLazy | IntFunction | +| List | ofLazy | int | | List | remove | Object | | List | remove | int | | List | removeAll | Collection | @@ -216,6 +218,8 @@ methodWithDuplicate | List | listIterator | int | | List | of | E | | List | of | E[] | +| List | ofLazy | IntFunction | +| List | ofLazy | int | | List | remove | Object | | List | remove | int | | List | removeAll | Collection | @@ -242,6 +246,8 @@ methodWithDuplicate | List | listIterator | int | | List | of | E | | List | of | E[] | +| List | ofLazy | IntFunction | +| List | ofLazy | int | | List | remove | Object | | List | remove | int | | List | removeAll | Collection | @@ -274,6 +280,8 @@ methodWithDuplicate | Map | of | K | | Map | of | V | | Map | ofEntries | Entry[] | +| Map | ofLazy | Function | +| Map | ofLazy | Set | | Map | put | K | | Map | put | V | | Map | putAll | Map | @@ -303,6 +311,8 @@ methodWithDuplicate | Map | of | K | | Map | of | V | | Map | ofEntries | Entry[] | +| Map | ofLazy | Function | +| Map | ofLazy | Set | | Map | put | Identity | | Map | put | Object | | Map | putAll | Map | @@ -333,6 +343,8 @@ methodWithDuplicate | Map | of | K | | Map | of | V | | Map | ofEntries | Entry[] | +| Map | ofLazy | Function | +| Map | ofLazy | Set | | Map | put | K | | Map | put | V | | Map | putAll | Map | @@ -361,6 +373,8 @@ methodWithDuplicate | Map | of | K | | Map | of | V | | Map | ofEntries | Entry[] | +| Map | ofLazy | Function | +| Map | ofLazy | Set | | Map | put | Object | | Map | putAll | Map | | Map | putIfAbsent | Object | @@ -388,6 +402,8 @@ methodWithDuplicate | Map | of | K | | Map | of | V | | Map | ofEntries | Entry[] | +| Map | ofLazy | Function | +| Map | ofLazy | Set | | Map | put | String | | Map | putAll | Map | | Map | putIfAbsent | String | diff --git a/java/ql/test-kotlin2/library-tests/reflection/reflection.expected b/java/ql/test-kotlin2/library-tests/reflection/reflection.expected index b5de2b1adea3..2c0bee11a9e2 100644 --- a/java/ql/test-kotlin2/library-tests/reflection/reflection.expected +++ b/java/ql/test-kotlin2/library-tests/reflection/reflection.expected @@ -266,6 +266,7 @@ compGenerated | file:///AccessFlag$Location.class:0:0:0:0 | getEntries | Default property accessor | | file:///AccessFlag.class:0:0:0:0 | getEntries | Default property accessor | | file:///AccessMode.class:0:0:0:0 | getEntries | Default property accessor | +| file:///ByteOrder.class:0:0:0:0 | getEntries | Default property accessor | | file:///CharProgression.class:0:0:0:0 | forEach | Forwarder for a Kotlin class inheriting an interface default method | | file:///CharProgression.class:0:0:0:0 | spliterator | Forwarder for a Kotlin class inheriting an interface default method | | file:///CharRange.class:0:0:0:0 | forEach | Forwarder for a Kotlin class inheriting an interface default method |