From jlahoda at openjdk.org Mon Sep 1 05:57:51 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 1 Sep 2025 05:57:51 GMT Subject: Integrated: 8177650: JShell tool: packages in classpath don't appear in completions In-Reply-To: References: Message-ID: <5adI4-XiRbIbljX36NB6Hl5rQ9u7LcFGAyxsZVxvJpo=.2ba4eb7c-a545-46e0-b06e-ad37c940e753@github.com> On Fri, 4 Jul 2025 17:32:38 GMT, Jan Lahoda wrote: > JShell provides the code completion feature, where it suggests possible follow ups for a given snippet prefix. To allow completion for packages, JShell uses a background task to go through known classes and create an index for them. > > There are two problems with this background task: > - the classpath is read from the JShell's FileManager, but the FileManager may not be configured with the compile options yet, so the classpath may not be filled yet, > - the module path is not included in the list of paths to paths to search > > This PR proposes to: > - use FileManager configured by passing the compile options through javac > - include the module path in the search path This pull request has now been integrated. Changeset: 28942406 Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/28942406020881be79b7543105b9eb2a0dda429e Stats: 373 lines in 5 files changed: 340 ins; 23 del; 10 mod 8177650: JShell tool: packages in classpath don't appear in completions Reviewed-by: asotona ------------- PR: https://git.openjdk.org/jdk/pull/26137 From lkorinth at openjdk.org Mon Sep 1 08:07:48 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 1 Sep 2025 08:07:48 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v8] In-Reply-To: References: Message-ID: <1SVkL88-a7Es6cosezvIjvZ63F4nv-2Kut2oKG27Eo8=.f2e2a083-b51d-4df9-ab6e-ec324467ebb9@github.com> > This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). > > My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have ploughed through test cases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > After the review, I will update the copyrights. > > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. > > I got 4 timing related faults: > 1) runtime/Thread/TestThreadDumpMonitorContention.java > This is probably: https://bugs.openjdk.org/browse/JDK-8361370 > 2) sun/tools/jhsdb/BasicLauncherTest.java > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. > 3) gc/stress/TestReclaimStringsLeaksMemory.java > I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. > 4) sun/security/ssl/X509KeyManager/CertChecking.java > This is a new test that I got on last rebase. I have added a timeout of 480 to it. > > In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. > > From the review of the cancelled "8356171: Increase timeout for test cases as preparation for change of... Leo Korinth has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 10 additional commits since the last revision: - new timeouts - Merge branch '_master_jdk' into _8260555 - update copyright - revert added timeout, it is not needed - feedback from Mark Sheppard - update testing.md, remove makefile link, fix bad text - after suggestion from Daniel - added extra timeout for: jdk/internal/vm/Continuation/BasicExt.java#COMP_WINDOW_LENGTH_{1-3}-GC_AFTER_YIELD - After suggestions from Erik and Andrey - 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26749/files - new: https://git.openjdk.org/jdk/pull/26749/files/4b33904a..7ca719c8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=06-07 Stats: 37788 lines in 1054 files changed: 23834 ins; 9562 del; 4392 mod Patch: https://git.openjdk.org/jdk/pull/26749.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26749/head:pull/26749 PR: https://git.openjdk.org/jdk/pull/26749 From lkorinth at openjdk.org Mon Sep 1 13:21:49 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 1 Sep 2025 13:21:49 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v9] In-Reply-To: References: Message-ID: > This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). > > My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have ploughed through test cases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > After the review, I will update the copyrights. > > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. > > I got 4 timing related faults: > 1) runtime/Thread/TestThreadDumpMonitorContention.java > This is probably: https://bugs.openjdk.org/browse/JDK-8361370 > 2) sun/tools/jhsdb/BasicLauncherTest.java > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. > 3) gc/stress/TestReclaimStringsLeaksMemory.java > I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. > 4) sun/security/ssl/X509KeyManager/CertChecking.java > This is a new test that I got on last rebase. I have added a timeout of 480 to it. > > In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. > > From the review of the cancelled "8356171: Increase timeout for test cases as preparation for change of... Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: changed both test in GetStackTraceALotWhenBlocking to use timeout of 1200 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26749/files - new: https://git.openjdk.org/jdk/pull/26749/files/7ca719c8..5c0bcd19 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26749&range=07-08 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/26749.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26749/head:pull/26749 PR: https://git.openjdk.org/jdk/pull/26749 From alanb at openjdk.org Mon Sep 1 13:55:46 2025 From: alanb at openjdk.org (Alan Bateman) Date: Mon, 1 Sep 2025 13:55:46 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v9] In-Reply-To: References: Message-ID: On Mon, 1 Sep 2025 13:21:49 GMT, Leo Korinth wrote: >> This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). >> >> My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have ploughed through test cases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> After the review, I will update the copyrights. >> >> I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. >> >> I got 4 timing related faults: >> 1) runtime/Thread/TestThreadDumpMonitorContention.java >> This is probably: https://bugs.openjdk.org/browse/JDK-8361370 >> 2) sun/tools/jhsdb/BasicLauncherTest.java >> I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. >> 3) gc/stress/TestReclaimStringsLeaksMemory.java >> I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. >> 4) sun/security/ssl/X509KeyManager/CertChecking.java >> This is a new test that I got on last rebase. I have added a timeout of 480 to it. >> >> In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. >> >> From the review of the cancelled "8356171: ... > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > changed both test in GetStackTraceALotWhenBlocking to use timeout of 1200 Marked as reviewed by alanb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26749#pullrequestreview-3173774701 From lkorinth at openjdk.org Mon Sep 1 16:00:47 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 1 Sep 2025 16:00:47 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: <9X-5PBm7G1Y8vJ8bw02E501aWdgleLyUWMk3nhSrF08=.bb490a54-e687-49cc-9ecc-df7c051eef18@github.com> On Fri, 22 Aug 2025 15:46:18 GMT, Albert Mingkun Yang wrote: >> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: >> >> update testing.md, remove makefile link, fix bad text > > test/hotspot/jtreg/serviceability/jvmti/vthread/SuspendResume2/SuspendResume2.java line 31: > >> 29: * @compile SuspendResume2.java >> 30: * @run driver jdk.test.lib.FileInstaller . . >> 31: * @run main/othervm/native/timeout=700 > > Why `700` instead of `480` in this file? I think this is one of the earlier tests that failed with a timeout factor of `0.7` on 480. Later on I doubled it, but here I was a bit more conservative. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2314279387 From lkorinth at openjdk.org Mon Sep 1 16:09:44 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 1 Sep 2025 16:09:44 GMT Subject: RFR: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 [v5] In-Reply-To: References: Message-ID: On Mon, 25 Aug 2025 13:48:10 GMT, Albert Mingkun Yang wrote: >> It is a way to give a "4x" lowest value, while not multiplying a 10x factor with four resulting in a 40x factor. I think (but I am not sure) that it would sometime time out if I only used the given timeout factor and not "guarding" with the max(x, 4). > >> while not multiplying a 10x factor with four resulting in a 40x factor. > > Why is that undesirable? The base is `(HOLD_TARGET_TIME + 30000) * 4` and the timeout-factor changes that linearly. Using `max(..., 4)` here may come as a surprise to end users, IMO. Because 40x is a very large timeout factor. I think I might misunderstand you in some way. My change is conservative, and will give a timeout that is not smaller than before (but can be larger if an explicit (non-default) timeout factor less than 4 was used before). Does that make sense, or do I answer something different from what you are asking? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26749#discussion_r2314295263 From duke at openjdk.org Tue Sep 2 00:54:58 2025 From: duke at openjdk.org (duke) Date: Tue, 2 Sep 2025 00:54:58 GMT Subject: Withdrawn: 8347291: Exhaustive switch over a generic sealed abstract class In-Reply-To: References: Message-ID: On Fri, 24 Jan 2025 01:08:56 GMT, Liam Miller-Cushon wrote: > This change avoids javac incorrectly reporting switches like the example in [JDK-8347291](https://bugs.openjdk.org/browse/JDK-8347291) as exhaustive. > > As Jan noted in the bug it seems like the inference behaviour here may not be correct. If it was able to infer a type without crashing that would also avoid the bug. > > However with the current inference behaviour, it's safer to assume that if inference crashes the subtype may need to be handled by the switch, instead of assuming that it doesn't. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/23286 From lkorinth at openjdk.org Tue Sep 2 07:29:57 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Tue, 2 Sep 2025 07:29:57 GMT Subject: Integrated: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 In-Reply-To: References: Message-ID: On Tue, 12 Aug 2025 17:01:41 GMT, Leo Korinth wrote: > This changes the timeout factor from 4 to 1. Most of the changes add timeouts to individual test cases so that I am able to run them with a timeout factor of 0.7 (some margin to the checked in factor of one) > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the Java properties (I cannot use the library function everywhere as jtreg does not allow me to add @library notations to non test case files). > > My approach has been to run all tests, and afterwards updating those that fail due to the timeout factor. The amount of updated test cases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed. In a few places, I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have ploughed through test cases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > After the review, I will update the copyrights. > > I have run testing tier1-8. The last time with a timeout factor of 1 instead of 0.7. > > I got 4 timing related faults: > 1) runtime/Thread/TestThreadDumpMonitorContention.java > This is probably: https://bugs.openjdk.org/browse/JDK-8361370 > 2) sun/tools/jhsdb/BasicLauncherTest.java > I am unsure about this one, it has not failed on my runs before, even with a timeout factor of 0.7, maybe I was unlucky. > 3) gc/stress/TestReclaimStringsLeaksMemory.java > I updated this to 480 seconds, I finish this fairly fast (~14s) on my not very fast computer, but the Macs that fail are old x86-based ones. > 4) sun/security/ssl/X509KeyManager/CertChecking.java > This is a new test that I got on last rebase. I have added a timeout of 480 to it. > > In addition to these four tests, I have another one "java/lang/ThreadLocal/MemoryLeak.java" that earlier failed with a timeout factor of 0.7 but did not fail in the last run. I will *not* update that test case, because the extra time spent is strange and should be looked at. I have created JDK-8352074 on that test case, and I will probably create another bug describing the timeout I got. > > From the review of the cancelled "8356171: Increase timeout for test cases as preparation for change of... This pull request has now been integrated. Changeset: 55e7af05 Author: Leo Korinth URL: https://git.openjdk.org/jdk/commit/55e7af0560335ef69af072cee60956cf8e6d00a1 Stats: 901 lines in 342 files changed: 51 ins; 91 del; 759 mod 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 Reviewed-by: alanb, sspitsyn, lmesnik, ihse ------------- PR: https://git.openjdk.org/jdk/pull/26749 From jlahoda at openjdk.org Wed Sep 3 05:54:31 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Wed, 3 Sep 2025 05:54:31 GMT Subject: RFR: 8351260: java.lang.AssertionError: Unexpected type tree: (ERROR) = (ERROR) Message-ID: Consider a very broken declaration like this: void test(List<@AlphaChars <@StringLength(int value = 5)String> s){ after seeing `@AlphaChars`, javac will try to parse `<@StringLength(int value = 5)String>` as a type, and assign the annotation to the type. But, the text does not parse as a type well (partly due to the `int value = 5`), and the parsing will proceed in an expression mode. Then a search for target type is performed to attach the annotation, and that fails, as the expression tree is not expected to be part of the type. The main proposal here is to wrap the badly parsed type in an `Erroneous` tree. The overall error recovery then seems to handle the situation well. The situation produces quite a few error reports, but it is not clear if this situation (esp. the nested `int value = 5`) is common enough to stretch the parsing error recovery capabilities to accommodate this code. ------------- Commit messages: - Adding more tests and a comment. - 8351260: java.lang.AssertionError: Unexpected type tree: (ERROR) = (ERROR) Changes: https://git.openjdk.org/jdk/pull/27065/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27065&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8351260 Stats: 92 lines in 3 files changed: 90 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/27065.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27065/head:pull/27065 PR: https://git.openjdk.org/jdk/pull/27065 From syan at openjdk.org Wed Sep 3 07:28:20 2025 From: syan at openjdk.org (SendaoYan) Date: Wed, 3 Sep 2025 07:28:20 GMT Subject: RFR: 8366582: Problemlist jdk/jshell/ToolSimpleTest.java Message-ID: Hi all, Should we problemlist jdk/jshell/ToolSimpleTest.java and jdk/jshell/ToolLocalSimpleTest.java on windows platform before the root cause been fixed. ------------- Commit messages: - 8366582: Problemlist jdk/jshell/ToolSimpleTest.java Changes: https://git.openjdk.org/jdk/pull/27066/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27066&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8366582 Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27066.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27066/head:pull/27066 PR: https://git.openjdk.org/jdk/pull/27066 From jlahoda at openjdk.org Wed Sep 3 09:00:42 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Wed, 3 Sep 2025 09:00:42 GMT Subject: RFR: 8366768: Problemlist jdk/jshell/ToolSimpleTest.java In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 07:23:01 GMT, SendaoYan wrote: > Hi all, > > Should we problemlist jdk/jshell/ToolSimpleTest.java and jdk/jshell/ToolLocalSimpleTest.java on windows platform before the root cause been fixed. Looks good to me - thanks! ------------- Marked as reviewed by jlahoda (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27066#pullrequestreview-3179661866 From mcimadamore at openjdk.org Wed Sep 3 09:49:47 2025 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Wed, 3 Sep 2025 09:49:47 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable In-Reply-To: References: Message-ID: <55UyC_qFFghp_fxg7oVtMk6_R6zMICrikszIO0HtIJ0=.40ab454b-e658-4356-b06f-ab548af2a946@github.com> On Sat, 30 Aug 2025 00:37:44 GMT, Chen Liang wrote: > The interface static methods added in Java 8 are never inherited in method resolution. However, javac incorrectly allowed them to be resolved against type variables with an interface as its only upper bound, which violates JLS 4.9: > >> The members of an intersection type are the members of the class or interface it induces. > > Combined with JLS 4.4: > >> The members of a type variable X with bound T & I1 & ... & In are the members of the intersection type ([?4.9](https://docs.oracle.com/javase/specs/jls/se24/html/jls-4.html#jls-4.9)) T & I1 & ... & In appearing at the point where the type variable is declared > > Last time this piece of code in Attr was updated was around Java 7, so this was probably missed in Java 8. > > The test cases added showcases wrong ways to refer to interface static methods: `Collator`, a subtype of `Comparator`, cannot use `reverseOrder`, so shouldn't type variable `T` bounded by `Comparator` be able to do so. > > In addition, the error for private member access on type variables should probably have been symbol not found instead of access errors - we might revisit that later. I made the new error symbol not found for parity with interface static reference on classes, as showcased in the compiler output in this new test. src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 4577: > 4575: // 1. Private members > 4576: // 2. Interface static methods > 4577: Symbol sym2 = sym.isPrivate() Code is good, but please break up the big conditional ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27015#discussion_r2318416548 From mcimadamore at openjdk.org Wed Sep 3 09:56:42 2025 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Wed, 3 Sep 2025 09:56:42 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable In-Reply-To: References: Message-ID: On Sat, 30 Aug 2025 00:37:44 GMT, Chen Liang wrote: > The interface static methods added in Java 8 are never inherited in method resolution. However, javac incorrectly allowed them to be resolved against type variables with an interface as its only upper bound, which violates JLS 4.9: > >> The members of an intersection type are the members of the class or interface it induces. > > Combined with JLS 4.4: > >> The members of a type variable X with bound T & I1 & ... & In are the members of the intersection type ([?4.9](https://docs.oracle.com/javase/specs/jls/se24/html/jls-4.html#jls-4.9)) T & I1 & ... & In appearing at the point where the type variable is declared > > Last time this piece of code in Attr was updated was around Java 7, so this was probably missed in Java 8. > > The test cases added showcases wrong ways to refer to interface static methods: `Collator`, a subtype of `Comparator`, cannot use `reverseOrder`, so shouldn't type variable `T` bounded by `Comparator` be able to do so. > > In addition, the error for private member access on type variables should probably have been symbol not found instead of access errors - we might revisit that later. I made the new error symbol not found for parity with interface static reference on classes, as showcased in the compiler output in this new test. The fix is correct, and mimics a fix that I made several years ago :-) https://hg.openjdk.org/jdk9/jdk9/langtools/rev/4d2d8b6459e1 I'd suggest to add a test with a type variable with intersection type bound, just for good measure, ------------- PR Review: https://git.openjdk.org/jdk/pull/27015#pullrequestreview-3179877224 From liach at openjdk.org Wed Sep 3 12:53:48 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 3 Sep 2025 12:53:48 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 09:53:40 GMT, Maurizio Cimadamore wrote: > I'd suggest to add a test with a type variable with intersection type bound, just for good measure Sure. One with bound `T extends Object & Comparator` would definitely better showcase the JLS rules without the fix, as this is already correct. Do you think I need a CSR? ------------- PR Comment: https://git.openjdk.org/jdk/pull/27015#issuecomment-3249124415 From cstein at openjdk.org Wed Sep 3 13:12:37 2025 From: cstein at openjdk.org (Christian Stein) Date: Wed, 3 Sep 2025 13:12:37 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac Message-ID: Please review this change to use JUnit in tests of `test/langtools/tools/javac`. ### Assess Status Quo A local `make test TEST=test/langtools/tools/javac` run before the conversion yields: Test results: passed: 3,938; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 Framework-based tests: 3043 = 2762 TestNG + 281 JUnit ### Perform Automatic Conversion - [junit-convert]( https://github.com/lahodaj/netbeans/tree/openjdk-testng-junit-fixes-and-hacks/java/java.openjdk.project/junit-convert) ### Perform Manual Adjustments Some of the following adjustments will be integrated into the `junit-convert` tool. #### Make argument source factory method `static` Method 'public java.lang.Object[][] org.openjdk.tests.javac.FDTest.caseGenerator()' must be static: local factory methods must be static unless the PER_CLASS @testinstance lifecycle mode is used; external factory methods must always be static. #### Make `@AfterAll`-annotated method `static` [ERROR] @afterall method 'public void org.openjdk.tests.vm.FDSeparateCompilationTest.cleanupCompilerCache()' must be static unless the test class is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. #### Remove `static` modifier from `@Test`-annotated methods This configuration error should have been detected by JUnit Jupiter and reported via the Discovery Issues API: https://docs.junit.org/current/user-guide/#running-tests-discovery-issues #### Rename test property to `JUnit.dirs` package org.junit.jupiter.api does not exist #### Add custom test instance factory Class [FDTests] must declare a single constructor Class [MethodReferenceTestKinds] must declare a single constructor ### Results Re-run tests via `make test TEST=test/langtools/tools/javac` after the conversion; yielding: Test results: passed: 3,939; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 Framework-based tests: 3043 = 0 TestNG + 3043 JUnit ------------- Commit messages: - Remove `static` modifier from `@Test`-annotated methods - Manual adjustments - Initial automatic conversion Changes: https://git.openjdk.org/jdk/pull/27046/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27046&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8366678 Stats: 628 lines in 39 files changed: 211 ins; 92 del; 325 mod Patch: https://git.openjdk.org/jdk/pull/27046.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27046/head:pull/27046 PR: https://git.openjdk.org/jdk/pull/27046 From liach at openjdk.org Wed Sep 3 13:41:42 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 3 Sep 2025 13:41:42 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac In-Reply-To: References: Message-ID: On Tue, 2 Sep 2025 12:30:08 GMT, Christian Stein wrote: > Please review this change to use JUnit in tests of `test/langtools/tools/javac`. > > ### Assess Status Quo > A local `make test TEST=test/langtools/tools/javac` run before the conversion yields: > > Test results: passed: 3,938; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 > Framework-based tests: 3043 = 2762 TestNG + 281 JUnit > > > ### Perform Automatic Conversion > - [junit-convert]( > https://github.com/lahodaj/netbeans/tree/openjdk-testng-junit-fixes-and-hacks/java/java.openjdk.project/junit-convert) > > ### Perform Manual Adjustments > > Some of the following adjustments will be integrated into the `junit-convert` tool. > > #### Make argument source factory method `static` > > Method 'public java.lang.Object[][] org.openjdk.tests.javac.FDTest.caseGenerator()' > must be static: local factory methods must be static > unless the PER_CLASS @testinstance lifecycle mode is used; > external factory methods must always be static. > > > #### Make `@AfterAll`-annotated method `static` > > [ERROR] @afterall method 'public void org.openjdk.tests.vm.FDSeparateCompilationTest.cleanupCompilerCache()' > must be static unless the test class > is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. > > > #### Remove `static` modifier from `@Test`-annotated methods > This configuration error should have been detected by JUnit Jupiter and reported via the Discovery > Issues API: https://docs.junit.org/current/user-guide/#running-tests-discovery-issues > > #### Rename test property to `JUnit.dirs` > > package org.junit.jupiter.api does not exist > > > #### Add custom test instance factory > > Class [FDTests] must declare a single constructor > Class [MethodReferenceTestKinds] must declare a single constructor > > > ### Results > Re-run tests via `make test TEST=test/langtools/tools/javac` after the conversion; yielding: > > Test results: passed: 3,939; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 > Framework-based tests: 3043 = 0 TestNG + 3043 JUnit Please run `bash make/scripts/update_copyright_year.sh -b 31847149c1956b23c19a99309982660b4bbdd2d6` to update your copyright years. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27046#issuecomment-3249303386 From cstein at openjdk.org Wed Sep 3 13:52:33 2025 From: cstein at openjdk.org (Christian Stein) Date: Wed, 3 Sep 2025 13:52:33 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v2] In-Reply-To: References: Message-ID: > Please review this change to use JUnit in tests of `test/langtools/tools/javac`. > > ### Assess Status Quo > A local `make test TEST=test/langtools/tools/javac` run before the conversion yields: > > Test results: passed: 3,938; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 > Framework-based tests: 3043 = 2762 TestNG + 281 JUnit > > > ### Perform Automatic Conversion > - [junit-convert]( > https://github.com/lahodaj/netbeans/tree/openjdk-testng-junit-fixes-and-hacks/java/java.openjdk.project/junit-convert) > > ### Perform Manual Adjustments > > Some of the following adjustments will be integrated into the `junit-convert` tool. > > #### Make argument source factory method `static` > > Method 'public java.lang.Object[][] org.openjdk.tests.javac.FDTest.caseGenerator()' > must be static: local factory methods must be static > unless the PER_CLASS @testinstance lifecycle mode is used; > external factory methods must always be static. > > > #### Make `@AfterAll`-annotated method `static` > > [ERROR] @afterall method 'public void org.openjdk.tests.vm.FDSeparateCompilationTest.cleanupCompilerCache()' > must be static unless the test class > is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. > > > #### Remove `static` modifier from `@Test`-annotated methods > This configuration error should have been detected by JUnit Jupiter and reported via the Discovery > Issues API: https://docs.junit.org/current/user-guide/#running-tests-discovery-issues > > #### Rename test property to `JUnit.dirs` > > package org.junit.jupiter.api does not exist > > > #### Add custom test instance factory > > Class [FDTests] must declare a single constructor > Class [MethodReferenceTestKinds] must declare a single constructor > > > ### Results > Re-run tests via `make test TEST=test/langtools/tools/javac` after the conversion; yielding: > > Test results: passed: 3,939; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 > Framework-based tests: 3043 = 0 TestNG + 3043 JUnit Christian Stein has updated the pull request incrementally with one additional commit since the last revision: Update copyright year ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27046/files - new: https://git.openjdk.org/jdk/pull/27046/files/5c3baed1..4fa84ef8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27046&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27046&range=00-01 Stats: 37 lines in 37 files changed: 0 ins; 0 del; 37 mod Patch: https://git.openjdk.org/jdk/pull/27046.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27046/head:pull/27046 PR: https://git.openjdk.org/jdk/pull/27046 From syan at openjdk.org Wed Sep 3 14:10:41 2025 From: syan at openjdk.org (SendaoYan) Date: Wed, 3 Sep 2025 14:10:41 GMT Subject: RFR: 8366768: Problemlist jdk/jshell/ToolSimpleTest.java In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 08:57:40 GMT, Jan Lahoda wrote: >> Hi all, >> >> Should we problemlist jdk/jshell/ToolSimpleTest.java and jdk/jshell/ToolLocalSimpleTest.java on windows platform before the root cause been fixed. > > Looks good to me - thanks! Thanks for your review @lahodaj I think we should merge this PR quickly to avoid test noisy, because this is tier1 test ------------- PR Comment: https://git.openjdk.org/jdk/pull/27066#issuecomment-3249417277 From jlahoda at openjdk.org Wed Sep 3 14:20:51 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Wed, 3 Sep 2025 14:20:51 GMT Subject: RFR: 8366768: Problemlist jdk/jshell/ToolSimpleTest.java In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 08:57:40 GMT, Jan Lahoda wrote: >> Hi all, >> >> Should we problemlist jdk/jshell/ToolSimpleTest.java and jdk/jshell/ToolLocalSimpleTest.java on windows platform before the root cause been fixed. > > Looks good to me - thanks! > Thanks for your review @lahodaj > > I think we should merge this PR quickly to avoid test noisy, because this is tier1 test Nothing against that - but that's up to you, you must issue the `/integrate` command. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27066#issuecomment-3249460894 From liach at openjdk.org Wed Sep 3 14:32:45 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 3 Sep 2025 14:32:45 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v2] In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 13:52:33 GMT, Christian Stein wrote: >> Please review this change to use JUnit in tests of `test/langtools/tools/javac`. >> >> ### Assess Status Quo >> A local `make test TEST=test/langtools/tools/javac` run before the conversion yields: >> >> Test results: passed: 3,938; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 >> Framework-based tests: 3043 = 2762 TestNG + 281 JUnit >> >> >> ### Perform Automatic Conversion >> - [junit-convert]( >> https://github.com/lahodaj/netbeans/tree/openjdk-testng-junit-fixes-and-hacks/java/java.openjdk.project/junit-convert) >> >> ### Perform Manual Adjustments >> >> Some of the following adjustments will be integrated into the `junit-convert` tool. >> >> #### Make argument source factory method `static` >> >> Method 'public java.lang.Object[][] org.openjdk.tests.javac.FDTest.caseGenerator()' >> must be static: local factory methods must be static >> unless the PER_CLASS @testinstance lifecycle mode is used; >> external factory methods must always be static. >> >> >> #### Make `@AfterAll`-annotated method `static` >> >> [ERROR] @afterall method 'public void org.openjdk.tests.vm.FDSeparateCompilationTest.cleanupCompilerCache()' >> must be static unless the test class >> is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. >> >> >> #### Remove `static` modifier from `@Test`-annotated methods >> This configuration error should have been detected by JUnit Jupiter and reported via the Discovery >> Issues API: https://docs.junit.org/current/user-guide/#running-tests-discovery-issues >> >> #### Rename test property to `JUnit.dirs` >> >> package org.junit.jupiter.api does not exist >> >> >> #### Add custom test instance factory >> >> Class [FDTests] must declare a single constructor >> Class [MethodReferenceTestKinds] must declare a single constructor >> >> >> ### Results >> Re-run tests via `make test TEST=test/langtools/tools/javac` after the conversion; yielding: >> >> Test results: passed: 3,939; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 >> Framework-based tests: 3043 = 0 TestNG + 3043 JUnit > > Christian Stein has updated the pull request incrementally with one additional commit since the last revision: > > Update copyright year test/langtools/tools/javac/file/MultiReleaseJar/MultiReleaseJarTest.java line 215: > 213: } > 214: > 215: public Object[][] createModes() { This one technically can be removed in favor of `@EnumSource` but since you are using a script and we can be more lenient. test/langtools/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestKinds.java line 185: > 183: } > 184: > 185: class LocalTestInstanceFactory implements TestInstanceFactory { Can't junit call the no-arg constructor naturally :thinking: test/langtools/tools/javac/lambdaShapes/org/openjdk/tests/javac/FDTest.java line 210: > 208: } > 209: > 210: class LocalTestInstanceFactory implements TestInstanceFactory { Since we have this again, can we just make a no-arg-constructor calling test instance factory and leave it in like /test/lib? test/langtools/tools/javac/lambdaShapes/org/openjdk/tests/vm/FDSeparateCompilationTest.java line 25: > 23: > 24: // this test has been disabled because of timeout issues. > 25: // see JDK-8006746 Should we convert this to a full jtreg header and use problem lists or `@ignore` directive instead? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2319026920 PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2319141375 PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2319162108 PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2319166549 From syan at openjdk.org Wed Sep 3 14:42:53 2025 From: syan at openjdk.org (SendaoYan) Date: Wed, 3 Sep 2025 14:42:53 GMT Subject: Integrated: 8366768: Problemlist jdk/jshell/ToolSimpleTest.java In-Reply-To: References: Message-ID: <-cLI1JmEaYL3suG7X0Lj3SCDohxYM8OxWuZLAzF8IaE=.021f55fe-35db-447a-8ed9-219db6d32ff4@github.com> On Wed, 3 Sep 2025 07:23:01 GMT, SendaoYan wrote: > Hi all, > > Should we problemlist jdk/jshell/ToolSimpleTest.java and jdk/jshell/ToolLocalSimpleTest.java on windows platform before the root cause been fixed. This pull request has now been integrated. Changeset: d5935af2 Author: SendaoYan URL: https://git.openjdk.org/jdk/commit/d5935af228d7129d75d6987767de50b019ec30c7 Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod 8366768: Problemlist jdk/jshell/ToolSimpleTest.java Reviewed-by: jlahoda ------------- PR: https://git.openjdk.org/jdk/pull/27066 From liach at openjdk.org Wed Sep 3 16:53:48 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 3 Sep 2025 16:53:48 GMT Subject: RFR: 8366768: Problemlist jdk/jshell/ToolSimpleTest.java In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 07:23:01 GMT, SendaoYan wrote: > Hi all, > > Should we problemlist jdk/jshell/ToolSimpleTest.java and jdk/jshell/ToolLocalSimpleTest.java on windows platform before the root cause been fixed. This failure happened once on linux-aarch64 too. So probably not platform-specific. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27066#issuecomment-3250014488 From liach at openjdk.org Wed Sep 3 21:07:48 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 3 Sep 2025 21:07:48 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable [v2] In-Reply-To: References: Message-ID: > The interface static methods added in Java 8 are never inherited in method resolution. However, javac incorrectly allowed them to be resolved against type variables with an interface as its only upper bound, which violates JLS 4.9: > >> The members of an intersection type are the members of the class or interface it induces. > > Combined with JLS 4.4: > >> The members of a type variable X with bound T & I1 & ... & In are the members of the intersection type ([?4.9](https://docs.oracle.com/javase/specs/jls/se24/html/jls-4.html#jls-4.9)) T & I1 & ... & In appearing at the point where the type variable is declared > > Last time this piece of code in Attr was updated was around Java 7, so this was probably missed in Java 8. > > The test cases added showcases wrong ways to refer to interface static methods: `Collator`, a subtype of `Comparator`, cannot use `reverseOrder`, so shouldn't type variable `T` bounded by `Comparator` be able to do so. > > In addition, the error for private member access on type variables should probably have been symbol not found instead of access errors - we might revisit that later. I made the new error symbol not found for parity with interface static reference on classes, as showcased in the compiler output in this new test. Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: - Break up long conditional, add intersection bounded test case - Merge branch 'master' of https://github.com/openjdk/jdk into fix/typevar-inherit-interface-static - 8365676: javac incorrectly allows calling interface static method via type variable ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27015/files - new: https://git.openjdk.org/jdk/pull/27015/files/266dc4c3..c3abc487 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27015&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27015&range=00-01 Stats: 7304 lines in 671 files changed: 4112 ins; 1396 del; 1796 mod Patch: https://git.openjdk.org/jdk/pull/27015.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27015/head:pull/27015 PR: https://git.openjdk.org/jdk/pull/27015 From liach at openjdk.org Wed Sep 3 21:11:43 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 3 Sep 2025 21:11:43 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable [v2] In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 21:07:48 GMT, Chen Liang wrote: >> The interface static methods added in Java 8 are never inherited in method resolution. However, javac incorrectly allowed them to be resolved against type variables with an interface as its only upper bound, which violates JLS 4.9: >> >>> The members of an intersection type are the members of the class or interface it induces. >> >> Combined with JLS 4.4: >> >>> The members of a type variable X with bound T & I1 & ... & In are the members of the intersection type ([?4.9](https://docs.oracle.com/javase/specs/jls/se24/html/jls-4.html#jls-4.9)) T & I1 & ... & In appearing at the point where the type variable is declared >> >> Last time this piece of code in Attr was updated was around Java 7, so this was probably missed in Java 8. >> >> The test cases added showcases wrong ways to refer to interface static methods: `Collator`, a subtype of `Comparator`, cannot use `reverseOrder`, so shouldn't type variable `T` bounded by `Comparator` be able to do so. >> >> In addition, the error for private member access on type variables should probably have been symbol not found instead of access errors - we might revisit that later. I made the new error symbol not found for parity with interface static reference on classes, as showcased in the compiler output in this new test. > > Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - Break up long conditional, add intersection bounded test case > - Merge branch 'master' of https://github.com/openjdk/jdk into fix/typevar-inherit-interface-static > - 8365676: javac incorrectly allows calling interface static method via type variable Interesting thing surfaces - the one with `extends Object & Comparator` bound reports the location to be `java.lang.Object&java.util.Comparator` while the new failure reports the location of `T`. Should we seek to unify this somehow? ------------- PR Comment: https://git.openjdk.org/jdk/pull/27015#issuecomment-3250814112 From acobbs at openjdk.org Wed Sep 3 23:36:02 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Wed, 3 Sep 2025 23:36:02 GMT Subject: RFR: 8155591: Misleading warning when not overriding close method in interface extending AutoCloseable Message-ID: The compiler generates a warning if you declare a `close()` method that throws any supertype of `InterruptedException` in a class or interface extending `AutoCloseable`. This is because suppressed `InterruptedException`'s are likely to lead to misbehavior at runtime. However, this feature also generates a warning due to `AutoCloseable.close()` itself, if you simply inherit it. For example: $ cat MyClass.java public interface MyClass extends AutoCloseable { } $ javac -Xlint:try MyClass.java MyClass.java:1: warning: [try] auto-closeable resource MyClass has a member method close() that could throw InterruptedException public interface MyClass extends AutoCloseable { ^ 1 warning The warning is not useful because `AutoCloseable.close()` is abstract and so it's going to be some other class' job to deal with the throws clause. This change prevents `AutoCloseable.close()` itself from triggering the warning in a class declaration. We preserve the existing behavior in which a warning is generated at the use site (i.e., at the try-with-resources statement). ------------- Commit messages: - Don't warn about AutoCloseable.close() itself throwing InterruptedException. Changes: https://git.openjdk.org/jdk/pull/27062/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27062&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8155591 Stats: 89 lines in 3 files changed: 86 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27062.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27062/head:pull/27062 PR: https://git.openjdk.org/jdk/pull/27062 From vromero at openjdk.org Thu Sep 4 01:55:41 2025 From: vromero at openjdk.org (Vicente Romero) Date: Thu, 4 Sep 2025 01:55:41 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable [v2] In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 12:51:26 GMT, Chen Liang wrote: > > I'd suggest to add a test with a type variable with intersection type bound, just for good measure > > Sure. One with bound `T extends Object & Comparator` would definitely better showcase the JLS rules without the fix, as this is already correct. Do you think I need a CSR? IMO yes, I think this deserves a CSR and probably release notes ------------- PR Comment: https://git.openjdk.org/jdk/pull/27015#issuecomment-3251413207 From vromero at openjdk.org Thu Sep 4 02:28:43 2025 From: vromero at openjdk.org (Vicente Romero) Date: Thu, 4 Sep 2025 02:28:43 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable [v2] In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 21:07:48 GMT, Chen Liang wrote: >> The interface static methods added in Java 8 are never inherited in method resolution. However, javac incorrectly allowed them to be resolved against type variables with an interface as its only upper bound, which violates JLS 4.9: >> >>> The members of an intersection type are the members of the class or interface it induces. >> >> Combined with JLS 4.4: >> >>> The members of a type variable X with bound T & I1 & ... & In are the members of the intersection type ([?4.9](https://docs.oracle.com/javase/specs/jls/se24/html/jls-4.html#jls-4.9)) T & I1 & ... & In appearing at the point where the type variable is declared >> >> Last time this piece of code in Attr was updated was around Java 7, so this was probably missed in Java 8. >> >> The test cases added showcases wrong ways to refer to interface static methods: `Collator`, a subtype of `Comparator`, cannot use `reverseOrder`, so shouldn't type variable `T` bounded by `Comparator` be able to do so. >> >> In addition, the error for private member access on type variables should probably have been symbol not found instead of access errors - we might revisit that later. I made the new error symbol not found for parity with interface static reference on classes, as showcased in the compiler output in this new test. > > Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - Break up long conditional, add intersection bounded test case > - Merge branch 'master' of https://github.com/openjdk/jdk into fix/typevar-inherit-interface-static > - 8365676: javac incorrectly allows calling interface static method via type variable lgtm ------------- Marked as reviewed by vromero (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27015#pullrequestreview-3183193092 From syan at openjdk.org Thu Sep 4 03:03:20 2025 From: syan at openjdk.org (SendaoYan) Date: Thu, 4 Sep 2025 03:03:20 GMT Subject: RFR: 8366849: Problemlist jdk/jshell/ToolSimpleTest.java as generic-all Message-ID: <4II_7xlmLiSTyblPDCPe48ey-PQCt-mm44UQjNmwT5c=.1b3ccca5-f0be-4b06-987d-87591d37532c@github.com> Hi all, Sorry for the interrupt. At first we found that jdk/jshell/ToolSimpleTest.java and jdk/jshell/ToolLocalSimpleTest.java fails on windows-x64 several times, but we found the tests also fails on linux-aarch64 and macos-aarch64 intermittently later. So should we problemlist these two tests as generic-all. ------------- Commit messages: - 8366849: Problemlist jdk/jshell/ToolSimpleTest.java as generic-all Changes: https://git.openjdk.org/jdk/pull/27082/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27082&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8366849 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/27082.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27082/head:pull/27082 PR: https://git.openjdk.org/jdk/pull/27082 From liach at openjdk.org Thu Sep 4 03:05:41 2025 From: liach at openjdk.org (Chen Liang) Date: Thu, 4 Sep 2025 03:05:41 GMT Subject: RFR: 8366849: Problemlist jdk/jshell/ToolSimpleTest.java as generic-all In-Reply-To: <4II_7xlmLiSTyblPDCPe48ey-PQCt-mm44UQjNmwT5c=.1b3ccca5-f0be-4b06-987d-87591d37532c@github.com> References: <4II_7xlmLiSTyblPDCPe48ey-PQCt-mm44UQjNmwT5c=.1b3ccca5-f0be-4b06-987d-87591d37532c@github.com> Message-ID: On Thu, 4 Sep 2025 02:57:34 GMT, SendaoYan wrote: > Hi all, > > Sorry for the interrupt. > At first we found that jdk/jshell/ToolSimpleTest.java and jdk/jshell/ToolLocalSimpleTest.java fails on windows-x64 several times, but we found the tests also fails on linux-aarch64 and macos-aarch64 intermittently later. So should we problemlist these two tests as generic-all. Sure, we can go ahead with this for now. ------------- Marked as reviewed by liach (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27082#pullrequestreview-3183238917 From syan at openjdk.org Thu Sep 4 03:20:41 2025 From: syan at openjdk.org (SendaoYan) Date: Thu, 4 Sep 2025 03:20:41 GMT Subject: RFR: 8366849: Problemlist jdk/jshell/ToolSimpleTest.java as generic-all In-Reply-To: References: <4II_7xlmLiSTyblPDCPe48ey-PQCt-mm44UQjNmwT5c=.1b3ccca5-f0be-4b06-987d-87591d37532c@github.com> Message-ID: On Thu, 4 Sep 2025 03:03:16 GMT, Chen Liang wrote: >> Hi all, >> >> Sorry for the interrupt. >> At first we found that jdk/jshell/ToolSimpleTest.java and jdk/jshell/ToolLocalSimpleTest.java fails on windows-x64 several times, but we found the tests also fails on linux-aarch64 and macos-aarch64 intermittently later. So should we problemlist these two tests as generic-all. > > Sure, we can go ahead with this for now. @liach Thanks for the review. I will integrate this PR after the GHA test finish and no other suggestions. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27082#issuecomment-3251638027 From liach at openjdk.org Thu Sep 4 04:11:43 2025 From: liach at openjdk.org (Chen Liang) Date: Thu, 4 Sep 2025 04:11:43 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable [v2] In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 21:07:48 GMT, Chen Liang wrote: >> The interface static methods added in Java 8 are never inherited in method resolution. However, javac incorrectly allowed them to be resolved against type variables with an interface as its only upper bound, which violates JLS 4.9: >> >>> The members of an intersection type are the members of the class or interface it induces. >> >> Combined with JLS 4.4: >> >>> The members of a type variable X with bound T & I1 & ... & In are the members of the intersection type ([?4.9](https://docs.oracle.com/javase/specs/jls/se24/html/jls-4.html#jls-4.9)) T & I1 & ... & In appearing at the point where the type variable is declared >> >> Last time this piece of code in Attr was updated was around Java 7, so this was probably missed in Java 8. >> >> The test cases added showcases wrong ways to refer to interface static methods: `Collator`, a subtype of `Comparator`, cannot use `reverseOrder`, so shouldn't type variable `T` bounded by `Comparator` be able to do so. >> >> In addition, the error for private member access on type variables should probably have been symbol not found instead of access errors - we might revisit that later. I made the new error symbol not found for parity with interface static reference on classes, as showcased in the compiler output in this new test. > > Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - Break up long conditional, add intersection bounded test case > - Merge branch 'master' of https://github.com/openjdk/jdk into fix/typevar-inherit-interface-static > - 8365676: javac incorrectly allows calling interface static method via type variable I have created the CSR https://bugs.openjdk.org/browse/JDK-8366848. Please help review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27015#issuecomment-3251755049 From cstein at openjdk.org Thu Sep 4 05:49:43 2025 From: cstein at openjdk.org (Christian Stein) Date: Thu, 4 Sep 2025 05:49:43 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v2] In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 13:42:25 GMT, Chen Liang wrote: >> Christian Stein has updated the pull request incrementally with one additional commit since the last revision: >> >> Update copyright year > > test/langtools/tools/javac/file/MultiReleaseJar/MultiReleaseJarTest.java line 215: > >> 213: } >> 214: >> 215: public Object[][] createModes() { > > This one technically can be removed in favor of `@EnumSource` but since you are using a script and we can be more lenient. Yes; but cleaning up the overall test setup and logic isn't part of this change. The goal is to keep the change set as minimal as possible. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2320900792 From cstein at openjdk.org Thu Sep 4 05:55:43 2025 From: cstein at openjdk.org (Christian Stein) Date: Thu, 4 Sep 2025 05:55:43 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v2] In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 14:19:10 GMT, Chen Liang wrote: >> Christian Stein has updated the pull request incrementally with one additional commit since the last revision: >> >> Update copyright year > > test/langtools/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestKinds.java line 185: > >> 183: } >> 184: >> 185: class LocalTestInstanceFactory implements TestInstanceFactory { > > Can't junit call the no-arg constructor naturally :thinking: It does; but iff it is the sole constructor. As Jupiter supports parameter injection by default, it's impossible to select the right constructor. > If no `TestInstanceFactory` is registered, the framework will invoke the _sole_ constructor for the test class to instantiate it, potentially resolving constructor arguments via registered `ParameterResolver` extensions. Find details at: https://docs.junit.org/current/user-guide/#writing-tests-dependency-injection and: https://docs.junit.org/current/user-guide/#extensions-test-instance-factories ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2320909559 From cstein at openjdk.org Thu Sep 4 06:03:45 2025 From: cstein at openjdk.org (Christian Stein) Date: Thu, 4 Sep 2025 06:03:45 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v2] In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 14:26:10 GMT, Chen Liang wrote: >> Christian Stein has updated the pull request incrementally with one additional commit since the last revision: >> >> Update copyright year > > test/langtools/tools/javac/lambdaShapes/org/openjdk/tests/javac/FDTest.java line 210: > >> 208: } >> 209: >> 210: class LocalTestInstanceFactory implements TestInstanceFactory { > > Since we have this again, can we just make a no-arg-constructor calling test instance factory and leave it in like /test/lib? We either help Jupiter to select the right constructor or rewrite the test class to have a single one. An alternative implemented in a future Jupiter version could be to ignore `private` constructors. On the other hand, having the need and ability to create "detached" test instances, not managed by Jupiter, is very uncommon. As those detached instances won't take part in Jupiter's test instance lifecycle: https://docs.junit.org/current/user-guide/#writing-tests-test-instance-lifecycle > test/langtools/tools/javac/lambdaShapes/org/openjdk/tests/vm/FDSeparateCompilationTest.java line 25: > >> 23: >> 24: // this test has been disabled because of timeout issues. >> 25: // see JDK-8006746 > > Should we convert this to a full jtreg header and use problem lists or `@ignore` directive instead? I didn't find `JDK-8006746` nor `8006746` in no other file ? that's why I decided to dispose (against the goal of this PR to not clean up...) that comment. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2320918103 PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2320921571 From jlahoda at openjdk.org Thu Sep 4 06:23:42 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Thu, 4 Sep 2025 06:23:42 GMT Subject: RFR: 8366849: Problemlist jdk/jshell/ToolSimpleTest.java as generic-all In-Reply-To: <4II_7xlmLiSTyblPDCPe48ey-PQCt-mm44UQjNmwT5c=.1b3ccca5-f0be-4b06-987d-87591d37532c@github.com> References: <4II_7xlmLiSTyblPDCPe48ey-PQCt-mm44UQjNmwT5c=.1b3ccca5-f0be-4b06-987d-87591d37532c@github.com> Message-ID: On Thu, 4 Sep 2025 02:57:34 GMT, SendaoYan wrote: > Hi all, > > Sorry for the interrupt. > At first we found that jdk/jshell/ToolSimpleTest.java and jdk/jshell/ToolLocalSimpleTest.java fails on windows-x64 several times, but we found the tests also fails on linux-aarch64 and macos-aarch64 intermittently later. So should we problemlist these two tests as generic-all. Marked as reviewed by jlahoda (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27082#pullrequestreview-3183617765 From syan at openjdk.org Thu Sep 4 07:17:47 2025 From: syan at openjdk.org (SendaoYan) Date: Thu, 4 Sep 2025 07:17:47 GMT Subject: RFR: 8366849: Problemlist jdk/jshell/ToolSimpleTest.java as generic-all In-Reply-To: References: <4II_7xlmLiSTyblPDCPe48ey-PQCt-mm44UQjNmwT5c=.1b3ccca5-f0be-4b06-987d-87591d37532c@github.com> Message-ID: On Thu, 4 Sep 2025 03:03:16 GMT, Chen Liang wrote: >> Hi all, >> >> Sorry for the interrupt. >> At first we found that jdk/jshell/ToolSimpleTest.java and jdk/jshell/ToolLocalSimpleTest.java fails on windows-x64 several times, but we found the tests also fails on linux-aarch64 and macos-aarch64 intermittently later. So should we problemlist these two tests as generic-all. > > Sure, we can go ahead with this for now. Thanks for the reviews @liach @lahodaj ------------- PR Comment: https://git.openjdk.org/jdk/pull/27082#issuecomment-3252247859 From syan at openjdk.org Thu Sep 4 07:17:48 2025 From: syan at openjdk.org (SendaoYan) Date: Thu, 4 Sep 2025 07:17:48 GMT Subject: Integrated: 8366849: Problemlist jdk/jshell/ToolSimpleTest.java as generic-all In-Reply-To: <4II_7xlmLiSTyblPDCPe48ey-PQCt-mm44UQjNmwT5c=.1b3ccca5-f0be-4b06-987d-87591d37532c@github.com> References: <4II_7xlmLiSTyblPDCPe48ey-PQCt-mm44UQjNmwT5c=.1b3ccca5-f0be-4b06-987d-87591d37532c@github.com> Message-ID: <_oJ1DQ0Cgc5Om6lpZ4Me8ec8oyzdM-TFCY0Nu5ayrfQ=.599ba3b5-8ef9-4d83-8907-8e4c1c34527f@github.com> On Thu, 4 Sep 2025 02:57:34 GMT, SendaoYan wrote: > Hi all, > > Sorry for the interrupt. > At first we found that jdk/jshell/ToolSimpleTest.java and jdk/jshell/ToolLocalSimpleTest.java fails on windows-x64 several times, but we found the tests also fails on linux-aarch64 and macos-aarch64 intermittently later. So should we problemlist these two tests as generic-all. This pull request has now been integrated. Changeset: 986ecff5 Author: SendaoYan URL: https://git.openjdk.org/jdk/commit/986ecff5f9b16f1b41ff15ad94774d65f3a4631d Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod 8366849: Problemlist jdk/jshell/ToolSimpleTest.java as generic-all Reviewed-by: liach, jlahoda ------------- PR: https://git.openjdk.org/jdk/pull/27082 From vromero at openjdk.org Thu Sep 4 12:32:43 2025 From: vromero at openjdk.org (Vicente Romero) Date: Thu, 4 Sep 2025 12:32:43 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable [v2] In-Reply-To: References: Message-ID: On Thu, 4 Sep 2025 04:09:07 GMT, Chen Liang wrote: > I have created the CSR https://bugs.openjdk.org/browse/JDK-8366848. Please help review. suggestion: in the Specification section of the CSR consider including the related texts from the spec ------------- PR Comment: https://git.openjdk.org/jdk/pull/27015#issuecomment-3253471561 From liach at openjdk.org Thu Sep 4 14:22:46 2025 From: liach at openjdk.org (Chen Liang) Date: Thu, 4 Sep 2025 14:22:46 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable [v2] In-Reply-To: References: Message-ID: On Thu, 4 Sep 2025 12:29:50 GMT, Vicente Romero wrote: >> I have created the CSR https://bugs.openjdk.org/browse/JDK-8366848. Please help review. > >> I have created the CSR https://bugs.openjdk.org/browse/JDK-8366848. Please help review. > > suggestion: in the Specification section of the CSR consider including the related texts from the spec > question regarding the wording in the CSR: with your patch, won't the invocation of static methods belonging to interfaces be rejected even if the interface is not the only upper bound of the type variable? @vicente-romero-oracle I have updated the CSR to include relevant specs and give more examples. Please review again. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27015#issuecomment-3253970641 From liach at openjdk.org Thu Sep 4 14:26:47 2025 From: liach at openjdk.org (Chen Liang) Date: Thu, 4 Sep 2025 14:26:47 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v2] In-Reply-To: References: Message-ID: On Thu, 4 Sep 2025 05:58:55 GMT, Christian Stein wrote: >> test/langtools/tools/javac/lambdaShapes/org/openjdk/tests/javac/FDTest.java line 210: >> >>> 208: } >>> 209: >>> 210: class LocalTestInstanceFactory implements TestInstanceFactory { >> >> Since we have this again, can we just make a no-arg-constructor calling test instance factory and leave it in like /test/lib? > > We either help Jupiter to select the right constructor or rewrite the test class to have a single one. > > An alternative implemented in a future Jupiter version could be to ignore `private` constructors. On the other hand, having the need and ability to create "detached" test instances, not managed by Jupiter, is very uncommon. As those detached instances won't take part in Jupiter's test instance lifecycle: https://docs.junit.org/current/user-guide/#writing-tests-test-instance-lifecycle Well, uncommon as it is claimed to be, it already appeared twice in the set of tests in javac ? >> test/langtools/tools/javac/lambdaShapes/org/openjdk/tests/vm/FDSeparateCompilationTest.java line 25: >> >>> 23: >>> 24: // this test has been disabled because of timeout issues. >>> 25: // see JDK-8006746 >> >> Should we convert this to a full jtreg header and use problem lists or `@ignore` directive instead? > > I didn't find `JDK-8006746` nor `8006746` in no other file ? that's why I decided to dispose (against the goal of this PR to not clean up...) that comment. @vicente-romero-oracle Since you originally handled this test, can you decide what we should do with this? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2322379163 PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2322371905 From cstein at openjdk.org Thu Sep 4 15:42:42 2025 From: cstein at openjdk.org (Christian Stein) Date: Thu, 4 Sep 2025 15:42:42 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v2] In-Reply-To: References: Message-ID: On Thu, 4 Sep 2025 14:23:58 GMT, Chen Liang wrote: >> We either help Jupiter to select the right constructor or rewrite the test class to have a single one. >> >> An alternative implemented in a future Jupiter version could be to ignore `private` constructors. On the other hand, having the need and ability to create "detached" test instances, not managed by Jupiter, is very uncommon. As those detached instances won't take part in Jupiter's test instance lifecycle: https://docs.junit.org/current/user-guide/#writing-tests-test-instance-lifecycle > > Well, uncommon as it is claimed to be, it already appeared twice in the set of tests in javac ? I think, these two classes started out as normal programs; using `main` methods as their entry-points. In such programs, you can and need to create instances to your liking, even of the static program-defining class. Using a framework, shifts the instantion duty to (most of the time) reflection, under the framework's control. That way, `@Before[After]All|Each` and other lifecycle callbacks are realized. Usually, you then never write `new MyObjectTest()` with your test code. That would be "detached" test instances; not par-taking in the test lifecycle. When those two test classes were migrated to use TestNG, they ended up with framework-managed instances (where @Test-annotated methods serve as entry-points) asserting stuff against "detached" instances created by the test logic. Therefore, I suggest to "just" help JUnit here to select the correct constructor - which TestNG does by default. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2322594772 From cstein at openjdk.org Thu Sep 4 16:34:26 2025 From: cstein at openjdk.org (Christian Stein) Date: Thu, 4 Sep 2025 16:34:26 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v3] In-Reply-To: References: Message-ID: <41uyd48pDiO7CqIKx3f9oVaiFPqVr2Vv0ZSZobUUlFE=.6ed9a790-5d7e-4988-a3dc-0d16be7f7d9c@github.com> > Please review this change to use JUnit in tests of `test/langtools/tools/javac`. > > ### Assess Status Quo > A local `make test TEST=test/langtools/tools/javac` run before the conversion yields: > > Test results: passed: 3,938; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 > Framework-based tests: 3043 = 2762 TestNG + 281 JUnit > > > ### Perform Automatic Conversion > - [junit-convert]( > https://github.com/lahodaj/netbeans/tree/openjdk-testng-junit-fixes-and-hacks/java/java.openjdk.project/junit-convert) > > ### Perform Manual Adjustments > > Some of the following adjustments will be integrated into the `junit-convert` tool. > > #### Make argument source factory method `static` > > Method 'public java.lang.Object[][] org.openjdk.tests.javac.FDTest.caseGenerator()' > must be static: local factory methods must be static > unless the PER_CLASS @testinstance lifecycle mode is used; > external factory methods must always be static. > > > #### Make `@AfterAll`-annotated method `static` > > [ERROR] @afterall method 'public void org.openjdk.tests.vm.FDSeparateCompilationTest.cleanupCompilerCache()' > must be static unless the test class > is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. > > > #### Remove `static` modifier from `@Test`-annotated methods > This configuration error should have been detected by JUnit Jupiter and reported via the Discovery > Issues API: https://docs.junit.org/current/user-guide/#running-tests-discovery-issues > > #### Rename test property to `JUnit.dirs` > > package org.junit.jupiter.api does not exist > > > #### Add custom test instance factory > > Class [FDTests] must declare a single constructor > Class [MethodReferenceTestKinds] must declare a single constructor > > > ### Results > Re-run tests via `make test TEST=test/langtools/tools/javac` after the conversion; yielding: > > Test results: passed: 3,939; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 > Framework-based tests: 3043 = 0 TestNG + 3043 JUnit Christian Stein has updated the pull request incrementally with one additional commit since the last revision: Refactor test classes to have a unique constructor That way, Jupiter doesn't need the help of a custom test instance factory ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27046/files - new: https://git.openjdk.org/jdk/pull/27046/files/4fa84ef8..839b9312 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27046&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27046&range=01-02 Stats: 36 lines in 2 files changed: 3 ins; 27 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/27046.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27046/head:pull/27046 PR: https://git.openjdk.org/jdk/pull/27046 From acobbs at openjdk.org Thu Sep 4 20:29:37 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Thu, 4 Sep 2025 20:29:37 GMT Subject: RFR: 8349847: Support configuring individual lint categories as errors [v10] In-Reply-To: References: Message-ID: > This PR enhances the `-Werror` flag to support lint categories just like `-Xlint` does. For example `-Werror:all,-preview` would cause an error if any warning not in the `preview` lint category occurred. > > The existing `-Xlint` flag has a particular behavior when conflicting flags are combined (e.g., `-Xlint:all -Xlint:none -Xlint:foo -Xlint:-foo` is equivalent to `-Xlint:all`). This behavior has been factored out and Javadocumented so that both `-Xlint` and `-Werror` can have this same "parsing" logic. > > See the CSR [JDK-8350044](https://bugs.openjdk.org/browse/JDK-8350044) for details on how the new flag behaves in certain corner cases. Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 18 commits: - Merge branch 'master' into JDK-8349847 to fix conflicts. - Improve documentation per CSR review comments. - Address review comments. - Merge branch 'master' into JDK-8349847 - Merge branch 'master' into JDK-8349847 to fix cross-compiling build problem. - Merge branch 'master' into JDK-8349847 to fix conflicts. - Merge branch 'master' into JDK-8349847 to fix conflicts. - Merge branch 'JDK-8359596' into JDK-8349847 to add "-Xlint:none" fix. - Ensure that "-Xlint:none" still works for the affected warnings. The extra checks for "-Xlint:none" are needed now because of JDK-8352612, which changed the behavior of "-Xlint:none" to no longer imply "-nowarn", which allowed the affected warnings to get away with skipping that check. - Minor naming and Javadoc tweaks. - ... and 8 more: https://git.openjdk.org/jdk/compare/945aaf89...f629438e ------------- Changes: https://git.openjdk.org/jdk/pull/23622/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23622&range=09 Stats: 269 lines in 13 files changed: 192 ins; 35 del; 42 mod Patch: https://git.openjdk.org/jdk/pull/23622.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23622/head:pull/23622 PR: https://git.openjdk.org/jdk/pull/23622 From vromero at openjdk.org Thu Sep 4 20:44:47 2025 From: vromero at openjdk.org (Vicente Romero) Date: Thu, 4 Sep 2025 20:44:47 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v3] In-Reply-To: <41uyd48pDiO7CqIKx3f9oVaiFPqVr2Vv0ZSZobUUlFE=.6ed9a790-5d7e-4988-a3dc-0d16be7f7d9c@github.com> References: <41uyd48pDiO7CqIKx3f9oVaiFPqVr2Vv0ZSZobUUlFE=.6ed9a790-5d7e-4988-a3dc-0d16be7f7d9c@github.com> Message-ID: On Thu, 4 Sep 2025 16:34:26 GMT, Christian Stein wrote: >> Please review this change to use JUnit in tests of `test/langtools/tools/javac`. >> >> ### Assess Status Quo >> A local `make test TEST=test/langtools/tools/javac` run before the conversion yields: >> >> Test results: passed: 3,938; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 >> Framework-based tests: 3043 = 2762 TestNG + 281 JUnit >> >> >> ### Perform Automatic Conversion >> - [junit-convert]( >> https://github.com/lahodaj/netbeans/tree/openjdk-testng-junit-fixes-and-hacks/java/java.openjdk.project/junit-convert) >> >> ### Perform Manual Adjustments >> >> Some of the following adjustments will be integrated into the `junit-convert` tool. >> >> #### Make argument source factory method `static` >> >> Method 'public java.lang.Object[][] org.openjdk.tests.javac.FDTest.caseGenerator()' >> must be static: local factory methods must be static >> unless the PER_CLASS @testinstance lifecycle mode is used; >> external factory methods must always be static. >> >> >> #### Make `@AfterAll`-annotated method `static` >> >> [ERROR] @afterall method 'public void org.openjdk.tests.vm.FDSeparateCompilationTest.cleanupCompilerCache()' >> must be static unless the test class >> is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. >> >> >> #### Remove `static` modifier from `@Test`-annotated methods >> This configuration error should have been detected by JUnit Jupiter and reported via the Discovery >> Issues API: https://docs.junit.org/current/user-guide/#running-tests-discovery-issues >> >> #### Rename test property to `JUnit.dirs` >> >> package org.junit.jupiter.api does not exist >> >> >> #### Add custom test instance factory >> >> Class [FDTests] must declare a single constructor >> Class [MethodReferenceTestKinds] must declare a single constructor >> >> >> ### Results >> Re-run tests via `make test TEST=test/langtools/tools/javac` after the conversion; yielding: >> >> Test results: passed: 3,939; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 >> Framework-based tests: 3043 = 0 TestNG + 3043 JUnit > > Christian Stein has updated the pull request incrementally with one additional commit since the last revision: > > Refactor test classes to have a unique constructor > > That way, Jupiter doesn't need the help of a custom test instance factory test/langtools/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestInnerDefault.java line 81: > 79: > 80: q = MethodReferenceTestInnerDefault.this::xs_B_; > 81: assertEquals("_B_xsB:*", q.m("*")); why changing the order of the arguments? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2323507582 From cstein at openjdk.org Thu Sep 4 20:48:44 2025 From: cstein at openjdk.org (Christian Stein) Date: Thu, 4 Sep 2025 20:48:44 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v3] In-Reply-To: References: <41uyd48pDiO7CqIKx3f9oVaiFPqVr2Vv0ZSZobUUlFE=.6ed9a790-5d7e-4988-a3dc-0d16be7f7d9c@github.com> Message-ID: On Thu, 4 Sep 2025 20:42:08 GMT, Vicente Romero wrote: >> Christian Stein has updated the pull request incrementally with one additional commit since the last revision: >> >> Refactor test classes to have a unique constructor >> >> That way, Jupiter doesn't need the help of a custom test instance factory > > test/langtools/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestInnerDefault.java line 81: > >> 79: >> 80: q = MethodReferenceTestInnerDefault.this::xs_B_; >> 81: assertEquals("_B_xsB:*", q.m("*")); > > why changing the order of the arguments? > The order of the expected and actual arguments to assertion methods such as `assertEquals(...)` needs to be swapped so that the expected result precedes the actual result. https://github.com/junit-team/junit-framework/wiki/Migrating-from-TestNG-to-JUnit-Jupiter ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2323514057 From cstein at openjdk.org Thu Sep 4 21:20:43 2025 From: cstein at openjdk.org (Christian Stein) Date: Thu, 4 Sep 2025 21:20:43 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v3] In-Reply-To: References: Message-ID: On Thu, 4 Sep 2025 21:11:31 GMT, Vicente Romero wrote: >> @vicente-romero-oracle Since you originally handled this test, can you decide what we should do with this? > > I didn't create the test, I'm not even sure that it is relevant anymore. Could probably be removed but not as part of this PR Alright, will restore the two lines. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2323559930 From vromero at openjdk.org Thu Sep 4 21:20:36 2025 From: vromero at openjdk.org (Vicente Romero) Date: Thu, 4 Sep 2025 21:20:36 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v3] In-Reply-To: References: Message-ID: On Thu, 4 Sep 2025 14:22:13 GMT, Chen Liang wrote: >> I didn't find `JDK-8006746` nor `8006746` in no other file ? that's why I decided to dispose (against the goal of this PR to not clean up...) that comment. > > @vicente-romero-oracle Since you originally handled this test, can you decide what we should do with this? I didn't create the test, I'm not even sure that it is relevant anymore. Could probably be removed but not as part of this PR ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2323557747 From vromero at openjdk.org Thu Sep 4 21:59:20 2025 From: vromero at openjdk.org (Vicente Romero) Date: Thu, 4 Sep 2025 21:59:20 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable [v2] In-Reply-To: References: Message-ID: On Thu, 4 Sep 2025 12:29:50 GMT, Vicente Romero wrote: >> I have created the CSR https://bugs.openjdk.org/browse/JDK-8366848. Please help review. > >> I have created the CSR https://bugs.openjdk.org/browse/JDK-8366848. Please help review. > > suggestion: in the Specification section of the CSR consider including the related texts from the spec > question regarding the wording in the CSR: with your patch, won't the invocation of static methods belonging to interfaces be rejected even if the interface is not the only upper bound of the type variable? > @vicente-romero-oracle I have updated the CSR to include relevant specs and give more examples. Please review again. yep what @jddarcy said, I agree with him, the new behavior should affect only new releases ------------- PR Comment: https://git.openjdk.org/jdk/pull/27015#issuecomment-3255862775 From cstein at openjdk.org Thu Sep 4 22:01:57 2025 From: cstein at openjdk.org (Christian Stein) Date: Thu, 4 Sep 2025 22:01:57 GMT Subject: RFR: 8361950: Update to use jtreg 8 [v4] In-Reply-To: References: Message-ID: <6p7ncBylItu9HEeCINmqu_JFoL6zNXwJuSQaZoQ0J2I=.451526e1-d918-4fee-b1a7-e8193da61545@github.com> > Please review the change to update to using jtreg 8. > > The primary change is to the `jib-profiles.js` file, which specifies the version of jtreg to use, for those systems that rely on this file. In addition, the requiredVersion has been updated in the various `TEST.ROOT` files. Christian Stein has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision: - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 - Update to use correct library directories See also: https://openjdk.org/jtreg/faq.html#how-do-i-find-the-path-for-the-testng-or-junit-jar-files - 8361950: Set required version to 8+2 - 8361950: Update to use jtreg 8 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26261/files - new: https://git.openjdk.org/jdk/pull/26261/files/56006240..12b0d0f5 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26261&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26261&range=02-03 Stats: 20940 lines in 1016 files changed: 14715 ins; 2669 del; 3556 mod Patch: https://git.openjdk.org/jdk/pull/26261.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26261/head:pull/26261 PR: https://git.openjdk.org/jdk/pull/26261 From cstein at openjdk.org Thu Sep 4 22:03:14 2025 From: cstein at openjdk.org (Christian Stein) Date: Thu, 4 Sep 2025 22:03:14 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v4] In-Reply-To: References: Message-ID: > Please review this change to use JUnit in tests of `test/langtools/tools/javac`. > > ### Assess Status Quo > A local `make test TEST=test/langtools/tools/javac` run before the conversion yields: > > Test results: passed: 3,938; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 > Framework-based tests: 3043 = 2762 TestNG + 281 JUnit > > > ### Perform Automatic Conversion > - [junit-convert]( > https://github.com/lahodaj/netbeans/tree/openjdk-testng-junit-fixes-and-hacks/java/java.openjdk.project/junit-convert) > > ### Perform Manual Adjustments > > Some of the following adjustments will be integrated into the `junit-convert` tool. > > #### Make argument source factory method `static` > > Method 'public java.lang.Object[][] org.openjdk.tests.javac.FDTest.caseGenerator()' > must be static: local factory methods must be static > unless the PER_CLASS @testinstance lifecycle mode is used; > external factory methods must always be static. > > > #### Make `@AfterAll`-annotated method `static` > > [ERROR] @afterall method 'public void org.openjdk.tests.vm.FDSeparateCompilationTest.cleanupCompilerCache()' > must be static unless the test class > is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. > > > #### Remove `static` modifier from `@Test`-annotated methods > This configuration error should have been detected by JUnit Jupiter and reported via the Discovery > Issues API: https://docs.junit.org/current/user-guide/#running-tests-discovery-issues > > #### Rename test property to `JUnit.dirs` > > package org.junit.jupiter.api does not exist > > > #### Add custom test instance factory > > Class [FDTests] must declare a single constructor > Class [MethodReferenceTestKinds] must declare a single constructor > > > ### Results > Re-run tests via `make test TEST=test/langtools/tools/javac` after the conversion; yielding: > > Test results: passed: 3,939; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 > Framework-based tests: 3043 = 0 TestNG + 3043 JUnit Christian Stein has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: - Restore comment - it is unrelated to the JUnit conversion - Update to use correct library directories See also: https://openjdk.org/jtreg/faq.html#how-do-i-find-the-path-for-the-testng-or-junit-jar-files - 8361950: Set required version to 8+2 - 8361950: Update to use jtreg 8 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27046/files - new: https://git.openjdk.org/jdk/pull/27046/files/839b9312..431eb75a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27046&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27046&range=02-03 Stats: 44 lines in 12 files changed: 11 ins; 19 del; 14 mod Patch: https://git.openjdk.org/jdk/pull/27046.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27046/head:pull/27046 PR: https://git.openjdk.org/jdk/pull/27046 From cstein at openjdk.org Thu Sep 4 22:03:16 2025 From: cstein at openjdk.org (Christian Stein) Date: Thu, 4 Sep 2025 22:03:16 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v2] In-Reply-To: References: Message-ID: <0vHEHTVIA7vl_zf407kREtL7n7R7piqpWTUQPRaGRXc=.4e13e317-b871-4809-a9c0-233cfeacb5bd@github.com> On Wed, 3 Sep 2025 13:52:33 GMT, Christian Stein wrote: >> Please review this change to use JUnit in tests of `test/langtools/tools/javac`. >> >> ### Assess Status Quo >> A local `make test TEST=test/langtools/tools/javac` run before the conversion yields: >> >> Test results: passed: 3,938; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 >> Framework-based tests: 3043 = 2762 TestNG + 281 JUnit >> >> >> ### Perform Automatic Conversion >> - [junit-convert]( >> https://github.com/lahodaj/netbeans/tree/openjdk-testng-junit-fixes-and-hacks/java/java.openjdk.project/junit-convert) >> >> ### Perform Manual Adjustments >> >> Some of the following adjustments will be integrated into the `junit-convert` tool. >> >> #### Make argument source factory method `static` >> >> Method 'public java.lang.Object[][] org.openjdk.tests.javac.FDTest.caseGenerator()' >> must be static: local factory methods must be static >> unless the PER_CLASS @testinstance lifecycle mode is used; >> external factory methods must always be static. >> >> >> #### Make `@AfterAll`-annotated method `static` >> >> [ERROR] @afterall method 'public void org.openjdk.tests.vm.FDSeparateCompilationTest.cleanupCompilerCache()' >> must be static unless the test class >> is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. >> >> >> #### Remove `static` modifier from `@Test`-annotated methods >> This configuration error should have been detected by JUnit Jupiter and reported via the Discovery >> Issues API: https://docs.junit.org/current/user-guide/#running-tests-discovery-issues >> >> #### Rename test property to `JUnit.dirs` >> >> package org.junit.jupiter.api does not exist >> >> >> #### Add custom test instance factory >> >> Class [FDTests] must declare a single constructor >> Class [MethodReferenceTestKinds] must declare a single constructor >> >> >> ### Results >> Re-run tests via `make test TEST=test/langtools/tools/javac` after the conversion; yielding: >> >> Test results: passed: 3,939; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 >> Framework-based tests: 3043 = 0 TestNG + 3043 JUnit > > Christian Stein has updated the pull request incrementally with one additional commit since the last revision: > > Update copyright year test/langtools/tools/javac/lambdaShapes/org/openjdk/tests/vm/FDSeparateCompilationTest.java line 23: > 21: * questions. > 22: */ > 23: Suggestion: */ // this test has been disabled because of timeout issues. // see JDK-8006746 Restore comment lines as their removal is not the task of this change. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2323585887 From cstein at openjdk.org Thu Sep 4 22:03:17 2025 From: cstein at openjdk.org (Christian Stein) Date: Thu, 4 Sep 2025 22:03:17 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v2] In-Reply-To: <0vHEHTVIA7vl_zf407kREtL7n7R7piqpWTUQPRaGRXc=.4e13e317-b871-4809-a9c0-233cfeacb5bd@github.com> References: <0vHEHTVIA7vl_zf407kREtL7n7R7piqpWTUQPRaGRXc=.4e13e317-b871-4809-a9c0-233cfeacb5bd@github.com> Message-ID: On Thu, 4 Sep 2025 21:25:48 GMT, Christian Stein wrote: >> Christian Stein has updated the pull request incrementally with one additional commit since the last revision: >> >> Update copyright year > > test/langtools/tools/javac/lambdaShapes/org/openjdk/tests/vm/FDSeparateCompilationTest.java line 23: > >> 21: * questions. >> 22: */ >> 23: > > Suggestion: > > */ > > // this test has been disabled because of timeout issues. > // see JDK-8006746 > > > > Restore comment lines as their removal is not the task of this change. image ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2323589286 From acobbs at openjdk.org Thu Sep 4 22:17:35 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Thu, 4 Sep 2025 22:17:35 GMT Subject: RFR: 8349847: Support configuring individual lint categories as errors [v11] In-Reply-To: References: Message-ID: > This PR enhances the `-Werror` flag to support lint categories just like `-Xlint` does. For example `-Werror:all,-preview` would cause an error if any warning not in the `preview` lint category occurred. > > The existing `-Xlint` flag has a particular behavior when conflicting flags are combined (e.g., `-Xlint:all -Xlint:none -Xlint:foo -Xlint:-foo` is equivalent to `-Xlint:all`). This behavior has been factored out and Javadocumented so that both `-Xlint` and `-Werror` can have this same "parsing" logic. > > See the CSR [JDK-8350044](https://bugs.openjdk.org/browse/JDK-8350044) for details on how the new flag behaves in certain corner cases. Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision: Add trailing "--help-lint" blurb to clarify how category aliases are handled. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23622/files - new: https://git.openjdk.org/jdk/pull/23622/files/f629438e..002c78ff Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23622&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23622&range=09-10 Stats: 5 lines in 2 files changed: 5 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/23622.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23622/head:pull/23622 PR: https://git.openjdk.org/jdk/pull/23622 From vromero at openjdk.org Thu Sep 4 22:28:34 2025 From: vromero at openjdk.org (Vicente Romero) Date: Thu, 4 Sep 2025 22:28:34 GMT Subject: RFR: 8351260: java.lang.AssertionError: Unexpected type tree: (ERROR) = (ERROR) In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 05:48:51 GMT, Jan Lahoda wrote: > Consider a very broken declaration like this: > > void test(List<@AlphaChars <@StringLength(int value = 5)String> s){ > > > after seeing `@AlphaChars`, javac will try to parse `<@StringLength(int value = 5)String>` as a type, and assign the annotation to the type. But, the text does not parse as a type well (partly due to the `int value = 5`), and the parsing will proceed in an expression mode. Then a search for target type is performed to attach the annotation, and that fails, as the expression tree is not expected to be part of the type. > > The main proposal here is to wrap the badly parsed type in an `Erroneous` tree. The overall error recovery then seems to handle the situation well. > > The situation produces quite a few error reports, but it is not clear if this situation (esp. the nested `int value = 5`) is common enough to stretch the parsing error recovery capabilities to accommodate this code. lgtm ------------- Marked as reviewed by vromero (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27065#pullrequestreview-3187407459 From cstein at openjdk.org Thu Sep 4 22:28:43 2025 From: cstein at openjdk.org (Christian Stein) Date: Thu, 4 Sep 2025 22:28:43 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v2] In-Reply-To: References: Message-ID: <6WKM7lzN9YChvsYQDddGNRaGoCUpSnCzxfYYgA767HM=.0e9a567b-e1a6-494f-b239-11072d9f6091@github.com> On Thu, 4 Sep 2025 15:39:58 GMT, Christian Stein wrote: >> Well, uncommon as it is claimed to be, it already appeared twice in the set of tests in javac ? > > I think, these two classes started out as normal programs; using `main` methods as their entry-points. In such programs, you can and need to create instances to your liking, even of the static program-defining class. > Using a framework, shifts the instantion duty to (most of the time) reflection, under the framework's control. That way, `@Before[After]All|Each` and other lifecycle callbacks are realized. Usually, you then never write `new MyObjectTest()` with your test code. That would be "detached" test instances; not par-taking in the test lifecycle. > > When those two test classes were migrated to use TestNG, they ended up with framework-managed instances (where @Test-annotated methods serve as entry-points) asserting stuff against "detached" instances created by the test logic. > > Therefore, I suggest to "just" help JUnit here to select the correct constructor - which TestNG does by default. Turns out that we can delete the extra constructor from the test classes and leave only a sole one to use for JUnit and local test needs. See https://github.com/openjdk/jdk/pull/27046/commits/839b93129bb3318ac659be031b3e296eeaf0ead2 for details. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2323647315 From liach at openjdk.org Thu Sep 4 22:55:21 2025 From: liach at openjdk.org (Chen Liang) Date: Thu, 4 Sep 2025 22:55:21 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v4] In-Reply-To: References: Message-ID: On Thu, 4 Sep 2025 22:03:14 GMT, Christian Stein wrote: >> Please review this change to use JUnit in tests of `test/langtools/tools/javac`. >> >> ### Assess Status Quo >> A local `make test TEST=test/langtools/tools/javac` run before the conversion yields: >> >> Test results: passed: 3,938; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 >> Framework-based tests: 3043 = 2762 TestNG + 281 JUnit >> >> >> ### Perform Automatic Conversion >> - [junit-convert]( >> https://github.com/lahodaj/netbeans/tree/openjdk-testng-junit-fixes-and-hacks/java/java.openjdk.project/junit-convert) >> >> ### Perform Manual Adjustments >> >> Some of the following adjustments will be integrated into the `junit-convert` tool. >> >> #### Make argument source factory method `static` >> >> Method 'public java.lang.Object[][] org.openjdk.tests.javac.FDTest.caseGenerator()' >> must be static: local factory methods must be static >> unless the PER_CLASS @testinstance lifecycle mode is used; >> external factory methods must always be static. >> >> >> #### Make `@AfterAll`-annotated method `static` >> >> [ERROR] @afterall method 'public void org.openjdk.tests.vm.FDSeparateCompilationTest.cleanupCompilerCache()' >> must be static unless the test class >> is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. >> >> >> #### Remove `static` modifier from `@Test`-annotated methods >> This configuration error should have been detected by JUnit Jupiter and reported via the Discovery >> Issues API: https://docs.junit.org/current/user-guide/#running-tests-discovery-issues >> >> #### Rename test property to `JUnit.dirs` >> >> package org.junit.jupiter.api does not exist >> >> >> #### Add custom test instance factory >> >> Class [FDTests] must declare a single constructor >> Class [MethodReferenceTestKinds] must declare a single constructor >> >> >> ### Results >> Re-run tests via `make test TEST=test/langtools/tools/javac` after the conversion; yielding: >> >> Test results: passed: 3,939; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 >> Framework-based tests: 3043 = 0 TestNG + 3043 JUnit > > Christian Stein has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: > > - Restore comment - it is unrelated to the JUnit conversion > - Update to use correct library directories > > See also: https://openjdk.org/jtreg/faq.html#how-do-i-find-the-path-for-the-testng-or-junit-jar-files > - 8361950: Set required version to 8+2 > - 8361950: Update to use jtreg 8 The actual changes look good - unfortunately github does not show the correct ... diff. ------------- Marked as reviewed by liach (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27046#pullrequestreview-3187465466 From vromero at openjdk.org Fri Sep 5 02:06:21 2025 From: vromero at openjdk.org (Vicente Romero) Date: Fri, 5 Sep 2025 02:06:21 GMT Subject: RFR: 8359383: Incorrect starting positions for implicitly typed variables [v2] In-Reply-To: References: Message-ID: On Mon, 11 Aug 2025 18:17:35 GMT, Archie Cobbs wrote: >> This fixes starting position bugs relating to implicitly typed variables; see the linked issue for details. >> >> This also makes it possible to recover the declaration type (explicit, implicit, or `var`) from a `JCVariableDecl` and, in the case of `var` declarations, the starting position of the `var`; previously this wasn't possible. >> >> Finally, as a minor drive-by improvement, we can now pretty print `var` as `var` instead of `/*missing*/`. > > Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - Add back regression test case that got removed somehow. > - Merge branch 'master' into JDK-8359383 > - Fix various starting position bugs relating to implicitly typed variables. lgtm ------------- Marked as reviewed by vromero (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25786#pullrequestreview-3187785504 From vromero at openjdk.org Fri Sep 5 02:14:19 2025 From: vromero at openjdk.org (Vicente Romero) Date: Fri, 5 Sep 2025 02:14:19 GMT Subject: RFR: 8365689: Elements.getFileObjectOf fails with a NullPointerException when an erroneous Element is passed in In-Reply-To: References: Message-ID: <3wsrIbAFWwzeWekgHQMsep85Az1OzNsUlu3fIn3B5UQ=.769f1d53-4736-419f-9fb2-6ac7257bda01@github.com> On Tue, 19 Aug 2025 07:35:05 GMT, Jan Lahoda wrote: > If an erroneous/unresolvable `Element` is passed to `Elements.getFileObjectOf`, it fails with an NPE like: > > Caused by: java.lang.NullPointerException: Cannot read field "classfile" because the return value of "com.sun.tools.javac.code.Symbol.enclClass()" is null > at jdk.compiler/com.sun.tools.javac.model.JavacElements.getFileObjectOf(JavacElements.java:803) > at TestFileObjectOf$PrintFiles.handleDeclaration(TestFileObjectOf.java:329) > at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2718) > > > The reason is the `Symbol.enclClass()` will return `null` for the erroneous `Element`. The proposed solution herein is to return `null` for erroneous/unresolvable `Element`s. lgtm ------------- Marked as reviewed by vromero (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26836#pullrequestreview-3187794108 From acobbs at openjdk.org Fri Sep 5 03:22:11 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Fri, 5 Sep 2025 03:22:11 GMT Subject: RFR: 8359383: Incorrect starting positions for implicitly typed variables [v2] In-Reply-To: References: Message-ID: On Mon, 11 Aug 2025 18:17:35 GMT, Archie Cobbs wrote: >> This fixes starting position bugs relating to implicitly typed variables; see the linked issue for details. >> >> This also makes it possible to recover the declaration type (explicit, implicit, or `var`) from a `JCVariableDecl` and, in the case of `var` declarations, the starting position of the `var`; previously this wasn't possible. >> >> Finally, as a minor drive-by improvement, we can now pretty print `var` as `var` instead of `/*missing*/`. > > Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - Add back regression test case that got removed somehow. > - Merge branch 'master' into JDK-8359383 > - Fix various starting position bugs relating to implicitly typed variables. Thanks for the review! ------------- PR Comment: https://git.openjdk.org/jdk/pull/25786#issuecomment-3256945278 From jlahoda at openjdk.org Fri Sep 5 10:03:33 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Fri, 5 Sep 2025 10:03:33 GMT Subject: RFR: 8365776: Convert JShell tests to use JUnit instead of TestNG Message-ID: This is a conversion of JShell tests from TestNG to JUnit 5. To make the changes more transparent, there are 4 commit in this PR: - https://github.com/openjdk/jdk/pull/26841/commits/c6b5d8441ad532551e626b3542431aa3f479ffc0: this one changes a name of a custom interface representing test cases, so that subsequent commits can use a simple name for `org.junit.jupiter.api.Test` (otherwise `Test` would resolve to the custom interface is subclasses of `UITesting`, and FQN would need to be used to refer to the annotation). - https://github.com/openjdk/jdk/pull/26841/commits/2afee7d258f646f822d0b1bc3465d5595058e3df: the bulk of changes, done automatically by: The bulk of the changes is done automatically, using this tool/script: https://github.com/lahodaj/netbeans/tree/19515c3e2dbc07d977ca227d933197f856121ae5/java/java.openjdk.project/junit-convert - https://github.com/openjdk/jdk/pull/26841/commits/8ca03af1b4d06e479cdfe7cc66186222feeaaa76: manual adjustments for things the tool does not handle (at least currently): - one indent problem - two uses of injected `java.lang.reflect.Method`, which needs to be replaced with `TestInfo` - a different way to skip a test (normally, the tool detects and converts uses of `SkipException`, but that exception was not used on this place). - https://github.com/openjdk/jdk/pull/26841/commits/639da0171a593031dae6a73830bb1665b7097e73: scripted update to copyright headers, done using: bash ./make/scripts/update_copyright_year.sh -b `git merge-base master jshell-upgrade-testng-to-junit` As part of validation of this change, this script: [CompareTestResults.java](https://github.com/user-attachments/files/22169483/CompareTestResults.java) was used to compare the results in `junit.txt` and `testng.txt` in test results before and after the change, and it didn't find a difference in test counts. ------------- Commit messages: - Update copyright years. - Manual adjustments. - Automatic changes. - Renaming UITesting.Test to UITesting.UITest to avoid clashes with the JUnit @Test annotation. Changes: https://git.openjdk.org/jdk/pull/26841/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26841&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8365776 Stats: 1771 lines in 123 files changed: 740 ins; 216 del; 815 mod Patch: https://git.openjdk.org/jdk/pull/26841.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26841/head:pull/26841 PR: https://git.openjdk.org/jdk/pull/26841 From duke at openjdk.org Fri Sep 5 10:03:33 2025 From: duke at openjdk.org (David Beaumont) Date: Fri, 5 Sep 2025 10:03:33 GMT Subject: RFR: 8365776: Convert JShell tests to use JUnit instead of TestNG In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 10:26:14 GMT, Jan Lahoda wrote: > This is a conversion of JShell tests from TestNG to JUnit 5. > > To make the changes more transparent, there are 4 commit in this PR: > - https://github.com/openjdk/jdk/pull/26841/commits/c6b5d8441ad532551e626b3542431aa3f479ffc0: this one changes a name of a custom interface representing test cases, so that subsequent commits can use a simple name for `org.junit.jupiter.api.Test` (otherwise `Test` would resolve to the custom interface is subclasses of `UITesting`, and FQN would need to be used to refer to the annotation). > - https://github.com/openjdk/jdk/pull/26841/commits/2afee7d258f646f822d0b1bc3465d5595058e3df: the bulk of changes, done automatically by: > The bulk of the changes is done automatically, using this tool/script: > https://github.com/lahodaj/netbeans/tree/19515c3e2dbc07d977ca227d933197f856121ae5/java/java.openjdk.project/junit-convert > - https://github.com/openjdk/jdk/pull/26841/commits/8ca03af1b4d06e479cdfe7cc66186222feeaaa76: manual adjustments for things the tool does not handle (at least currently): > - one indent problem > - two uses of injected `java.lang.reflect.Method`, which needs to be replaced with `TestInfo` > - a different way to skip a test (normally, the tool detects and converts uses of `SkipException`, but that exception was not used on this place). > - https://github.com/openjdk/jdk/pull/26841/commits/639da0171a593031dae6a73830bb1665b7097e73: scripted update to copyright headers, done using: > > bash ./make/scripts/update_copyright_year.sh -b `git merge-base master jshell-upgrade-testng-to-junit` > > > As part of validation of this change, this script: > [CompareTestResults.java](https://github.com/user-attachments/files/22169483/CompareTestResults.java) > was used to compare the results in `junit.txt` and `testng.txt` in test results before and after the change, and it didn't find a difference in test counts. Just leaving some thoughts in passing - not a review in any meaningful sense. No signs of any issues so far either (about 50 files examined). test/langtools/jdk/jshell/AnalyzeSnippetTest.java line 87: > 85: ImportSnippet sn = (ImportSnippet) assertSnippet("import java.util.List;", > 86: SubKind.SINGLE_TYPE_IMPORT_SUBKIND); > 87: assertEquals("List", sn.name()); Nice that this is handling the order of expected/actual properly. test/langtools/jdk/jshell/ClassesTest.java line 70: > 68: assertTypeDeclSnippet(c1, "A", RECOVERABLE_NOT_DEFINED, CLASS_SUBKIND, 1, 0); > 69: TypeDeclSnippet c2 = classKey(assertEval("@interface A { Class f() default B.class; }", > 70: ste(MAIN_SNIPPET, RECOVERABLE_NOT_DEFINED, RECOVERABLE_NOT_DEFINED, false, null), Might be worth making sure that any helper asserts are also refactored to be conceptually "(, )" just to be consistent. Obviously asserts shared with other tests not being converted (yet) could wait until everything is done, but ideally it would happen eventually. test/langtools/jdk/jshell/CommandCompletionTest.java line 94: > 92: } > 93: > 94: public void assertCompletion(String code, boolean isSmart, String... expected) { Of course this is where , hits the snag of varargs being better for a list/set of expected things. It's one of the reasons I personally prefer (, ), but this code needs consistency more than personal preference :) test/langtools/jdk/jshell/CompletionSuggestionTest.java line 759: > 757: } > 758: > 759: @Test(enabled = false) //TODO 8171829 Sadly the TODO got lost here. Maybe worth looking through diffs with grep as a 2nd pass for inline comments like this to see what was removed. test/langtools/jdk/jshell/ComputeFQNsTest.java line 132: > 130: QualifiedNames candidates = getAnalysis().listQualifiedNames(code, code.length()); > 131: > 132: assertEquals(Arrays.asList(), candidates.getNames(), "Input: " + code + ", candidates=" + candidates.getNames()); This is where my itch for test readability wants to see `List.of()` etc, I know it's not much, but every little helps. Of course, in Truth this is even nicer as: assertThat(candidates.getNames()).withMessage("Input: " + code).isEmpty(); ------------- PR Review: https://git.openjdk.org/jdk/pull/26841#pullrequestreview-3132392319 PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2285296296 PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2285305488 PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2285310088 PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2285313918 PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2285321182 From jlahoda at openjdk.org Fri Sep 5 10:03:33 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Fri, 5 Sep 2025 10:03:33 GMT Subject: RFR: 8365776: Convert JShell tests to use JUnit instead of TestNG In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 10:26:14 GMT, Jan Lahoda wrote: > This is a conversion of JShell tests from TestNG to JUnit 5. > > To make the changes more transparent, there are 4 commit in this PR: > - https://github.com/openjdk/jdk/pull/26841/commits/c6b5d8441ad532551e626b3542431aa3f479ffc0: this one changes a name of a custom interface representing test cases, so that subsequent commits can use a simple name for `org.junit.jupiter.api.Test` (otherwise `Test` would resolve to the custom interface is subclasses of `UITesting`, and FQN would need to be used to refer to the annotation). > - https://github.com/openjdk/jdk/pull/26841/commits/2afee7d258f646f822d0b1bc3465d5595058e3df: the bulk of changes, done automatically by: > The bulk of the changes is done automatically, using this tool/script: > https://github.com/lahodaj/netbeans/tree/19515c3e2dbc07d977ca227d933197f856121ae5/java/java.openjdk.project/junit-convert > - https://github.com/openjdk/jdk/pull/26841/commits/8ca03af1b4d06e479cdfe7cc66186222feeaaa76: manual adjustments for things the tool does not handle (at least currently): > - one indent problem > - two uses of injected `java.lang.reflect.Method`, which needs to be replaced with `TestInfo` > - a different way to skip a test (normally, the tool detects and converts uses of `SkipException`, but that exception was not used on this place). > - https://github.com/openjdk/jdk/pull/26841/commits/639da0171a593031dae6a73830bb1665b7097e73: scripted update to copyright headers, done using: > > bash ./make/scripts/update_copyright_year.sh -b `git merge-base master jshell-upgrade-testng-to-junit` > > > As part of validation of this change, this script: > [CompareTestResults.java](https://github.com/user-attachments/files/22169483/CompareTestResults.java) > was used to compare the results in `junit.txt` and `testng.txt` in test results before and after the change, and it didn't find a difference in test counts. I've updated the script and the patches here: - the comments around the `@Test` annotation should now be preserved. (I tried to move the TODO comments to the `@Disabled` annotation, but it would probably take too much time.) - the script no longer makes the data providers `static`, and adds the per-class lifecycle automatically if it detects the need. Or at least tries to. To keep things sensible, I force pushed here. The original commits are available under branch `jshell-upgrade-testng-to-junit.bak1`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26841#issuecomment-3201142106 From jlahoda at openjdk.org Fri Sep 5 10:03:33 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Fri, 5 Sep 2025 10:03:33 GMT Subject: RFR: 8365776: Convert JShell tests to use JUnit instead of TestNG In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 13:39:14 GMT, David Beaumont wrote: >> This is a conversion of JShell tests from TestNG to JUnit 5. >> >> To make the changes more transparent, there are 4 commit in this PR: >> - https://github.com/openjdk/jdk/pull/26841/commits/c6b5d8441ad532551e626b3542431aa3f479ffc0: this one changes a name of a custom interface representing test cases, so that subsequent commits can use a simple name for `org.junit.jupiter.api.Test` (otherwise `Test` would resolve to the custom interface is subclasses of `UITesting`, and FQN would need to be used to refer to the annotation). >> - https://github.com/openjdk/jdk/pull/26841/commits/2afee7d258f646f822d0b1bc3465d5595058e3df: the bulk of changes, done automatically by: >> The bulk of the changes is done automatically, using this tool/script: >> https://github.com/lahodaj/netbeans/tree/19515c3e2dbc07d977ca227d933197f856121ae5/java/java.openjdk.project/junit-convert >> - https://github.com/openjdk/jdk/pull/26841/commits/8ca03af1b4d06e479cdfe7cc66186222feeaaa76: manual adjustments for things the tool does not handle (at least currently): >> - one indent problem >> - two uses of injected `java.lang.reflect.Method`, which needs to be replaced with `TestInfo` >> - a different way to skip a test (normally, the tool detects and converts uses of `SkipException`, but that exception was not used on this place). >> - https://github.com/openjdk/jdk/pull/26841/commits/639da0171a593031dae6a73830bb1665b7097e73: scripted update to copyright headers, done using: >> >> bash ./make/scripts/update_copyright_year.sh -b `git merge-base master jshell-upgrade-testng-to-junit` >> >> >> As part of validation of this change, this script: >> [CompareTestResults.java](https://github.com/user-attachments/files/22169483/CompareTestResults.java) >> was used to compare the results in `junit.txt` and `testng.txt` in test results before and after the change, and it didn't find a difference in test counts. > > test/langtools/jdk/jshell/CommandCompletionTest.java line 94: > >> 92: } >> 93: >> 94: public void assertCompletion(String code, boolean isSmart, String... expected) { > > Of course this is where , hits the snag of varargs being better for a list/set of expected things. It's one of the reasons I personally prefer (, ), but this code needs consistency more than personal preference :) Here it is input and then expected values, not really actual value and the expected value. So the inconsistency is not that big. I am afraid that if we move expected to front here, there will be a lot of readability lost. For me, at least. Currently (with TestNG), the code is consistent and readable. If, in order to convert to JUnit, I would have to sacrifice readability to keep consistency, then I guess I would start to question if the conversion has a point. I.e. the conversion would need to bring a benefit big enough to compensate for the loss of readability here. > test/langtools/jdk/jshell/ComputeFQNsTest.java line 132: > >> 130: QualifiedNames candidates = getAnalysis().listQualifiedNames(code, code.length()); >> 131: >> 132: assertEquals(Arrays.asList(), candidates.getNames(), "Input: " + code + ", candidates=" + candidates.getNames()); > > This is where my itch for test readability wants to see `List.of()` etc, I know it's not much, but every little helps. > Of course, in Truth this is even nicer as: > > assertThat(candidates.getNames()).withMessage("Input: " + code).isEmpty(); I think I am relatively opposed to mix different types of changes, esp. if there are biggish. Also, automatic `Arrays.asList()` -> `List.of()` is somewhat troublesome, as the semantics is different. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2285600560 PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2285569963 From cstein at openjdk.org Fri Sep 5 10:03:34 2025 From: cstein at openjdk.org (Christian Stein) Date: Fri, 5 Sep 2025 10:03:34 GMT Subject: RFR: 8365776: Convert JShell tests to use JUnit instead of TestNG In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 15:19:25 GMT, Jan Lahoda wrote: >> test/langtools/jdk/jshell/CommandCompletionTest.java line 94: >> >>> 92: } >>> 93: >>> 94: public void assertCompletion(String code, boolean isSmart, String... expected) { >> >> Of course this is where , hits the snag of varargs being better for a list/set of expected things. It's one of the reasons I personally prefer (, ), but this code needs consistency more than personal preference :) > > Here it is input and then expected values, not really actual value and the expected value. So the inconsistency is not that big. > > I am afraid that if we move expected to front here, there will be a lot of readability lost. For me, at least. Currently (with TestNG), the code is consistent and readable. If, in order to convert to JUnit, I would have to sacrifice readability to keep consistency, then I guess I would start to question if the conversion has a point. I.e. the conversion would need to bring a benefit big enough to compensate for the loss of readability here. In conversions like this we should not touch test-local code unrelated to the framework migration. Just keep those helpers "as-is" in order to keep the touched surface of PR small(er) and on-topic. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2285637847 From duke at openjdk.org Fri Sep 5 10:03:34 2025 From: duke at openjdk.org (David Beaumont) Date: Fri, 5 Sep 2025 10:03:34 GMT Subject: RFR: 8365776: Convert JShell tests to use JUnit instead of TestNG In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 15:32:55 GMT, Christian Stein wrote: >> Here it is input and then expected values, not really actual value and the expected value. So the inconsistency is not that big. >> >> I am afraid that if we move expected to front here, there will be a lot of readability lost. For me, at least. Currently (with TestNG), the code is consistent and readable. If, in order to convert to JUnit, I would have to sacrifice readability to keep consistency, then I guess I would start to question if the conversion has a point. I.e. the conversion would need to bring a benefit big enough to compensate for the loss of readability here. > > In conversions like this we should not touch test-local code unrelated to the framework migration. Just keep those helpers "as-is" in order to keep the touched surface of PR small(er) and on-topic. I think people are thinking I was suggesting a change in this PR, I was not. I was simply pointing out the consistency issue which now arises. If I had to say what I'd like to see in tests, it would be to switch to using the Truth API everywhere (which is, realistically, not going to happen) because it is both more readable in the code *and* gives much much better error messages (and it's compatible with JUnit). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2288549459 From duke at openjdk.org Fri Sep 5 10:03:34 2025 From: duke at openjdk.org (Francesco Andreuzzi) Date: Fri, 5 Sep 2025 10:03:34 GMT Subject: RFR: 8365776: Convert JShell tests to use JUnit instead of TestNG In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 10:26:14 GMT, Jan Lahoda wrote: > This is a conversion of JShell tests from TestNG to JUnit 5. > > To make the changes more transparent, there are 4 commit in this PR: > - https://github.com/openjdk/jdk/pull/26841/commits/c6b5d8441ad532551e626b3542431aa3f479ffc0: this one changes a name of a custom interface representing test cases, so that subsequent commits can use a simple name for `org.junit.jupiter.api.Test` (otherwise `Test` would resolve to the custom interface is subclasses of `UITesting`, and FQN would need to be used to refer to the annotation). > - https://github.com/openjdk/jdk/pull/26841/commits/2afee7d258f646f822d0b1bc3465d5595058e3df: the bulk of changes, done automatically by: > The bulk of the changes is done automatically, using this tool/script: > https://github.com/lahodaj/netbeans/tree/19515c3e2dbc07d977ca227d933197f856121ae5/java/java.openjdk.project/junit-convert > - https://github.com/openjdk/jdk/pull/26841/commits/8ca03af1b4d06e479cdfe7cc66186222feeaaa76: manual adjustments for things the tool does not handle (at least currently): > - one indent problem > - two uses of injected `java.lang.reflect.Method`, which needs to be replaced with `TestInfo` > - a different way to skip a test (normally, the tool detects and converts uses of `SkipException`, but that exception was not used on this place). > - https://github.com/openjdk/jdk/pull/26841/commits/639da0171a593031dae6a73830bb1665b7097e73: scripted update to copyright headers, done using: > > bash ./make/scripts/update_copyright_year.sh -b `git merge-base master jshell-upgrade-testng-to-junit` > > > As part of validation of this change, this script: > [CompareTestResults.java](https://github.com/user-attachments/files/22169483/CompareTestResults.java) > was used to compare the results in `junit.txt` and `testng.txt` in test results before and after the change, and it didn't find a difference in test counts. test/langtools/jdk/jshell/ComputeFQNsTest.java line 80: > 78: } > 79: > 80: @Test(enabled = false) //TODO 8161165 Should the `// TODO` comment stay? test/langtools/jdk/jshell/EditorTestBase.java line 266: > 264: } > 265: > 266: @Test(enabled = false) // TODO JDK-8191875 Should the `// TODO` comment stay? test/langtools/jdk/jshell/ErrorTranslationTest.java line 76: > 74: } > 75: > 76: @Test(enabled = false) // TODO 8132147 Should the `// TODO` comment stay? test/langtools/jdk/jshell/ExceptionsTest.java line 295: > 293: } > 294: > 295: @Test(enabled = false) // TODO 8129427 Should the `// TODO` comment stay? test/langtools/jdk/jshell/ExternalEditorTest.java line 253: > 251: } > 252: > 253: @Test(enabled = false) // TODO 8159229 Should the `// TODO` comment stay? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2284885174 PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2284888622 PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2284889638 PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2284890329 PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2284891071 From duke at openjdk.org Fri Sep 5 10:03:34 2025 From: duke at openjdk.org (David Beaumont) Date: Fri, 5 Sep 2025 10:03:34 GMT Subject: RFR: 8365776: Convert JShell tests to use JUnit instead of TestNG In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 15:07:53 GMT, Jan Lahoda wrote: >> test/langtools/jdk/jshell/ComputeFQNsTest.java line 132: >> >>> 130: QualifiedNames candidates = getAnalysis().listQualifiedNames(code, code.length()); >>> 131: >>> 132: assertEquals(Arrays.asList(), candidates.getNames(), "Input: " + code + ", candidates=" + candidates.getNames()); >> >> This is where my itch for test readability wants to see `List.of()` etc, I know it's not much, but every little helps. >> Of course, in Truth this is even nicer as: >> >> assertThat(candidates.getNames()).withMessage("Input: " + code).isEmpty(); > > I think I am relatively opposed to mix different types of changes, esp. if there are biggish. Also, automatic `Arrays.asList()` -> `List.of()` is somewhat troublesome, as the semantics is different. I was in no way suggesting that this sort of thing be changed in this PR, simply making a comment. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2288539425 From acobbs at openjdk.org Fri Sep 5 14:33:22 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Fri, 5 Sep 2025 14:33:22 GMT Subject: Integrated: 8359383: Incorrect starting positions for implicitly typed variables In-Reply-To: References: Message-ID: On Thu, 12 Jun 2025 19:07:38 GMT, Archie Cobbs wrote: > This fixes starting position bugs relating to implicitly typed variables; see the linked issue for details. > > This also makes it possible to recover the declaration type (explicit, implicit, or `var`) from a `JCVariableDecl` and, in the case of `var` declarations, the starting position of the `var`; previously this wasn't possible. > > Finally, as a minor drive-by improvement, we can now pretty print `var` as `var` instead of `/*missing*/`. This pull request has now been integrated. Changeset: 1e90af08 Author: Archie Cobbs URL: https://git.openjdk.org/jdk/commit/1e90af08abb74df9ec4ab94b67deeae5c1c9fee1 Stats: 153 lines in 12 files changed: 94 ins; 10 del; 49 mod 8359383: Incorrect starting positions for implicitly typed variables Reviewed-by: vromero ------------- PR: https://git.openjdk.org/jdk/pull/25786 From acobbs at openjdk.org Fri Sep 5 16:15:48 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Fri, 5 Sep 2025 16:15:48 GMT Subject: RFR: 8349847: Support configuring individual lint categories as errors [v12] In-Reply-To: References: Message-ID: > This PR enhances the `-Werror` flag to support lint categories just like `-Xlint` does. For example `-Werror:all,-preview` would cause an error if any warning not in the `preview` lint category occurred. > > The existing `-Xlint` flag has a particular behavior when conflicting flags are combined (e.g., `-Xlint:all -Xlint:none -Xlint:foo -Xlint:-foo` is equivalent to `-Xlint:all`). This behavior has been factored out and Javadocumented so that both `-Xlint` and `-Werror` can have this same "parsing" logic. > > See the CSR [JDK-8350044](https://bugs.openjdk.org/browse/JDK-8350044) for details on how the new flag behaves in certain corner cases. Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision: Reword the "--help-lint" trailing blurb to make it sound more friendly. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23622/files - new: https://git.openjdk.org/jdk/pull/23622/files/002c78ff..66dc9a1e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23622&range=11 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23622&range=10-11 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/23622.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23622/head:pull/23622 PR: https://git.openjdk.org/jdk/pull/23622 From vromero at openjdk.org Fri Sep 5 17:26:14 2025 From: vromero at openjdk.org (Vicente Romero) Date: Fri, 5 Sep 2025 17:26:14 GMT Subject: RFR: 8365776: Convert JShell tests to use JUnit instead of TestNG In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 10:26:14 GMT, Jan Lahoda wrote: > This is a conversion of JShell tests from TestNG to JUnit 5. > > To make the changes more transparent, there are 4 commit in this PR: > - https://github.com/openjdk/jdk/pull/26841/commits/c6b5d8441ad532551e626b3542431aa3f479ffc0: this one changes a name of a custom interface representing test cases, so that subsequent commits can use a simple name for `org.junit.jupiter.api.Test` (otherwise `Test` would resolve to the custom interface is subclasses of `UITesting`, and FQN would need to be used to refer to the annotation). > - https://github.com/openjdk/jdk/pull/26841/commits/2afee7d258f646f822d0b1bc3465d5595058e3df: the bulk of changes, done automatically by: > The bulk of the changes is done automatically, using this tool/script: > https://github.com/lahodaj/netbeans/tree/19515c3e2dbc07d977ca227d933197f856121ae5/java/java.openjdk.project/junit-convert > - https://github.com/openjdk/jdk/pull/26841/commits/8ca03af1b4d06e479cdfe7cc66186222feeaaa76: manual adjustments for things the tool does not handle (at least currently): > - one indent problem > - two uses of injected `java.lang.reflect.Method`, which needs to be replaced with `TestInfo` > - a different way to skip a test (normally, the tool detects and converts uses of `SkipException`, but that exception was not used on this place). > - https://github.com/openjdk/jdk/pull/26841/commits/639da0171a593031dae6a73830bb1665b7097e73: scripted update to copyright headers, done using: > > bash ./make/scripts/update_copyright_year.sh -b `git merge-base master jshell-upgrade-testng-to-junit` > > > As part of validation of this change, this script: > https://gist.github.com/lahodaj/a6535272ec275ffa394232657492218b > was used to compare the results in `junit.txt` and `testng.txt` in test results before and after the change, and it didn't find a difference in test counts. lgtm ------------- Marked as reviewed by vromero (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26841#pullrequestreview-3190244602 From archie.cobbs at gmail.com Fri Sep 5 18:39:04 2025 From: archie.cobbs at gmail.com (Archie Cobbs) Date: Fri, 5 Sep 2025 13:39:04 -0500 Subject: Proposal: Warnings for unnecessary warning suppression In-Reply-To: References: <4a5cce73-3b39-416b-8308-2edbef4dfa15@oracle.com> Message-ID: PIcking back up this discussion regarding adding a new compiler warning for unnecessary @SuppressWarnings annotations... The CSR has been updated (hopefully for the better) based on the conversation in this thread and is ready for another review by anyone who is interested. Otherwise I'll plan to finalize it in a few days. Thanks, -Archie On Fri, May 9, 2025 at 10:23?AM Archie Cobbs wrote: > Hi Maurizio, > > Thanks for your input. > > On Fri, May 9, 2025 at 9:31?AM Maurizio Cimadamore < > maurizio.cimadamore at oracle.com> wrote: > >> IMHO, this is a problem present with the addition of every new lint >> warning. It's not specific to this one. Of course, some new lint warning >> operate on brand new language features, so the potential to compromise >> existing compilaton units is low. But I'd expect that warnings such as >> "serial" would have ran into similar corner cases (e.g. previously ok code >> started to report new warnings, and to fail with Werror). >> >> So I think this seems ok, and not enough to cause a tweak to the >> treatment of lint:all. >> > That sounds good to me, but Joe Darcy had some reservations (see CSR). So > we would need to decide how to proceed. > > Maybe the thing to do is just to ensure that it gets introduced early in > the cycle so we can get some experience with it...? > >> I'll add here that a more robust fix for Werror issues is to enable >> developers to be more specific in the warnings they'd like to promote to >> errors (as discussed in the past). I'll CC Kevin who has always been a fan >> of this feature ;-) >> > Good news: that PR is already in place :) > https://github.com/openjdk/jdk/pull/23622 > >> Also complicating things, there are two different ways to suppress >> warnings, @SuppressWarnings("foo") and -Xlint:-foo and for similar >> "corner case" reasons they need to be configurable separately. >> >> IMHO, the main value of this new lint warning is to detect the use of >> `@SuppressWarnings` that are redundant. Sure there's the command-line >> flavor as well, but that renders any source code analysis dependent on the >> flags passed to javac. In other words, detecting redundant >> `@SuppressWarnings` has a more "timeless" nature that does not apply to >> detecting redundant command-line suppressions. The former tells you >> something about _your code_, in a way that is independent from which flags >> you use to compile it. Which is why I think we should only worry about that. >> > I think that's a reasonable way to start - that is, we just add the > category for "suppression" now and worry later about possibly adding > "supression-option". > > Joe - any thoughts? > > -Archie > > -- > Archie L. Cobbs > -- Archie L. Cobbs -------------- next part -------------- An HTML attachment was scrubbed... URL: From liach at openjdk.org Sat Sep 6 01:07:12 2025 From: liach at openjdk.org (Chen Liang) Date: Sat, 6 Sep 2025 01:07:12 GMT Subject: RFR: 8361950: Update to use jtreg 8 [v4] In-Reply-To: <6p7ncBylItu9HEeCINmqu_JFoL6zNXwJuSQaZoQ0J2I=.451526e1-d918-4fee-b1a7-e8193da61545@github.com> References: <6p7ncBylItu9HEeCINmqu_JFoL6zNXwJuSQaZoQ0J2I=.451526e1-d918-4fee-b1a7-e8193da61545@github.com> Message-ID: On Thu, 4 Sep 2025 22:01:57 GMT, Christian Stein wrote: >> Please review the change to update to using jtreg 8. >> >> The primary change is to the `jib-profiles.js` file, which specifies the version of jtreg to use, for those systems that rely on this file. In addition, the requiredVersion has been updated in the various `TEST.ROOT` files. > > Christian Stein has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision: > > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Update to use correct library directories > > See also: https://openjdk.org/jtreg/faq.html#how-do-i-find-the-path-for-the-testng-or-junit-jar-files > - 8361950: Set required version to 8+2 > - 8361950: Update to use jtreg 8 #26749 was merged 4 days ago. Can we integrate this one now? ------------- PR Comment: https://git.openjdk.org/jdk/pull/26261#issuecomment-3260152639 From alanb at openjdk.org Sat Sep 6 07:04:14 2025 From: alanb at openjdk.org (Alan Bateman) Date: Sat, 6 Sep 2025 07:04:14 GMT Subject: RFR: 8361950: Update to use jtreg 8 [v4] In-Reply-To: References: <6p7ncBylItu9HEeCINmqu_JFoL6zNXwJuSQaZoQ0J2I=.451526e1-d918-4fee-b1a7-e8193da61545@github.com> Message-ID: On Sat, 6 Sep 2025 01:04:56 GMT, Chen Liang wrote: > #26749 was merged 4 days ago. Can we integrate this one now? I think it would be useful to get input from @dholmes-ora and @lkorinth before doing this. There seems to be several timeout issues in the last few days, a few follow-on changes to adjust the timeout of a few tests, and a spate of tests being reported as timed out after passing. Updating jtreg adds another change to the picture. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26261#issuecomment-3261436239 From dholmes at openjdk.org Mon Sep 8 04:27:19 2025 From: dholmes at openjdk.org (David Holmes) Date: Mon, 8 Sep 2025 04:27:19 GMT Subject: RFR: 8361950: Update to use jtreg 8 [v4] In-Reply-To: <6p7ncBylItu9HEeCINmqu_JFoL6zNXwJuSQaZoQ0J2I=.451526e1-d918-4fee-b1a7-e8193da61545@github.com> References: <6p7ncBylItu9HEeCINmqu_JFoL6zNXwJuSQaZoQ0J2I=.451526e1-d918-4fee-b1a7-e8193da61545@github.com> Message-ID: On Thu, 4 Sep 2025 22:01:57 GMT, Christian Stein wrote: >> Please review the change to update to using jtreg 8. >> >> The primary change is to the `jib-profiles.js` file, which specifies the version of jtreg to use, for those systems that rely on this file. In addition, the requiredVersion has been updated in the various `TEST.ROOT` files. > > Christian Stein has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision: > > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Update to use correct library directories > > See also: https://openjdk.org/jtreg/faq.html#how-do-i-find-the-path-for-the-testng-or-junit-jar-files > - 8361950: Set required version to 8+2 > - 8361950: Update to use jtreg 8 I would appreciate it if this could hold off a while longer as we have a few issues causing noise in our testing at the moment and I don't want to muddy the waters even further. Thanks. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26261#issuecomment-3264544890 From jlahoda at openjdk.org Mon Sep 8 04:38:26 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 8 Sep 2025 04:38:26 GMT Subject: Integrated: 8365776: Convert JShell tests to use JUnit instead of TestNG In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 10:26:14 GMT, Jan Lahoda wrote: > This is a conversion of JShell tests from TestNG to JUnit 5. > > To make the changes more transparent, there are 4 commit in this PR: > - https://github.com/openjdk/jdk/pull/26841/commits/c6b5d8441ad532551e626b3542431aa3f479ffc0: this one changes a name of a custom interface representing test cases, so that subsequent commits can use a simple name for `org.junit.jupiter.api.Test` (otherwise `Test` would resolve to the custom interface is subclasses of `UITesting`, and FQN would need to be used to refer to the annotation). > - https://github.com/openjdk/jdk/pull/26841/commits/2afee7d258f646f822d0b1bc3465d5595058e3df: the bulk of changes, done automatically by: > The bulk of the changes is done automatically, using this tool/script: > https://github.com/lahodaj/netbeans/tree/19515c3e2dbc07d977ca227d933197f856121ae5/java/java.openjdk.project/junit-convert > - https://github.com/openjdk/jdk/pull/26841/commits/8ca03af1b4d06e479cdfe7cc66186222feeaaa76: manual adjustments for things the tool does not handle (at least currently): > - one indent problem > - two uses of injected `java.lang.reflect.Method`, which needs to be replaced with `TestInfo` > - a different way to skip a test (normally, the tool detects and converts uses of `SkipException`, but that exception was not used on this place). > - https://github.com/openjdk/jdk/pull/26841/commits/639da0171a593031dae6a73830bb1665b7097e73: scripted update to copyright headers, done using: > > bash ./make/scripts/update_copyright_year.sh -b `git merge-base master jshell-upgrade-testng-to-junit` > > > As part of validation of this change, this script: > https://gist.github.com/lahodaj/a6535272ec275ffa394232657492218b > was used to compare the results in `junit.txt` and `testng.txt` in test results before and after the change, and it didn't find a difference in test counts. This pull request has now been integrated. Changeset: b0ca9bf6 Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/b0ca9bf61e0390a3b022a0915eacabb0cfd92e93 Stats: 1771 lines in 123 files changed: 740 ins; 216 del; 815 mod 8365776: Convert JShell tests to use JUnit instead of TestNG Reviewed-by: vromero ------------- PR: https://git.openjdk.org/jdk/pull/26841 From jlahoda at openjdk.org Mon Sep 8 05:23:04 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 8 Sep 2025 05:23:04 GMT Subject: RFR: 8285150: Improve tab completion for annotations [v3] In-Reply-To: References: Message-ID: > When using types code like: > > @Deprecated( > > > and presses ``, there should be a sensible completion, but currently there is nothing. This PR proposes to add code completion for annotation attributes. Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits: - Merge branch 'master' into JDK-8285150 - Fixing completion prefix behavior - Merge branch 'master' into JDK-8285150-dev2 - Improving the handling of annotation attributes that are annotations and enum constants. - Merge branch 'master' into JDK-8285150 - Merge branch 'master' into JDK-8285150 - 8285150: Improve tab completion for annotations ------------- Changes: https://git.openjdk.org/jdk/pull/22840/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22840&range=02 Stats: 321 lines in 4 files changed: 300 ins; 0 del; 21 mod Patch: https://git.openjdk.org/jdk/pull/22840.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22840/head:pull/22840 PR: https://git.openjdk.org/jdk/pull/22840 From jlahoda at openjdk.org Mon Sep 8 05:51:25 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 8 Sep 2025 05:51:25 GMT Subject: RFR: 8285150: Improve tab completion for annotations [v4] In-Reply-To: References: Message-ID: > When using types code like: > > @Deprecated( > > > and presses ``, there should be a sensible completion, but currently there is nothing. This PR proposes to add code completion for annotation attributes. Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: - Adding Test annotation - Merge branch 'master' into JDK-8285150 - Merge branch 'master' into JDK-8285150 - Fixing completion prefix behavior - Merge branch 'master' into JDK-8285150-dev2 - Improving the handling of annotation attributes that are annotations and enum constants. - Merge branch 'master' into JDK-8285150 - Merge branch 'master' into JDK-8285150 - 8285150: Improve tab completion for annotations ------------- Changes: https://git.openjdk.org/jdk/pull/22840/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22840&range=03 Stats: 322 lines in 4 files changed: 301 ins; 0 del; 21 mod Patch: https://git.openjdk.org/jdk/pull/22840.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22840/head:pull/22840 PR: https://git.openjdk.org/jdk/pull/22840 From jlahoda at openjdk.org Mon Sep 8 06:36:18 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 8 Sep 2025 06:36:18 GMT Subject: Integrated: 8351260: java.lang.AssertionError: Unexpected type tree: (ERROR) = (ERROR) In-Reply-To: References: Message-ID: <4gL1Pmi5Jb1n0nQaG6qTmyd4jvybt2RsUrMA0YBqr3Y=.12b80d78-9da4-49e2-8646-32bee15071c0@github.com> On Wed, 3 Sep 2025 05:48:51 GMT, Jan Lahoda wrote: > Consider a very broken declaration like this: > > void test(List<@AlphaChars <@StringLength(int value = 5)String> s){ > > > after seeing `@AlphaChars`, javac will try to parse `<@StringLength(int value = 5)String>` as a type, and assign the annotation to the type. But, the text does not parse as a type well (partly due to the `int value = 5`), and the parsing will proceed in an expression mode. Then a search for target type is performed to attach the annotation, and that fails, as the expression tree is not expected to be part of the type. > > The main proposal here is to wrap the badly parsed type in an `Erroneous` tree. The overall error recovery then seems to handle the situation well. > > The situation produces quite a few error reports, but it is not clear if this situation (esp. the nested `int value = 5`) is common enough to stretch the parsing error recovery capabilities to accommodate this code. This pull request has now been integrated. Changeset: f9dc640e Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/f9dc640ef07ea5569b3581360041db2bb7e30c40 Stats: 92 lines in 3 files changed: 90 ins; 0 del; 2 mod 8351260: java.lang.AssertionError: Unexpected type tree: (ERROR) = (ERROR) Reviewed-by: vromero ------------- PR: https://git.openjdk.org/jdk/pull/27065 From jlahoda at openjdk.org Mon Sep 8 12:30:17 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 8 Sep 2025 12:30:17 GMT Subject: Integrated: 8365689: Elements.getFileObjectOf fails with a NullPointerException when an erroneous Element is passed in In-Reply-To: References: Message-ID: On Tue, 19 Aug 2025 07:35:05 GMT, Jan Lahoda wrote: > If an erroneous/unresolvable `Element` is passed to `Elements.getFileObjectOf`, it fails with an NPE like: > > Caused by: java.lang.NullPointerException: Cannot read field "classfile" because the return value of "com.sun.tools.javac.code.Symbol.enclClass()" is null > at jdk.compiler/com.sun.tools.javac.model.JavacElements.getFileObjectOf(JavacElements.java:803) > at TestFileObjectOf$PrintFiles.handleDeclaration(TestFileObjectOf.java:329) > at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2718) > > > The reason is the `Symbol.enclClass()` will return `null` for the erroneous `Element`. The proposed solution herein is to return `null` for erroneous/unresolvable `Element`s. This pull request has now been integrated. Changeset: 03c54d42 Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/03c54d4288dfd70190c3f306a44a8424f268f787 Stats: 159 lines in 2 files changed: 156 ins; 0 del; 3 mod 8365689: Elements.getFileObjectOf fails with a NullPointerException when an erroneous Element is passed in Reviewed-by: darcy, vromero ------------- PR: https://git.openjdk.org/jdk/pull/26836 From acobbs at openjdk.org Mon Sep 8 16:58:44 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Mon, 8 Sep 2025 16:58:44 GMT Subject: RFR: 8366561: Improve documentation for how the -Xlint flag works Message-ID: This is a documentation-only change to improve compiler documentation around the `-Xlint` flag and lint categories. * Changes to `--help` output: * Note that `--enable-preview` disables the `preview` lint category as a side-effect * Changes to `--help-extra` output: * Refer to "lint warning categories" instead of "warning categories" when appropriate (not all warnings are lint warnings) * Note that `-Xlint` enables all lint categories (sync with man page) * Note that some categories are enabled by default even without any `-Xlint` flags * Changes to `--help-lint` output: * Refer to "lint warning categories" instead of "warning categories" when appropriate (not all warnings are lint warnings) * Sort lint categories and aliases alphabetically together * Indicate which lint categories are enabled by default with an asterisk * Tighten up "alias" verbiage and generalize it to work with future possible category aliases * Add a footer blurb clarifying that aliases are fully interchangeable with their primary keys * Changes to `module-info.java` javadoc: * Clarify that `@SuppressWarnings` ignores unrecognized strings * Remove lint categories not actually supported by `@SuppressWarnings` from the list of such * Changes to the `javac(1)` man page: * Sync with the above changes to `--help`, `--help-extra`, and `--help-lint` ------------- Commit messages: - Minor code cleanup. - Clarify that "processing" is not supported by @SuppressWarnings. - Synchronize --help-extra and man page descriptions of the "-Xlint" flag. - Minor refactoring creating method Lint.getDefaults(). - Update man page with the same improvements applied to help output. - Note that unrecognized strings in @SuppressWarnings annotations are ignored. - Documentation improvements relating to -Xlint and lint categories. Changes: https://git.openjdk.org/jdk/pull/27129/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27129&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8366561 Stats: 140 lines in 5 files changed: 55 ins; 31 del; 54 mod Patch: https://git.openjdk.org/jdk/pull/27129.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27129/head:pull/27129 PR: https://git.openjdk.org/jdk/pull/27129 From liach at openjdk.org Mon Sep 8 19:55:14 2025 From: liach at openjdk.org (Chen Liang) Date: Mon, 8 Sep 2025 19:55:14 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable [v2] In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 21:07:48 GMT, Chen Liang wrote: >> The interface static methods added in Java 8 are never inherited in method resolution. However, javac incorrectly allowed them to be resolved against type variables with an interface as its only upper bound, which violates JLS 4.9: >> >>> The members of an intersection type are the members of the class or interface it induces. >> >> Combined with JLS 4.4: >> >>> The members of a type variable X with bound T & I1 & ... & In are the members of the intersection type ([?4.9](https://docs.oracle.com/javase/specs/jls/se24/html/jls-4.html#jls-4.9)) T & I1 & ... & In appearing at the point where the type variable is declared >> >> Last time this piece of code in Attr was updated was around Java 7, so this was probably missed in Java 8. >> >> The test cases added showcases wrong ways to refer to interface static methods: `Collator`, a subtype of `Comparator`, cannot use `reverseOrder`, so shouldn't type variable `T` bounded by `Comparator` be able to do so. >> >> In addition, the error for private member access on type variables should probably have been symbol not found instead of access errors - we might revisit that later. I made the new error symbol not found for parity with interface static reference on classes, as showcased in the compiler output in this new test. > > Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - Break up long conditional, add intersection bounded test case > - Merge branch 'master' of https://github.com/openjdk/jdk into fix/typevar-inherit-interface-static > - 8365676: javac incorrectly allows calling interface static method via type variable I have done a corpus compilation experiment against maven central artifacts and found no new compile error due to this change. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27015#issuecomment-3267726160 From vromero at openjdk.org Mon Sep 8 20:47:15 2025 From: vromero at openjdk.org (Vicente Romero) Date: Mon, 8 Sep 2025 20:47:15 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable [v2] In-Reply-To: References: Message-ID: On Mon, 8 Sep 2025 19:52:51 GMT, Chen Liang wrote: > I have done a corpus compilation experiment against maven central artifacts and found no new compile error due to this change. probably good idea to add a comment in the CSR ------------- PR Comment: https://git.openjdk.org/jdk/pull/27015#issuecomment-3267956500 From liach at openjdk.org Tue Sep 9 03:03:11 2025 From: liach at openjdk.org (Chen Liang) Date: Tue, 9 Sep 2025 03:03:11 GMT Subject: RFR: 8285150: Improve tab completion for annotations [v4] In-Reply-To: References: Message-ID: On Mon, 8 Sep 2025 05:51:25 GMT, Jan Lahoda wrote: >> When using types code like: >> >> @Deprecated( >> >> >> and presses ``, there should be a sensible completion, but currently there is nothing. This PR proposes to add code completion for annotation attributes. > > Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: > > - Adding Test annotation > - Merge branch 'master' into JDK-8285150 > - Merge branch 'master' into JDK-8285150 > - Fixing completion prefix behavior > - Merge branch 'master' into JDK-8285150-dev2 > - Improving the handling of annotation attributes that are annotations and enum constants. > - Merge branch 'master' into JDK-8285150 > - Merge branch 'master' into JDK-8285150 > - 8285150: Improve tab completion for annotations test/langtools/jdk/jshell/ToolTabSnippetTest.java line 348: > 346: } > 347: > 348: public void testAnnotation() throws Exception { We are now junit, needs `@Test` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22840#discussion_r2331877308 From jlahoda at openjdk.org Tue Sep 9 05:41:26 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Tue, 9 Sep 2025 05:41:26 GMT Subject: RFR: 8285150: Improve tab completion for annotations [v5] In-Reply-To: References: Message-ID: > When using types code like: > > @Deprecated( > > > and presses ``, there should be a sensible completion, but currently there is nothing. This PR proposes to add code completion for annotation attributes. Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision: Adding Test annotation ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22840/files - new: https://git.openjdk.org/jdk/pull/22840/files/35311d8e..d99640d3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22840&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22840&range=03-04 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/22840.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22840/head:pull/22840 PR: https://git.openjdk.org/jdk/pull/22840 From ihse at openjdk.org Tue Sep 9 14:39:28 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 9 Sep 2025 14:39:28 GMT Subject: RFR: 8367259: Clean up make/scripts and bin directory Message-ID: Over time, cruft have accumulated in terms of scripts that are no longer relevant. These should be removed. Also, scripts that are not used as part of the build process, but run by JDK developers from time to time, should reside in `bin` instead of `make/scripts`. I have also updated `generate-symbol-data.sh` and `update_pch.sh` so they work regardless of current dir. ------------- Commit messages: - 8367259: Clean up make/scripts and bin directory Changes: https://git.openjdk.org/jdk/pull/27172/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27172&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8367259 Stats: 657 lines in 11 files changed: 113 ins; 540 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/27172.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27172/head:pull/27172 PR: https://git.openjdk.org/jdk/pull/27172 From liach at openjdk.org Tue Sep 9 14:55:02 2025 From: liach at openjdk.org (Chen Liang) Date: Tue, 9 Sep 2025 14:55:02 GMT Subject: RFR: 8285150: Improve tab completion for annotations [v5] In-Reply-To: References: Message-ID: On Tue, 9 Sep 2025 05:41:26 GMT, Jan Lahoda wrote: >> When using types code like: >> >> @Deprecated( >> >> >> and presses ``, there should be a sensible completion, but currently there is nothing. This PR proposes to add code completion for annotation attributes. > > Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision: > > Adding Test annotation Though I don't really understand jshell, I find the code mostly good in terms of style. I don't know if you want other reviewers like Adam to check. ------------- Marked as reviewed by liach (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22840#pullrequestreview-3202009266 From erikj at openjdk.org Tue Sep 9 17:18:46 2025 From: erikj at openjdk.org (Erik Joelsson) Date: Tue, 9 Sep 2025 17:18:46 GMT Subject: RFR: 8367259: Clean up make/scripts and bin directory In-Reply-To: References: Message-ID: On Tue, 9 Sep 2025 13:55:41 GMT, Magnus Ihse Bursie wrote: > Over time, cruft have accumulated in terms of scripts that are no longer relevant. These should be removed. Also, scripts that are not used as part of the build process, but run by JDK developers from time to time, should reside in `bin` instead of `make/scripts`. > > I have also updated `generate-symbol-data.sh` and `update_pch.sh` so they work regardless of current dir. Marked as reviewed by erikj (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27172#pullrequestreview-3202554210 From acobbs at openjdk.org Tue Sep 9 20:21:37 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Tue, 9 Sep 2025 20:21:37 GMT Subject: RFR: 8366561: Improve documentation for how the -Xlint flag works [v2] In-Reply-To: References: Message-ID: > This is a documentation-only change to improve compiler documentation around the `-Xlint` flag and lint categories. > > * Changes to `--help` output: > * Note that `--enable-preview` disables the `preview` lint category as a side-effect > > * Changes to `--help-extra` output: > * Refer to "lint warning categories" instead of "warning categories" when appropriate (not all warnings are lint warnings) > * Note that `-Xlint` enables all lint categories (sync with man page) > * Note that some categories are enabled by default even without any `-Xlint` flags > > * Changes to `--help-lint` output: > * Refer to "lint warning categories" instead of "warning categories" when appropriate (not all warnings are lint warnings) > * Sort lint categories and aliases alphabetically together > * Indicate which lint categories are enabled by default with an asterisk > * Tighten up "alias" verbiage and generalize it to work with future possible category aliases > * Add a footer blurb clarifying that aliases are fully interchangeable with their primary keys > > * Changes to `module-info.java` javadoc: > * Clarify that `@SuppressWarnings` ignores unrecognized strings > * Remove lint categories not actually supported by `@SuppressWarnings` from the list of such > > * Changes to the `javac(1)` man page: > * Sync with the above changes to `--help`, `--help-extra`, and `--help-lint` Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision: Changes based on CSR review suggestions. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27129/files - new: https://git.openjdk.org/jdk/pull/27129/files/410a3f57..a497a469 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27129&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27129&range=00-01 Stats: 67 lines in 4 files changed: 45 ins; 4 del; 18 mod Patch: https://git.openjdk.org/jdk/pull/27129.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27129/head:pull/27129 PR: https://git.openjdk.org/jdk/pull/27129 From ihse at openjdk.org Wed Sep 10 10:01:03 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 10 Sep 2025 10:01:03 GMT Subject: Integrated: 8367259: Clean up make/scripts and bin directory In-Reply-To: References: Message-ID: On Tue, 9 Sep 2025 13:55:41 GMT, Magnus Ihse Bursie wrote: > Over time, cruft have accumulated in terms of scripts that are no longer relevant. These should be removed. Also, scripts that are not used as part of the build process, but run by JDK developers from time to time, should reside in `bin` instead of `make/scripts`. > > I have also updated `generate-symbol-data.sh` and `update_pch.sh` so they work regardless of current dir. This pull request has now been integrated. Changeset: 5c9f60dc Author: Magnus Ihse Bursie URL: https://git.openjdk.org/jdk/commit/5c9f60dc5a6e64be55819469bbf10948803d0fd5 Stats: 657 lines in 11 files changed: 113 ins; 540 del; 4 mod 8367259: Clean up make/scripts and bin directory Reviewed-by: erikj ------------- PR: https://git.openjdk.org/jdk/pull/27172 From jlahoda at openjdk.org Wed Sep 10 18:34:50 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Wed, 10 Sep 2025 18:34:50 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable [v2] In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 21:07:48 GMT, Chen Liang wrote: >> The interface static methods added in Java 8 are never inherited in method resolution. However, javac incorrectly allowed them to be resolved against type variables with an interface as its only upper bound, which violates JLS 4.9: >> >>> The members of an intersection type are the members of the class or interface it induces. >> >> Combined with JLS 4.4: >> >>> The members of a type variable X with bound T & I1 & ... & In are the members of the intersection type ([?4.9](https://docs.oracle.com/javase/specs/jls/se24/html/jls-4.html#jls-4.9)) T & I1 & ... & In appearing at the point where the type variable is declared >> >> Last time this piece of code in Attr was updated was around Java 7, so this was probably missed in Java 8. >> >> The test cases added showcases wrong ways to refer to interface static methods: `Collator`, a subtype of `Comparator`, cannot use `reverseOrder`, so shouldn't type variable `T` bounded by `Comparator` be able to do so. >> >> In addition, the error for private member access on type variables should probably have been symbol not found instead of access errors - we might revisit that later. I made the new error symbol not found for parity with interface static reference on classes, as showcased in the compiler output in this new test. > > Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - Break up long conditional, add intersection bounded test case > - Merge branch 'master' of https://github.com/openjdk/jdk into fix/typevar-inherit-interface-static > - 8365676: javac incorrectly allows calling interface static method via type variable I may be in the minority, but I think I prefer the "access error" for private methods, rather than "symbol not found". In the latter case, the user might see the method, and ask "why it cannot find the method". Access error gives the answer to that. I don't think we currently have something like that for static methods, so OK to use "symbol not found" here, I think. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27015#issuecomment-3276080254 From liach at openjdk.org Wed Sep 10 19:14:12 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 10 Sep 2025 19:14:12 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable [v2] In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 21:07:48 GMT, Chen Liang wrote: >> The interface static methods added in Java 8 are never inherited in method resolution. However, javac incorrectly allowed them to be resolved against type variables with an interface as its only upper bound, which violates JLS 4.9: >> >>> The members of an intersection type are the members of the class or interface it induces. >> >> Combined with JLS 4.4: >> >>> The members of a type variable X with bound T & I1 & ... & In are the members of the intersection type ([?4.9](https://docs.oracle.com/javase/specs/jls/se24/html/jls-4.html#jls-4.9)) T & I1 & ... & In appearing at the point where the type variable is declared >> >> Last time this piece of code in Attr was updated was around Java 7, so this was probably missed in Java 8. >> >> The test cases added showcases wrong ways to refer to interface static methods: `Collator`, a subtype of `Comparator`, cannot use `reverseOrder`, so shouldn't type variable `T` bounded by `Comparator` be able to do so. >> >> In addition, the error for private member access on type variables should probably have been symbol not found instead of access errors - we might revisit that later. I made the new error symbol not found for parity with interface static reference on classes, as showcased in the compiler output in this new test. > > Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - Break up long conditional, add intersection bounded test case > - Merge branch 'master' of https://github.com/openjdk/jdk into fix/typevar-inherit-interface-static > - 8365676: javac incorrectly allows calling interface static method via type variable Sure, we can always review the access error vs symbol not found message later. There has been a similar problem with hotspot runtime, where constructor lookup in java.lang.Class always result in an IllegalAccessError and never NoSuchMethodError. The present "access error" for private methods should be good to keep. Thanks for the reviews! I will merge mainline and do another tier 1-3 before integration. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27015#issuecomment-3276200303 From liach at openjdk.org Wed Sep 10 21:24:05 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 10 Sep 2025 21:24:05 GMT Subject: RFR: 8365676: javac incorrectly allows calling interface static method via type variable [v2] In-Reply-To: References: Message-ID: On Wed, 3 Sep 2025 21:07:48 GMT, Chen Liang wrote: >> The interface static methods added in Java 8 are never inherited in method resolution. However, javac incorrectly allowed them to be resolved against type variables with an interface as its only upper bound, which violates JLS 4.9: >> >>> The members of an intersection type are the members of the class or interface it induces. >> >> Combined with JLS 4.4: >> >>> The members of a type variable X with bound T & I1 & ... & In are the members of the intersection type ([?4.9](https://docs.oracle.com/javase/specs/jls/se24/html/jls-4.html#jls-4.9)) T & I1 & ... & In appearing at the point where the type variable is declared >> >> Last time this piece of code in Attr was updated was around Java 7, so this was probably missed in Java 8. >> >> The test cases added showcases wrong ways to refer to interface static methods: `Collator`, a subtype of `Comparator`, cannot use `reverseOrder`, so shouldn't type variable `T` bounded by `Comparator` be able to do so. >> >> In addition, the error for private member access on type variables should probably have been symbol not found instead of access errors - we might revisit that later. I made the new error symbol not found for parity with interface static reference on classes, as showcased in the compiler output in this new test. > > Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - Break up long conditional, add intersection bounded test case > - Merge branch 'master' of https://github.com/openjdk/jdk into fix/typevar-inherit-interface-static > - 8365676: javac incorrectly allows calling interface static method via type variable Tier 1-3 clear. Thanks for the reviews! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27015#issuecomment-3276589453 From liach at openjdk.org Wed Sep 10 21:28:18 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 10 Sep 2025 21:28:18 GMT Subject: Integrated: 8365676: javac incorrectly allows calling interface static method via type variable In-Reply-To: References: Message-ID: On Sat, 30 Aug 2025 00:37:44 GMT, Chen Liang wrote: > The interface static methods added in Java 8 are never inherited in method resolution. However, javac incorrectly allowed them to be resolved against type variables with an interface as its only upper bound, which violates JLS 4.9: > >> The members of an intersection type are the members of the class or interface it induces. > > Combined with JLS 4.4: > >> The members of a type variable X with bound T & I1 & ... & In are the members of the intersection type ([?4.9](https://docs.oracle.com/javase/specs/jls/se24/html/jls-4.html#jls-4.9)) T & I1 & ... & In appearing at the point where the type variable is declared > > Last time this piece of code in Attr was updated was around Java 7, so this was probably missed in Java 8. > > The test cases added showcases wrong ways to refer to interface static methods: `Collator`, a subtype of `Comparator`, cannot use `reverseOrder`, so shouldn't type variable `T` bounded by `Comparator` be able to do so. > > In addition, the error for private member access on type variables should probably have been symbol not found instead of access errors - we might revisit that later. I made the new error symbol not found for parity with interface static reference on classes, as showcased in the compiler output in this new test. This pull request has now been integrated. Changeset: 85996572 Author: Chen Liang URL: https://git.openjdk.org/jdk/commit/85996572b61e789d7e45bd26b23d233a0a41e158 Stats: 37 lines in 3 files changed: 34 ins; 0 del; 3 mod 8365676: javac incorrectly allows calling interface static method via type variable Co-authored-by: Maurizio Cimadamore Reviewed-by: vromero ------------- PR: https://git.openjdk.org/jdk/pull/27015 From jlahoda at openjdk.org Thu Sep 11 10:41:38 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Thu, 11 Sep 2025 10:41:38 GMT Subject: RFR: 8285150: Improve tab completion for annotations [v5] In-Reply-To: References: Message-ID: On Tue, 9 Sep 2025 05:41:26 GMT, Jan Lahoda wrote: >> When using types code like: >> >> @Deprecated( >> >> >> and presses ``, there should be a sensible completion, but currently there is nothing. This PR proposes to add code completion for annotation attributes. > > Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision: > > Adding Test annotation Thanks for the review! ------------- PR Comment: https://git.openjdk.org/jdk/pull/22840#issuecomment-3279842932 From jlahoda at openjdk.org Thu Sep 11 10:47:16 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Thu, 11 Sep 2025 10:47:16 GMT Subject: Integrated: 8285150: Improve tab completion for annotations In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 06:24:13 GMT, Jan Lahoda wrote: > When using types code like: > > @Deprecated( > > > and presses ``, there should be a sensible completion, but currently there is nothing. This PR proposes to add code completion for annotation attributes. This pull request has now been integrated. Changeset: 3355a9d3 Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/3355a9d3fa3e57d489f716ebc1c885c1391274ea Stats: 323 lines in 4 files changed: 302 ins; 0 del; 21 mod 8285150: Improve tab completion for annotations Reviewed-by: liach ------------- PR: https://git.openjdk.org/jdk/pull/22840 From jlahoda at openjdk.org Fri Sep 12 08:02:26 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Fri, 12 Sep 2025 08:02:26 GMT Subject: RFR: 8364991: Incorrect not-exhaustive error Message-ID: Consider this code: $ cat Test.java package test; public class Test { private int test1(Root r) { return switch (r) { case Root(R2(R1 _), R2(R1 _)) -> 0; case Root(R2(R1 _), R2(R2 _)) -> 0; case Root(R2(R2 _), R2(R1 _)) -> 0; case Root(R2(R2 _), R2 _) -> 0; }; } sealed interface Base {} record R1() implements Base {} record R2(Base b1) implements Base {} record Root(R2 b2, R2 b3) {} } javac (JDK 25) will produce a compile-time error for this code: $ javac test/Test.java .../test/Test.java:4: error: the switch expression does not cover all possible input values return switch (r) { ^ 1 error This error is not correct according to the JLS. JLS defines a set of possible reductions of pattern sets, and if there exists a series of reductions from the pattern set into a pattern set that covers the selector type, the switch is exhaustive. One such reduction is that if there's a sub-set of (record) patterns that only differ in one component ("the mismatching component"), we can replace them with a (set of) patterns where this component is reduced, and the other components are unmodified. Such path exists here (every line shows a set of patterns that is being transformed): Root(R2(R1 _), R2(R1 _)), Root(R2(R1 _), R2(R2 _)), Root(R2(R2 _), R2(R1 _)), Root(R2(R2 _), R2 _) => choosing the second component as the mismatching component, then we can reduce Root(R2(R1 _), R2(R1 _)), Root(R2(R1 _), R2(R2 _)) => Root(R2(R1 _), R2 _); as we can reduce R2(R1 _), R2(R2 _) to R2 _ Root(R2(R1 _), R2 _), Root(R2(R2 _), R2(R1 _)), Root(R2(R2 _), R2 _) => choosing the first component as the mismatching component, we can reduce Root(R2(R1 _), R2 _), Root(R2(R2 _), R2 _) => Root(R2 _, R2 _) Root(R2 _, R2 _) => Root _ => exhaustive The problem here is that in the first step, javac chooses this path: Root(R2(R1 _), R2(R1 _)), Root(R2(R1 _), R2(R2 _)), Root(R2(R2 _), R2(R1 _)), Root(R2(R2 _), R2 _) => reduce Root(R2(R1 _), R2(R1 _)), Root(R2(R2 _), R2(R1 _)) => Root(R2 _, R2(R1 _)) Root(R2 _, R2(R1 _)), Root(R2(R1 _), R2(R2 _)), Root(R2(R2 _), R2 _) => dead end, as there are no two patterns that would have the same nested pattern in the same component If javac would do full backtracking, it could go back, and choose the other path, and find out the switch is exhaustive. But, full naive backtracking is, I think, prohibitively too slow for even relatively small switches. The implementation approach javac is using so far is that it does not remove some of the reduced patterns from the set. So, it can use the pattern again, and hence basically pick a different reduction path. But, it fails here, and if we would keep the relevant patterns here in the set, the overall performance would be too bad. So, this PR proposes that, when reducing a sub-set of patterns to another set of patterns, javac keeps a record that the new pattern(s) originate in specific original pattern(s), and if it needs to, it will look into this record when searching for possible reductions. javac does "fast reduction rounds" normally using hashes, but if it fails to find reductions using the fast approach, it switches to a (much) slower approach that uses plain subtyping instead of hashes. The new approach to search for reductions proposed herein is part of this slow round only. So, basically, the new chain after this PR is roughly: Root(R2(R1 _), R2(R1 _)), Root(R2(R1 _), R2(R2 _)), Root(R2(R2 _), R2(R1 _)), Root(R2(R2 _), R2 _) => reduce Root(R2(R1 _), R2(R1 _)), Root(R2(R2 _), R2(R1 _)) => Root(R2 _, R2(R1 _)) Root(R2 _, R2(R1 _)), Root(R2(R1 _), R2(R2 _)), Root(R2(R2 _), R2 _) => javac does not find anything it can reduce in the first stage, and will look at the original patterns. It will find out that Root(R2 _, R2(R1 _)) originates in Root(R2(R1 _), R2(R1 _)), Root(R2(R2 _), R2(R1 _)), and that it could reduce (second component mismatching): Root(R2(R1 _), R2(R1 _)), Root(R2(R1 _), R2(R2 _)) => Root(R2(R1 _), R2 _) Root(R2 _, R2(R1 _)), Root(R2(R1 _), R2 _), Root(R2(R2 _), R2 _) => as before, choosing the first component as the mismatching component, we can reduce Root(R2(R1 _), R2 _), Root(R2(R2 _), R2 _) => Root(R2 _, R2 _) Root(R2 _, R2(R1 _)), Root(R2 _, R2 _) => Root _ => exhaustive ------------- Commit messages: - Adding test. - Adjusting to spec. - Merge branch 'master' into JDK-8364991 - Improving test debuggability. - 8364991: Incorrect not-exhaustive error Changes: https://git.openjdk.org/jdk/pull/27247/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27247&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8364991 Stats: 155 lines in 2 files changed: 130 ins; 0 del; 25 mod Patch: https://git.openjdk.org/jdk/pull/27247.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27247/head:pull/27247 PR: https://git.openjdk.org/jdk/pull/27247 From jlahoda at openjdk.org Fri Sep 12 09:57:04 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Fri, 12 Sep 2025 09:57:04 GMT Subject: RFR: 8367499: Refactor exhaustiveness computation from Flow into a separate class Message-ID: Currently the switch exhaustiveness computation code is part of `Flow`. And while conceptually the check is part of the `Flow` phase, the code is >500 lines of code currently, and likely to get bigger/more complicated in the future. Among other reasons due to enhancements like https://bugs.openjdk.org/browse/JDK-8367530. The proposal herein is to move the exhaustiveness computation to a separate class `ExhastivenessComputer`. There's no functional change, only move of the code. This is intentional, to aid the review process. One possibility to inspect what is happening is: git show upstream/pr/27247:src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java >/tmp/Flow-original.java diff -d -w /tmp/Flow-original.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ExhaustivenessComputer.java >/tmp/exhaustivenesscomputer-comparison.diff diff -d -w /tmp/Flow-original.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java >/tmp/flow-comparison.diff and inspecting `/tmp/exhaustivenesscomputer-comparison.diff`, `/tmp/flow-comparison.diff`. ------------- Depends on: https://git.openjdk.org/jdk/pull/27247 Commit messages: - 8367499: Refactor exhaustiveness computation from Flow into a separate class Changes: https://git.openjdk.org/jdk/pull/27253/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27253&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8367499 Stats: 1217 lines in 2 files changed: 640 ins; 574 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27253.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27253/head:pull/27253 PR: https://git.openjdk.org/jdk/pull/27253 From fandreuzzi at openjdk.org Fri Sep 12 10:48:42 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Fri, 12 Sep 2025 10:48:42 GMT Subject: RFR: 8367499: Refactor exhaustiveness computation from Flow into a separate class In-Reply-To: References: Message-ID: On Fri, 12 Sep 2025 09:49:14 GMT, Jan Lahoda wrote: > Currently the switch exhaustiveness computation code is part of `Flow`. And while conceptually the check is part of the `Flow` phase, the code is >500 lines of code currently, and likely to get bigger/more complicated in the future. Among other reasons due to enhancements like https://bugs.openjdk.org/browse/JDK-8367530. > > The proposal herein is to move the exhaustiveness computation to a separate class `ExhastivenessComputer`. There's no functional change, only move of the code. This is intentional, to aid the review process. > > One possibility to inspect what is happening is: > > git show upstream/pr/27247:src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java >/tmp/Flow-original.java > diff -d -w /tmp/Flow-original.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ExhaustivenessComputer.java >/tmp/exhaustivenesscomputer-comparison.diff > diff -d -w /tmp/Flow-original.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java >/tmp/flow-comparison.diff > > and inspecting `/tmp/exhaustivenesscomputer-comparison.diff`, `/tmp/flow-comparison.diff`. src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ExhaustivenessComputer.java line 204: > 202: > 203: for (PatternDescription pdOne : patterns) { > 204: if (pdOne instanceof BindingPattern bpOne) { The scope of this `if` is quite wide, you could consider inverting the condition and `continue`ing if the condition does not match. This would save an indentation level. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27253#discussion_r2343822773 From fandreuzzi at openjdk.org Fri Sep 12 10:53:18 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Fri, 12 Sep 2025 10:53:18 GMT Subject: RFR: 8367499: Refactor exhaustiveness computation from Flow into a separate class In-Reply-To: References: Message-ID: On Fri, 12 Sep 2025 09:49:14 GMT, Jan Lahoda wrote: > Currently the switch exhaustiveness computation code is part of `Flow`. And while conceptually the check is part of the `Flow` phase, the code is >500 lines of code currently, and likely to get bigger/more complicated in the future. Among other reasons due to enhancements like https://bugs.openjdk.org/browse/JDK-8367530. > > The proposal herein is to move the exhaustiveness computation to a separate class `ExhastivenessComputer`. There's no functional change, only move of the code. This is intentional, to aid the review process. > > One possibility to inspect what is happening is: > > git show upstream/pr/27247:src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java >/tmp/Flow-original.java > diff -d -w /tmp/Flow-original.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ExhaustivenessComputer.java >/tmp/exhaustivenesscomputer-comparison.diff > diff -d -w /tmp/Flow-original.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java >/tmp/flow-comparison.diff > > and inspecting `/tmp/exhaustivenesscomputer-comparison.diff`, `/tmp/flow-comparison.diff`. src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ExhaustivenessComputer.java line 138: > 136: return true; > 137: } > 138: if (!repeat) { You could consider not inverting the bool here, since anyway you're handling both cases ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27253#discussion_r2343831664 From jlahoda at openjdk.org Fri Sep 12 10:57:15 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Fri, 12 Sep 2025 10:57:15 GMT Subject: RFR: 8367499: Refactor exhaustiveness computation from Flow into a separate class In-Reply-To: References: Message-ID: <-FJSObiwrgBGcpwfGeCVDwB4wY2VYIKKYD5ZM6CLQ-Q=.2f0a6141-6440-4abb-a39b-61a7bb40af7b@github.com> On Fri, 12 Sep 2025 10:46:26 GMT, Francesco Andreuzzi wrote: >> Currently the switch exhaustiveness computation code is part of `Flow`. And while conceptually the check is part of the `Flow` phase, the code is >500 lines of code currently, and likely to get bigger/more complicated in the future. Among other reasons due to enhancements like https://bugs.openjdk.org/browse/JDK-8367530. >> >> The proposal herein is to move the exhaustiveness computation to a separate class `ExhastivenessComputer`. There's no functional change, only move of the code. This is intentional, to aid the review process. >> >> One possibility to inspect what is happening is: >> >> git show upstream/pr/27247:src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java >/tmp/Flow-original.java >> diff -d -w /tmp/Flow-original.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ExhaustivenessComputer.java >/tmp/exhaustivenesscomputer-comparison.diff >> diff -d -w /tmp/Flow-original.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java >/tmp/flow-comparison.diff >> >> and inspecting `/tmp/exhaustivenesscomputer-comparison.diff`, `/tmp/flow-comparison.diff`. > > src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ExhaustivenessComputer.java line 204: > >> 202: >> 203: for (PatternDescription pdOne : patterns) { >> 204: if (pdOne instanceof BindingPattern bpOne) { > > The scope of this `if` is quite wide, you could consider inverting the condition and `continue`ing if the condition does not match. This would save an indentation level. Sorry, but the point here is to move the code from one place to another (as suggested in the description). I suspect that any change, despite how desirable it might look, is likely to make reviewing this change more difficult, and hence I would like to avoid that. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27253#discussion_r2343837511 From fandreuzzi at openjdk.org Fri Sep 12 10:57:16 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Fri, 12 Sep 2025 10:57:16 GMT Subject: RFR: 8367499: Refactor exhaustiveness computation from Flow into a separate class In-Reply-To: <-FJSObiwrgBGcpwfGeCVDwB4wY2VYIKKYD5ZM6CLQ-Q=.2f0a6141-6440-4abb-a39b-61a7bb40af7b@github.com> References: <-FJSObiwrgBGcpwfGeCVDwB4wY2VYIKKYD5ZM6CLQ-Q=.2f0a6141-6440-4abb-a39b-61a7bb40af7b@github.com> Message-ID: On Fri, 12 Sep 2025 10:54:04 GMT, Jan Lahoda wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ExhaustivenessComputer.java line 204: >> >>> 202: >>> 203: for (PatternDescription pdOne : patterns) { >>> 204: if (pdOne instanceof BindingPattern bpOne) { >> >> The scope of this `if` is quite wide, you could consider inverting the condition and `continue`ing if the condition does not match. This would save an indentation level. > > Sorry, but the point here is to move the code from one place to another (as suggested in the description). I suspect that any change, despite how desirable it might look, is likely to make reviewing this change more difficult, and hence I would like to avoid that. I see, thanks for the clarification. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27253#discussion_r2343839560 From acobbs at openjdk.org Tue Sep 16 01:49:39 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Tue, 16 Sep 2025 01:49:39 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression Message-ID: This PR adds a new compiler warning for `@SuppressWarnings` annotations that don't actually suppress any warnings. Summary of code changes: * Add new warning and associated lint category `"suppression"` * Update `LintMapper` to keep track of which `@SuppressWarnings` suppressions have been validated ? * Update `Log.warning()` so it validates any current suppression of the warning's lint category in effect. * Add a new `validate` parameter to `Lint.isEnabled()` and `Lint.isSuppressed()` that specifies whether to also validate any current suppression. * Add `Lint.isActive()` to check whether a category is enabled _or_ suppression of the category is being tracked - in other words, whether the warning calculation needs to be performed. Used for non-trivial warning calculations. * Add `-Xlint:-suppression` flags to `*.gmk` build files so the build doesn't break ? The suppression of a lint category is "validated" as soon as it suppresses some warning in that category ------------- Commit messages: - Add clarifying comment. - Merge branch 'master' into JDK-8344159 - Change inner class name to avoid shadowing superclass name. - Add a couple of code clarification comments. - Refactor test to avoid requiring changes to TestRunner. - Remove unnecessary -Xlint:-suppression flags. - Minor cleanups. - Add OPTIONS, PATH, and SUPPRESSION to the regression test. - Minor regression test cleanups. - Minor comment tweaks. - ... and 120 more: https://git.openjdk.org/jdk/compare/11cdafb8...e3283ba9 Changes: https://git.openjdk.org/jdk/pull/25167/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25167&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8344159 Stats: 1661 lines in 33 files changed: 1485 ins; 51 del; 125 mod Patch: https://git.openjdk.org/jdk/pull/25167.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25167/head:pull/25167 PR: https://git.openjdk.org/jdk/pull/25167 From erikj at openjdk.org Tue Sep 16 13:04:16 2025 From: erikj at openjdk.org (Erik Joelsson) Date: Tue, 16 Sep 2025 13:04:16 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: References: Message-ID: On Sat, 10 May 2025 20:20:32 GMT, Archie Cobbs wrote: > This PR adds a new compiler warning for `@SuppressWarnings` annotations that don't actually suppress any warnings. > > Summary of code changes: > > * Add new warning and associated lint category `"suppression"` > * Update `LintMapper` to keep track of which `@SuppressWarnings` suppressions have been validated ? > * Update `Log.warning()` so it validates any current suppression of the warning's lint category in effect. > * Add a new `validate` parameter to `Lint.isEnabled()` and `Lint.isSuppressed()` that specifies whether to also validate any current suppression. > * Add `Lint.isActive()` to check whether a category is enabled _or_ suppression of the category is being tracked - in other words, whether the warning calculation needs to be performed. Used for non-trivial warning calculations. > * Add `-Xlint:-suppression` flags to `*.gmk` build files so the build doesn't break > > ? The suppression of a lint category is "validated" as soon as it suppresses some warning in that category Build changes look good. ------------- Marked as reviewed by erikj (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25167#pullrequestreview-3229887954 From erikj at openjdk.org Tue Sep 16 13:55:23 2025 From: erikj at openjdk.org (Erik Joelsson) Date: Tue, 16 Sep 2025 13:55:23 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: References: Message-ID: <81JqWQPRbafWl22IItWNL52faigZS1l31SXsD9Zq1EE=.b6d84001-edd9-443a-8ca7-555a81ae6af0@github.com> On Sat, 10 May 2025 20:20:32 GMT, Archie Cobbs wrote: > This PR adds a new compiler warning for `@SuppressWarnings` annotations that don't actually suppress any warnings. > > Summary of code changes: > > * Add new warning and associated lint category `"suppression"` > * Update `LintMapper` to keep track of which `@SuppressWarnings` suppressions have been validated ? > * Update `Log.warning()` so it validates any current suppression of the warning's lint category in effect. > * Add a new `validate` parameter to `Lint.isEnabled()` and `Lint.isSuppressed()` that specifies whether to also validate any current suppression. > * Add `Lint.isActive()` to check whether a category is enabled _or_ suppression of the category is being tracked - in other words, whether the warning calculation needs to be performed. Used for non-trivial warning calculations. > * Add `-Xlint:-suppression` flags to `*.gmk` build files so the build doesn't break > > ? The suppression of a lint category is "validated" as soon as it suppresses some warning in that category > /label remove kulla I have removed kulla-dev from the bot configuration so the stuck label is now benign. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25167#issuecomment-3298796516 From darcy at openjdk.org Tue Sep 16 19:01:10 2025 From: darcy at openjdk.org (Joe Darcy) Date: Tue, 16 Sep 2025 19:01:10 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: References: Message-ID: On Sat, 10 May 2025 20:20:32 GMT, Archie Cobbs wrote: > This PR adds a new compiler warning for `@SuppressWarnings` annotations that don't actually suppress any warnings. > > Summary of code changes: > > * Add new warning and associated lint category `"suppression"` > * Update `LintMapper` to keep track of which `@SuppressWarnings` suppressions have been validated ? > * Update `Log.warning()` so it validates any current suppression of the warning's lint category in effect. > * Add a new `validate` parameter to `Lint.isEnabled()` and `Lint.isSuppressed()` that specifies whether to also validate any current suppression. > * Add `Lint.isActive()` to check whether a category is enabled _or_ suppression of the category is being tracked - in other words, whether the warning calculation needs to be performed. Used for non-trivial warning calculations. > * Add `-Xlint:-suppression` flags to `*.gmk` build files so the build doesn't break > > ? The suppression of a lint category is "validated" as soon as it suppresses some warning in that category Hi @archiecobbs , are there bugs filed to clean the causes of the warnings? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25167#issuecomment-3299975129 From acobbs at openjdk.org Tue Sep 16 20:06:30 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Tue, 16 Sep 2025 20:06:30 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: References: Message-ID: On Tue, 16 Sep 2025 18:58:41 GMT, Joe Darcy wrote: > Hi @archiecobbs , are there bugs filed to clean the causes of the warnings? Hi @jddarcy, At the beginning of this project as a preliminary step I filed a bunch of bugs+PR's to remove unnecessary `@SuppressWarnings` annotations. These were accepted, but they affected every area of the JDK and people kept adding new ones so it was impractical to keep up. The only way to make this cleanup operation "stick" is to fail the build whenever anyone violates it, and of course that requires that this PR be integrated first. If/when that happens I plan to do one final "mop up" round that should finally stick :) Here is the list of earlier clean up PR's: * #22906 * #21859 * #21858 * #21857 * #21856 * #21855 * #21854 * #21853 * #21852 * #21851 * #21850 * #21844 ------------- PR Comment: https://git.openjdk.org/jdk/pull/25167#issuecomment-3300177821 From darcy at openjdk.org Tue Sep 16 20:17:03 2025 From: darcy at openjdk.org (Joe Darcy) Date: Tue, 16 Sep 2025 20:17:03 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: References: Message-ID: On Tue, 16 Sep 2025 20:03:45 GMT, Archie Cobbs wrote: >> Hi @archiecobbs , are there bugs filed to clean the causes of the warnings? > >> Hi @archiecobbs , are there bugs filed to clean the causes of the warnings? > > Hi @jddarcy, > > At the beginning of this project as a preliminary step I filed a bunch of bugs+PR's to remove unnecessary `@SuppressWarnings` annotations. These were accepted, but they affected every area of the JDK and people kept adding new ones so it was impractical to keep up. The only way to make this cleanup operation "stick" is to fail the build whenever anyone violates it, and of course that requires that this PR be integrated first. If/when that happens I plan to do one final "mop up" round that should finally stick :) > > Here is the list of earlier clean up PR's: > > * #22906 > * #21859 > * #21858 > * #21857 > * #21856 > * #21855 > * #21854 > * #21853 > * #21852 > * #21851 > * #21850 > * #21844 > > Hi @archiecobbs , are there bugs filed to clean the causes of the warnings? > > Hi @jddarcy, > > At the beginning of this project as a preliminary step I filed a bunch of bugs+PR's to remove unnecessary `@SuppressWarnings` annotations. These were accepted, but they affected every area of the JDK and people kept adding new ones so it was impractical to keep up. The only way to make this cleanup operation "stick" is to fail the build whenever anyone violates it, and of course that requires that this PR be integrated first. If/when that happens I plan to do one final "mop up" round that should finally stick :) > > Here is the list of earlier clean up PR's: > > * [8346953: Remove unnecessary @SuppressWarnings annotations (client, #2) #22906](https://github.com/openjdk/jdk/pull/22906) > > * [8343486: Remove unnecessary @SuppressWarnings annotations and -Xlint:-foo options #21859](https://github.com/openjdk/jdk/pull/21859) > > * [8343484: Remove unnecessary @SuppressWarnings annotations (nio) #21858](https://github.com/openjdk/jdk/pull/21858) > > * [8343483: Remove unnecessary @SuppressWarnings annotations (serviceability) #21857](https://github.com/openjdk/jdk/pull/21857) > > * [8343482: Remove unnecessary @SuppressWarnings annotations (net) #21856](https://github.com/openjdk/jdk/pull/21856) > > * [8343481: Remove unnecessary @SuppressWarnings annotations (kulla) #21855](https://github.com/openjdk/jdk/pull/21855) > > * [8343480: Remove unnecessary @SuppressWarnings annotations (javadoc) #21854](https://github.com/openjdk/jdk/pull/21854) > > * [8343479: Remove unnecessary @SuppressWarnings annotations (hotspot) #21853](https://github.com/openjdk/jdk/pull/21853) > > * [8343478: Remove unnecessary @SuppressWarnings annotations (core-libs) #21852](https://github.com/openjdk/jdk/pull/21852) > > * [8343477: Remove unnecessary @SuppressWarnings annotations (compiler) #21851](https://github.com/openjdk/jdk/pull/21851) > > * [8343476: Remove unnecessary @SuppressWarnings annotations (client) #21850](https://github.com/openjdk/jdk/pull/21850) > > * [8343467: Remove unnecessary @SuppressWarnings annotations (security) #21844](https://github.com/openjdk/jdk/pull/21844) Sounds good; I linked the umbrella issue for the earlier round of cleanup to this issue in JBS. My interest is getting back to at least a subset of modules, including java.base, compiling under "-Xlint:all -Werror" and it sounds like that is the plan as follow-up work after this PR goes in; thanks. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25167#issuecomment-3300210592 From dholmes at openjdk.org Wed Sep 17 00:58:38 2025 From: dholmes at openjdk.org (David Holmes) Date: Wed, 17 Sep 2025 00:58:38 GMT Subject: RFR: 8361950: Update to use jtreg 8 [v4] In-Reply-To: <6p7ncBylItu9HEeCINmqu_JFoL6zNXwJuSQaZoQ0J2I=.451526e1-d918-4fee-b1a7-e8193da61545@github.com> References: <6p7ncBylItu9HEeCINmqu_JFoL6zNXwJuSQaZoQ0J2I=.451526e1-d918-4fee-b1a7-e8193da61545@github.com> Message-ID: On Thu, 4 Sep 2025 22:01:57 GMT, Christian Stein wrote: >> Please review the change to update to using jtreg 8. >> >> The primary change is to the `jib-profiles.js` file, which specifies the version of jtreg to use, for those systems that rely on this file. In addition, the requiredVersion has been updated in the various `TEST.ROOT` files. > > Christian Stein has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision: > > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Update to use correct library directories > > See also: https://openjdk.org/jtreg/faq.html#how-do-i-find-the-path-for-the-testng-or-junit-jar-files > - 8361950: Set required version to 8+2 > - 8361950: Update to use jtreg 8 I'm happy to see this go in now. Thanks ------------- PR Comment: https://git.openjdk.org/jdk/pull/26261#issuecomment-3300816267 From cstein at openjdk.org Wed Sep 17 05:41:55 2025 From: cstein at openjdk.org (Christian Stein) Date: Wed, 17 Sep 2025 05:41:55 GMT Subject: RFR: 8361950: Update to use jtreg 8 [v5] In-Reply-To: References: Message-ID: > Please review the change to update to using jtreg 8. > > The primary change is to the `jib-profiles.js` file, which specifies the version of jtreg to use, for those systems that rely on this file. In addition, the requiredVersion has been updated in the various `TEST.ROOT` files. Christian Stein has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 - Update to use correct library directories See also: https://openjdk.org/jtreg/faq.html#how-do-i-find-the-path-for-the-testng-or-junit-jar-files - 8361950: Set required version to 8+2 - 8361950: Update to use jtreg 8 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26261/files - new: https://git.openjdk.org/jdk/pull/26261/files/12b0d0f5..7f2017b4 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26261&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26261&range=03-04 Stats: 34669 lines in 1054 files changed: 16580 ins; 9869 del; 8220 mod Patch: https://git.openjdk.org/jdk/pull/26261.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26261/head:pull/26261 PR: https://git.openjdk.org/jdk/pull/26261 From alanb at openjdk.org Wed Sep 17 06:41:54 2025 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 17 Sep 2025 06:41:54 GMT Subject: RFR: 8361950: Update to use jtreg 8 [v5] In-Reply-To: References: Message-ID: On Wed, 17 Sep 2025 05:41:55 GMT, Christian Stein wrote: >> Please review the change to update to using jtreg 8. >> >> The primary change is to the `jib-profiles.js` file, which specifies the version of jtreg to use, for those systems that rely on this file. In addition, the requiredVersion has been updated in the various `TEST.ROOT` files. > > Christian Stein has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Update to use correct library directories > > See also: https://openjdk.org/jtreg/faq.html#how-do-i-find-the-path-for-the-testng-or-junit-jar-files > - 8361950: Set required version to 8+2 > - 8361950: Update to use jtreg 8 make/autoconf/lib-tests.m4 line 31: > 29: > 30: # Minimum supported versions > 31: JTREG_MINIMUM_VERSION=8 Is the min version 8 or 8.2? (everywhere else in the PR suggests 8+2 so just curious). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26261#discussion_r2354467094 From cstein at openjdk.org Wed Sep 17 06:45:37 2025 From: cstein at openjdk.org (Christian Stein) Date: Wed, 17 Sep 2025 06:45:37 GMT Subject: RFR: 8361950: Update to use jtreg 8 [v5] In-Reply-To: References: Message-ID: On Wed, 17 Sep 2025 06:39:17 GMT, Alan Bateman wrote: >> Christian Stein has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: >> >> - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 >> - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 >> - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 >> - Update to use correct library directories >> >> See also: https://openjdk.org/jtreg/faq.html#how-do-i-find-the-path-for-the-testng-or-junit-jar-files >> - 8361950: Set required version to 8+2 >> - 8361950: Update to use jtreg 8 > > make/autoconf/lib-tests.m4 line 31: > >> 29: >> 30: # Minimum supported versions >> 31: JTREG_MINIMUM_VERSION=8 > > Is the min version 8 or 8.2? (everywhere else in the PR suggests 8+2 so just curious). It's 8. The +2 refers to the build number, which is required in other places. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26261#discussion_r2354476356 From alanb at openjdk.org Wed Sep 17 06:52:34 2025 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 17 Sep 2025 06:52:34 GMT Subject: RFR: 8361950: Update to use jtreg 8 [v5] In-Reply-To: References: Message-ID: <166qfREU1L7ZkPFg-uAVlnjoiaysBbGxYRRfAGU147E=.ba03b95e-726e-4e31-b05e-e0a2afebcfd6@github.com> On Wed, 17 Sep 2025 06:43:20 GMT, Christian Stein wrote: >> make/autoconf/lib-tests.m4 line 31: >> >>> 29: >>> 30: # Minimum supported versions >>> 31: JTREG_MINIMUM_VERSION=8 >> >> Is the min version 8 or 8.2? (everywhere else in the PR suggests 8+2 so just curious). > > It's 8. The +2 refers to the build number, which is required in other places. Thanks for clarifying. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26261#discussion_r2354488946 From jlahoda at openjdk.org Wed Sep 17 08:27:48 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Wed, 17 Sep 2025 08:27:48 GMT Subject: RFR: 8366582: Test jdk/jshell/ToolSimpleTest.java failed: provider not found Message-ID: The `jdk/jshell/ToolSimpleTest.java` randomly fails, the reason is this: when indexing the bootclasspath/`PLATFORM_CLASS_PATH`, `$JDK_HOME/lib/modules` is typically there, but it can't be opened as a FileSystem, and the exception is sent to the debugging facility. The debugging facility typically does nothing, but in this test contains a test case that enabled debugging, and if the order of things is that the debugging is first enabled, and then the `ProviderNotFoundException` is reported, the test fails. The proposal herein is to not to try to open `$JDK_HOME/lib/modules` as a file system. Note the standard platform classes are indexed using `SYSTEM_MODULES`. ------------- Commit messages: - Cleanup. - 8366582: Test jdk/jshell/ToolSimpleTest.java failed: provider not found Changes: https://git.openjdk.org/jdk/pull/27333/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27333&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8366582 Stats: 8 lines in 2 files changed: 5 ins; 2 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27333.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27333/head:pull/27333 PR: https://git.openjdk.org/jdk/pull/27333 From jlahoda at openjdk.org Wed Sep 17 08:28:25 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Wed, 17 Sep 2025 08:28:25 GMT Subject: RFR: 8367279: Test tools/javac/tree/TreePosTest.java timed out Message-ID: The `test/langtools/tools/javac/tree/TreePosTest.java` tries to parse all langtools tests, and started to time out recently in some cases. In the case of this test, we can try to use the `JavacTaskPool`, which pools and reuses javac instances, rather than creating (and initializing) a javac instance for each file. Given this test only parses the file, and even attributes them, this should be relatively safe. Locally, I can't confirm too significant time improvements (before this change ~6s, after this change ~4s), but it might help on CI. ------------- Commit messages: - 8367279: Test tools/javac/tree/TreePosTest.java timed out Changes: https://git.openjdk.org/jdk/pull/27334/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27334&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8367279 Stats: 29 lines in 1 file changed: 6 ins; 8 del; 15 mod Patch: https://git.openjdk.org/jdk/pull/27334.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27334/head:pull/27334 PR: https://git.openjdk.org/jdk/pull/27334 From fandreuzzi at openjdk.org Wed Sep 17 08:31:57 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Wed, 17 Sep 2025 08:31:57 GMT Subject: RFR: 8367279: Test tools/javac/tree/TreePosTest.java timed out In-Reply-To: References: Message-ID: On Wed, 17 Sep 2025 08:20:09 GMT, Jan Lahoda wrote: > The `test/langtools/tools/javac/tree/TreePosTest.java` tries to parse all langtools tests, and started to time out recently in some cases. In the case of this test, we can try to use the `JavacTaskPool`, which pools and reuses javac instances, rather than creating (and initializing) a javac instance for each file. Given this test only parses the file, and even attributes them, this should be relatively safe. > > Locally, I can't confirm too significant time improvements (before this change ~6s, after this change ~4s), but it might help on CI. test/langtools/tools/javac/tree/TreePosTest.java line 290: > 288: if (r.errors > 0) > 289: throw new ParseException(sw.toString()); > 290: Iterator iter = trees.iterator(); Maybe `var` here would make the logic a bit more explicit? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27334#discussion_r2354737594 From ihse at openjdk.org Wed Sep 17 08:41:57 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 17 Sep 2025 08:41:57 GMT Subject: RFR: 8361950: Update to use jtreg 8 [v5] In-Reply-To: References: Message-ID: On Wed, 17 Sep 2025 05:41:55 GMT, Christian Stein wrote: >> Please review the change to update to using jtreg 8. >> >> The primary change is to the `jib-profiles.js` file, which specifies the version of jtreg to use, for those systems that rely on this file. In addition, the requiredVersion has been updated in the various `TEST.ROOT` files. > > Christian Stein has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Update to use correct library directories > > See also: https://openjdk.org/jtreg/faq.html#how-do-i-find-the-path-for-the-testng-or-junit-jar-files > - 8361950: Set required version to 8+2 > - 8361950: Update to use jtreg 8 Marked as reviewed by ihse (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26261#pullrequestreview-3233332473 From syan at openjdk.org Wed Sep 17 09:05:21 2025 From: syan at openjdk.org (SendaoYan) Date: Wed, 17 Sep 2025 09:05:21 GMT Subject: RFR: 8366582: Test jdk/jshell/ToolSimpleTest.java failed: provider not found In-Reply-To: References: Message-ID: <_4JJIxFZRSoCO6DNTDN3JDxS3YiUsLozkkTFXeE8sXU=.d35ddad7-b4dc-42c7-ab03-79ec65aa68de@github.com> On Wed, 17 Sep 2025 08:15:21 GMT, Jan Lahoda wrote: > The `jdk/jshell/ToolSimpleTest.java` randomly fails, the reason is this: when indexing the bootclasspath/`PLATFORM_CLASS_PATH`, `$JDK_HOME/lib/modules` is typically there, but it can't be opened as a FileSystem, and the exception is sent to the debugging facility. The debugging facility typically does nothing, but in this test contains a test case that enabled debugging, and if the order of things is that the debugging is first enabled, and then the `ProviderNotFoundException` is reported, the test fails. > > The proposal herein is to not to try to open `$JDK_HOME/lib/modules` as a file system. Note the standard platform classes are indexed using `SYSTEM_MODULES`. src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java line 2307: > 2305: if (!Files.isDirectory(path)) { > 2306: if (Files.exists(path) && > 2307: !isJRTMarkerFile(path)) { //don't directly index lib/modules Suggestion: !isJRTMarkerFile(path)) { //don't directly index lib/modules ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27333#discussion_r2354828223 From liach at openjdk.org Wed Sep 17 11:51:58 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 17 Sep 2025 11:51:58 GMT Subject: RFR: 8361950: Update to use jtreg 8 [v5] In-Reply-To: References: Message-ID: On Wed, 17 Sep 2025 05:41:55 GMT, Christian Stein wrote: >> Please review the change to update to using jtreg 8. >> >> The primary change is to the `jib-profiles.js` file, which specifies the version of jtreg to use, for those systems that rely on this file. In addition, the requiredVersion has been updated in the various `TEST.ROOT` files. > > Christian Stein has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Update to use correct library directories > > See also: https://openjdk.org/jtreg/faq.html#how-do-i-find-the-path-for-the-testng-or-junit-jar-files > - 8361950: Set required version to 8+2 > - 8361950: Update to use jtreg 8 Marked as reviewed by liach (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26261#pullrequestreview-3234055339 From alanb at openjdk.org Wed Sep 17 18:05:03 2025 From: alanb at openjdk.org (Alan Bateman) Date: Wed, 17 Sep 2025 18:05:03 GMT Subject: RFR: 8361950: Update to use jtreg 8 [v5] In-Reply-To: References: Message-ID: On Wed, 17 Sep 2025 05:41:55 GMT, Christian Stein wrote: >> Please review the change to update to using jtreg 8. >> >> The primary change is to the `jib-profiles.js` file, which specifies the version of jtreg to use, for those systems that rely on this file. In addition, the requiredVersion has been updated in the various `TEST.ROOT` files. > > Christian Stein has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Merge branch 'openjdk:master' into JDK-8361950-jtreg-8 > - Update to use correct library directories > > See also: https://openjdk.org/jtreg/faq.html#how-do-i-find-the-path-for-the-testng-or-junit-jar-files > - 8361950: Set required version to 8+2 > - 8361950: Update to use jtreg 8 I assume you'll do another run of all tiers before integrating. ------------- Marked as reviewed by alanb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26261#pullrequestreview-3235634542 From cstein at openjdk.org Wed Sep 17 19:24:13 2025 From: cstein at openjdk.org (Christian Stein) Date: Wed, 17 Sep 2025 19:24:13 GMT Subject: RFR: 8361950: Update to use jtreg 8 [v5] In-Reply-To: References: Message-ID: On Wed, 17 Sep 2025 18:02:32 GMT, Alan Bateman wrote: > I assume you'll do another run of all tiers before integrating. Yes. A run of tier 1-9 is in progress, with tier 1-5 already looking very promising. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26261#issuecomment-3304276125 From cstein at openjdk.org Thu Sep 18 05:54:50 2025 From: cstein at openjdk.org (Christian Stein) Date: Thu, 18 Sep 2025 05:54:50 GMT Subject: RFR: 8361950: Update to use jtreg 8 [v6] In-Reply-To: References: Message-ID: > Please review the change to update to using jtreg 8. > > The primary change is to the `jib-profiles.js` file, which specifies the version of jtreg to use, for those systems that rely on this file. In addition, the requiredVersion has been updated in the various `TEST.ROOT` files. Christian Stein has updated the pull request incrementally with one additional commit since the last revision: Fix copyright header [skip ci] ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26261/files - new: https://git.openjdk.org/jdk/pull/26261/files/7f2017b4..fd7bf6fd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26261&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26261&range=04-05 Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/26261.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26261/head:pull/26261 PR: https://git.openjdk.org/jdk/pull/26261 From jpai at openjdk.org Thu Sep 18 05:54:51 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Thu, 18 Sep 2025 05:54:51 GMT Subject: RFR: 8361950: Update to use jtreg 8 [v6] In-Reply-To: References: Message-ID: On Thu, 18 Sep 2025 05:52:07 GMT, Christian Stein wrote: >> Please review the change to update to using jtreg 8. >> >> The primary change is to the `jib-profiles.js` file, which specifies the version of jtreg to use, for those systems that rely on this file. In addition, the requiredVersion has been updated in the various `TEST.ROOT` files. > > Christian Stein has updated the pull request incrementally with one additional commit since the last revision: > > Fix copyright header > > [skip ci] The latest changes in `fd7bf6f` look good to me. ------------- Marked as reviewed by jpai (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26261#pullrequestreview-3237379113 From cstein at openjdk.org Thu Sep 18 12:12:31 2025 From: cstein at openjdk.org (Christian Stein) Date: Thu, 18 Sep 2025 12:12:31 GMT Subject: Integrated: 8361950: Update to use jtreg 8 In-Reply-To: References: Message-ID: On Fri, 11 Jul 2025 09:05:40 GMT, Christian Stein wrote: > Please review the change to update to using jtreg 8. > > The primary change is to the `jib-profiles.js` file, which specifies the version of jtreg to use, for those systems that rely on this file. In addition, the requiredVersion has been updated in the various `TEST.ROOT` files. This pull request has now been integrated. Changeset: 5db1dfe5 Author: Christian Stein URL: https://git.openjdk.org/jdk/commit/5db1dfe5c8b5df40779bb450849e6433aa9825ab Stats: 41 lines in 11 files changed: 9 ins; 19 del; 13 mod 8361950: Update to use jtreg 8 Reviewed-by: jpai, iris, joehw, erikj, ihse, liach, alanb ------------- PR: https://git.openjdk.org/jdk/pull/26261 From liach at openjdk.org Thu Sep 18 12:41:00 2025 From: liach at openjdk.org (Chen Liang) Date: Thu, 18 Sep 2025 12:41:00 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v5] In-Reply-To: References: Message-ID: On Thu, 18 Sep 2025 12:37:51 GMT, Christian Stein wrote: >> Please review this change to use JUnit in tests of `test/langtools/tools/javac`. >> >> ### Assess Status Quo >> A local `make test TEST=test/langtools/tools/javac` run before the conversion yields: >> >> Test results: passed: 3,938; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 >> Framework-based tests: 3043 = 2762 TestNG + 281 JUnit >> >> >> ### Perform Automatic Conversion >> - [junit-convert]( >> https://github.com/lahodaj/netbeans/tree/openjdk-testng-junit-fixes-and-hacks/java/java.openjdk.project/junit-convert) >> >> ### Perform Manual Adjustments >> >> Some of the following adjustments will be integrated into the `junit-convert` tool. >> >> #### Make argument source factory method `static` >> >> Method 'public java.lang.Object[][] org.openjdk.tests.javac.FDTest.caseGenerator()' >> must be static: local factory methods must be static >> unless the PER_CLASS @testinstance lifecycle mode is used; >> external factory methods must always be static. >> >> >> #### Make `@AfterAll`-annotated method `static` >> >> [ERROR] @afterall method 'public void org.openjdk.tests.vm.FDSeparateCompilationTest.cleanupCompilerCache()' >> must be static unless the test class >> is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. >> >> >> #### Remove `static` modifier from `@Test`-annotated methods >> This configuration error should have been detected by JUnit Jupiter and reported via the Discovery >> Issues API: https://docs.junit.org/current/user-guide/#running-tests-discovery-issues >> >> #### Rename test property to `JUnit.dirs` >> >> package org.junit.jupiter.api does not exist >> >> >> #### Add custom test instance factory >> >> Class [FDTests] must declare a single constructor >> Class [MethodReferenceTestKinds] must declare a single constructor >> >> >> ### Results >> Re-run tests via `make test TEST=test/langtools/tools/javac` after the conversion; yielding: >> >> Test results: passed: 3,939; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 >> Framework-based tests: 3043 = 0 TestNG + 3043 JUnit > > Christian Stein has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 10 commits: > > - Merge remote-tracking branch 'openjdk/master' into JDK-8366678-use-junit-in-javac-tests > > # Conflicts: > # test/jdk/java/security/SignedJar/spi-calendar-provider/TestSPISigned.java > - Restore comment - it is unrelated to the JUnit conversion > - Update to use correct library directories > > See also: https://openjdk.org/jtreg/faq.html#how-do-i-find-the-path-for-the-testng-or-junit-jar-files > - 8361950: Set required version to 8+2 > - 8361950: Update to use jtreg 8 > - Refactor test classes to have a unique constructor > > That way, Jupiter doesn't need the help of a custom test instance factory > - Update copyright year > - Remove `static` modifier from `@Test`-annotated methods > > This configuration error should have been detected > by JUnit Jupiter and reported via the Discovery > Issues API: > > https://docs.junit.org/current/user-guide/#running-tests-discovery-issues > - Manual adjustments > > - Make argument source factory method `static` > > Solves: > ``` > Method 'public java.lang.Object[][] org.openjdk.tests.javac.FDTest.caseGenerator()' > must be static: local factory methods must be static > unless the PER_CLASS @TestInstance lifecycle mode is used; > external factory methods must always be static. > ``` > > - Make `@AfterAll`-annotated method `static` > > Solves: > ``` > [ERROR] @AfterAll method 'public void org.openjdk.tests.vm.FDSeparateCompilationTest.cleanupCompilerCache()' > must be static unless the test class > is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. > ``` > > - Rename test property to `JUnit.dirs` > > Solves: > ``` > package org.junit.jupiter.api does not exist > ``` > > - Add custom test instance factory > > Solves: > ``` > Class [FDTests] must declare a single constructor > Class [MethodReferenceTestKinds] must declare a single constructor > ``` > - Initial automatic conversion > > https://github.com/lahodaj/netbeans/tree/openjdk-testng-junit-fixes-and-hacks/java/java.openjdk.project/junit-convert Merge looks trivial ------------- Marked as reviewed by liach (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27046#pullrequestreview-3239400608 From cstein at openjdk.org Thu Sep 18 12:40:59 2025 From: cstein at openjdk.org (Christian Stein) Date: Thu, 18 Sep 2025 12:40:59 GMT Subject: RFR: 8366678: Use JUnit in test/langtools/tools/javac [v5] In-Reply-To: References: Message-ID: > Please review this change to use JUnit in tests of `test/langtools/tools/javac`. > > ### Assess Status Quo > A local `make test TEST=test/langtools/tools/javac` run before the conversion yields: > > Test results: passed: 3,938; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 > Framework-based tests: 3043 = 2762 TestNG + 281 JUnit > > > ### Perform Automatic Conversion > - [junit-convert]( > https://github.com/lahodaj/netbeans/tree/openjdk-testng-junit-fixes-and-hacks/java/java.openjdk.project/junit-convert) > > ### Perform Manual Adjustments > > Some of the following adjustments will be integrated into the `junit-convert` tool. > > #### Make argument source factory method `static` > > Method 'public java.lang.Object[][] org.openjdk.tests.javac.FDTest.caseGenerator()' > must be static: local factory methods must be static > unless the PER_CLASS @testinstance lifecycle mode is used; > external factory methods must always be static. > > > #### Make `@AfterAll`-annotated method `static` > > [ERROR] @afterall method 'public void org.openjdk.tests.vm.FDSeparateCompilationTest.cleanupCompilerCache()' > must be static unless the test class > is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. > > > #### Remove `static` modifier from `@Test`-annotated methods > This configuration error should have been detected by JUnit Jupiter and reported via the Discovery > Issues API: https://docs.junit.org/current/user-guide/#running-tests-discovery-issues > > #### Rename test property to `JUnit.dirs` > > package org.junit.jupiter.api does not exist > > > #### Add custom test instance factory > > Class [FDTests] must declare a single constructor > Class [MethodReferenceTestKinds] must declare a single constructor > > > ### Results > Re-run tests via `make test TEST=test/langtools/tools/javac` after the conversion; yielding: > > Test results: passed: 3,939; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 > Framework-based tests: 3043 = 0 TestNG + 3043 JUnit Christian Stein has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 10 commits: - Merge remote-tracking branch 'openjdk/master' into JDK-8366678-use-junit-in-javac-tests # Conflicts: # test/jdk/java/security/SignedJar/spi-calendar-provider/TestSPISigned.java - Restore comment - it is unrelated to the JUnit conversion - Update to use correct library directories See also: https://openjdk.org/jtreg/faq.html#how-do-i-find-the-path-for-the-testng-or-junit-jar-files - 8361950: Set required version to 8+2 - 8361950: Update to use jtreg 8 - Refactor test classes to have a unique constructor That way, Jupiter doesn't need the help of a custom test instance factory - Update copyright year - Remove `static` modifier from `@Test`-annotated methods This configuration error should have been detected by JUnit Jupiter and reported via the Discovery Issues API: https://docs.junit.org/current/user-guide/#running-tests-discovery-issues - Manual adjustments - Make argument source factory method `static` Solves: ``` Method 'public java.lang.Object[][] org.openjdk.tests.javac.FDTest.caseGenerator()' must be static: local factory methods must be static unless the PER_CLASS @TestInstance lifecycle mode is used; external factory methods must always be static. ``` - Make `@AfterAll`-annotated method `static` Solves: ``` [ERROR] @AfterAll method 'public void org.openjdk.tests.vm.FDSeparateCompilationTest.cleanupCompilerCache()' must be static unless the test class is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. ``` - Rename test property to `JUnit.dirs` Solves: ``` package org.junit.jupiter.api does not exist ``` - Add custom test instance factory Solves: ``` Class [FDTests] must declare a single constructor Class [MethodReferenceTestKinds] must declare a single constructor ``` - Initial automatic conversion https://github.com/lahodaj/netbeans/tree/openjdk-testng-junit-fixes-and-hacks/java/java.openjdk.project/junit-convert ------------- Changes: https://git.openjdk.org/jdk/pull/27046/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27046&range=04 Stats: 653 lines in 39 files changed: 195 ins; 97 del; 361 mod Patch: https://git.openjdk.org/jdk/pull/27046.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27046/head:pull/27046 PR: https://git.openjdk.org/jdk/pull/27046 From ihse at openjdk.org Thu Sep 18 14:50:18 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 18 Sep 2025 14:50:18 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: References: Message-ID: On Sat, 10 May 2025 20:20:32 GMT, Archie Cobbs wrote: > This PR adds a new compiler warning for `@SuppressWarnings` annotations that don't actually suppress any warnings. > > Summary of code changes: > > * Add new warning and associated lint category `"suppression"` > * Update `LintMapper` to keep track of which `@SuppressWarnings` suppressions have been validated ? > * Update `Log.warning()` so it validates any current suppression of the warning's lint category in effect. > * Add a new `validate` parameter to `Lint.isEnabled()` and `Lint.isSuppressed()` that specifies whether to also validate any current suppression. > * Add `Lint.isActive()` to check whether a category is enabled _or_ suppression of the category is being tracked - in other words, whether the warning calculation needs to be performed. Used for non-trivial warning calculations. > * Add `-Xlint:-suppression` flags to `*.gmk` build files so the build doesn't break > > ? The suppression of a lint category is "validated" as soon as it suppresses some warning in that category Build changes look fine. ------------- Marked as reviewed by ihse (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25167#pullrequestreview-3240239228 From wenanjian at openjdk.org Sun Sep 21 00:50:18 2025 From: wenanjian at openjdk.org (Anjian Wen) Date: Sun, 21 Sep 2025 00:50:18 GMT Subject: RFR: 8365732: RISC-V: implement AES CTR intrinsics [v7] In-Reply-To: References: Message-ID: <6-c0fA19VDBsLUwN2ewcYQ_bPSD7Zt6h5lsIOhTMGpk=.80f0aca5-601b-48dd-9c0e-c79612976da9@github.com> On Fri, 19 Sep 2025 07:09:27 GMT, Fei Yang wrote: >> Anjian Wen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision: >> >> - Merge branch 'openjdk:master' into aes_ctr >> - fix the counter increase at limit and add test >> - change format >> - update reg use and instruction >> - change some name and format >> - delete useless Label, change L_judge_used to L_slow_loop >> - add Flags and fix the stubid name >> - RISC-V: implement AES-CTR mode intrinsics > > src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 2667: > >> 2665: __ addi(t0, counter, 8); >> 2666: __ ld(tmp, Address(t0)); >> 2667: __ rev8(tmp, tmp); > > Note that `rev8` is only available under `UseZbb`. Maybe you should use `revb/revbw` instead which considers that the availability of Zbb extension. I used the zbb and zvbb instructions in my patch?which seem not easy to replace in vector operations, and there are some optimizations when using them, so I think we may add a extension check in vm_version_riscv.cpp? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25281#discussion_r2365883933 From wenanjian at openjdk.org Sun Sep 21 00:57:40 2025 From: wenanjian at openjdk.org (Anjian Wen) Date: Sun, 21 Sep 2025 00:57:40 GMT Subject: RFR: 8365732: RISC-V: implement AES CTR intrinsics [v9] In-Reply-To: References: Message-ID: > Hi everyone, please help review this patch which Implement the _counterMode_AESCrypt with Zvkned. On my QEMU, with Zvkned extension enabled, the tests in test/hotspot/jtreg/compiler/codegen/aes/ Passed. Anjian Wen has updated the pull request incrementally with one additional commit since the last revision: add zbb and zvbb check ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25281/files - new: https://git.openjdk.org/jdk/pull/25281/files/35f82e0a..529f7cf8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25281&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25281&range=07-08 Stats: 8 lines in 1 file changed: 8 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25281.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25281/head:pull/25281 PR: https://git.openjdk.org/jdk/pull/25281 From duke at openjdk.org Sun Sep 21 07:45:35 2025 From: duke at openjdk.org (Stephan Schroevers) Date: Sun, 21 Sep 2025 07:45:35 GMT Subject: RFR: 8348611: Eliminate DeferredLintHandler and emit warnings after attribution [v11] In-Reply-To: References: <08zj2WBmFFeEQbGegExwyGLIDLQV71_TmkqDA4lYad8=.50f5befe-7d49-4865-92e8-fcbbf1f5ea32@github.com> Message-ID: On Thu, 14 Aug 2025 04:00:12 GMT, Archie Cobbs wrote: >> This is a cleanup/refactoring of how lint warnings are logged and `@SuppressWarnings` annotations applied. >> >> A central challenge with lint warnings is that warnings can be generated during any compiler phase, but whether a particular lint warning is suppressed via `@SuppressWarnings` can't be known until after attribution. For example, the parser doesn't have enough information to interpret and apply `@SuppressWarnings("text-blocks")` to text blocks, or `@SuppressWarnings("preview")` to preview lexical features; instead, the `DeferredLintHandler` is used to workaround this limitation. >> >> In addition, several other factors complicate things: >> * Knowing the current applicable `Lint` instance requires manually tracking it with each declaration visited and applying/removing the `@SuppressWarnings` annotation there, if any >> * Some warnings are "suppressibly mandatory" (i.e., they are _emitted if not suppressed_ instead of _emitted if enabled_) >> * Some warnings are "unsuppressibly mandatory" (e.g., the "internal proprietary API" warning) >> * Some mandatory warnings are _aggregated_ into notes that are emitted at the end of compilation when not enabled >> * Some warnings are _lint_ warnings, with a corresponding lint category, while others are just "plain" warnings >> * Some lint warnings are suppressible via `@SuppressWarnings`, while others are only suppressible via `-Xlint:-foo` flags >> * Speculative compilation requires holding log messages in purgatory until the speculation resolves, after which they are then either discarded or emitted. But this creates a tricky interaction with `DeferredLintHandler` because even after speculation is complete, we may still not yet know whether a warning should be suppressed. >> >> Previously the logic to get all of this right was non-obviously woven around the code base. In particular, you needed to know somehow whether or not to use `DeferredLintHandler`, and in what "mode". >> >> The overall goal of this PR is to simplify usage so that **no matter where you are in the compiler, you can just invoke `log.warning()` to log a warning** and (mostly) forget about all of the details listed above. > > Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision: > > Remove unused field from "LintRange" record. This PR fixes an issue that impacts JDK 25. See openrewrite/rewrite-templating#165 for details. Can/will it be backported for inclusion in JDK 25.0.1? (Asking here, as I don't have an account at https://bugs.openjdk.org/. Let me know if there's a better/preferred channel.) ------------- PR Comment: https://git.openjdk.org/jdk/pull/24584#issuecomment-3315229489 From acobbs at openjdk.org Sun Sep 21 13:54:32 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Sun, 21 Sep 2025 13:54:32 GMT Subject: RFR: 8348611: Eliminate DeferredLintHandler and emit warnings after attribution [v11] In-Reply-To: References: <08zj2WBmFFeEQbGegExwyGLIDLQV71_TmkqDA4lYad8=.50f5befe-7d49-4865-92e8-fcbbf1f5ea32@github.com> Message-ID: On Sat, 20 Sep 2025 20:10:50 GMT, Stephan Schroevers wrote: >> Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove unused field from "LintRange" record. > > This PR fixes an issue that impacts JDK 25. See openrewrite/rewrite-templating#165 for details. Can/will it be backported for inclusion in JDK 25.0.1? > > (Asking here, as I don't have an account at https://bugs.openjdk.org/. Let me know if there's a better/preferred channel.) @Stephan202, I took at look at the openrewrite issue but it's not specific on what the actual bug is. Also, this PR was mostly a refactoring so that doesn't clarify it either. Do you have a small reproducer test case that demonstrates the bug? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24584#issuecomment-3316008914 From duke at openjdk.org Sun Sep 21 14:33:34 2025 From: duke at openjdk.org (Stephan Schroevers) Date: Sun, 21 Sep 2025 14:33:34 GMT Subject: RFR: 8348611: Eliminate DeferredLintHandler and emit warnings after attribution [v11] In-Reply-To: References: <08zj2WBmFFeEQbGegExwyGLIDLQV71_TmkqDA4lYad8=.50f5befe-7d49-4865-92e8-fcbbf1f5ea32@github.com> Message-ID: <6KrP8XwSjh-w5rzUlcgVLGCKnVBkdINCmo93sjfswI8=.298dabd0-27a6-43fd-9ef9-e3bd27dc17f8@github.com> On Sun, 21 Sep 2025 13:51:05 GMT, Archie Cobbs wrote: >> This PR fixes an issue that impacts JDK 25. See openrewrite/rewrite-templating#165 for details. Can/will it be backported for inclusion in JDK 25.0.1? >> >> (Asking here, as I don't have an account at https://bugs.openjdk.org/. Let me know if there's a better/preferred channel.) > > @Stephan202, > > I took at look at the openrewrite issue but it's not specific on what the actual bug is. Also, this PR was mostly a refactoring so that doesn't clarify it either. Do you have a small reproducer test case that demonstrates the bug? Hey @archiecobbs! I used the reproducer in openrewrite/rewrite-templating#165 to `git bisect` my way to the commits that introduced and then resolved the issue (by building the JDK at a specific revision, then manually checking whether the build failed with `export JAVA_HOME=/tmp/jdk/build/linux-x86_64-server-release/jdk`). The actual bug is described [here](https://github.com/PicnicSupermarket/error-prone-support/pull/1853#pullrequestreview-3241202198): "somehow" when OpenRewrite's annotation processor is active, `javac` reports `unchecked` and `deprecation` warnings, despite occurring in a `@SuppressWarnings` scope. I only briefly looked around with a debugger, but was not familiar enough with JDK internals to quickly understand what happens. I'm currently working on a much smaller reproduction case; I'll post here once done. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24584#issuecomment-3316031893 From duke at openjdk.org Sun Sep 21 15:05:35 2025 From: duke at openjdk.org (Stephan Schroevers) Date: Sun, 21 Sep 2025 15:05:35 GMT Subject: RFR: 8348611: Eliminate DeferredLintHandler and emit warnings after attribution [v11] In-Reply-To: References: <08zj2WBmFFeEQbGegExwyGLIDLQV71_TmkqDA4lYad8=.50f5befe-7d49-4865-92e8-fcbbf1f5ea32@github.com> Message-ID: On Thu, 14 Aug 2025 04:00:12 GMT, Archie Cobbs wrote: >> This is a cleanup/refactoring of how lint warnings are logged and `@SuppressWarnings` annotations applied. >> >> A central challenge with lint warnings is that warnings can be generated during any compiler phase, but whether a particular lint warning is suppressed via `@SuppressWarnings` can't be known until after attribution. For example, the parser doesn't have enough information to interpret and apply `@SuppressWarnings("text-blocks")` to text blocks, or `@SuppressWarnings("preview")` to preview lexical features; instead, the `DeferredLintHandler` is used to workaround this limitation. >> >> In addition, several other factors complicate things: >> * Knowing the current applicable `Lint` instance requires manually tracking it with each declaration visited and applying/removing the `@SuppressWarnings` annotation there, if any >> * Some warnings are "suppressibly mandatory" (i.e., they are _emitted if not suppressed_ instead of _emitted if enabled_) >> * Some warnings are "unsuppressibly mandatory" (e.g., the "internal proprietary API" warning) >> * Some mandatory warnings are _aggregated_ into notes that are emitted at the end of compilation when not enabled >> * Some warnings are _lint_ warnings, with a corresponding lint category, while others are just "plain" warnings >> * Some lint warnings are suppressible via `@SuppressWarnings`, while others are only suppressible via `-Xlint:-foo` flags >> * Speculative compilation requires holding log messages in purgatory until the speculation resolves, after which they are then either discarded or emitted. But this creates a tricky interaction with `DeferredLintHandler` because even after speculation is complete, we may still not yet know whether a warning should be suppressed. >> >> Previously the logic to get all of this right was non-obviously woven around the code base. In particular, you needed to know somehow whether or not to use `DeferredLintHandler`, and in what "mode". >> >> The overall goal of this PR is to simplify usage so that **no matter where you are in the compiler, you can just invoke `log.warning()` to log a warning** and (mostly) forget about all of the details listed above. > > Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision: > > Remove unused field from "LintRange" record. Alright, run the following script in an empty directory to create a `pom.xml` and `src/main/java/com/example/Reproducer.java`: #!/usr/bin/env bash set -euo pipefail # Creates files in the current directory to reproduce the issue. # This script writes `pom.xml` and `src/main/java/com/example/Reproducer.java`. mkdir -p src/main/java/com/example cat > pom.xml <<'POM_EOF' 4.0.0 com.example reproducer 0.0.1-SNAPSHOT UTF-8 com.google.errorprone error_prone_core 2.42.0 javax.annotation javax.annotation-api 1.3.2 org.assertj assertj-bom 3.27.4 pom import org.openrewrite.recipe rewrite-recipe-bom 3.14.0 pom import com.google.errorprone error_prone_core javax.annotation javax.annotation-api provided org.assertj assertj-core org.openrewrite rewrite-java org.openrewrite rewrite-templating org.apache.maven.plugins maven-compiler-plugin 3.14.0 -Xlint:all true 17 true true break-it org.apache.maven.plugins maven-compiler-plugin org.openrewrite rewrite-templating POM_EOF cat > src/main/java/com/example/Reproducer.java <<'JAVA_EOF' package com.example; import com.google.errorprone.refaster.annotation.AfterTemplate; import com.google.errorprone.refaster.annotation.BeforeTemplate; import org.assertj.core.api.AbstractThrowableAssert; final class Reproducer { // XXX: This rule changes the `Throwable` against which subsequent assertions are made. static final class AbstractThrowableAssertCauseIsSameAs { @BeforeTemplate @SuppressWarnings("deprecation" /* This deprecated API will be rewritten. */) AbstractThrowableAssert before( AbstractThrowableAssert throwableAssert, Throwable expected) { return throwableAssert.hasCauseReference(expected); } @AfterTemplate AbstractThrowableAssert after( AbstractThrowableAssert throwableAssert, Throwable expected) { return throwableAssert.cause().isSameAs(expected); } } } JAVA_EOF With JDK 25, the build passes when running `mvn clean compile`, but fails when running `mvn clean compile -Pbreak-it`: ... [INFO] --- compiler:3.14.0:compile (default-compile) @ reproducer --- [INFO] Recompiling the module because of changed source code. [INFO] Compiling 1 source file with javac [debug parameters release 17] to target/classes [INFO] ------------------------------------------------------------- [WARNING] COMPILATION WARNING : [INFO] ------------------------------------------------------------- [WARNING] /tmp/_/src/main/java/com/example/Reproducer.java:[14,29] hasCauseReference(java.lang.Throwable) in org.assertj.core.api.AbstractThrowableAssert has been deprecated [INFO] 1 warning [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] warnings found and -Werror specified [INFO] 1 error [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE ... With JDK 24 and below (and the latest JDK 26 EA build) the build correctly passes with both commands. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24584#issuecomment-3316051542 From acobbs at openjdk.org Mon Sep 22 00:33:34 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Mon, 22 Sep 2025 00:33:34 GMT Subject: RFR: 8348611: Eliminate DeferredLintHandler and emit warnings after attribution [v11] In-Reply-To: References: <08zj2WBmFFeEQbGegExwyGLIDLQV71_TmkqDA4lYad8=.50f5befe-7d49-4865-92e8-fcbbf1f5ea32@github.com> Message-ID: On Sun, 21 Sep 2025 15:02:55 GMT, Stephan Schroevers wrote: >> Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove unused field from "LintRange" record. > > Alright, run the following script in an empty directory to create a `pom.xml` and `src/main/java/com/example/Reproducer.java`: > > #!/usr/bin/env bash > > set -euo pipefail > > # Creates files in the current directory to reproduce the issue. > # This script writes `pom.xml` and `src/main/java/com/example/Reproducer.java`. > > mkdir -p src/main/java/com/example > > cat > pom.xml <<'POM_EOF' > > > 4.0.0 > > com.example > reproducer > 0.0.1-SNAPSHOT > > > UTF-8 > > > > > > com.google.errorprone > error_prone_core > 2.42.0 > > > javax.annotation > javax.annotation-api > 1.3.2 > > > org.assertj > assertj-bom > 3.27.4 > pom > import > > > org.openrewrite.recipe > rewrite-recipe-bom > 3.14.0 > pom > import > > > > > > > com.google.errorprone > error_prone_core > > > javax.annotation > javax.annotation-api > provided > > > org.assertj > assertj-core > > > org.openrewrite References: Message-ID: On Tue, 2 Sep 2025 12:30:08 GMT, Christian Stein wrote: > Please review this change to use JUnit in tests of `test/langtools/tools/javac`. > > ### Assess Status Quo > A local `make test TEST=test/langtools/tools/javac` run before the conversion yields: > > Test results: passed: 3,938; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 > Framework-based tests: 3043 = 2762 TestNG + 281 JUnit > > > ### Perform Automatic Conversion > - [junit-convert]( > https://github.com/lahodaj/netbeans/tree/openjdk-testng-junit-fixes-and-hacks/java/java.openjdk.project/junit-convert) > > ### Perform Manual Adjustments > > Some of the following adjustments will be integrated into the `junit-convert` tool. > > #### Make argument source factory method `static` > > Method 'public java.lang.Object[][] org.openjdk.tests.javac.FDTest.caseGenerator()' > must be static: local factory methods must be static > unless the PER_CLASS @testinstance lifecycle mode is used; > external factory methods must always be static. > > > #### Make `@AfterAll`-annotated method `static` > > [ERROR] @afterall method 'public void org.openjdk.tests.vm.FDSeparateCompilationTest.cleanupCompilerCache()' > must be static unless the test class > is annotated with `@TestInstance(Lifecycle.PER_CLASS)`. > > > #### Remove `static` modifier from `@Test`-annotated methods > This configuration error should have been detected by JUnit Jupiter and reported via the Discovery > Issues API: https://docs.junit.org/current/user-guide/#running-tests-discovery-issues > > #### Rename test property to `JUnit.dirs` > > package org.junit.jupiter.api does not exist > > > #### Prune extra contructors > > Class [FDTests] must declare a single constructor > Class [MethodReferenceTestKinds] must declare a single constructor > > > Initially by adding custom test instance factory to help JUnit select the correct constructor. > Now by deleting all-but-one constructor to used by file-local code and JUnit alike. > > ### Results > Re-run tests via `make test TEST=test/langtools/tools/javac` after the conversion; yielding: > > Test results: passed: 3,939; excluded: 4; did not match keywords: 2; did not meet platform requirements: 2 > Framework-based tests: 3043 = 0 TestNG + 3043 JUnit This pull request has now been integrated. Changeset: 682fd784 Author: Christian Stein URL: https://git.openjdk.org/jdk/commit/682fd7846c9a6f80c399c7e44f3fccb9a07c6c47 Stats: 653 lines in 39 files changed: 195 ins; 97 del; 361 mod 8366678: Use JUnit in test/langtools/tools/javac Reviewed-by: liach ------------- PR: https://git.openjdk.org/jdk/pull/27046 From jlahoda at openjdk.org Mon Sep 22 06:35:37 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 22 Sep 2025 06:35:37 GMT Subject: RFR: 8348611: Eliminate DeferredLintHandler and emit warnings after attribution [v11] In-Reply-To: References: <08zj2WBmFFeEQbGegExwyGLIDLQV71_TmkqDA4lYad8=.50f5befe-7d49-4865-92e8-fcbbf1f5ea32@github.com> Message-ID: On Thu, 14 Aug 2025 04:00:12 GMT, Archie Cobbs wrote: >> This is a cleanup/refactoring of how lint warnings are logged and `@SuppressWarnings` annotations applied. >> >> A central challenge with lint warnings is that warnings can be generated during any compiler phase, but whether a particular lint warning is suppressed via `@SuppressWarnings` can't be known until after attribution. For example, the parser doesn't have enough information to interpret and apply `@SuppressWarnings("text-blocks")` to text blocks, or `@SuppressWarnings("preview")` to preview lexical features; instead, the `DeferredLintHandler` is used to workaround this limitation. >> >> In addition, several other factors complicate things: >> * Knowing the current applicable `Lint` instance requires manually tracking it with each declaration visited and applying/removing the `@SuppressWarnings` annotation there, if any >> * Some warnings are "suppressibly mandatory" (i.e., they are _emitted if not suppressed_ instead of _emitted if enabled_) >> * Some warnings are "unsuppressibly mandatory" (e.g., the "internal proprietary API" warning) >> * Some mandatory warnings are _aggregated_ into notes that are emitted at the end of compilation when not enabled >> * Some warnings are _lint_ warnings, with a corresponding lint category, while others are just "plain" warnings >> * Some lint warnings are suppressible via `@SuppressWarnings`, while others are only suppressible via `-Xlint:-foo` flags >> * Speculative compilation requires holding log messages in purgatory until the speculation resolves, after which they are then either discarded or emitted. But this creates a tricky interaction with `DeferredLintHandler` because even after speculation is complete, we may still not yet know whether a warning should be suppressed. >> >> Previously the logic to get all of this right was non-obviously woven around the code base. In particular, you needed to know somehow whether or not to use `DeferredLintHandler`, and in what "mode". >> >> The overall goal of this PR is to simplify usage so that **no matter where you are in the compiler, you can just invoke `log.warning()` to log a warning** and (mostly) forget about all of the details listed above. > > Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision: > > Remove unused field from "LintRange" record. I am afraid I need to be even more strict: internal "APIs" are not supported, and are not kept stable. Any use of such "APIs" is not recommended, and it is solely up to the user to handle any updates/changes. My wild guess here is that openrewrite tries to suppress diagnostics (so that it can attribute the template without producing anything), but that fails for some reason (although I admit I don't immediately see the reason). It is hard to say, as the code simply ignores all exceptions: https://github.com/openrewrite/rewrite-templating/blob/02cc7b03b9ef8eea0c609866bf0788d08731deb6/src/main/java/org/openrewrite/java/template/internal/CompilerMessageSuppressor.java#L127 And since this PR moves the warning reporting a to later point, it appears to work after this PR. Also, for completeness, code like this: https://github.com/openrewrite/rewrite-templating/blob/02cc7b03b9ef8eea0c609866bf0788d08731deb6/src/main/java/org/openrewrite/java/template/processor/TypeAwareProcessor.java#L138 is basically guaranteed to stop working at some point: https://openjdk.org/jeps/498 ------------- PR Comment: https://git.openjdk.org/jdk/pull/24584#issuecomment-3317172398 From asotona at openjdk.org Mon Sep 22 19:02:54 2025 From: asotona at openjdk.org (Adam Sotona) Date: Mon, 22 Sep 2025 19:02:54 GMT Subject: RFR: 8366926: Unexpected exception occurs when executing code in a "local" JShell environment Message-ID: JShell "local" execution environments instruments loaded classes. Instrumentation depends on the default class hierarchy resolution, which only knows already loaded classes. Reported bug provides a test case where class hierarchy of the local classes is required and the resolution fails. This patch configures instrumentation with the default class hierarchy resolver chained with a resolver parsing the pre-instrumentation class binaries. Please review. Thanks, Adam ------------- Commit messages: - 8366926: Unexpected exception occurs when executing code in a "local" JShell environment Changes: https://git.openjdk.org/jdk/pull/27436/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27436&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8366926 Stats: 89 lines in 2 files changed: 84 ins; 2 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27436.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27436/head:pull/27436 PR: https://git.openjdk.org/jdk/pull/27436 From liach at openjdk.org Mon Sep 22 21:07:49 2025 From: liach at openjdk.org (Chen Liang) Date: Mon, 22 Sep 2025 21:07:49 GMT Subject: RFR: 8366926: Unexpected exception occurs when executing code in a "local" JShell environment In-Reply-To: References: Message-ID: On Mon, 22 Sep 2025 18:54:59 GMT, Adam Sotona wrote: > JShell "local" execution environments instruments loaded classes. > Instrumentation depends on the default class hierarchy resolution, which only knows already loaded classes. > Reported bug provides a test case where class hierarchy of the local classes is required and the resolution fails. > > This patch configures instrumentation with the default class hierarchy resolver chained with a resolver parsing the pre-instrumentation class binaries. > > Please review. > > Thanks, > Adam Looks right to me. ------------- Marked as reviewed by liach (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27436#pullrequestreview-3255189349 From jlahoda at openjdk.org Tue Sep 23 08:15:59 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Tue, 23 Sep 2025 08:15:59 GMT Subject: RFR: 8366926: Unexpected exception occurs when executing code in a "local" JShell environment In-Reply-To: References: Message-ID: <7UM0gALJ4WDjY7HEUvfIsBSHrMo4pC4H5IolIRsUuuI=.6b6e13a5-6b89-4c76-b698-b8e35acef908@github.com> On Mon, 22 Sep 2025 18:54:59 GMT, Adam Sotona wrote: > JShell "local" execution environments instruments loaded classes. > Instrumentation depends on the default class hierarchy resolution, which only knows already loaded classes. > Reported bug provides a test case where class hierarchy of the local classes is required and the resolution fails. > > This patch configures instrumentation with the default class hierarchy resolver chained with a resolver parsing the pre-instrumentation class binaries. > > Please review. > > Thanks, > Adam Looks good to me, thanks! ------------- Marked as reviewed by jlahoda (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27436#pullrequestreview-3256787683 From asotona at openjdk.org Tue Sep 23 09:12:50 2025 From: asotona at openjdk.org (Adam Sotona) Date: Tue, 23 Sep 2025 09:12:50 GMT Subject: RFR: 8366926: Unexpected exception occurs when executing code in a "local" JShell environment In-Reply-To: References: Message-ID: On Mon, 22 Sep 2025 18:54:59 GMT, Adam Sotona wrote: > JShell "local" execution environments instruments loaded classes. > Instrumentation depends on the default class hierarchy resolution, which only knows already loaded classes. > Reported bug provides a test case where class hierarchy of the local classes is required and the resolution fails. > > This patch configures instrumentation with the default class hierarchy resolver chained with a resolver parsing the pre-instrumentation class binaries. > > Please review. > > Thanks, > Adam Thank you for the reviews! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27436#issuecomment-3323064725 From asotona at openjdk.org Tue Sep 23 09:12:52 2025 From: asotona at openjdk.org (Adam Sotona) Date: Tue, 23 Sep 2025 09:12:52 GMT Subject: Integrated: 8366926: Unexpected exception occurs when executing code in a "local" JShell environment In-Reply-To: References: Message-ID: On Mon, 22 Sep 2025 18:54:59 GMT, Adam Sotona wrote: > JShell "local" execution environments instruments loaded classes. > Instrumentation depends on the default class hierarchy resolution, which only knows already loaded classes. > Reported bug provides a test case where class hierarchy of the local classes is required and the resolution fails. > > This patch configures instrumentation with the default class hierarchy resolver chained with a resolver parsing the pre-instrumentation class binaries. > > Please review. > > Thanks, > Adam This pull request has now been integrated. Changeset: d316d3f7 Author: Adam Sotona URL: https://git.openjdk.org/jdk/commit/d316d3f74fd951613eef3870ee3da2c2dc5b719c Stats: 89 lines in 2 files changed: 84 ins; 2 del; 3 mod 8366926: Unexpected exception occurs when executing code in a "local" JShell environment Reviewed-by: liach, jlahoda ------------- PR: https://git.openjdk.org/jdk/pull/27436 From acobbs at openjdk.org Tue Sep 23 17:18:45 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Tue, 23 Sep 2025 17:18:45 GMT Subject: RFR: 8366561: Improve documentation for how the -Xlint flag works [v3] In-Reply-To: References: Message-ID: > This is a documentation-only change to improve compiler documentation around the `-Xlint` flag and lint categories. > > * Changes to `--help` output: > * Note that `--enable-preview` disables the `preview` lint category as a side-effect > > * Changes to `--help-extra` output: > * Refer to "lint warning categories" instead of "warning categories" when appropriate (not all warnings are lint warnings) > * Note that `-Xlint` enables all lint categories (sync with man page) > * Note that some categories are enabled by default even without any `-Xlint` flags > > * Changes to `--help-lint` output: > * Refer to "lint warning categories" instead of "warning categories" when appropriate (not all warnings are lint warnings) > * Sort lint categories and aliases alphabetically together > * Indicate which lint categories are enabled by default > * Tighten up "alias" verbiage and generalize it to work with future possible category aliases > * Add a footer blurb clarifying that aliases are fully interchangeable with their primary keys > > * Changes to `module-info.java` javadoc: > * Clarify that `@SuppressWarnings` ignores unrecognized strings > * Remove lint categories not actually supported by `@SuppressWarnings` from the list of such > * Put them in a separate table instead > > * Changes to the `javac(1)` man page: > * Sync with the above changes to `--help`, `--help-extra`, and `--help-lint` Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains nine additional commits since the last revision: - Merge branch 'master' into JDK-8366561 to get recent build fixes. - Changes based on CSR review suggestions. - Minor code cleanup. - Clarify that "processing" is not supported by @SuppressWarnings. - Synchronize --help-extra and man page descriptions of the "-Xlint" flag. - Minor refactoring creating method Lint.getDefaults(). - Update man page with the same improvements applied to help output. - Note that unrecognized strings in @SuppressWarnings annotations are ignored. - Documentation improvements relating to -Xlint and lint categories. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27129/files - new: https://git.openjdk.org/jdk/pull/27129/files/a497a469..dd59cabc Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27129&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27129&range=01-02 Stats: 169936 lines in 2002 files changed: 135604 ins; 22142 del; 12190 mod Patch: https://git.openjdk.org/jdk/pull/27129.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27129/head:pull/27129 PR: https://git.openjdk.org/jdk/pull/27129 From acobbs at openjdk.org Tue Sep 23 17:19:23 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Tue, 23 Sep 2025 17:19:23 GMT Subject: RFR: 8155591: Misleading warning when not overriding close method in interface extending AutoCloseable [v2] In-Reply-To: References: Message-ID: > The compiler generates a warning if you declare a `close()` method that throws any supertype of `InterruptedException` in a class or interface extending `AutoCloseable`. This is because suppressed `InterruptedException`'s are likely to lead to misbehavior at runtime. > > However, this feature also generates a warning due to `AutoCloseable.close()` itself, if you simply inherit it. For example: > > $ cat MyClass.java > public interface MyClass extends AutoCloseable { > } > $ javac -Xlint:try MyClass.java > MyClass.java:1: warning: [try] auto-closeable resource MyClass has a member method close() that could throw InterruptedException > public interface MyClass extends AutoCloseable { > ^ > 1 warning > > The warning is not useful because `AutoCloseable.close()` is abstract and so it's going to be some other class' job to deal with the throws clause. > > This change prevents `AutoCloseable.close()` itself from triggering the warning in a class declaration. We preserve the existing behavior in which a warning is generated at the use site (i.e., at the try-with-resources statement). Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: - Merge branch 'master' into JDK-8155591 to get recent build fixes. - Don't warn about AutoCloseable.close() itself throwing InterruptedException. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27062/files - new: https://git.openjdk.org/jdk/pull/27062/files/5953041d..3f769967 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27062&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27062&range=00-01 Stats: 173525 lines in 2141 files changed: 137903 ins; 22605 del; 13017 mod Patch: https://git.openjdk.org/jdk/pull/27062.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27062/head:pull/27062 PR: https://git.openjdk.org/jdk/pull/27062 From acobbs at openjdk.org Tue Sep 23 18:06:32 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Tue, 23 Sep 2025 18:06:32 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: References: Message-ID: On Sat, 10 May 2025 20:20:32 GMT, Archie Cobbs wrote: > This PR adds a new compiler warning for `@SuppressWarnings` annotations that don't actually suppress any warnings. > > Summary of code changes: > > * Add new warning and associated lint category `"suppression"` > * Update `LintMapper` to keep track of which `@SuppressWarnings` suppressions have been validated ? > * Update `Log.warning()` so it validates any current suppression of the warning's lint category in effect. > * Add a new `validate` parameter to `Lint.isEnabled()` and `Lint.isSuppressed()` that specifies whether to also validate any current suppression. > * Add `Lint.isActive()` to check whether a category is enabled _or_ suppression of the category is being tracked - in other words, whether the warning calculation needs to be performed. Used for non-trivial warning calculations. > * Add `-Xlint:-suppression` flags to `*.gmk` build files so the build doesn't break > > ? The suppression of a lint category is "validated" as soon as it suppresses some warning in that category Bumping up the reviewer count to ensure someone from the compiler group approves. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25167#issuecomment-3325033159 From prappo at openjdk.org Tue Sep 23 21:04:59 2025 From: prappo at openjdk.org (Pavel Rappo) Date: Tue, 23 Sep 2025 21:04:59 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: References: Message-ID: On Sat, 10 May 2025 20:20:32 GMT, Archie Cobbs wrote: > This PR adds a new compiler warning for `@SuppressWarnings` annotations that don't actually suppress any warnings. > > Summary of code changes: > > * Add new warning and associated lint category `"suppression"` > * Update `LintMapper` to keep track of which `@SuppressWarnings` suppressions have been validated ? > * Update `Log.warning()` so it validates any current suppression of the warning's lint category in effect. > * Add a new `validate` parameter to `Lint.isEnabled()` and `Lint.isSuppressed()` that specifies whether to also validate any current suppression. > * Add `Lint.isActive()` to check whether a category is enabled _or_ suppression of the category is being tracked - in other words, whether the warning calculation needs to be performed. Used for non-trivial warning calculations. > * Add `-Xlint:-suppression` flags to `*.gmk` build files so the build doesn't break > > ? The suppression of a lint category is "validated" as soon as it suppresses some warning in that category Hi Archie. I've just seen this PR. It looks nice. While I've read the CSR, I haven't read any compiler-dev thread(s). At least not carefully. I also haven't seen the diff. IIUC, this annotation can be applied to itself: `@SupressWarnings("suppression")`. Has the scope of `@SupressWarnings` always included the annotation itself, or it's something that you had to tweak in this PR? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25167#issuecomment-3325540024 From acobbs at openjdk.org Tue Sep 23 21:23:47 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Tue, 23 Sep 2025 21:23:47 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: References: Message-ID: <8zSBYHWXazhdwlpRxMJW0k5gYZDEshXtKo2ToQxoHiw=.c6c7e5c9-4ad3-4435-b7b2-6bfb0a9371e7@github.com> On Tue, 23 Sep 2025 21:02:03 GMT, Pavel Rappo wrote: > While I've read the CSR, I haven't read any compiler-dev thread(s). At least not carefully. I also haven't seen the diff. FWIW there is a discussion thread (starting [here](https://mail.openjdk.org/pipermail/compiler-dev/2024-November/028573.html)), but it's been on/off since November 2024. > IIUC, this annotation can be applied to itself: `@SupressWarnings("suppression")`. Has the scope of `@SupressWarnings` always included the annotation itself, or it's something that you had to tweak in this PR? Astute question :) In general, it's completely up to the particular warning. The scope can even extend _before_ the annotation; this is the case with `"dangling-doc-comments"` (see #24600). But normally the "scope" of a declaration includes any annotations on that declaration, simply because the start position of the declaration includes them (the annotations are part of the declaration, not a separate prior thing). Regarding exactly how "it's completely up to the particular warning": Since #26138, the `DiagnosticPosition` class now has a `getLintPosition()` property. This allows the caller to specify any arbitrary source code position at which to define which `@SuppressWarnings` annotations apply to the warning. Search for `withLintPosition()` to see a couple of uses of it. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25167#issuecomment-3325592697 From prappo at openjdk.org Tue Sep 23 21:27:56 2025 From: prappo at openjdk.org (Pavel Rappo) Date: Tue, 23 Sep 2025 21:27:56 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: <8zSBYHWXazhdwlpRxMJW0k5gYZDEshXtKo2ToQxoHiw=.c6c7e5c9-4ad3-4435-b7b2-6bfb0a9371e7@github.com> References: <8zSBYHWXazhdwlpRxMJW0k5gYZDEshXtKo2ToQxoHiw=.c6c7e5c9-4ad3-4435-b7b2-6bfb0a9371e7@github.com> Message-ID: On Tue, 23 Sep 2025 21:20:19 GMT, Archie Cobbs wrote: > > While I've read the CSR, I haven't read any compiler-dev thread(s). At least not carefully. I also haven't seen the diff. > > FWIW there is a discussion thread (starting [here](https://mail.openjdk.org/pipermail/compiler-dev/2024-November/028573.html)), but it's been on/off since November 2024. > > > IIUC, this annotation can be applied to itself: `@SupressWarnings("suppression")`. Has the scope of `@SupressWarnings` always included the annotation itself, or it's something that you had to tweak in this PR? > > Astute question :) In general, it's completely up to the particular warning. The scope can even extend _before_ the annotation; this is the case with `"dangling-doc-comments"` (see #24600). But normally the "scope" of a declaration includes any annotations on that declaration, simply because the start position of the declaration includes them (the annotations are part of the declaration, not a separate prior thing). > > Regarding exactly how "it's completely up to the particular warning": Since #26138, the `DiagnosticPosition` class now has a `getLintPosition()` property. This allows the caller to specify any arbitrary source code position at which to define which `@SuppressWarnings` annotations apply to the warning. Search for `withLintPosition()` to see a couple of uses of it. The reason I ask is that I can probably see how it could be useful to emit a "suppression" warning from this: @SuppressWarnings("suppression") public class A { } I'm not suggesting the PR should implement it, I'm just thinking aloud. I realise that if it were to implement the annotation as non-self-referring, then there would need to be a way to suppress it too, however silly it may sound. IIRC there's no way to apply a meta annotation on a _call site_. Even if `@SuppressWarnings` was a `@Repeatable` annotation, this would not have the desired effect: @SuppressWarnings("suppression") @SuppressWarnings("suppression") public void foo(String bar) { ... Another option is to go one scope higher and put an annotation there: @SuppressWarnings("suppression") public class FooBar { ... @SuppressWarnings("suppression") public void foo(String bar) { ... The problem is that you may not have a higher scope. Which sounds like a rare, uninteresting corner case. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25167#issuecomment-3325606585 From acobbs at openjdk.org Tue Sep 23 21:52:26 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Tue, 23 Sep 2025 21:52:26 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: References: <8zSBYHWXazhdwlpRxMJW0k5gYZDEshXtKo2ToQxoHiw=.c6c7e5c9-4ad3-4435-b7b2-6bfb0a9371e7@github.com> Message-ID: <-8TLt8uqvhTgk9TrvHb-L0Rf4nalm3u1sP8UkFrC-Wg=.fdbd7008-4346-4a5d-9dae-1fb7887cc7a0@github.com> On Tue, 23 Sep 2025 21:25:26 GMT, Pavel Rappo wrote: > The reason I ask is that I can probably see how it could be useful to emit a "suppression" warning from this: It's a reasonable option to consider. I think the main worry is that it could complicate build situations where the same code was being compiled with `-Werror` under two different compiler versions. Suppose you had code like this: method m() { // warning here } that generated a `"foo"` warning in JDK N but not JDK M. So you do this: @SuppressWarnings("foo") method m() { // warning here } OK, now you get a `"suppression"` warning in JDK M but not JDK N. So next you do this: @SuppressWarnings({ "foo", "suppression" }) method m() { // warning here } Oops! Now you get a `"suppression"` warning in JDK N. Then the only way out would be `-Xlint:-suppression`, which means the feature has caused a wild goose chase and is being somewhat self-defeating. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25167#issuecomment-3325659614 From prappo at openjdk.org Tue Sep 23 22:28:37 2025 From: prappo at openjdk.org (Pavel Rappo) Date: Tue, 23 Sep 2025 22:28:37 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: <-8TLt8uqvhTgk9TrvHb-L0Rf4nalm3u1sP8UkFrC-Wg=.fdbd7008-4346-4a5d-9dae-1fb7887cc7a0@github.com> References: <8zSBYHWXazhdwlpRxMJW0k5gYZDEshXtKo2ToQxoHiw=.c6c7e5c9-4ad3-4435-b7b2-6bfb0a9371e7@github.com> <-8TLt8uqvhTgk9TrvHb-L0Rf4nalm3u1sP8UkFrC-Wg=.fdbd7008-4346-4a5d-9dae-1fb7887cc7a0@github.com> Message-ID: On Tue, 23 Sep 2025 21:49:49 GMT, Archie Cobbs wrote: > Oops! Now you get a `"suppression"` warning in JDK N. Thanks for this explanation. I can now see what you mean in the _Different Compiler Versions_ section of the CSR. That's some quality reasoning and future-proofing. I suppose, it would unnecessarily complicate the design if we stipulate that `@SuppressWarnings("suppression")` should only emit a warning if there are no `@SuppressWarning` in any of the _child scopes_. Note, not just ineffective `@SuppressWarning`s, but none at all. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25167#issuecomment-3325741752 From acobbs at openjdk.org Wed Sep 24 15:02:02 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Wed, 24 Sep 2025 15:02:02 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: References: <8zSBYHWXazhdwlpRxMJW0k5gYZDEshXtKo2ToQxoHiw=.c6c7e5c9-4ad3-4435-b7b2-6bfb0a9371e7@github.com> <-8TLt8uqvhTgk9TrvHb-L0Rf4nalm3u1sP8UkFrC-Wg=.fdbd7008-4346-4a5d-9dae-1fb7887cc7a0@github.com> Message-ID: On Tue, 23 Sep 2025 22:26:08 GMT, Pavel Rappo wrote: > Thanks for this explanation. I can now see what you mean in the _Different Compiler Versions_ section of the CSR. That's some quality reasoning and future-proofing. Credit goes to @jddarcy for pinpointing those possible traps. > I suppose, it would unnecessarily complicate the design if we stipulate that `@SuppressWarnings("suppression")` should only emit a warning if there are no `@SuppressWarnings` in any of the _child scopes_. Note, not just ineffective `@SuppressWarnings`s, but none at all. Here's an analogy that helps me justify the current design, fwiw. Have you ever been to New York or another city and walked by an otherwise completely blank wall that has "POST NO BILLS" signs stuck to it, and then thought about how ironic it is that posting bills is required in order to notify people not to post bills? Sticking `@SuppressWarnings("suppression")` on a declaration is analogous. We're posting a notification not to do something, even though the notification itself risks doing it. But that's OK and we make a special exception for it. If we didn't make such exceptions, then when you walked by such a wall you'd see a workman repeatedly posting and unposting the "POST NO BILLS" bills :) ------------- PR Comment: https://git.openjdk.org/jdk/pull/25167#issuecomment-3329111827 From prappo at openjdk.org Wed Sep 24 16:36:32 2025 From: prappo at openjdk.org (Pavel Rappo) Date: Wed, 24 Sep 2025 16:36:32 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: References: <8zSBYHWXazhdwlpRxMJW0k5gYZDEshXtKo2ToQxoHiw=.c6c7e5c9-4ad3-4435-b7b2-6bfb0a9371e7@github.com> <-8TLt8uqvhTgk9TrvHb-L0Rf4nalm3u1sP8UkFrC-Wg=.fdbd7008-4346-4a5d-9dae-1fb7887cc7a0@github.com> Message-ID: On Wed, 24 Sep 2025 14:58:38 GMT, Archie Cobbs wrote: > > Thanks for this explanation. I can now see what you mean in the _Different Compiler Versions_ section of the CSR. That's some quality reasoning and future-proofing. > > Credit goes to @jddarcy for pinpointing those possible traps. > > > I suppose, it would unnecessarily complicate the design if we stipulate that `@SuppressWarnings("suppression")` should only emit a warning if there are no `@SuppressWarnings` in any of the _child scopes_. Note, not just ineffective `@SuppressWarnings`s, but none at all. > > Here's an analogy that helps me justify the current design, fwiw. Have you ever been to New York or another city and walked by an otherwise completely blank wall that has "POST NO BILLS" signs stuck to it, and then thought about how ironic it is that posting bills is required in order to notify people not to post bills? > > Sticking `@SuppressWarnings("suppression")` on a declaration is analogous. We're posting a notification not to do something, even though the notification itself risks doing it. But that's OK and we make a special exception for it. > > If we didn't make such exceptions, then when you walked by such a wall you'd see a workman repeatedly posting and unposting the "POST NO BILLS" bills :) That analogy is amusing, but it either barely applies here, or I'm too tired to see how it does. In my most recent message, I mused about this: _what if `@SuppressWarnings("suppression")` were to emit a warning only if there's no `@SuppressWarnings` of any kind anywhere under it?_ This behaviour is minimally stricter than that of this PR, and is compatible with the M-N-compiler use case. Basically, if `@SuppressWarnings("suppression")` was accidentally left with no suppressions under it, the compiler would warn you, so you could remove it. Because what's the reason for `@SuppressWarnings("suppression")` whose scope contains no suppressions? Just to clarify, here's an example of what I mean: @SuppressWarnings("suppression") public void m() { /* a method that contains no @SuppressWarnings annotations whatsoever */ } Here's an example of what I **don't** mean: @SuppressWarnings("suppression") public void m() { /* a method that only contains @SuppressWarnings annotations that are ineffective. That is, annotations, that if removed, would __not__ break compilation with -Werror */ } The idea here is to minimise the chance of `@SuppressWarnings("suppression")` becoming part of the furniture and hiding unneeded future suppressions. But maybe changing the behaviour as described above would introduce more complexity and future issues than it would catch potential bugs. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25167#issuecomment-3329793388 From acobbs at openjdk.org Wed Sep 24 16:48:58 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Wed, 24 Sep 2025 16:48:58 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: References: <8zSBYHWXazhdwlpRxMJW0k5gYZDEshXtKo2ToQxoHiw=.c6c7e5c9-4ad3-4435-b7b2-6bfb0a9371e7@github.com> <-8TLt8uqvhTgk9TrvHb-L0Rf4nalm3u1sP8UkFrC-Wg=.fdbd7008-4346-4a5d-9dae-1fb7887cc7a0@github.com> Message-ID: <_QblLaoRLKcV6Mf8E3WFd-zpuxn3OKOUHfW0Gez7_0I=.d69c5927-075c-4008-8f62-f447816925f6@github.com> On Wed, 24 Sep 2025 16:33:18 GMT, Pavel Rappo wrote: > Basically, if `@SuppressWarnings("suppression")` was accidentally left with no suppressions under it, the compiler would warn you, so you could remove it. Because what's the reason for `@SuppressWarnings("suppression")` whose scope contains no suppressions? Sorry I didn't address this question before - but yes, this is a reasonable ida. It would basically be adding an exception to the exception. So, a bit of additional complexity but for a worthwhile cause. To stretch the analogy, it would be like making the observation: "If the area of the wall is zero, then you never need to post a "POST NO BILLS" bill on it". I can think of one possible wrinkle though: warnings can actually be suppressed in the source code in two ways, by `@SuppressWarnings` and by `@Deprecated` (see `Lint.suppressionsFrom(Symbol)`). So you'd also have to look for `@Deprecated`; but this also brings up the unsettling possibility that in the future, some new annotation might have a similar side-effect, and then we'd be in trouble again. So there is an aspect of this idea that requires us to make certain predictions about the future, which of course is dangerous. I think it's safer to "just say no". ------------- PR Comment: https://git.openjdk.org/jdk/pull/25167#issuecomment-3329828755 From prappo at openjdk.org Thu Sep 25 09:28:21 2025 From: prappo at openjdk.org (Pavel Rappo) Date: Thu, 25 Sep 2025 09:28:21 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression In-Reply-To: <_QblLaoRLKcV6Mf8E3WFd-zpuxn3OKOUHfW0Gez7_0I=.d69c5927-075c-4008-8f62-f447816925f6@github.com> References: <8zSBYHWXazhdwlpRxMJW0k5gYZDEshXtKo2ToQxoHiw=.c6c7e5c9-4ad3-4435-b7b2-6bfb0a9371e7@github.com> <-8TLt8uqvhTgk9TrvHb-L0Rf4nalm3u1sP8UkFrC-Wg=.fdbd7008-4346-4a5d-9dae-1fb7887cc7a0@github.com> <_QblLaoRLKcV6Mf8E3WFd-zpuxn3OKOUHfW0Gez7_0I=.d69c5927-075c-4008-8f62-f447816925f6@github.com> Message-ID: On Wed, 24 Sep 2025 16:45:35 GMT, Archie Cobbs wrote: > I can think of one possible wrinkle though: warnings can actually be suppressed in the source code in two ways, by `@SuppressWarnings` and by `@Deprecated` (see `Lint.suppressionsFrom(Symbol)`). So you'd also have to look for `@Deprecated`; but this also brings up the unsettling possibility that in the future, some new annotation might have a similar side-effect, and then we'd be in trouble again. So there is an aspect of this idea that requires us to make certain predictions about the future, which of course is dangerous. I think it's safer to "just say no". `@Deprecated` as well as a conceivable future tag whose secondary effect is to silence possible warnings are very different from `@SuppressWarnings`. While I don't see why we might need to consider those underneath `@SuppressWarnings("suppression")` to decide if it should emit a warning, it's okay to say that it's safer not to complicate things. Thanks. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25167#issuecomment-3333072769 From asotona at openjdk.org Thu Sep 25 10:05:51 2025 From: asotona at openjdk.org (Adam Sotona) Date: Thu, 25 Sep 2025 10:05:51 GMT Subject: RFR: 8367279: Test tools/javac/tree/TreePosTest.java timed out In-Reply-To: References: Message-ID: On Wed, 17 Sep 2025 08:20:09 GMT, Jan Lahoda wrote: > The `test/langtools/tools/javac/tree/TreePosTest.java` tries to parse all langtools tests, and started to time out recently in some cases. In the case of this test, we can try to use the `JavacTaskPool`, which pools and reuses javac instances, rather than creating (and initializing) a javac instance for each file. Given this test only parses the file, and even attributes them, this should be relatively safe. > > Locally, I can't confirm too significant time improvements (before this change ~6s, after this change ~4s), but it might help on CI. The patch improves test performance by 11% on my laptop. ------------- Marked as reviewed by asotona (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27334#pullrequestreview-3266866123 From asotona at openjdk.org Thu Sep 25 12:12:20 2025 From: asotona at openjdk.org (Adam Sotona) Date: Thu, 25 Sep 2025 12:12:20 GMT Subject: RFR: 8366582: Test jdk/jshell/ToolSimpleTest.java failed: provider not found In-Reply-To: References: Message-ID: On Wed, 17 Sep 2025 08:15:21 GMT, Jan Lahoda wrote: > The `jdk/jshell/ToolSimpleTest.java` randomly fails, the reason is this: when indexing the bootclasspath/`PLATFORM_CLASS_PATH`, `$JDK_HOME/lib/modules` is typically there, but it can't be opened as a FileSystem, and the exception is sent to the debugging facility. The debugging facility typically does nothing, but in this test contains a test case that enabled debugging, and if the order of things is that the debugging is first enabled, and then the `ProviderNotFoundException` is reported, the test fails. > > The proposal herein is to not to try to open `$JDK_HOME/lib/modules` as a file system. Note the standard platform classes are indexed using `SYSTEM_MODULES`. Looks good to me. ------------- Marked as reviewed by asotona (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27333#pullrequestreview-3267340755 From duke at openjdk.org Thu Sep 25 12:44:33 2025 From: duke at openjdk.org (Khalid Boulanouare) Date: Thu, 25 Sep 2025 12:44:33 GMT Subject: RFR: 8360498: [TEST_BUG] Some Mixing test continue to fail [v15] In-Reply-To: References: Message-ID: > This PR will consolidate fixes of the following bugs: > > https://bugs.openjdk.org/browse/JDK-8361188 > https://bugs.openjdk.org/browse/JDK-8361189 > https://bugs.openjdk.org/browse/JDK-8361190 > https://bugs.openjdk.org/browse/JDK-8361191 > https://bugs.openjdk.org/browse/JDK-8361192 > https://bugs.openjdk.org/browse/JDK-8361193 > https://bugs.openjdk.org/browse/JDK-8361195 > > This PR depends on https://github.com/openjdk/jdk/pull/25971 > > For test : java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java, the fix suggested is to return false in method isValidForPixelCheck for embedded frame, in which case the component is set to null. For more details see bug: [JDK-8361188](https://bugs.openjdk.org/browse/JDK-8361188) > > For test : test/jdk/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java, I had to create a a tolerance color matching method for mac for the tests to pass. Also, the jbuttons needed to have different color than the color of the background frame, in order for test to pass. For more detail see bug: https://bugs.openjdk.org/browse/JDK-8361193 > > For test : test/jdk/java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java, it seems that color selected for lightweight component matches the background color of the frame. And this will cause the test to fail when matching colors. Choosing any color different than the background color will get the test to pass. For more details, see bug: https://bugs.openjdk.org/browse/JDK-8361192 > > For test test/jdk/java/awt/Mixing/AWT_Mixing/JPopupMenuOverlapping.java, it looks like the frame when visible, the popup test does not work properly. The frame needs to be hidden for the test to click on popup. For more details see bug: https://bugs.openjdk.org/browse/JDK-8361191 > > For test test/jdk/java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java, the test runs successfully but it times out after the default 2 minutes of jtreg. increasing the timeout to 3 minutes get the test to pass. For more details please refer to bug: https://bugs.openjdk.org/browse/JDK-8361190 Khalid Boulanouare has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 74 commits: - Merge branch 'openjdk:master' into jdk-8360498 - Removes not needed changes - Revert "Removes not needed changes" This reverts commit e76780d50cc390e35443dccb193cfbc9a1cec1cb. - Removes not needed changes - Removes extra white lines - Merge branch 'pr/25971' into jdk-8360498 - Merge branch 'openjdk:master' into jdk-8158801 - Merge branch 'pr/25971' into jdk-8360498 - Merge branch 'openjdk:master' into jdk-8158801 - Centers missed frames in the middle of screen - ... and 64 more: https://git.openjdk.org/jdk/compare/26b5708c...e5753d14 ------------- Changes: https://git.openjdk.org/jdk/pull/26625/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26625&range=14 Stats: 185 lines in 14 files changed: 96 ins; 44 del; 45 mod Patch: https://git.openjdk.org/jdk/pull/26625.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26625/head:pull/26625 PR: https://git.openjdk.org/jdk/pull/26625 From duke at openjdk.org Thu Sep 25 13:03:51 2025 From: duke at openjdk.org (Khalid Boulanouare) Date: Thu, 25 Sep 2025 13:03:51 GMT Subject: RFR: 8360498: [TEST_BUG] Some Mixing test continue to fail [v16] In-Reply-To: References: Message-ID: <5YzcczRe9VgQqc7POMiumcCnf6esXSQO6PpUbIuuxhA=.efcb29a6-3705-475d-901c-515838317bfe@github.com> > This PR will consolidate fixes of the following bugs: > > https://bugs.openjdk.org/browse/JDK-8361188 > https://bugs.openjdk.org/browse/JDK-8361189 > https://bugs.openjdk.org/browse/JDK-8361190 > https://bugs.openjdk.org/browse/JDK-8361191 > https://bugs.openjdk.org/browse/JDK-8361192 > https://bugs.openjdk.org/browse/JDK-8361193 > https://bugs.openjdk.org/browse/JDK-8361195 > > This PR depends on https://github.com/openjdk/jdk/pull/25971 > > For test : java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java, the fix suggested is to return false in method isValidForPixelCheck for embedded frame, in which case the component is set to null. For more details see bug: [JDK-8361188](https://bugs.openjdk.org/browse/JDK-8361188) > > For test : test/jdk/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java, I had to create a a tolerance color matching method for mac for the tests to pass. Also, the jbuttons needed to have different color than the color of the background frame, in order for test to pass. For more detail see bug: https://bugs.openjdk.org/browse/JDK-8361193 > > For test : test/jdk/java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java, it seems that color selected for lightweight component matches the background color of the frame. And this will cause the test to fail when matching colors. Choosing any color different than the background color will get the test to pass. For more details, see bug: https://bugs.openjdk.org/browse/JDK-8361192 > > For test test/jdk/java/awt/Mixing/AWT_Mixing/JPopupMenuOverlapping.java, it looks like the frame when visible, the popup test does not work properly. The frame needs to be hidden for the test to click on popup. For more details see bug: https://bugs.openjdk.org/browse/JDK-8361191 > > For test test/jdk/java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java, the test runs successfully but it times out after the default 2 minutes of jtreg. increasing the timeout to 3 minutes get the test to pass. For more details please refer to bug: https://bugs.openjdk.org/browse/JDK-8361190 Khalid Boulanouare has updated the pull request incrementally with one additional commit since the last revision: Resolves confict for when there is a merge with jdk-8158801 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26625/files - new: https://git.openjdk.org/jdk/pull/26625/files/e5753d14..8794db9a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26625&range=15 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26625&range=14-15 Stats: 55 lines in 1 file changed: 36 ins; 3 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/26625.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26625/head:pull/26625 PR: https://git.openjdk.org/jdk/pull/26625 From alanb at openjdk.org Thu Sep 25 13:30:34 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 25 Sep 2025 13:30:34 GMT Subject: RFR: 8360498: [TEST_BUG] Some Mixing test continue to fail [v16] In-Reply-To: <5YzcczRe9VgQqc7POMiumcCnf6esXSQO6PpUbIuuxhA=.efcb29a6-3705-475d-901c-515838317bfe@github.com> References: <5YzcczRe9VgQqc7POMiumcCnf6esXSQO6PpUbIuuxhA=.efcb29a6-3705-475d-901c-515838317bfe@github.com> Message-ID: On Thu, 25 Sep 2025 13:03:51 GMT, Khalid Boulanouare wrote: >> This PR will consolidate fixes of the following bugs: >> >> https://bugs.openjdk.org/browse/JDK-8361188 >> https://bugs.openjdk.org/browse/JDK-8361189 >> https://bugs.openjdk.org/browse/JDK-8361190 >> https://bugs.openjdk.org/browse/JDK-8361191 >> https://bugs.openjdk.org/browse/JDK-8361192 >> https://bugs.openjdk.org/browse/JDK-8361193 >> https://bugs.openjdk.org/browse/JDK-8361195 >> >> This PR depends on https://github.com/openjdk/jdk/pull/25971 >> >> For test : java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java, the fix suggested is to return false in method isValidForPixelCheck for embedded frame, in which case the component is set to null. For more details see bug: [JDK-8361188](https://bugs.openjdk.org/browse/JDK-8361188) >> >> For test : test/jdk/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java, I had to create a a tolerance color matching method for mac for the tests to pass. Also, the jbuttons needed to have different color than the color of the background frame, in order for test to pass. For more detail see bug: https://bugs.openjdk.org/browse/JDK-8361193 >> >> For test : test/jdk/java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java, it seems that color selected for lightweight component matches the background color of the frame. And this will cause the test to fail when matching colors. Choosing any color different than the background color will get the test to pass. For more details, see bug: https://bugs.openjdk.org/browse/JDK-8361192 >> >> For test test/jdk/java/awt/Mixing/AWT_Mixing/JPopupMenuOverlapping.java, it looks like the frame when visible, the popup test does not work properly. The frame needs to be hidden for the test to click on popup. For more details see bug: https://bugs.openjdk.org/browse/JDK-8361191 >> >> For test test/jdk/java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java, the test runs successfully but it times out after the default 2 minutes of jtreg. increasing the timeout to 3 minutes get the test to pass. For more details please refer to bug: https://bugs.openjdk.org/browse/JDK-8361190 > > Khalid Boulanouare has updated the pull request incrementally with one additional commit since the last revision: > > Resolves confict for when there is a merge with jdk-8158801 What is this about? The PR suggests 500+ commits and 300+ files changed but I think it's just a change to some AWT tests. Can you sync up the branch so that it only contains the changes to the AWT tests that you want to change, and remove all the labels except "client" as it will otherwise broadcast to all the mailing lists. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26625#issuecomment-3334044893 From fandreuzzi at openjdk.org Thu Sep 25 13:51:48 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Thu, 25 Sep 2025 13:51:48 GMT Subject: RFR: 8368357: Some HotSpot source files have initial blank lines Message-ID: <9121m5P5MFrgd7v8Rl88DaZLT6UBKVUciMcZvWNtqiM=.0fdcc411-6f28-4dc2-bb54-9c37712d22d2@github.com> Removing some spurious blank lines at the beginning of the file. Looks trivial to me. ------------- Commit messages: - more - rm Changes: https://git.openjdk.org/jdk/pull/27489/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27489&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8368357 Stats: 8 lines in 8 files changed: 0 ins; 8 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27489.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27489/head:pull/27489 PR: https://git.openjdk.org/jdk/pull/27489 From duke at openjdk.org Thu Sep 25 14:00:08 2025 From: duke at openjdk.org (Khalid Boulanouare) Date: Thu, 25 Sep 2025 14:00:08 GMT Subject: RFR: 8360498: [TEST_BUG] Some Mixing test continue to fail [v17] In-Reply-To: References: Message-ID: > This PR will consolidate fixes of the following bugs: > > https://bugs.openjdk.org/browse/JDK-8361188 > https://bugs.openjdk.org/browse/JDK-8361189 > https://bugs.openjdk.org/browse/JDK-8361190 > https://bugs.openjdk.org/browse/JDK-8361191 > https://bugs.openjdk.org/browse/JDK-8361192 > https://bugs.openjdk.org/browse/JDK-8361193 > https://bugs.openjdk.org/browse/JDK-8361195 > > This PR depends on https://github.com/openjdk/jdk/pull/25971 > > For test : java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java, the fix suggested is to return false in method isValidForPixelCheck for embedded frame, in which case the component is set to null. For more details see bug: [JDK-8361188](https://bugs.openjdk.org/browse/JDK-8361188) > > For test : test/jdk/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java, I had to create a a tolerance color matching method for mac for the tests to pass. Also, the jbuttons needed to have different color than the color of the background frame, in order for test to pass. For more detail see bug: https://bugs.openjdk.org/browse/JDK-8361193 > > For test : test/jdk/java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java, it seems that color selected for lightweight component matches the background color of the frame. And this will cause the test to fail when matching colors. Choosing any color different than the background color will get the test to pass. For more details, see bug: https://bugs.openjdk.org/browse/JDK-8361192 > > For test test/jdk/java/awt/Mixing/AWT_Mixing/JPopupMenuOverlapping.java, it looks like the frame when visible, the popup test does not work properly. The frame needs to be hidden for the test to click on popup. For more details see bug: https://bugs.openjdk.org/browse/JDK-8361191 > > For test test/jdk/java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java, the test runs successfully but it times out after the default 2 minutes of jtreg. increasing the timeout to 3 minutes get the test to pass. For more details please refer to bug: https://bugs.openjdk.org/browse/JDK-8361190 Khalid Boulanouare has updated the pull request incrementally with three additional commits since the last revision: - Merge branch 'openjdk:master' into jdk-8360498 - 8359378: aarch64: crash when using -XX:+UseFPUForSpilling Reviewed-by: aph, rcastanedalo - 8367103: RISC-V: store cpu features in a bitmap Reviewed-by: fyang, luhenry ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26625/files - new: https://git.openjdk.org/jdk/pull/26625/files/8794db9a..69c087a7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26625&range=16 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26625&range=15-16 Stats: 214 lines in 3 files changed: 142 ins; 4 del; 68 mod Patch: https://git.openjdk.org/jdk/pull/26625.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26625/head:pull/26625 PR: https://git.openjdk.org/jdk/pull/26625 From duke at openjdk.org Thu Sep 25 14:00:10 2025 From: duke at openjdk.org (Khalid Boulanouare) Date: Thu, 25 Sep 2025 14:00:10 GMT Subject: RFR: 8360498: [TEST_BUG] Some Mixing test continue to fail [v16] In-Reply-To: References: <5YzcczRe9VgQqc7POMiumcCnf6esXSQO6PpUbIuuxhA=.efcb29a6-3705-475d-901c-515838317bfe@github.com> Message-ID: On Thu, 25 Sep 2025 13:26:46 GMT, Alan Bateman wrote: >> Khalid Boulanouare has updated the pull request incrementally with one additional commit since the last revision: >> >> Resolves confict for when there is a merge with jdk-8158801 > > What is this about? The PR suggests 500+ commits and 300+ files changed but I think it's just a change to some AWT tests. Can you sync up the branch so that it only contains the changes to the AWT tests that you want to change, and remove all the labels except "client" as it will otherwise broadcast to all the mailing lists. @AlanBateman This PR is created based on PR https://github.com/openjdk/jdk/tree/pr/25971. My branch https://github.com/kboulanou/jdk/tree/jdk-8360498 is only 2 commits behind master. I am waiting for approval for PR https://github.com/openjdk/jdk/tree/pr/25971 for this PR to follow. Please let me know if there is anything I need to do. Thanks. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26625#issuecomment-3334251324 From stefank at openjdk.org Thu Sep 25 14:14:42 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Thu, 25 Sep 2025 14:14:42 GMT Subject: RFR: 8368357: Some HotSpot source files have initial blank lines In-Reply-To: <9121m5P5MFrgd7v8Rl88DaZLT6UBKVUciMcZvWNtqiM=.0fdcc411-6f28-4dc2-bb54-9c37712d22d2@github.com> References: <9121m5P5MFrgd7v8Rl88DaZLT6UBKVUciMcZvWNtqiM=.0fdcc411-6f28-4dc2-bb54-9c37712d22d2@github.com> Message-ID: On Thu, 25 Sep 2025 13:44:13 GMT, Francesco Andreuzzi wrote: > Removing some spurious blank lines at the beginning of the file. Looks trivial to me. HotSpot code looks good. The other files look good as well, but let's wait for the other group's Reviewers to chime in. ------------- Marked as reviewed by stefank (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27489#pullrequestreview-3267968546 From ayang at openjdk.org Thu Sep 25 15:48:38 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Thu, 25 Sep 2025 15:48:38 GMT Subject: RFR: 8368357: Some source files have initial blank lines In-Reply-To: <9121m5P5MFrgd7v8Rl88DaZLT6UBKVUciMcZvWNtqiM=.0fdcc411-6f28-4dc2-bb54-9c37712d22d2@github.com> References: <9121m5P5MFrgd7v8Rl88DaZLT6UBKVUciMcZvWNtqiM=.0fdcc411-6f28-4dc2-bb54-9c37712d22d2@github.com> Message-ID: On Thu, 25 Sep 2025 13:44:13 GMT, Francesco Andreuzzi wrote: > Removing some spurious blank lines at the beginning of the file. Looks trivial to me. The title can probably be updated, as the patch changes files outside hotspot. ------------- Marked as reviewed by ayang (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27489#pullrequestreview-3268425252 From serb at openjdk.org Thu Sep 25 18:41:16 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 25 Sep 2025 18:41:16 GMT Subject: RFR: 8368357: Some source files have initial blank lines In-Reply-To: <9121m5P5MFrgd7v8Rl88DaZLT6UBKVUciMcZvWNtqiM=.0fdcc411-6f28-4dc2-bb54-9c37712d22d2@github.com> References: <9121m5P5MFrgd7v8Rl88DaZLT6UBKVUciMcZvWNtqiM=.0fdcc411-6f28-4dc2-bb54-9c37712d22d2@github.com> Message-ID: On Thu, 25 Sep 2025 13:44:13 GMT, Francesco Andreuzzi wrote: > Removing some spurious blank lines at the beginning of the file. Looks trivial to me. Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27489#pullrequestreview-3269026321 From duke at openjdk.org Fri Sep 26 13:53:56 2025 From: duke at openjdk.org (duke) Date: Fri, 26 Sep 2025 13:53:56 GMT Subject: RFR: 8368357: Some source files have initial blank lines In-Reply-To: <9121m5P5MFrgd7v8Rl88DaZLT6UBKVUciMcZvWNtqiM=.0fdcc411-6f28-4dc2-bb54-9c37712d22d2@github.com> References: <9121m5P5MFrgd7v8Rl88DaZLT6UBKVUciMcZvWNtqiM=.0fdcc411-6f28-4dc2-bb54-9c37712d22d2@github.com> Message-ID: On Thu, 25 Sep 2025 13:44:13 GMT, Francesco Andreuzzi wrote: > Removing some spurious blank lines at the beginning of the file. Looks trivial to me. @fandreuz Your change (at version 8a753ce5c03817bd5a007f0cb660fb45d77b6c5b) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27489#issuecomment-3338831250 From jwaters at openjdk.org Fri Sep 26 16:34:21 2025 From: jwaters at openjdk.org (Julian Waters) Date: Fri, 26 Sep 2025 16:34:21 GMT Subject: RFR: 8368357: Some source files have initial blank lines In-Reply-To: <9121m5P5MFrgd7v8Rl88DaZLT6UBKVUciMcZvWNtqiM=.0fdcc411-6f28-4dc2-bb54-9c37712d22d2@github.com> References: <9121m5P5MFrgd7v8Rl88DaZLT6UBKVUciMcZvWNtqiM=.0fdcc411-6f28-4dc2-bb54-9c37712d22d2@github.com> Message-ID: On Thu, 25 Sep 2025 13:44:13 GMT, Francesco Andreuzzi wrote: > Removing some spurious blank lines at the beginning of the file. Looks trivial to me. HotSpot looks good. Please wait for the reviewers of the other non HotSpot parts to approve before integrating however. ------------- Marked as reviewed by jwaters (Committer). PR Review: https://git.openjdk.org/jdk/pull/27489#pullrequestreview-3272985248 From vromero at openjdk.org Fri Sep 26 21:59:19 2025 From: vromero at openjdk.org (Vicente Romero) Date: Fri, 26 Sep 2025 21:59:19 GMT Subject: RFR: 8366561: Improve documentation for how the -Xlint flag works [v3] In-Reply-To: References: Message-ID: On Tue, 23 Sep 2025 17:18:45 GMT, Archie Cobbs wrote: >> This is a documentation-only change to improve compiler documentation around the `-Xlint` flag and lint categories. >> >> * Changes to `--help` output: >> * Note that `--enable-preview` disables the `preview` lint category as a side-effect >> >> * Changes to `--help-extra` output: >> * Refer to "lint warning categories" instead of "warning categories" when appropriate (not all warnings are lint warnings) >> * Note that `-Xlint` enables all lint categories (sync with man page) >> * Note that some categories are enabled by default even without any `-Xlint` flags >> >> * Changes to `--help-lint` output: >> * Refer to "lint warning categories" instead of "warning categories" when appropriate (not all warnings are lint warnings) >> * Sort lint categories and aliases alphabetically together >> * Indicate which lint categories are enabled by default >> * Tighten up "alias" verbiage and generalize it to work with future possible category aliases >> * Add a footer blurb clarifying that aliases are fully interchangeable with their primary keys >> >> * Changes to `module-info.java` javadoc: >> * Clarify that `@SuppressWarnings` ignores unrecognized strings >> * Remove lint categories not actually supported by `@SuppressWarnings` from the list of such >> * Put them in a separate table instead >> >> * Changes to the `javac(1)` man page: >> * Sync with the above changes to `--help`, `--help-extra`, and `--help-lint` > > Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains nine additional commits since the last revision: > > - Merge branch 'master' into JDK-8366561 to get recent build fixes. > - Changes based on CSR review suggestions. > - Minor code cleanup. > - Clarify that "processing" is not supported by @SuppressWarnings. > - Synchronize --help-extra and man page descriptions of the "-Xlint" flag. > - Minor refactoring creating method Lint.getDefaults(). > - Update man page with the same improvements applied to help output. > - Note that unrecognized strings in @SuppressWarnings annotations are ignored. > - Documentation improvements relating to -Xlint and lint categories. lgtm ------------- Marked as reviewed by vromero (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27129#pullrequestreview-3274059729 From acobbs at openjdk.org Sat Sep 27 02:37:40 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Sat, 27 Sep 2025 02:37:40 GMT Subject: RFR: 8366561: Improve documentation for how the -Xlint flag works [v3] In-Reply-To: References: Message-ID: On Fri, 26 Sep 2025 21:56:48 GMT, Vicente Romero wrote: >> Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains nine additional commits since the last revision: >> >> - Merge branch 'master' into JDK-8366561 to get recent build fixes. >> - Changes based on CSR review suggestions. >> - Minor code cleanup. >> - Clarify that "processing" is not supported by @SuppressWarnings. >> - Synchronize --help-extra and man page descriptions of the "-Xlint" flag. >> - Minor refactoring creating method Lint.getDefaults(). >> - Update man page with the same improvements applied to help output. >> - Note that unrecognized strings in @SuppressWarnings annotations are ignored. >> - Documentation improvements relating to -Xlint and lint categories. > > lgtm @vicente-romero-oracle thanks for the review! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27129#issuecomment-3341038462 From acobbs at openjdk.org Sat Sep 27 02:37:41 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Sat, 27 Sep 2025 02:37:41 GMT Subject: Integrated: 8366561: Improve documentation for how the -Xlint flag works In-Reply-To: References: Message-ID: On Fri, 5 Sep 2025 22:12:52 GMT, Archie Cobbs wrote: > This is a documentation-only change to improve compiler documentation around the `-Xlint` flag and lint categories. > > * Changes to `--help` output: > * Note that `--enable-preview` disables the `preview` lint category as a side-effect > > * Changes to `--help-extra` output: > * Refer to "lint warning categories" instead of "warning categories" when appropriate (not all warnings are lint warnings) > * Note that `-Xlint` enables all lint categories (sync with man page) > * Note that some categories are enabled by default even without any `-Xlint` flags > > * Changes to `--help-lint` output: > * Refer to "lint warning categories" instead of "warning categories" when appropriate (not all warnings are lint warnings) > * Sort lint categories and aliases alphabetically together > * Indicate which lint categories are enabled by default > * Tighten up "alias" verbiage and generalize it to work with future possible category aliases > * Add a footer blurb clarifying that aliases are fully interchangeable with their primary keys > > * Changes to `module-info.java` javadoc: > * Clarify that `@SuppressWarnings` ignores unrecognized strings > * Remove lint categories not actually supported by `@SuppressWarnings` from the list of such > * Put them in a separate table instead > > * Changes to the `javac(1)` man page: > * Sync with the above changes to `--help`, `--help-extra`, and `--help-lint` This pull request has now been integrated. Changeset: 5b1ebbb2 Author: Archie Cobbs URL: https://git.openjdk.org/jdk/commit/5b1ebbb2713e54511cb695d1d6f7f6b7f827b2a7 Stats: 171 lines in 5 files changed: 96 ins; 31 del; 44 mod 8366561: Improve documentation for how the -Xlint flag works Reviewed-by: vromero ------------- PR: https://git.openjdk.org/jdk/pull/27129 From acobbs at openjdk.org Sun Sep 28 18:53:35 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Sun, 28 Sep 2025 18:53:35 GMT Subject: RFR: 8349847: Support configuring individual lint categories as errors [v13] In-Reply-To: References: Message-ID: > This PR enhances the `-Werror` flag to support lint categories just like `-Xlint` does. For example `-Werror:all,-preview` would cause an error if any warning not in the `preview` lint category occurred. > > The existing `-Xlint` flag has a particular behavior when conflicting flags are combined (e.g., `-Xlint:all -Xlint:none -Xlint:foo -Xlint:-foo` is equivalent to `-Xlint:all`). This behavior has been factored out and Javadocumented so that both `-Xlint` and `-Werror` can have this same "parsing" logic. > > See the CSR [JDK-8350044](https://bugs.openjdk.org/browse/JDK-8350044) for details on how the new flag behaves in certain corner cases. Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 21 commits: - Merge branch 'master' into JDK-8349847 to fix conflicts. - Reword the "--help-lint" trailing blurb to make it sound more friendly. - Add trailing "--help-lint" blurb to clarify how category aliases are handled. - Merge branch 'master' into JDK-8349847 to fix conflicts. - Improve documentation per CSR review comments. - Address review comments. - Merge branch 'master' into JDK-8349847 - Merge branch 'master' into JDK-8349847 to fix cross-compiling build problem. - Merge branch 'master' into JDK-8349847 to fix conflicts. - Merge branch 'master' into JDK-8349847 to fix conflicts. - ... and 11 more: https://git.openjdk.org/jdk/compare/9093d3a0...0599ab08 ------------- Changes: https://git.openjdk.org/jdk/pull/23622/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23622&range=12 Stats: 241 lines in 13 files changed: 180 ins; 27 del; 34 mod Patch: https://git.openjdk.org/jdk/pull/23622.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23622/head:pull/23622 PR: https://git.openjdk.org/jdk/pull/23622 From acobbs at openjdk.org Sun Sep 28 18:56:01 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Sun, 28 Sep 2025 18:56:01 GMT Subject: RFR: 8344159: Add lint warnings for unnecessary warning suppression [v2] In-Reply-To: References: Message-ID: <5Yc8i9GJZU7D_rezsZX5g6ud_5AIs0sNeFf3pf-fA-E=.0585ea54-97f0-4a54-831f-3239ae1386ae@github.com> > This PR adds a new compiler warning for `@SuppressWarnings` annotations that don't actually suppress any warnings. > > Summary of code changes: > > * Add new warning and associated lint category `"suppression"` > * Update `LintMapper` to keep track of which `@SuppressWarnings` suppressions have been validated ? > * Update `Log.warning()` so it validates any current suppression of the warning's lint category in effect. > * Add a new `validate` parameter to `Lint.isEnabled()` and `Lint.isSuppressed()` that specifies whether to also validate any current suppression. > * Add `Lint.isActive()` to check whether a category is enabled _or_ suppression of the category is being tracked - in other words, whether the warning calculation needs to be performed. Used for non-trivial warning calculations. > * Add `-Xlint:-suppression` flags to `*.gmk` build files so the build doesn't break > > ? The suppression of a lint category is "validated" as soon as it suppresses some warning in that category Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 131 commits: - Merge branch 'master' into JDK-8344159 to fix conflicts. - Add clarifying comment. - Merge branch 'master' into JDK-8344159 - Change inner class name to avoid shadowing superclass name. - Add a couple of code clarification comments. - Refactor test to avoid requiring changes to TestRunner. - Remove unnecessary -Xlint:-suppression flags. - Minor cleanups. - Add OPTIONS, PATH, and SUPPRESSION to the regression test. - Minor regression test cleanups. - ... and 121 more: https://git.openjdk.org/jdk/compare/9093d3a0...7714095d ------------- Changes: https://git.openjdk.org/jdk/pull/25167/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25167&range=01 Stats: 1658 lines in 33 files changed: 1485 ins; 49 del; 124 mod Patch: https://git.openjdk.org/jdk/pull/25167.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25167/head:pull/25167 PR: https://git.openjdk.org/jdk/pull/25167 From jlahoda at openjdk.org Mon Sep 29 05:37:06 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 29 Sep 2025 05:37:06 GMT Subject: RFR: 8367499: Refactor exhaustiveness computation from Flow into a separate class [v2] In-Reply-To: References: Message-ID: > Currently the switch exhaustiveness computation code is part of `Flow`. And while conceptually the check is part of the `Flow` phase, the code is >500 lines of code currently, and likely to get bigger/more complicated in the future. Among other reasons due to enhancements like https://bugs.openjdk.org/browse/JDK-8367530. > > The proposal herein is to move the exhaustiveness computation to a separate class `ExhastivenessComputer`. There's no functional change, only move of the code. This is intentional, to aid the review process. > > One possibility to inspect what is happening is: > > git show upstream/pr/27247:src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java >/tmp/Flow-original.java > diff -d -w /tmp/Flow-original.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ExhaustivenessComputer.java >/tmp/exhaustivenesscomputer-comparison.diff > diff -d -w /tmp/Flow-original.java src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java >/tmp/flow-comparison.diff > > and inspecting `/tmp/exhaustivenesscomputer-comparison.diff`, `/tmp/flow-comparison.diff`. Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision: Adding doc comment. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27253/files - new: https://git.openjdk.org/jdk/pull/27253/files/0d778871..69638358 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27253&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27253&range=00-01 Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27253.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27253/head:pull/27253 PR: https://git.openjdk.org/jdk/pull/27253 From jlahoda at openjdk.org Mon Sep 29 05:39:25 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 29 Sep 2025 05:39:25 GMT Subject: Integrated: 8366582: Test jdk/jshell/ToolSimpleTest.java failed: provider not found In-Reply-To: References: Message-ID: On Wed, 17 Sep 2025 08:15:21 GMT, Jan Lahoda wrote: > The `jdk/jshell/ToolSimpleTest.java` randomly fails, the reason is this: when indexing the bootclasspath/`PLATFORM_CLASS_PATH`, `$JDK_HOME/lib/modules` is typically there, but it can't be opened as a FileSystem, and the exception is sent to the debugging facility. The debugging facility typically does nothing, but in this test contains a test case that enabled debugging, and if the order of things is that the debugging is first enabled, and then the `ProviderNotFoundException` is reported, the test fails. > > The proposal herein is to not to try to open `$JDK_HOME/lib/modules` as a file system. Note the standard platform classes are indexed using `SYSTEM_MODULES`. This pull request has now been integrated. Changeset: d53190ac Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/d53190ac4485e535f0a603036ecf47d4ff6e4178 Stats: 8 lines in 2 files changed: 5 ins; 2 del; 1 mod 8366582: Test jdk/jshell/ToolSimpleTest.java failed: provider not found Reviewed-by: asotona ------------- PR: https://git.openjdk.org/jdk/pull/27333 From myankelevich at openjdk.org Mon Sep 29 10:28:19 2025 From: myankelevich at openjdk.org (Mikhail Yankelevich) Date: Mon, 29 Sep 2025 10:28:19 GMT Subject: RFR: 8365072: Refactor tests to use PEM API (Phase 2) [v3] In-Reply-To: <_Qf2f6cwWoaNPHpm8TfYeWQTiiqhn-z291PeGY7uP6U=.8e77e560-d233-4232-86e8-4e0da5180947@github.com> References: <_Qf2f6cwWoaNPHpm8TfYeWQTiiqhn-z291PeGY7uP6U=.8e77e560-d233-4232-86e8-4e0da5180947@github.com> Message-ID: > Tests changed in this PR: > 1. test/jdk/java/security/cert/CertPathBuilder/selfIssued/StatusLoopDependency.java > 2. test/jdk/java/security/cert/CertPathValidator/indirectCRL/CircularCRLTwoLevel.java > 3. test/jdk/java/security/cert/CertPathValidator/indirectCRL/CircularCRLTwoLevelRevoked.java > 6. test/jdk/sun/security/ssl/ClientHandshaker/RSAExport.java > 7. test/jdk/javax/net/ssl/ServerName/SSLSocketSNISensitive.java > 9. test/jdk/sun/security/ssl/X509TrustManagerImpl/BasicConstraints.java > 10. test/jdk/sun/security/ssl/X509TrustManagerImpl/ComodoHacker.java > 11. test/jdk/javax/net/ssl/interop/ClientHelloInterOp.java > 12. test/jdk/sun/security/rsa/InvalidBitString.java > 14. test/jdk/java/security/cert/CertPathBuilder/NoExtensions.java > 17. test/jdk/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorTrustAnchor.java > 19. test/jdk/sun/security/x509/X509CRLImpl/Verify.java > > PEMRecord tests will be done under a subtask [JDK-8367326](https://bugs.openjdk.org/browse/JDK-8367326) Mikhail Yankelevich has updated the pull request incrementally with 364 additional commits since the last revision: - removed pemrecord usage - 8365190: Remove LockingMode related code from share Reviewed-by: aboldtch, dholmes, ayang, coleenp, lmesnik, rcastanedalo - 8367025: zIndexDistributor.hpp uses angle-bracket inclusion of globalDefinitions.hpp Reviewed-by: aboldtch, tschatzl, jwaters - 8360219: [AIX] assert(locals_base >= l2) failed: bad placement Reviewed-by: dlong, mdoerr - 8366864: Sort os/linux includes Reviewed-by: ayang, dholmes - 8366874: Test gc/arguments/TestParallelGCErgo.java fails with UseTransparentHugePages Reviewed-by: ayang, shade, stefank, tschatzl - 8351260: java.lang.AssertionError: Unexpected type tree: (ERROR) = (ERROR) Reviewed-by: vromero - 8365776: Convert JShell tests to use JUnit instead of TestNG Reviewed-by: vromero - 8354871: Replace stack map frame type magics with constants Reviewed-by: liach - 8361533: Apply java.io.Serial annotations in java.logging Reviewed-by: rriggs - ... and 354 more: https://git.openjdk.org/jdk/compare/d44cb277...e0be5eaa ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27194/files - new: https://git.openjdk.org/jdk/pull/27194/files/d44cb277..e0be5eaa Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27194&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27194&range=01-02 Stats: 53711 lines in 1891 files changed: 31453 ins; 14034 del; 8224 mod Patch: https://git.openjdk.org/jdk/pull/27194.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27194/head:pull/27194 PR: https://git.openjdk.org/jdk/pull/27194 From jlahoda at openjdk.org Mon Sep 29 13:18:44 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 29 Sep 2025 13:18:44 GMT Subject: RFR: 8366968: Exhaustive switch expression rejected by for not covering all possible values Message-ID: Consider case like (from the bug): class Demo { sealed interface Base permits Special, Value {} non-sealed interface Value extends Base {} sealed interface Special extends Base permits SpecialValue {} non-sealed interface SpecialValue extends Value, Special {} static int demo(final Base base) { return switch (base) { case final Value value -> 0; // Uncommenting the following line will make javac accept this program //case final Special value -> throw new AssertionError(); }; } } This fails to compile: /tmp/Demo.java:12: error: the switch expression does not cover all possible input values return switch (base) { ^ 1 error Note there is no instance of `Special` that would not be an instance of `Value` as well. I.e. covering `Value` will catch all input. Also, note that if `case Value` is replaced with `case SpecialValue`, javac also compile the code: case final Value value -> 0; => case final SpecialValue value -> 0; $ ~/tools/jdk/jdk-25/bin/javac /tmp/Demo.java $ Which shows the problem: replacing a type with a super type should not cause the switch to stop to be exhaustive (i.e. the switch is exhaustive for `SpecialValue`, but replacing it with its super type `Value`, the switch is no longer exhaustive for javac). javac contains a piece of code that searches through subtypes to handle diamond class hierarchies like the one above. But, when it searches for subtypes, it does a search through permitted subtypes of the type. And since `Value` is not sealed, this search will not find `SpecialValue`, and javac won't see the switch to be exhaustive. The proposal herein is to broaden the search, and consider all transitive permitted subtypes of the selector type, and filter subtypes of the current type from this set (if the current type is abstract, if it is not abstract, we can't do the subtype search at all). This should, I think, include all relevant subtypes. ------------- Depends on: https://git.openjdk.org/jdk/pull/27253 Commit messages: - 8366968: Exhaustive switch expression rejected by for not covering all possible values Changes: https://git.openjdk.org/jdk/pull/27547/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27547&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8366968 Stats: 43 lines in 2 files changed: 36 ins; 1 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/27547.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27547/head:pull/27547 PR: https://git.openjdk.org/jdk/pull/27547 From liach at openjdk.org Mon Sep 29 15:35:40 2025 From: liach at openjdk.org (Chen Liang) Date: Mon, 29 Sep 2025 15:35:40 GMT Subject: RFR: 8364991: Incorrect not-exhaustive error In-Reply-To: References: Message-ID: On Fri, 12 Sep 2025 07:53:09 GMT, Jan Lahoda wrote: > Consider this code: > > $ cat Test.java > package test; > public class Test { > private int test1(Root r) { > return switch (r) { > case Root(R2(R1 _), R2(R1 _)) -> 0; > case Root(R2(R1 _), R2(R2 _)) -> 0; > case Root(R2(R2 _), R2(R1 _)) -> 0; > case Root(R2(R2 _), R2 _) -> 0; > }; > } > sealed interface Base {} > record R1() implements Base {} > record R2(Base b1) implements Base {} > record Root(R2 b2, R2 b3) {} > } > > > javac (JDK 25) will produce a compile-time error for this code: > > $ javac test/Test.java > .../test/Test.java:4: error: the switch expression does not cover all possible input values > return switch (r) { > ^ > 1 error > > > This error is not correct according to the JLS. JLS defines a set of possible reductions of pattern sets, and if there exists a series of reductions from the pattern set into a pattern set that covers the selector type, the switch is exhaustive. > > One such reduction is that if there's a sub-set of (record) patterns that only differ in one component ("the mismatching component"), we can replace them with a (set of) patterns where this component is reduced, and the other components are unmodified. > > Such path exists here (every line shows a set of patterns that is being transformed): > > Root(R2(R1 _), R2(R1 _)), Root(R2(R1 _), R2(R2 _)), Root(R2(R2 _), R2(R1 _)), Root(R2(R2 _), R2 _) > => choosing the second component as the mismatching component, then we can reduce Root(R2(R1 _), R2(R1 _)), Root(R2(R1 _), R2(R2 _)) => Root(R2(R1 _), R2 _); as we can reduce R2(R1 _), R2(R2 _) to R2 _ > Root(R2(R1 _), R2 _), Root(R2(R2 _), R2(R1 _)), Root(R2(R2 _), R2 _) > => choosing the first component as the mismatching component, we can reduce Root(R2(R1 _), R2 _), Root(R2(R2 _), R2 _) => Root(R2 _, R2 _) > Root(R2 _, R2 _) > => > Root _ > => > exhaustive > > > The problem here is that in the first step, javac chooses this path: > > Root(R2(R1 _), R2(R1 _)), Root(R2(R1 _), R2(R2 _)), Root(R2(R2 _), R2(R1 _)), Root(R2(R2 _), R2 _) > => reduce Root(R2(R1 _), R2(R1 _)), Root(R2(R2 _), R2(R1 _)) => Root(R2 _, R2(R1 _)) > Root(R2 _, R2(R1 _)), Root(R2(R1 _), R2(R2 _)), Root(R2(R2 _), R2 _) > => dead end, as there are no two patterns that would have the same nested pattern in the same component > > > If javac would do full backtracking, it could go back, and choose the other path, and find out the switch is exhaustive. But, full naive backtracking is, I think, prohibitively too slow for even relatively small swit... src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java line 1093: > 1091: if (nestedRPOne.equals(currentReplaced)) { > 1092: foundMatchingReplaced = true; > 1093: break; Can we just use `continue ACCEPT;`, and remove the `foundMatchingReplaced` variable? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27247#discussion_r2388355666 From jlahoda at openjdk.org Mon Sep 29 16:24:58 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Mon, 29 Sep 2025 16:24:58 GMT Subject: RFR: 8368848: JShell's code completion not always working for multi-snippet inputs Message-ID: Having a JShell input like: jshell> String s() { return "";} s(). the code completion is not working for it. The reason is that the input is two snippets, but the code completion will interpret it as only one snippet, and a method declaration and method invocation cannot coexist inside one snippet (as one is a declaration that must appear outside of a method, and the invocation must be inside a method body or field initializer). The proposal herein is for the JShell's code completion to split the input into snippets, and create a wrapper/compilation unit based on all the snippets. ------------- Commit messages: - 8368848: JShell's code completion not always working for multi-snippet inputs Changes: https://git.openjdk.org/jdk/pull/27552/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27552&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8368848 Stats: 140 lines in 4 files changed: 114 ins; 15 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/27552.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27552/head:pull/27552 PR: https://git.openjdk.org/jdk/pull/27552 From jpai at openjdk.org Tue Sep 30 06:55:49 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Tue, 30 Sep 2025 06:55:49 GMT Subject: RFR: 8368357: Some source files have initial blank lines In-Reply-To: <9121m5P5MFrgd7v8Rl88DaZLT6UBKVUciMcZvWNtqiM=.0fdcc411-6f28-4dc2-bb54-9c37712d22d2@github.com> References: <9121m5P5MFrgd7v8Rl88DaZLT6UBKVUciMcZvWNtqiM=.0fdcc411-6f28-4dc2-bb54-9c37712d22d2@github.com> Message-ID: <-AtApQjIshlnieD15eDe-CktLxAG14eDbk8USBlQ0P0=.dbf5e726-ba74-4ba3-aeb7-97dd820c130b@github.com> On Thu, 25 Sep 2025 13:44:13 GMT, Francesco Andreuzzi wrote: > Removing some spurious blank lines at the beginning of the file. Looks trivial to me. This looks good and trivial to me. ------------- Marked as reviewed by jpai (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27489#pullrequestreview-3282862820 From fandreuzzi at openjdk.org Tue Sep 30 10:44:22 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Tue, 30 Sep 2025 10:44:22 GMT Subject: Integrated: 8368357: Some source files have initial blank lines In-Reply-To: <9121m5P5MFrgd7v8Rl88DaZLT6UBKVUciMcZvWNtqiM=.0fdcc411-6f28-4dc2-bb54-9c37712d22d2@github.com> References: <9121m5P5MFrgd7v8Rl88DaZLT6UBKVUciMcZvWNtqiM=.0fdcc411-6f28-4dc2-bb54-9c37712d22d2@github.com> Message-ID: On Thu, 25 Sep 2025 13:44:13 GMT, Francesco Andreuzzi wrote: > Removing some spurious blank lines at the beginning of the file. Looks trivial to me. This pull request has now been integrated. Changeset: ba0a6eed Author: Francesco Andreuzzi Committer: Albert Mingkun Yang URL: https://git.openjdk.org/jdk/commit/ba0a6eed1a6a22bd4c1d159592b62e054afa401a Stats: 8 lines in 8 files changed: 0 ins; 8 del; 0 mod 8368357: Some source files have initial blank lines Reviewed-by: stefank, ayang, serb, jwaters, jpai ------------- PR: https://git.openjdk.org/jdk/pull/27489 From jlahoda at openjdk.org Tue Sep 30 11:57:31 2025 From: jlahoda at openjdk.org (Jan Lahoda) Date: Tue, 30 Sep 2025 11:57:31 GMT Subject: Integrated: 8365060: Historical data for JDK 8 should include the jdk.net package In-Reply-To: <7EA7TV3a3aPdhvDV0Jd1zD_xHqUNVakc2KtgQ62_C_c=.7136a250-dfaf-454d-aa13-3499addd6762@github.com> References: <7EA7TV3a3aPdhvDV0Jd1zD_xHqUNVakc2KtgQ62_C_c=.7136a250-dfaf-454d-aa13-3499addd6762@github.com> Message-ID: On Mon, 18 Aug 2025 08:18:04 GMT, Jan Lahoda wrote: > In JDK 8, the package `jdk.net` was exported and part of `rt.jar`, and hence should have been part of the historical data for `--release`, but it is not. The primary goal of this PR is to add historical data for `jdk.net` for JDK 8. > > The changes herein are based on JDK 8u462. I used the Probe running on JDK 8 to dump the classfiles, along these lines: > > $ java -classpath .../make/langtools/src/classes/ build.tools.symbolgenerator.Probe /tmp/jdk8-classfiles > > > and then the up-to-date `CreateSymbols` to generate the `sym.txt` files, along these lines: > > java --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED CreateSymbols.java build-description-incremental-file .../src/jdk.compiler/share/data/symbols/symbols .../src/jdk.compiler/share/data/symbols/include.list 8 /tmp/jdk8-classfiles '' --normalize-method-flags > > > There are a few APIs that have been added for this release, and a few representational changes. > > Most notably - the ordering of "removal" entries (i.e. those that start with `-`) and "add" entries is much more strict in the current `CreateSymbols`, and so there are some changes where the removal entries are moved to the front. I went through those, and they seem OK to me. > > I'll add specific comments to the other updates to the files. This pull request has now been integrated. Changeset: 8606d3f8 Author: Jan Lahoda URL: https://git.openjdk.org/jdk/commit/8606d3f8405b73878a1319ba3574ef69349aa2a1 Stats: 286 lines in 13 files changed: 203 ins; 67 del; 16 mod 8365060: Historical data for JDK 8 should include the jdk.net package Reviewed-by: shade, liach ------------- PR: https://git.openjdk.org/jdk/pull/26817 From asotona at openjdk.org Tue Sep 30 15:11:17 2025 From: asotona at openjdk.org (Adam Sotona) Date: Tue, 30 Sep 2025 15:11:17 GMT Subject: RFR: 8368848: JShell's code completion not always working for multi-snippet inputs In-Reply-To: References: Message-ID: On Mon, 29 Sep 2025 16:16:39 GMT, Jan Lahoda wrote: > Having a JShell input like: > > jshell> String s() { return "";} s(). > > > the code completion is not working for it. The reason is that the input is two snippets, but the code completion will interpret it as only one snippet, and a method declaration and method invocation cannot coexist inside one snippet (as one is a declaration that must appear outside of a method, and the invocation must be inside a method body or field initializer). > > The proposal herein is for the JShell's code completion to split the input into snippets, and create a wrapper/compilation unit based on all the snippets. Looks good to me. ------------- Marked as reviewed by asotona (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27552#pullrequestreview-3285498523