From 1a7784b40de38071738ea670eb6ec57310f4e96e Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Tue, 25 Feb 2025 18:48:06 +0000 Subject: [PATCH 1/5] Update test expectations for JDK24 upgrade --- .../compilation-units/cus.expected | 2 ++ .../test.expected | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/java/ql/test-kotlin1/library-tests/compilation-units/cus.expected b/java/ql/test-kotlin1/library-tests/compilation-units/cus.expected index 97b688e87956..6a09d9908c3b 100644 --- a/java/ql/test-kotlin1/library-tests/compilation-units/cus.expected +++ b/java/ql/test-kotlin1/library-tests/compilation-units/cus.expected @@ -2,6 +2,8 @@ | AbstractList$RandomAccessSpliterator | .../AbstractList$RandomAccessSpliterator.class:0:0:0:0 | | ArrayList | .../ArrayList.class:0:0:0:0 | | ArrayList$ArrayListSpliterator | .../ArrayList$ArrayListSpliterator.class:0:0:0:0 | +| CleanerImpl$CleanableList | .../CleanerImpl$CleanableList.class:0:0:0:0 | +| CleanerImpl$CleanableList$Node | .../CleanerImpl$CleanableList$Node.class:0:0:0:0 | | List | .../List.class:0:0:0:0 | | ListIterator | .../ListIterator.class:0:0:0:0 | | MemorySessionImpl$ResourceList | .../MemorySessionImpl$ResourceList.class:0:0:0:0 | 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 cc941f0c44b2..b901340b9642 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 @@ -16,6 +16,22 @@ methodWithDuplicate | AbstractCollection | removeAll | Collection | | AbstractCollection | retainAll | Collection | | AbstractCollection | toArray | T[] | +| AbstractCollection> | add | Entry | +| AbstractCollection> | addAll | Collection> | +| AbstractCollection> | contains | Object | +| AbstractCollection> | containsAll | Collection | +| AbstractCollection> | remove | Object | +| AbstractCollection> | removeAll | Collection | +| AbstractCollection> | retainAll | Collection | +| AbstractCollection> | toArray | T[] | +| AbstractCollection | add | K | +| AbstractCollection | addAll | Collection | +| AbstractCollection | contains | Object | +| AbstractCollection | containsAll | Collection | +| AbstractCollection | remove | Object | +| AbstractCollection | removeAll | Collection | +| AbstractCollection | retainAll | Collection | +| AbstractCollection | toArray | T[] | | AbstractCollection | add | Runnable | | AbstractCollection | addAll | Collection | | AbstractCollection | contains | Object | @@ -40,6 +56,14 @@ methodWithDuplicate | AbstractCollection | removeAll | Collection | | AbstractCollection | retainAll | Collection | | AbstractCollection | toArray | T[] | +| AbstractCollection | add | V | +| AbstractCollection | addAll | Collection | +| AbstractCollection | contains | Object | +| AbstractCollection | containsAll | Collection | +| AbstractCollection | remove | Object | +| AbstractCollection | removeAll | Collection | +| AbstractCollection | retainAll | Collection | +| AbstractCollection | toArray | T[] | | AbstractList | add | E | | AbstractList | add | int | | AbstractList | addAll | Collection | From fd762332d1ba9df3851db4b49d21d4fc9dbdc810 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Tue, 25 Feb 2025 22:59:03 +0000 Subject: [PATCH 2/5] Accept test changes --- .../compilation-units/cus.expected | 2 ++ .../test.expected | 24 +++++++++++++++++++ .../reflection/reflection.expected | 1 + .../errortype-with-params/PrintAst.expected | 2 +- .../library-tests/errortype/Diags.expected | 1 + .../ql/test/library-tests/errortype/Test.java | 1 + 6 files changed, 30 insertions(+), 1 deletion(-) diff --git a/java/ql/test-kotlin2/library-tests/compilation-units/cus.expected b/java/ql/test-kotlin2/library-tests/compilation-units/cus.expected index 97b688e87956..6a09d9908c3b 100644 --- a/java/ql/test-kotlin2/library-tests/compilation-units/cus.expected +++ b/java/ql/test-kotlin2/library-tests/compilation-units/cus.expected @@ -2,6 +2,8 @@ | AbstractList$RandomAccessSpliterator | .../AbstractList$RandomAccessSpliterator.class:0:0:0:0 | | ArrayList | .../ArrayList.class:0:0:0:0 | | ArrayList$ArrayListSpliterator | .../ArrayList$ArrayListSpliterator.class:0:0:0:0 | +| CleanerImpl$CleanableList | .../CleanerImpl$CleanableList.class:0:0:0:0 | +| CleanerImpl$CleanableList$Node | .../CleanerImpl$CleanableList$Node.class:0:0:0:0 | | List | .../List.class:0:0:0:0 | | ListIterator | .../ListIterator.class:0:0:0:0 | | MemorySessionImpl$ResourceList | .../MemorySessionImpl$ResourceList.class:0:0:0:0 | 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 eba4613fba5e..03e86e2d2a18 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 @@ -16,6 +16,22 @@ methodWithDuplicate | AbstractCollection | removeAll | Collection | | AbstractCollection | retainAll | Collection | | AbstractCollection | toArray | T[] | +| AbstractCollection> | add | Entry | +| AbstractCollection> | addAll | Collection> | +| AbstractCollection> | contains | Object | +| AbstractCollection> | containsAll | Collection | +| AbstractCollection> | remove | Object | +| AbstractCollection> | removeAll | Collection | +| AbstractCollection> | retainAll | Collection | +| AbstractCollection> | toArray | T[] | +| AbstractCollection | add | K | +| AbstractCollection | addAll | Collection | +| AbstractCollection | contains | Object | +| AbstractCollection | containsAll | Collection | +| AbstractCollection | remove | Object | +| AbstractCollection | removeAll | Collection | +| AbstractCollection | retainAll | Collection | +| AbstractCollection | toArray | T[] | | AbstractCollection | add | Runnable | | AbstractCollection | addAll | Collection | | AbstractCollection | contains | Object | @@ -40,6 +56,14 @@ methodWithDuplicate | AbstractCollection | removeAll | Collection | | AbstractCollection | retainAll | Collection | | AbstractCollection | toArray | T[] | +| AbstractCollection | add | V | +| AbstractCollection | addAll | Collection | +| AbstractCollection | contains | Object | +| AbstractCollection | containsAll | Collection | +| AbstractCollection | remove | Object | +| AbstractCollection | removeAll | Collection | +| AbstractCollection | retainAll | Collection | +| AbstractCollection | toArray | T[] | | AbstractList | add | E | | AbstractList | add | int | | AbstractList | addAll | Collection | diff --git a/java/ql/test-kotlin2/library-tests/reflection/reflection.expected b/java/ql/test-kotlin2/library-tests/reflection/reflection.expected index 62ee93d85088..92b20bcae778 100644 --- a/java/ql/test-kotlin2/library-tests/reflection/reflection.expected +++ b/java/ql/test-kotlin2/library-tests/reflection/reflection.expected @@ -333,6 +333,7 @@ compGenerated | file:///TextStyle.class:0:0:0:0 | getEntries | Default property accessor | | file:///Thread$State.class:0:0:0:0 | getEntries | Default property accessor | | file:///TimeUnit.class:0:0:0:0 | getEntries | Default property accessor | +| file:///TypeKind.class:0:0:0:0 | getEntries | Default property accessor | | file:///VarHandle$AccessMode.class:0:0:0:0 | getEntries | Default property accessor | | file:///VarHandle$AccessType.class:0:0:0:0 | getEntries | Default property accessor | | file:///Wrapper.class:0:0:0:0 | getEntries | Default property accessor | diff --git a/java/ql/test/library-tests/errortype-with-params/PrintAst.expected b/java/ql/test/library-tests/errortype-with-params/PrintAst.expected index 1c2e7a4f31e0..d7f2916c0213 100644 --- a/java/ql/test/library-tests/errortype-with-params/PrintAst.expected +++ b/java/ql/test/library-tests/errortype-with-params/PrintAst.expected @@ -2,5 +2,5 @@ Test.java: # 0| [CompilationUnit] Test # 1| 1: [Class] Test #-----| -1: (Base Types) -# 1| 0: [TypeAccess] +# 1| 0: [TypeAccess] Unavailable # 1| 0: [TypeAccess] String diff --git a/java/ql/test/library-tests/errortype/Diags.expected b/java/ql/test/library-tests/errortype/Diags.expected index c561f5caf8d0..dfd80b2466a1 100644 --- a/java/ql/test/library-tests/errortype/Diags.expected +++ b/java/ql/test/library-tests/errortype/Diags.expected @@ -3,4 +3,5 @@ | Test.java:6:23:6:39 | Unexpected symbol for constructor: new NoSuchClass() | | Test.java:6:23:6:39 | Unknown or erroneous type for expression of kind ClassInstanceCreation | | Test.java:6:27:6:37 | Unknown or erroneous type for expression of kind TypeAccess | +| Test.java:7:12:7:14 | Unknown or erroneous type for expression of kind VarAccess | | file://:0:0:0:0 | 2 errors during annotation processing | diff --git a/java/ql/test/library-tests/errortype/Test.java b/java/ql/test/library-tests/errortype/Test.java index 715c7af1afc3..c393faf75990 100644 --- a/java/ql/test/library-tests/errortype/Test.java +++ b/java/ql/test/library-tests/errortype/Test.java @@ -14,3 +14,4 @@ public NoSuchClass test() { // Diagnostic Matches: 2 errors during annotation processing // Diagnostic Matches: Unknown or erroneous type for expression of kind TypeAccess // Diagnostic Matches: Unknown or erroneous type for expression of kind ClassInstanceCreation +// Diagnostic Matches: Unknown or erroneous type for expression of kind VarAccess From 6f2cf89b28e949b1979b66ed241424d90a2d14b2 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Thu, 27 Feb 2025 18:14:36 +0000 Subject: [PATCH 3/5] Change note --- java/ql/lib/change-notes/2025-02-27-jdk-24.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 java/ql/lib/change-notes/2025-02-27-jdk-24.yml diff --git a/java/ql/lib/change-notes/2025-02-27-jdk-24.yml b/java/ql/lib/change-notes/2025-02-27-jdk-24.yml new file mode 100644 index 000000000000..cc620c54d6e7 --- /dev/null +++ b/java/ql/lib/change-notes/2025-02-27-jdk-24.yml @@ -0,0 +1,4 @@ +--- +category: feature +--- +* The Java extractor and QL libraries now support Java 23. From f99cc5deee141ef1dcd8983eca36a2dd495127d7 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Thu, 27 Feb 2025 18:17:22 +0000 Subject: [PATCH 4/5] Docs: note JDK 24 support --- docs/codeql/reusables/supported-versions-compilers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/codeql/reusables/supported-versions-compilers.rst b/docs/codeql/reusables/supported-versions-compilers.rst index 9daa65c16750..a4686807db39 100644 --- a/docs/codeql/reusables/supported-versions-compilers.rst +++ b/docs/codeql/reusables/supported-versions-compilers.rst @@ -33,7 +33,7 @@ .. [2] Objective-C, Objective-C++, C++/CLI, and C++/CX are not supported. .. [3] Support for the clang-cl compiler is preliminary. .. [4] Support for the Arm Compiler (armcc) is preliminary. - .. [5] Builds that execute on Java 7 to 22 can be analyzed. The analysis understands standard language features in Java 8 to 22; "preview" and "incubator" features are not supported. Source code using Java language versions older than Java 8 are analyzed as Java 8 code. + .. [5] Builds that execute on Java 7 to 24 can be analyzed. The analysis understands standard language features in Java 8 to 24; "preview" and "incubator" features are not supported. Source code using Java language versions older than Java 8 are analyzed as Java 8 code. .. [6] ECJ is supported when the build invokes it via the Maven Compiler plugin or the Takari Lifecycle plugin. .. [7] JSX and Flow code, YAML, JSON, HTML, and XML files may also be analyzed with JavaScript files. .. [8] The extractor requires Python 3 to run. To analyze Python 2.7 you should install both versions of Python. From ef44b3976c433cb8507c71e1f7b0cb7f3d35e4b0 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Thu, 27 Feb 2025 18:33:39 +0000 Subject: [PATCH 5/5] Fix version Co-authored-by: yo-h <55373593+yo-h@users.noreply.github.com> --- java/ql/lib/change-notes/2025-02-27-jdk-24.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/lib/change-notes/2025-02-27-jdk-24.yml b/java/ql/lib/change-notes/2025-02-27-jdk-24.yml index cc620c54d6e7..fe718c82fff8 100644 --- a/java/ql/lib/change-notes/2025-02-27-jdk-24.yml +++ b/java/ql/lib/change-notes/2025-02-27-jdk-24.yml @@ -1,4 +1,4 @@ --- category: feature --- -* The Java extractor and QL libraries now support Java 23. +* The Java extractor and QL libraries now support Java 24.