From cushon at openjdk.org Sat Nov 1 16:26:04 2025 From: cushon at openjdk.org (Liam Miller-Cushon) Date: Sat, 1 Nov 2025 16:26:04 GMT Subject: RFR: 8354548: Update CLDR to Version 48.0 [v2] In-Reply-To: <9VpoTyAJ3oQwtSpHO6sCVwaWA_Jx3B91DS2oxOTTTcI=.afc95ec9-c937-44e8-9a0c-9b087dd3c4ff@github.com> References: <9VpoTyAJ3oQwtSpHO6sCVwaWA_Jx3B91DS2oxOTTTcI=.afc95ec9-c937-44e8-9a0c-9b087dd3c4ff@github.com> Message-ID: On Thu, 30 Oct 2025 23:13:02 GMT, Naoto Sato wrote: >> Upgrading the CLDR to version 48.0. A corresponding CSR has also been drafted. > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > .md files make/data/cldr/common/main/tok.xml line 444: > 442: > 443: > 444: 'tenpo' 'sike' #y 'la' 'tenpo' MMMM 'la' 'tenpo' 'suno' #d I think `DateTimeFormatter` doesn't handle the new patterns for `tok`, I am seeing the following crash with these changes: jshell> Instant.parse("2018-07-16T23:58:59.000000200Z").atZone(ZoneId.of("UTC")).format(DateTimeFormatter.ofLocalizedDate(FormatStyle.LONG).withLocale(Locale.of("tok"))) | Exception java.lang.IllegalArgumentException: Pattern includes reserved character: '#' | at DateTimeFormatterBuilder.parsePattern (DateTimeFormatterBuilder.java:2056) | at DateTimeFormatterBuilder.appendPattern (DateTimeFormatterBuilder.java:1910) | at DateTimeFormatterBuilder$LocalizedPrinterParser.lambda$formatter$0 (DateTimeFormatterBuilder.java:5181) | at ConcurrentHashMap.computeIfAbsent (ConcurrentHashMap.java:1727) | at DateTimeFormatterBuilder$LocalizedPrinterParser.formatter (DateTimeFormatterBuilder.java:5179) | at DateTimeFormatterBuilder$LocalizedPrinterParser.format (DateTimeFormatterBuilder.java:5154) | at DateTimeFormatterBuilder$CompositePrinterParser.format (DateTimeFormatterBuilder.java:2547) | at DateTimeFormatter.formatTo (DateTimeFormatter.java:1907) | at DateTimeFormatter.format (DateTimeFormatter.java:1881) | at ZonedDateTime.format (ZonedDateTime.java:2158) | at (#6:1) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28076#discussion_r2483784510 From duke at openjdk.org Sun Nov 2 09:54:05 2025 From: duke at openjdk.org (Tatsunori Uchino) Date: Sun, 2 Nov 2025 09:54:05 GMT Subject: RFR: 8364007: Add no-argument codePointCount method to CharSequence and String [v3] In-Reply-To: References: Message-ID: On Sat, 26 Jul 2025 10:10:40 GMT, Tatsunori Uchino wrote: >> Adds `codePointCount()` overloads to `String`, `Character`, `(Abstract)StringBuilder`, and `StringBuffer` to make it possible to conveniently retrieve the length of a string as code points without extra boundary checks. >> >> >> if (superTremendouslyLongExpressionYieldingAString().codePointCount() > limit) { >> throw new Exception("exceeding length"); >> } >> >> >> Is a CSR required to this change? > > Tatsunori Uchino has updated the pull request incrementally with four additional commits since the last revision: > > - Update `@bug` in correct file > - Add default implementation on codePointCount in CharSequence > - Update `@bug` entries in test class doc comments > - Discard changes on code whose form is not `str.codePointCount(0, str.length())` The CSR text is not modified from the boilerplate, but I have no authority to modify it. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26461#issuecomment-3477670082 From naoto at openjdk.org Mon Nov 3 18:42:01 2025 From: naoto at openjdk.org (Naoto Sato) Date: Mon, 3 Nov 2025 18:42:01 GMT Subject: RFR: 8354548: Update CLDR to Version 48.0 [v2] In-Reply-To: References: <9VpoTyAJ3oQwtSpHO6sCVwaWA_Jx3B91DS2oxOTTTcI=.afc95ec9-c937-44e8-9a0c-9b087dd3c4ff@github.com> Message-ID: On Sat, 1 Nov 2025 16:23:18 GMT, Liam Miller-Cushon wrote: >> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: >> >> .md files > > make/data/cldr/common/main/tok.xml line 444: > >> 442: >> 443: >> 444: 'tenpo' 'sike' #y 'la' 'tenpo' MMMM 'la' 'tenpo' 'suno' #d > > I think `DateTimeFormatter` doesn't handle the new patterns for `tok`, I am seeing the following crash with these changes: > > > jshell> Instant.parse("2018-07-16T23:58:59.000000200Z").atZone(ZoneId.of("UTC")).format(DateTimeFormatter.ofLocalizedDate(FormatStyle.LONG).withLocale(Locale.of("tok"))) > | Exception java.lang.IllegalArgumentException: Pattern includes reserved character: '#' > | at DateTimeFormatterBuilder.parsePattern (DateTimeFormatterBuilder.java:2056) > | at DateTimeFormatterBuilder.appendPattern (DateTimeFormatterBuilder.java:1910) > | at DateTimeFormatterBuilder$LocalizedPrinterParser.lambda$formatter$0 (DateTimeFormatterBuilder.java:5181) > | at ConcurrentHashMap.computeIfAbsent (ConcurrentHashMap.java:1727) > | at DateTimeFormatterBuilder$LocalizedPrinterParser.formatter (DateTimeFormatterBuilder.java:5179) > | at DateTimeFormatterBuilder$LocalizedPrinterParser.format (DateTimeFormatterBuilder.java:5154) > | at DateTimeFormatterBuilder$CompositePrinterParser.format (DateTimeFormatterBuilder.java:2547) > | at DateTimeFormatter.formatTo (DateTimeFormatter.java:1907) > | at DateTimeFormatter.format (DateTimeFormatter.java:1881) > | at ZonedDateTime.format (ZonedDateTime.java:2158) > | at (#6:1) Thanks. Will address this in the next version. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28076#discussion_r2487494223 From naoto at openjdk.org Mon Nov 3 21:27:13 2025 From: naoto at openjdk.org (Naoto Sato) Date: Mon, 3 Nov 2025 21:27:13 GMT Subject: RFR: 8354548: Update CLDR to Version 48.0 [v3] In-Reply-To: References: Message-ID: > Upgrading the CLDR to version 48.0. A corresponding CSR has also been drafted. Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: `#` fix for "tok" locale ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28076/files - new: https://git.openjdk.org/jdk/pull/28076/files/38f86493..41fa00fb Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28076&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28076&range=01-02 Stats: 101 lines in 2 files changed: 99 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/28076.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28076/head:pull/28076 PR: https://git.openjdk.org/jdk/pull/28076 From jlu at openjdk.org Mon Nov 3 23:54:37 2025 From: jlu at openjdk.org (Justin Lu) Date: Mon, 3 Nov 2025 23:54:37 GMT Subject: RFR: 8370420: HostLocaleProviderAdapter_md.c from libjava can use GetLocaleInfoEx, GetCalendarInfoEx, EnumCalendarInfoExEx directly Message-ID: This PR cleans up some native code for Windows i18n functions. These particular calls are designed to run on Windows Vista and later. Since Vista (and older) are not supported Windows platforms, the calls no longer need to be checked if they are supported and can be called directly. Reference to docs: https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getlocaleinfoex. > Minimum supported client: Windows Vista > Minimum supported server: Windows Server 2008 ------------- Commit messages: - Merge branch 'master' into JDK-8370420-Windows - init Changes: https://git.openjdk.org/jdk/pull/28119/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28119&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8370420 Stats: 34 lines in 1 file changed: 1 ins; 19 del; 14 mod Patch: https://git.openjdk.org/jdk/pull/28119.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28119/head:pull/28119 PR: https://git.openjdk.org/jdk/pull/28119 From bpb at openjdk.org Tue Nov 4 00:07:03 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Tue, 4 Nov 2025 00:07:03 GMT Subject: RFR: 8370420: HostLocaleProviderAdapter_md.c from libjava can use GetLocaleInfoEx, GetCalendarInfoEx, EnumCalendarInfoExEx directly In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 23:48:22 GMT, Justin Lu wrote: > This PR cleans up some native code for Windows i18n functions. These particular calls are designed to run on Windows Vista and later. Since Vista (and older) are not supported Windows platforms, the calls no longer need to be checked if they are supported and can be called directly. > > Reference to docs: https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getlocaleinfoex. > >> Minimum supported client: Windows Vista >> Minimum supported server: Windows Server 2008 Looks all right to me. ------------- Marked as reviewed by bpb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28119#pullrequestreview-3413411560 From naoto at openjdk.org Tue Nov 4 00:11:36 2025 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 4 Nov 2025 00:11:36 GMT Subject: RFR: 8354548: Update CLDR to Version 48.0 [v4] In-Reply-To: References: Message-ID: > Upgrading the CLDR to version 48.0. A corresponding CSR has also been drafted. Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Unicode copyright update for the generated sources ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28076/files - new: https://git.openjdk.org/jdk/pull/28076/files/41fa00fb..05f5f0d9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28076&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28076&range=02-03 Stats: 45 lines in 1 file changed: 8 ins; 0 del; 37 mod Patch: https://git.openjdk.org/jdk/pull/28076.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28076/head:pull/28076 PR: https://git.openjdk.org/jdk/pull/28076 From naoto at openjdk.org Tue Nov 4 00:49:06 2025 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 4 Nov 2025 00:49:06 GMT Subject: RFR: 8370420: HostLocaleProviderAdapter_md.c from libjava can use GetLocaleInfoEx, GetCalendarInfoEx, EnumCalendarInfoExEx directly In-Reply-To: References: Message-ID: On Mon, 3 Nov 2025 23:48:22 GMT, Justin Lu wrote: > This PR cleans up some native code for Windows i18n functions. These particular calls are designed to run on Windows Vista and later. Since Vista (and older) are not supported Windows platforms, the calls no longer need to be checked if they are supported and can be called directly. > > Reference to docs: https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getlocaleinfoex. > >> Minimum supported client: Windows Vista >> Minimum supported server: Windows Server 2008 I think we can clean it further, as we don't need to call Win32 through their function pointers. Specifically, typedef int (WINAPI *PGLIE)(const jchar *, LCTYPE, LPWSTR, int); typedef int (WINAPI *PGCIE)(const jchar *, CALID, LPCWSTR, CALTYPE, LPWSTR, int, LPDWORD); typedef int (WINAPI *PECIEE)(CALINFO_ENUMPROCEXEX, const jchar *, CALID, LPCWSTR, CALTYPE, LPARAM); PGLIE pGetLocaleInfoEx; PGCIE pGetCalendarInfoEx; PECIEE pEnumCalendarInfoExEx; BOOL initialized = FALSE; and it's init code can all go away, IIUC ------------- PR Comment: https://git.openjdk.org/jdk/pull/28119#issuecomment-3483228621 From mbaesken at openjdk.org Tue Nov 4 08:17:21 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Tue, 4 Nov 2025 08:17:21 GMT Subject: RFR: 8370420: HostLocaleProviderAdapter_md.c from libjava can use GetLocaleInfoEx, GetCalendarInfoEx, EnumCalendarInfoExEx directly In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 00:46:37 GMT, Naoto Sato wrote: > I think we can clean it further, as we don't need to call Win32 through their function pointers. Specifically, > > ``` > typedef int (WINAPI *PGLIE)(const jchar *, LCTYPE, LPWSTR, int); > typedef int (WINAPI *PGCIE)(const jchar *, CALID, LPCWSTR, CALTYPE, LPWSTR, int, LPDWORD); > typedef int (WINAPI *PECIEE)(CALINFO_ENUMPROCEXEX, const jchar *, CALID, LPCWSTR, CALTYPE, LPARAM); > PGLIE pGetLocaleInfoEx; > PGCIE pGetCalendarInfoEx; > PECIEE pEnumCalendarInfoExEx; > BOOL initialized = FALSE; > ``` > > and it's init code can all go away, IIUC Yes the GetProcAddress stuff should be removed too, see https://github.com/openjdk/jdk/blob/c1476fca9d7a679d32b7b43956638b845d1027cc/src/java.base/windows/native/libjava/HostLocaleProviderAdapter_md.c#L189 ------------- PR Comment: https://git.openjdk.org/jdk/pull/28119#issuecomment-3484469810 From naoto at openjdk.org Tue Nov 4 17:53:36 2025 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 4 Nov 2025 17:53:36 GMT Subject: RFR: 8354548: Update CLDR to Version 48.0 [v5] In-Reply-To: References: Message-ID: > Upgrading the CLDR to version 48.0. A corresponding CSR has also been drafted. Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Minor header fix ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28076/files - new: https://git.openjdk.org/jdk/pull/28076/files/05f5f0d9..b0bfd789 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28076&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28076&range=03-04 Stats: 2 lines in 1 file changed: 2 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/28076.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28076/head:pull/28076 PR: https://git.openjdk.org/jdk/pull/28076 From jlu at openjdk.org Tue Nov 4 19:06:31 2025 From: jlu at openjdk.org (Justin Lu) Date: Tue, 4 Nov 2025 19:06:31 GMT Subject: RFR: 8370420: HostLocaleProviderAdapter_md.c from libjava can use GetLocaleInfoEx, GetCalendarInfoEx, EnumCalendarInfoExEx directly [v2] In-Reply-To: References: Message-ID: > This PR cleans up some native code for Windows i18n functions. These particular calls are designed to run on Windows Vista and later. Since Vista (and older) are not supported Windows platforms, the calls no longer need to be checked if they are supported and can be called directly. > > Reference to docs: https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getlocaleinfoex. > >> Minimum supported client: Windows Vista >> Minimum supported server: Windows Server 2008 Justin Lu has updated the pull request incrementally with one additional commit since the last revision: Remove dynamic loading and call directly ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28119/files - new: https://git.openjdk.org/jdk/pull/28119/files/0ccf212a..e18a5744 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28119&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28119&range=00-01 Stats: 62 lines in 2 files changed: 5 ins; 44 del; 13 mod Patch: https://git.openjdk.org/jdk/pull/28119.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28119/head:pull/28119 PR: https://git.openjdk.org/jdk/pull/28119 From naoto at openjdk.org Tue Nov 4 19:43:54 2025 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 4 Nov 2025 19:43:54 GMT Subject: RFR: 8370420: HostLocaleProviderAdapter_md.c from libjava can use GetLocaleInfoEx, GetCalendarInfoEx, EnumCalendarInfoExEx directly [v2] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 19:06:31 GMT, Justin Lu wrote: >> This PR cleans up some native code for Windows i18n functions. These particular calls are designed to run on Windows Vista and later. Since Vista (and older) are not supported Windows platforms, the calls no longer need to be checked if they are supported and can be called directly. >> >> Reference to docs: https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getlocaleinfoex. >> >>> Minimum supported client: Windows Vista >>> Minimum supported server: Windows Server 2008 > > Justin Lu has updated the pull request incrementally with one additional commit since the last revision: > > Remove dynamic loading and call directly LGTM ------------- Marked as reviewed by naoto (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28119#pullrequestreview-3418379991 From jlu at openjdk.org Tue Nov 4 20:07:18 2025 From: jlu at openjdk.org (Justin Lu) Date: Tue, 4 Nov 2025 20:07:18 GMT Subject: RFR: 8354548: Update CLDR to Version 48.0 [v5] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 17:53:36 GMT, Naoto Sato wrote: >> Upgrading the CLDR to version 48.0. A corresponding CSR has also been drafted. > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Minor header fix Took a look at all the changes besides the XML data itself. LGTM. make/data/cldr/LICENSE line 1: > 1: ?UNICODE LICENSE V3 I guess a line ending change on their end? make/jdk/src/classes/build/tools/cldrconverter/Bundle.java line 852: > 850: > 851: /** > 852: * Escape reserved pattern characters, '#', '{', and '}' in the pattern Even though they may not be offending now, should '[' and ']' be included since they are also non CLDR date time patterns (not A-Z), but are recognized in DateTimeFormatter patterns? ------------- Marked as reviewed by jlu (Committer). PR Review: https://git.openjdk.org/jdk/pull/28076#pullrequestreview-3412376711 PR Review Comment: https://git.openjdk.org/jdk/pull/28076#discussion_r2491900624 PR Review Comment: https://git.openjdk.org/jdk/pull/28076#discussion_r2491874764 From jlu at openjdk.org Tue Nov 4 20:07:21 2025 From: jlu at openjdk.org (Justin Lu) Date: Tue, 4 Nov 2025 20:07:21 GMT Subject: RFR: 8354548: Update CLDR to Version 48.0 [v2] In-Reply-To: <9VpoTyAJ3oQwtSpHO6sCVwaWA_Jx3B91DS2oxOTTTcI=.afc95ec9-c937-44e8-9a0c-9b087dd3c4ff@github.com> References: <9VpoTyAJ3oQwtSpHO6sCVwaWA_Jx3B91DS2oxOTTTcI=.afc95ec9-c937-44e8-9a0c-9b087dd3c4ff@github.com> Message-ID: <_OeoX0nyVU3EogxGV3pXv1knDQQmDs7axRKf2QOM4wg=.b500b7df-f03b-4605-af83-8b5394a81fe6@github.com> On Thu, 30 Oct 2025 23:13:02 GMT, Naoto Sato wrote: >> Upgrading the CLDR to version 48.0. A corresponding CSR has also been drafted. > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > .md files test/jdk/java/text/Format/CompactNumberFormat/TestCompactNumber.java line 1: > 1: /* Bug id update needed? test/jdk/sun/util/resources/cldr/TimeZoneNamesTest.java line 1: > 1: /* Bug id update needed? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28076#discussion_r2487475839 PR Review Comment: https://git.openjdk.org/jdk/pull/28076#discussion_r2487488844 From naoto at openjdk.org Tue Nov 4 21:03:25 2025 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 4 Nov 2025 21:03:25 GMT Subject: RFR: 8354548: Update CLDR to Version 48.0 [v6] In-Reply-To: References: Message-ID: > Upgrading the CLDR to version 48.0. A corresponding CSR has also been drafted. Naoto Sato has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 58 commits: - Addressing review comments - Merge branch 'master' into JDK-8354548-CLDR-48 - Minor header fix - Unicode copyright update for the generated sources - `#` fix for "tok" locale - .md files - v48 final - Merge branch 'master' into JDK-8354548-CLDR-48 - Merge branch 'master' into JDK-8354548-CLDR-48 - Merge branch 'master' into JDK-8354548-CLDR-48 - ... and 48 more: https://git.openjdk.org/jdk/compare/9f972008...b5c74834 ------------- Changes: https://git.openjdk.org/jdk/pull/28076/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28076&range=05 Stats: 135921 lines in 390 files changed: 94379 ins; 15578 del; 25964 mod Patch: https://git.openjdk.org/jdk/pull/28076.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28076/head:pull/28076 PR: https://git.openjdk.org/jdk/pull/28076 From naoto at openjdk.org Tue Nov 4 21:05:06 2025 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 4 Nov 2025 21:05:06 GMT Subject: RFR: 8354548: Update CLDR to Version 48.0 [v5] In-Reply-To: References: Message-ID: On Tue, 4 Nov 2025 20:02:47 GMT, Justin Lu wrote: >> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: >> >> Minor header fix > > make/data/cldr/LICENSE line 1: > >> 1: ?UNICODE LICENSE V3 > > I guess a line ending change on their end? Yes. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28076#discussion_r2492033121 From naoto at openjdk.org Tue Nov 4 21:47:01 2025 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 4 Nov 2025 21:47:01 GMT Subject: RFR: 8354548: Update CLDR to Version 48.0 [v7] In-Reply-To: References: Message-ID: > Upgrading the CLDR to version 48.0. A corresponding CSR has also been drafted. Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Test data fix for zh_HK which uses '[' and ']' literals ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28076/files - new: https://git.openjdk.org/jdk/pull/28076/files/b5c74834..5de0854a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28076&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28076&range=05-06 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/28076.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28076/head:pull/28076 PR: https://git.openjdk.org/jdk/pull/28076 From eawazilalwataniuh7 at gmail.com Wed Nov 5 02:58:16 2025 From: eawazilalwataniuh7 at gmail.com (eawazilalwataniuh) Date: Wed, 5 Nov 2025 04:58:16 +0200 Subject: Commercial Roof Insulation Solutions Message-ID: ??? ?????? ??????? ???????? ? ??? ?????? ??????? ???????? ???? ???? ?????? ?????? ??? ???? ?????? ???????? ?????? ?????? ???????. ?????? ??? ???????? ???????? ?????????? ???????? ????? ??? ??? ??? ???? ????? ????????? ?????? ??????? ????? ???????. ??????? ????? ????? ?? ????? ????? ??????? ????? ??????? ???????? ???? ??????? ?????? ??? ????? ???????. ?? ??? ???????? ????????? ???? ????? ??????? ??????? ?????? ????? ?????? ????????? ?? ??????? ????????? ????? ??????? ??? ??? ??????? ???? ????? ???? ???? ??????. ??? ???? ?????? ???????? ??????? ??????? ??????? ?????? ????? ???????? ???? ????? ?????? ????? ???? ??????? ????. ????? ???? ???????? ????? ???????? ?? ???? ?????? ??? *????? ??? ?????? * ???? ????? ?????? ?? ????? ?????? ??? ?????? ???????? ????? ?????. ??? ???? *????? ??????? * ?????? ?????? ????? ????? ????? ??????? ???????? ????? ???????? ??????? ?? ???????. ???? ??? ??? ?????? ????? ????? ??????? ??????? ?????? ??????? ??????? ??????? ??? ???? ?????? ??????? ??? ???? ?????? ?? ???????? ??? ????? *???? ??? ????? * ???? ???? ???? ?????? ??????? ????? ??????? ???????? ????? ????? ??????? ????? ???? ?????? ?????? ???? ?????. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbaesken at openjdk.org Wed Nov 5 08:08:03 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Wed, 5 Nov 2025 08:08:03 GMT Subject: RFR: 8370420: HostLocaleProviderAdapter_md.c from libjava can use GetLocaleInfoEx, GetCalendarInfoEx, EnumCalendarInfoExEx directly [v2] In-Reply-To: References: Message-ID: <3DrRXpA2tp_sHI34pEugtcLNstNe4RpekKAwgeNhS00=.983daaf2-92fd-4c21-bb32-96daac3e0bc2@github.com> On Tue, 4 Nov 2025 19:06:31 GMT, Justin Lu wrote: >> This PR cleans up some native code for Windows i18n functions. These particular calls are designed to run on Windows Vista and later. Since Vista (and older) are not supported Windows platforms, the calls no longer need to be checked if they are supported and can be called directly. >> >> Reference to docs: https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getlocaleinfoex. >> >>> Minimum supported client: Windows Vista >>> Minimum supported server: Windows Server 2008 > > Justin Lu has updated the pull request incrementally with one additional commit since the last revision: > > Remove dynamic loading and call directly Marked as reviewed by mbaesken (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28119#pullrequestreview-3420458873 From naoto at openjdk.org Wed Nov 5 17:09:48 2025 From: naoto at openjdk.org (Naoto Sato) Date: Wed, 5 Nov 2025 17:09:48 GMT Subject: RFR: 8354548: Update CLDR to Version 48.0 [v8] In-Reply-To: References: Message-ID: > Upgrading the CLDR to version 48.0. A corresponding CSR has also been drafted. Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: More test data ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28076/files - new: https://git.openjdk.org/jdk/pull/28076/files/5de0854a..45ba153f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28076&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28076&range=06-07 Stats: 27 lines in 1 file changed: 27 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/28076.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28076/head:pull/28076 PR: https://git.openjdk.org/jdk/pull/28076 From jlu at openjdk.org Wed Nov 5 22:19:36 2025 From: jlu at openjdk.org (Justin Lu) Date: Wed, 5 Nov 2025 22:19:36 GMT Subject: RFR: 8370420: HostLocaleProviderAdapter_md.c from libjava can use GetLocaleInfoEx, GetCalendarInfoEx, EnumCalendarInfoExEx directly [v3] In-Reply-To: References: Message-ID: > This PR cleans up some native code for Windows i18n functions. These particular calls are designed to run on Windows Vista and later. Since Vista (and older) are not supported Windows platforms, the calls no longer need to be checked if they are supported and can be called directly. > > Reference to docs: https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getlocaleinfoex. > >> Minimum supported client: Windows Vista >> Minimum supported server: Windows Server 2008 Justin Lu 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 'master' into JDK-8370420-Windows - Merge branch 'master' into JDK-8370420-Windows - Remove dynamic loading and call directly - Merge branch 'master' into JDK-8370420-Windows - init ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28119/files - new: https://git.openjdk.org/jdk/pull/28119/files/e18a5744..e6d45424 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28119&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28119&range=01-02 Stats: 12203 lines in 397 files changed: 7768 ins; 3189 del; 1246 mod Patch: https://git.openjdk.org/jdk/pull/28119.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28119/head:pull/28119 PR: https://git.openjdk.org/jdk/pull/28119 From liach at openjdk.org Wed Nov 5 23:34:14 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 5 Nov 2025 23:34:14 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v20] In-Reply-To: References: Message-ID: On Fri, 24 Oct 2025 09:01:10 GMT, Per Minborg wrote: >> Implement JEP 526: Lazy Constants (Second Preview) >> >> The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. >> >> The old benchmarks are not moved/renamed to allow comparison with previous releases. >> >> `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. > > Per Minborg has updated the pull request incrementally with one additional commit since the last revision: > > Rework toString implementations src/java.base/share/classes/java/lang/LazyConstant.java line 94: > 92: * lazy constant remains uninitialized. > 93: * > 94: *

Composing lazy constants

This section has some interesting usage, but I don't believe it should be included in the API specification. Behaviors described here can be derived from the formal specifications. src/java.base/share/classes/java/lang/LazyConstant.java line 209: > 207: > 208: /** > 209: * {@return the contents of this lazy constant if initialized, otherwise,\ Suggestion: * {@return the contents of this lazy constant if initialized, otherwise, src/java.base/share/classes/java/util/AbstractMap.java line 34: > 32: > 33: import jdk.internal.vm.annotation.AOTSafeClassInitializer; > 34: import jdk.internal.vm.annotation.Stable; Suggestion: src/java.base/share/classes/java/util/Currency.java line 146: > 144: private static ConcurrentMap instances = new ConcurrentHashMap<>(7); > 145: private static final LazyConstant> available = > 146: LazyConstant.of(new Supplier>() { Why can't we retain the method reference here? This is not used in early bootstrap. src/java.base/share/classes/java/util/LazyCollections.java line 516: > 514: > 515: @ForceInline > 516: private void disposeOfMutex(long offset) { I recommend removing this unused and otherwise confusing method. src/java.base/share/classes/java/util/LazyCollections.java line 559: > 557: } > 558: > 559: public static int lastIndexOf(List> list, Object o) { This indexOf and lastIndexOf appear unused. src/java.base/share/classes/java/util/Map.java line 1814: > 1812: final Set keyCopies = Set.copyOf(keys); > 1813: Objects.requireNonNull(computingFunction); > 1814: if (keys instanceof EnumSet && !keys.isEmpty()) { I wonder if it's premature for us to optimize like this - for example, this would be wasteful if the key set contains one enum constant but there are 1000 enum constants in this enum. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2496459406 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2496468213 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2496478562 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2496479687 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2496503928 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2496514844 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2496516750 From darcy at openjdk.org Thu Nov 6 05:02:15 2025 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 6 Nov 2025 05:02:15 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v20] In-Reply-To: References: Message-ID: On Fri, 24 Oct 2025 09:01:10 GMT, Per Minborg wrote: >> Implement JEP 526: Lazy Constants (Second Preview) >> >> The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. >> >> The old benchmarks are not moved/renamed to allow comparison with previous releases. >> >> `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. > > Per Minborg has updated the pull request incrementally with one additional commit since the last revision: > > Rework toString implementations src/java.base/share/classes/java/lang/LazyConstant.java line 184: > 182: * Use in static initializers may interact with class initialization order; > 183: * cyclic initialization may result in initialization errors as described > 184: * in {@jls 12.4} of The Java Language Specification. Please use some text like "section" or "§" in from of the `@jls` tag. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2497396558 From mbaesken at openjdk.org Thu Nov 6 08:15:04 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Thu, 6 Nov 2025 08:15:04 GMT Subject: RFR: 8370420: HostLocaleProviderAdapter_md.c from libjava can use GetLocaleInfoEx, GetCalendarInfoEx, EnumCalendarInfoExEx directly [v3] In-Reply-To: References: Message-ID: On Wed, 5 Nov 2025 22:19:36 GMT, Justin Lu wrote: >> This PR cleans up some native code for Windows i18n functions. These particular calls are designed to run on Windows Vista and later. Since Vista (and older) are not supported Windows platforms, the calls no longer need to be checked if they are supported and can be called directly. >> >> Reference to docs: https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getlocaleinfoex. >> >>> Minimum supported client: Windows Vista >>> Minimum supported server: Windows Server 2008 > > Justin Lu 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 'master' into JDK-8370420-Windows > - Merge branch 'master' into JDK-8370420-Windows > - Remove dynamic loading and call directly > - Merge branch 'master' into JDK-8370420-Windows > - init Marked as reviewed by mbaesken (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28119#pullrequestreview-3426812666 From jlu at openjdk.org Thu Nov 6 17:12:34 2025 From: jlu at openjdk.org (Justin Lu) Date: Thu, 6 Nov 2025 17:12:34 GMT Subject: RFR: 8370420: HostLocaleProviderAdapter_md.c from libjava can use GetLocaleInfoEx, GetCalendarInfoEx, EnumCalendarInfoExEx directly [v3] In-Reply-To: References: Message-ID: <6fZEpffL-VLzAHZ1pstX_i-KlEjYev4CPGyYv2cJMDk=.83c45c0e-9051-47e6-920a-a23748313de7@github.com> On Wed, 5 Nov 2025 22:19:36 GMT, Justin Lu wrote: >> This PR cleans up some native code for Windows i18n functions. These particular calls are designed to run on Windows Vista and later. Since Vista (and older) are not supported Windows platforms, the calls no longer need to be checked if they are supported and can be called directly. >> >> Reference to docs: https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getlocaleinfoex. >> >>> Minimum supported client: Windows Vista >>> Minimum supported server: Windows Server 2008 > > Justin Lu 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 'master' into JDK-8370420-Windows > - Merge branch 'master' into JDK-8370420-Windows > - Remove dynamic loading and call directly > - Merge branch 'master' into JDK-8370420-Windows > - init Thank you all for the reviews and suggestions. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28119#issuecomment-3498417066 From jlu at openjdk.org Thu Nov 6 17:15:45 2025 From: jlu at openjdk.org (Justin Lu) Date: Thu, 6 Nov 2025 17:15:45 GMT Subject: Integrated: 8370420: HostLocaleProviderAdapter_md.c from libjava can use GetLocaleInfoEx, GetCalendarInfoEx, EnumCalendarInfoExEx directly In-Reply-To: References: Message-ID: <8yUS7ZLAkcQ23T1qnXzqdWyeE0Nm3k3yG1_X2vTPkZ4=.cb20a15d-961b-4a3c-bc63-11e4de66d943@github.com> On Mon, 3 Nov 2025 23:48:22 GMT, Justin Lu wrote: > This PR cleans up some native code for Windows i18n functions. These particular calls are designed to run on Windows Vista and later. Since Vista (and older) are not supported Windows platforms, the calls no longer need to be checked if they are supported and can be called directly. > > Reference to docs: https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getlocaleinfoex. > >> Minimum supported client: Windows Vista >> Minimum supported server: Windows Server 2008 This pull request has now been integrated. Changeset: 0026967e Author: Justin Lu URL: https://git.openjdk.org/jdk/commit/0026967e030fd4557b5365870d55f863fe2a4512 Stats: 90 lines in 2 files changed: 6 ins; 63 del; 21 mod 8370420: HostLocaleProviderAdapter_md.c from libjava can use GetLocaleInfoEx, GetCalendarInfoEx, EnumCalendarInfoExEx directly Reviewed-by: naoto, mbaesken, bpb ------------- PR: https://git.openjdk.org/jdk/pull/28119 From naoto at openjdk.org Thu Nov 6 19:43:15 2025 From: naoto at openjdk.org (Naoto Sato) Date: Thu, 6 Nov 2025 19:43:15 GMT Subject: RFR: 8371339: Illegal pattern char 'B' with locale.providers as HOST on macOS for Taiwanese Message-ID: <30ThkifrSqifpcv8THhqYLuq535cHggNmDFIGim8F0k=.e5ea6c2c-1704-4fb7-8296-9c5756cd4b6c@github.com> This is a leftover when we introduced "dayperiods" in the JDK ([JDK-8247781](https://bugs.openjdk.org/browse/JDK-8247781)). The CLDR Converter was modified to generate patterns for SimpleDateFormat for dayperiods (simply replacing them with ampm), and the same processing should have been applied to Host provider on mac, which also uses LDML patterns. As in the bug report, macos recently started using dayperiods, thus the issue was revealed. Regression test is not provided as it would require the macos's default locale should be configured to zh_TW. I have manually confirmed that the proposed fix would work for the problem case. ------------- Commit messages: - initial commit Changes: https://git.openjdk.org/jdk/pull/28181/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28181&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8371339 Stats: 12 lines in 1 file changed: 11 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28181.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28181/head:pull/28181 PR: https://git.openjdk.org/jdk/pull/28181 From joehw at openjdk.org Fri Nov 7 18:32:06 2025 From: joehw at openjdk.org (Joe Wang) Date: Fri, 7 Nov 2025 18:32:06 GMT Subject: RFR: 8354548: Update CLDR to Version 48.0 [v8] In-Reply-To: References: Message-ID: On Wed, 5 Nov 2025 17:09:48 GMT, Naoto Sato wrote: >> Upgrading the CLDR to version 48.0. A corresponding CSR has also been drafted. > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > More test data Marked as reviewed by joehw (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28076#pullrequestreview-3435649380 From naoto at openjdk.org Fri Nov 7 19:36:24 2025 From: naoto at openjdk.org (Naoto Sato) Date: Fri, 7 Nov 2025 19:36:24 GMT Subject: RFR: 8354548: Update CLDR to Version 48.0 [v8] In-Reply-To: References: Message-ID: On Wed, 5 Nov 2025 17:09:48 GMT, Naoto Sato wrote: >> Upgrading the CLDR to version 48.0. A corresponding CSR has also been drafted. > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > More test data Thanks for the reviews! ------------- PR Comment: https://git.openjdk.org/jdk/pull/28076#issuecomment-3504507613 From naoto at openjdk.org Fri Nov 7 19:36:26 2025 From: naoto at openjdk.org (Naoto Sato) Date: Fri, 7 Nov 2025 19:36:26 GMT Subject: Integrated: 8354548: Update CLDR to Version 48.0 In-Reply-To: References: Message-ID: On Thu, 30 Oct 2025 22:37:34 GMT, Naoto Sato wrote: > Upgrading the CLDR to version 48.0. A corresponding CSR has also been drafted. This pull request has now been integrated. Changeset: 2c3c4707 Author: Naoto Sato URL: https://git.openjdk.org/jdk/commit/2c3c4707c0ac7f4432ada9621f4b2e5fe4aef51f Stats: 135950 lines in 390 files changed: 94406 ins; 15578 del; 25966 mod 8354548: Update CLDR to Version 48.0 Reviewed-by: joehw, jlu ------------- PR: https://git.openjdk.org/jdk/pull/28076 From rriggs at openjdk.org Fri Nov 7 20:35:05 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Fri, 7 Nov 2025 20:35:05 GMT Subject: RFR: 8365675: Add String Unicode Case-Folding Support [v7] In-Reply-To: References: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> Message-ID: On Thu, 30 Oct 2025 02:59:45 GMT, Xueming Shen wrote: >> ### Summary >> >> Case folding is a key operation for case-insensitive matching (e.g., string equality, regex matching), where the goal is to eliminate case distinctions without applying locale or language specific conversions. >> >> Currently, the JDK does not expose a direct API for Unicode-compliant case folding. Developers now rely on methods such as: >> >> **String.equalsIgnoreCase(String)** >> >> - Unicode-aware, locale-independent. >> - Implementation uses Character.toLowerCase(Character.toUpperCase(int)) per code point. >> - Limited: does not support 1:M mapping defined in Unicode case folding. >> >> **Character.toLowerCase(int) / Character.toUpperCase(int)** >> >> - Locale-independent, single code point only. >> - No support for 1:M mappings. >> >> **String.toLowerCase(Locale.ROOT) / String.toUpperCase(Locale.ROOT)** >> >> - Based on Unicode SpecialCasing.txt, supports 1:M mappings. >> - Intended primarily for presentation/display, not structural case-insensitive matching. >> - Requires full string conversion before comparison, which is less efficient and not intended for structural matching. >> >> **1:M mapping example, U+00DF (?)** >> >> - String.toUpperCase(Locale.ROOT, "?") ? "SS" >> - Case folding produces "ss", matching Unicode caseless comparison rules. >> >> >> jshell> "\u00df".equalsIgnoreCase("ss") >> $22 ==> false >> >> jshell> "\u00df".toUpperCase(Locale.ROOT).toLowerCase(Locale.ROOT).equals("ss") >> $24 ==> true >> >> >> ### Motivation & Direction >> >> Add Unicode standard-compliant case-less comparison methods to the String class, enabling & improving reliable and efficient Unicode-aware/compliant case-insensitive matching. >> >> - Unicode-compliant **full** case folding. >> - Simpler, stable and more efficient case-less matching without workarounds. >> - Brings Java's string comparison handling in line with other programming languages/libraries. >> >> This PR proposes to introduce the following comparison methods in `String` class >> >> - boolean equalsFoldCase(String anotherString) >> - int compareToFoldCase(String anotherString) >> - Comparator UNICODE_CASEFOLD_ORDER >> >> These methods are intended to be the preferred choice when Unicode-compliant case-less matching is required. >> >> *Note: An early draft also proposed a String.toCaseFold() method returning a new case-folded string. >> However, during review this was considered error-prone, as the resulting string could easily be mistaken for a general transformation like toLowerCase() and then pass... > > Xueming Shen has updated the pull request incrementally with one additional commit since the last revision: > > update to use value long for folding src/java.base/share/classes/java/lang/StringLatin1.java line 278: > 276: return 1; > 277: } > 278: if (k2 < olast || f1 != 0) { Should `f1` here be `f2`, partial codePoint remaining in 2nd string? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2505385527 From rriggs at openjdk.org Fri Nov 7 20:35:05 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Fri, 7 Nov 2025 20:35:05 GMT Subject: RFR: 8365675: Add String Unicode Case-Folding Support [v7] In-Reply-To: References: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> Message-ID: On Fri, 7 Nov 2025 20:30:53 GMT, Roger Riggs wrote: >> Xueming Shen has updated the pull request incrementally with one additional commit since the last revision: >> >> update to use value long for folding > > src/java.base/share/classes/java/lang/StringLatin1.java line 278: > >> 276: return 1; >> 277: } >> 278: if (k2 < olast || f1 != 0) { > > Should `f1` here be `f2`, partial codePoint remaining in 2nd string? A new test case maybe useful. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2505389674 From jlu at openjdk.org Fri Nov 7 21:19:00 2025 From: jlu at openjdk.org (Justin Lu) Date: Fri, 7 Nov 2025 21:19:00 GMT Subject: RFR: 8371339: Illegal pattern char 'B' with locale.providers as HOST on macOS for Taiwanese In-Reply-To: <30ThkifrSqifpcv8THhqYLuq535cHggNmDFIGim8F0k=.e5ea6c2c-1704-4fb7-8296-9c5756cd4b6c@github.com> References: <30ThkifrSqifpcv8THhqYLuq535cHggNmDFIGim8F0k=.e5ea6c2c-1704-4fb7-8296-9c5756cd4b6c@github.com> Message-ID: <0EbAV9233uo0bDUJaJPkCGuVQMxoA-EutwMEHMC1BqU=.1a32b36e-8bba-4939-80dd-d692c76be59f@github.com> On Thu, 6 Nov 2025 19:35:06 GMT, Naoto Sato wrote: > This is a leftover when we introduced "dayperiods" in the JDK ([JDK-8247781](https://bugs.openjdk.org/browse/JDK-8247781)). The CLDR Converter was modified to generate patterns for SimpleDateFormat for dayperiods (simply replacing them with ampm), and the same processing should have been applied to Host provider on mac, which also uses LDML patterns. As in the bug report, macos recently started using dayperiods, thus the issue was revealed. Regression test is not provided as it would require the macos's default locale should be configured to zh_TW. I have manually confirmed that the proposed fix would work for the problem case. Case handling for day period looks the same as in _cldrconverter/Bundle.java_ ------------- Marked as reviewed by jlu (Committer). PR Review: https://git.openjdk.org/jdk/pull/28181#pullrequestreview-3436454712 From rriggs at openjdk.org Fri Nov 7 22:36:11 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Fri, 7 Nov 2025 22:36:11 GMT Subject: RFR: 8365675: Add String Unicode Case-Folding Support [v7] In-Reply-To: References: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> Message-ID: On Thu, 30 Oct 2025 02:59:45 GMT, Xueming Shen wrote: >> ### Summary >> >> Case folding is a key operation for case-insensitive matching (e.g., string equality, regex matching), where the goal is to eliminate case distinctions without applying locale or language specific conversions. >> >> Currently, the JDK does not expose a direct API for Unicode-compliant case folding. Developers now rely on methods such as: >> >> **String.equalsIgnoreCase(String)** >> >> - Unicode-aware, locale-independent. >> - Implementation uses Character.toLowerCase(Character.toUpperCase(int)) per code point. >> - Limited: does not support 1:M mapping defined in Unicode case folding. >> >> **Character.toLowerCase(int) / Character.toUpperCase(int)** >> >> - Locale-independent, single code point only. >> - No support for 1:M mappings. >> >> **String.toLowerCase(Locale.ROOT) / String.toUpperCase(Locale.ROOT)** >> >> - Based on Unicode SpecialCasing.txt, supports 1:M mappings. >> - Intended primarily for presentation/display, not structural case-insensitive matching. >> - Requires full string conversion before comparison, which is less efficient and not intended for structural matching. >> >> **1:M mapping example, U+00DF (?)** >> >> - String.toUpperCase(Locale.ROOT, "?") ? "SS" >> - Case folding produces "ss", matching Unicode caseless comparison rules. >> >> >> jshell> "\u00df".equalsIgnoreCase("ss") >> $22 ==> false >> >> jshell> "\u00df".toUpperCase(Locale.ROOT).toLowerCase(Locale.ROOT).equals("ss") >> $24 ==> true >> >> >> ### Motivation & Direction >> >> Add Unicode standard-compliant case-less comparison methods to the String class, enabling & improving reliable and efficient Unicode-aware/compliant case-insensitive matching. >> >> - Unicode-compliant **full** case folding. >> - Simpler, stable and more efficient case-less matching without workarounds. >> - Brings Java's string comparison handling in line with other programming languages/libraries. >> >> This PR proposes to introduce the following comparison methods in `String` class >> >> - boolean equalsFoldCase(String anotherString) >> - int compareToFoldCase(String anotherString) >> - Comparator UNICODE_CASEFOLD_ORDER >> >> These methods are intended to be the preferred choice when Unicode-compliant case-less matching is required. >> >> *Note: An early draft also proposed a String.toCaseFold() method returning a new case-folded string. >> However, during review this was considered error-prone, as the resulting string could easily be mistaken for a general transformation like toLowerCase() and then pass... > > Xueming Shen has updated the pull request incrementally with one additional commit since the last revision: > > update to use value long for folding Looking good. I'll look at the javadoc again when the CSR comments are addressed. src/java.base/share/classes/jdk/internal/lang/CaseFolding.java.template line 53: > 51: public static boolean isDefined(int cp) { > 52: return getDefined(cp) != -1; > 53: } Extra space. src/java.base/share/classes/jdk/internal/lang/CaseFolding.java.template line 107: > 105: * family may appears independently or within a class. > 106: *

> 107: * For loose/case-insensitive matching, the back-refs, slices and singles apply {code toUpperCase} and Missing at-sign in markup: Suggestion: * For loose/case-insensitive matching, the back-refs, slices and singles apply {@code toUpperCase} and src/java.base/share/classes/jdk/internal/lang/CaseFolding.java.template line 136: > 134: * > 135: *

> 136: * @spec https://www.unicode.org/reports/tr18/#Simple_Loose_Matches I'd put @spec after @return. src/java.base/share/classes/jdk/internal/lang/CaseFolding.java.template line 152: > 150: } > 151: } > 152: } If expanded_case_cps was sorted, Array.binarySearch could be used to find the index of the first character in the range. And the loop could break when cp reaches the end of the range. src/java.base/share/classes/jdk/internal/lang/CaseFolding.java.template line 163: > 161: .stream() > 162: .mapToInt(Integer::intValue) > 163: .toArray(); It might be worthwhile to sort these to enable skipping a quicker break when the last one in the range is seen. src/java.base/share/classes/jdk/internal/lang/CaseFolding.java.template line 169: > 167: private static final int HASH_NEXT = 2; > 168: > 169: private static int[][] hashKeys(int[] keys) { It may be worthwhile to round up the hash modulo to a prime number to avoid unfortunate hash collisions. test/jdk/java/lang/String/UnicodeCaseFoldingTest.java line 31: > 29: * @compile --add-exports java.base/jdk.internal.lang=ALL-UNNAMED > 30: * UnicodeCaseFoldingTest.java > 31: * @run junit/othervm --add-exports java.base/jdk.internal.lang=ALL-UNNAMED The @module directive can replace the explicit --add-exports and the explicit @compile may be unnecessary. * @modules java.base/jdk.internal.lang:+open ------------- PR Review: https://git.openjdk.org/jdk/pull/27628#pullrequestreview-3436511645 PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2505610221 PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2505623056 PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2505629880 PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2505705459 PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2505699712 PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2505714395 PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2505728277 From liach at openjdk.org Sat Nov 8 13:56:05 2025 From: liach at openjdk.org (Chen Liang) Date: Sat, 8 Nov 2025 13:56:05 GMT Subject: RFR: 8364007: Add no-argument codePointCount method to CharSequence and String [v3] In-Reply-To: References: Message-ID: <3JOprtfyEvBcaGwc36e-4qD7pXLFJ_bWYce2CHerALQ=.95148986-fa08-4ec7-93d9-0014d075abb0@github.com> On Sun, 2 Nov 2025 09:50:21 GMT, Tatsunori Uchino wrote: >> Tatsunori Uchino has updated the pull request incrementally with four additional commits since the last revision: >> >> - Update `@bug` in correct file >> - Add default implementation on codePointCount in CharSequence >> - Update `@bug` entries in test class doc comments >> - Discard changes on code whose form is not `str.codePointCount(0, str.length())` > > The CSR text is not modified from the boilerplate, but I have no authority to modify it. Hi @tats-u, if you can provide the text for the CSR, I can help upload your text to the JBS. Unfortunately you need a JBS account in order to update the CSR. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26461#issuecomment-3506558280 From pminborg at openjdk.org Mon Nov 10 11:11:05 2025 From: pminborg at openjdk.org (Per Minborg) Date: Mon, 10 Nov 2025 11:11:05 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v21] In-Reply-To: References: Message-ID: > Implement JEP 526: Lazy Constants (Second Preview) > > The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. > > The old benchmarks are not moved/renamed to allow comparison with previous releases. > > `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 107 commits: - Merge master - Rework toString implementations - Update after doc comments - Merge branch 'master' into lazy-constants - Revert the AbstractMap.keySet @Stable annotation - Update docs after comments - Improve method docs - Improve equals/hashCode document - Update wording on List/Map Object methods - Update javadocs - ... and 97 more: https://git.openjdk.org/jdk/compare/681dab72...f775aaf1 ------------- Changes: https://git.openjdk.org/jdk/pull/27605/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27605&range=20 Stats: 8482 lines in 60 files changed: 3875 ins; 4490 del; 117 mod Patch: https://git.openjdk.org/jdk/pull/27605.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27605/head:pull/27605 PR: https://git.openjdk.org/jdk/pull/27605 From pminborg at openjdk.org Mon Nov 10 11:17:43 2025 From: pminborg at openjdk.org (Per Minborg) Date: Mon, 10 Nov 2025 11:17:43 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v22] In-Reply-To: References: Message-ID: > Implement JEP 526: Lazy Constants (Second Preview) > > The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. > > The old benchmarks are not moved/renamed to allow comparison with previous releases. > > `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. Per Minborg has updated the pull request incrementally with one additional commit since the last revision: Fix merge mistake ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27605/files - new: https://git.openjdk.org/jdk/pull/27605/files/f775aaf1..003eaf1c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27605&range=21 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27605&range=20-21 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/27605.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27605/head:pull/27605 PR: https://git.openjdk.org/jdk/pull/27605 From pminborg at openjdk.org Mon Nov 10 12:36:12 2025 From: pminborg at openjdk.org (Per Minborg) Date: Mon, 10 Nov 2025 12:36:12 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v20] In-Reply-To: References: Message-ID: On Wed, 5 Nov 2025 23:31:38 GMT, Chen Liang wrote: >> Per Minborg has updated the pull request incrementally with one additional commit since the last revision: >> >> Rework toString implementations > > src/java.base/share/classes/java/util/Map.java line 1814: > >> 1812: final Set keyCopies = Set.copyOf(keys); >> 1813: Objects.requireNonNull(computingFunction); >> 1814: if (keys instanceof EnumSet && !keys.isEmpty()) { > > I wonder if it's premature for us to optimize like this - for example, this would be wasteful if the key set contains one enum constant but there are 1000 enum constants in this enum. There is a `min` and a `max` ordinal calculated, so in your example above, only one array item is used. I.e., if there are 1,000 enum constant and we are using enum with ordinal 42, then min = max = 42 and only a one-element array is ever allocated. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2510377932 From pminborg at openjdk.org Mon Nov 10 13:00:35 2025 From: pminborg at openjdk.org (Per Minborg) Date: Mon, 10 Nov 2025 13:00:35 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v23] In-Reply-To: References: Message-ID: > Implement JEP 526: Lazy Constants (Second Preview) > > The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. > > The old benchmarks are not moved/renamed to allow comparison with previous releases. > > `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. Per Minborg has updated the pull request incrementally with one additional commit since the last revision: Address comments in PR ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27605/files - new: https://git.openjdk.org/jdk/pull/27605/files/003eaf1c..03616ef6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27605&range=22 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27605&range=21-22 Stats: 119 lines in 6 files changed: 17 ins; 72 del; 30 mod Patch: https://git.openjdk.org/jdk/pull/27605.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27605/head:pull/27605 PR: https://git.openjdk.org/jdk/pull/27605 From d.yamazaki at peya.tokyo Mon Nov 10 12:25:55 2025 From: d.yamazaki at peya.tokyo (Daisuke Yamazaki) Date: Mon, 10 Nov 2025 21:25:55 +0900 Subject: Proposal: 8338093: Localization of yes/no options in console input Message-ID: <19a6dbae0ad.7e56af0a221616.1073185985223008803@peya.tokyo> Hello, Currently, keytool accepts input only in English, even though the options labels are localised. This raises the question: Should the options also be localised in accordance with user's language? We basically have two choices: 1. Localise the options and accept input in the corresponding language 2. Keep the options uniform in English and accept only English input Some languages require input via an IME. For example: - In japanese, "???" must be typed as "iie". - In chinese, "?" must be typed as "fou" and then selected from candidates. Performing this kind of input can be cumbersome in a console environment, so I personally prefer the second approach: keeping options in English. Currently, some options are incorrectly localized (i.e., the program does not accept input in these languages): German, French, Japanese, Korean, Portuguese (pt_BR), Swedish, Chinese (CN/TW). I am planning to create a patch to unify this behavior and would like to discuss which approach would be preferable. Thank you, D.Yamazaki From alan.bateman at oracle.com Mon Nov 10 13:22:36 2025 From: alan.bateman at oracle.com (Alan Bateman) Date: Mon, 10 Nov 2025 13:22:36 +0000 Subject: Proposal: 8338093: Localization of yes/no options in console input In-Reply-To: <19a6dbae0ad.7e56af0a221616.1073185985223008803@peya.tokyo> References: <19a6dbae0ad.7e56af0a221616.1073185985223008803@peya.tokyo> Message-ID: <12b66ef8-0802-41ae-8d34-84a414e51e43@oracle.com> Adding security-dev to the discussion as keytool is maintained there. On 10/11/2025 12:25, Daisuke Yamazaki wrote: > Hello, > > Currently, keytool accepts input only in English, even though the options > labels are localised. > This raises the question: Should the options also be localised in accordance > with user's language? > > We basically have two choices: > 1. Localise the options and accept input in the corresponding language > 2. Keep the options uniform in English and accept only English input > > Some languages require input via an IME. For example: > - In japanese, "???" must be typed as "iie". > - In chinese, "?" must be typed as "fou" and then selected from candidates. > > Performing this kind of input can be cumbersome in a console environment, > so I personally prefer the second approach: keeping options in English. > > Currently, some options are incorrectly localized (i.e., the program does not > accept input in these languages): German, French, Japanese, Korean, > Portuguese (pt_BR), Swedish, Chinese (CN/TW). > > I am planning to create a patch to unify this behavior and would like to > discuss which approach would be preferable. > > Thank you, > D.Yamazaki From pminborg at openjdk.org Mon Nov 10 14:59:03 2025 From: pminborg at openjdk.org (Per Minborg) Date: Mon, 10 Nov 2025 14:59:03 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v24] In-Reply-To: References: Message-ID: > Implement JEP 526: Lazy Constants (Second Preview) > > The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. > > The old benchmarks are not moved/renamed to allow comparison with previous releases. > > `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. Per Minborg has updated the pull request incrementally with one additional commit since the last revision: Add @AOTSafeClassInitializer ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27605/files - new: https://git.openjdk.org/jdk/pull/27605/files/03616ef6..e479cb4b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27605&range=23 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27605&range=22-23 Stats: 5 lines in 2 files changed: 5 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27605.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27605/head:pull/27605 PR: https://git.openjdk.org/jdk/pull/27605 From weijun.wang at oracle.com Mon Nov 10 18:53:31 2025 From: weijun.wang at oracle.com (Wei-Jun Wang) Date: Mon, 10 Nov 2025 18:53:31 +0000 Subject: Proposal: 8338093: Localization of yes/no options in console input In-Reply-To: <12b66ef8-0802-41ae-8d34-84a414e51e43@oracle.com> References: <19a6dbae0ad.7e56af0a221616.1073185985223008803@peya.tokyo> <12b66ef8-0802-41ae-8d34-84a414e51e43@oracle.com> Message-ID: <823F82ED-F242-48AC-9145-83747AE5BAC0@oracle.com> The current code accepts y/n/yes/no (case insensitive) and it's quite good. I think modifying the prompts to be clearer is good. I'm adding Justin and Naoto here. The current prompts mostly look like Do you still want to add it? [no] How do you suggest we rewrite it to be more clear on expected inputs? And how to avoid translators translating them to localized words like "???" or "?"? Thanks, Weijun > On Nov 10, 2025, at 08:22, Alan Bateman wrote: > > > Adding security-dev to the discussion as keytool is maintained there. > > On 10/11/2025 12:25, Daisuke Yamazaki wrote: >> Hello, >> >> Currently, keytool accepts input only in English, even though the options >> labels are localised. >> This raises the question: Should the options also be localised in accordance >> with user's language? >> >> We basically have two choices: >> 1. Localise the options and accept input in the corresponding language >> 2. Keep the options uniform in English and accept only English input >> >> Some languages require input via an IME. For example: >> - In japanese, "???" must be typed as "iie". >> - In chinese, "?" must be typed as "fou" and then selected from candidates. >> >> Performing this kind of input can be cumbersome in a console environment, >> so I personally prefer the second approach: keeping options in English. >> >> Currently, some options are incorrectly localized (i.e., the program does not >> accept input in these languages): German, French, Japanese, Korean, >> Portuguese (pt_BR), Swedish, Chinese (CN/TW). >> >> I am planning to create a patch to unify this behavior and would like to >> discuss which approach would be preferable. >> >> Thank you, >> D.Yamazaki > From naoto.sato at oracle.com Mon Nov 10 19:05:28 2025 From: naoto.sato at oracle.com (Naoto Sato) Date: Mon, 10 Nov 2025 11:05:28 -0800 Subject: Proposal: 8338093: Localization of yes/no options in console input In-Reply-To: <823F82ED-F242-48AC-9145-83747AE5BAC0@oracle.com> References: <19a6dbae0ad.7e56af0a221616.1073185985223008803@peya.tokyo> <12b66ef8-0802-41ae-8d34-84a414e51e43@oracle.com> <823F82ED-F242-48AC-9145-83747AE5BAC0@oracle.com> Message-ID: <6e8a4971-f702-44e7-8621-566d1273382a@oracle.com> I think the common prompt format is [Y/n] or [y/N], where capitalization indicates the default. That should also have translators not translate it. (Commenting on it would be safer too) Naoto On 11/10/25 10:53 AM, Wei-Jun Wang wrote: > The current code accepts y/n/yes/no (case insensitive) and it's quite good. I think modifying the prompts to be clearer is good. > > I'm adding Justin and Naoto here. The current prompts mostly look like > > Do you still want to add it? [no] > > How do you suggest we rewrite it to be more clear on expected inputs? And how to avoid translators translating them to localized words like "???" or "?"? > > Thanks, > Weijun > >> On Nov 10, 2025, at 08:22, Alan Bateman wrote: >> >> >> Adding security-dev to the discussion as keytool is maintained there. >> >> On 10/11/2025 12:25, Daisuke Yamazaki wrote: >>> Hello, >>> >>> Currently, keytool accepts input only in English, even though the options >>> labels are localised. >>> This raises the question: Should the options also be localised in accordance >>> with user's language? >>> >>> We basically have two choices: >>> 1. Localise the options and accept input in the corresponding language >>> 2. Keep the options uniform in English and accept only English input >>> >>> Some languages require input via an IME. For example: >>> - In japanese, "???" must be typed as "iie". >>> - In chinese, "?" must be typed as "fou" and then selected from candidates. >>> >>> Performing this kind of input can be cumbersome in a console environment, >>> so I personally prefer the second approach: keeping options in English. >>> >>> Currently, some options are incorrectly localized (i.e., the program does not >>> accept input in these languages): German, French, Japanese, Korean, >>> Portuguese (pt_BR), Swedish, Chinese (CN/TW). >>> >>> I am planning to create a patch to unify this behavior and would like to >>> discuss which approach would be preferable. >>> >>> Thank you, >>> D.Yamazaki >> > From weijun.wang at oracle.com Mon Nov 10 19:35:45 2025 From: weijun.wang at oracle.com (Wei-Jun Wang) Date: Mon, 10 Nov 2025 19:35:45 +0000 Subject: Proposal: 8338093: Localization of yes/no options in console input In-Reply-To: <6e8a4971-f702-44e7-8621-566d1273382a@oracle.com> References: <19a6dbae0ad.7e56af0a221616.1073185985223008803@peya.tokyo> <12b66ef8-0802-41ae-8d34-84a414e51e43@oracle.com> <823F82ED-F242-48AC-9145-83747AE5BAC0@oracle.com> <6e8a4971-f702-44e7-8621-566d1273382a@oracle.com> Message-ID: Hello, D.Yamazaki, Welcome to contributing to JDK. For your patch, please only update the English properties file, I think there is a policy that translations should always be handled by dedicated teams. I assume you are already familiar with the key sections of the OpenJDK Developers' Guide [1] and the OCA [2]. Thanks, Weijun [1] https://openjdk.org/guide/ [2] https://oca.opensource.oracle.com/?ojr=faq > On Nov 10, 2025, at 14:05, Naoto Sato wrote: > > I think the common prompt format is [Y/n] or [y/N], where capitalization indicates the default. That should also have translators not translate it. (Commenting on it would be safer too) > > Naoto > > On 11/10/25 10:53 AM, Wei-Jun Wang wrote: >> The current code accepts y/n/yes/no (case insensitive) and it's quite good. I think modifying the prompts to be clearer is good. >> I'm adding Justin and Naoto here. The current prompts mostly look like >> Do you still want to add it? [no] >> How do you suggest we rewrite it to be more clear on expected inputs? And how to avoid translators translating them to localized words like "???" or "?"? >> Thanks, >> Weijun >>> On Nov 10, 2025, at 08:22, Alan Bateman wrote: >>> >>> >>> Adding security-dev to the discussion as keytool is maintained there. >>> >>> On 10/11/2025 12:25, Daisuke Yamazaki wrote: >>>> Hello, >>>> >>>> Currently, keytool accepts input only in English, even though the options >>>> labels are localised. >>>> This raises the question: Should the options also be localised in accordance >>>> with user's language? >>>> >>>> We basically have two choices: >>>> 1. Localise the options and accept input in the corresponding language >>>> 2. Keep the options uniform in English and accept only English input >>>> >>>> Some languages require input via an IME. For example: >>>> - In japanese, "???" must be typed as "iie". >>>> - In chinese, "?" must be typed as "fou" and then selected from candidates. >>>> >>>> Performing this kind of input can be cumbersome in a console environment, >>>> so I personally prefer the second approach: keeping options in English. >>>> >>>> Currently, some options are incorrectly localized (i.e., the program does not >>>> accept input in these languages): German, French, Japanese, Korean, >>>> Portuguese (pt_BR), Swedish, Chinese (CN/TW). >>>> >>>> I am planning to create a patch to unify this behavior and would like to >>>> discuss which approach would be preferable. >>>> >>>> Thank you, >>>> D.Yamazaki >>> > From justin.lu at oracle.com Mon Nov 10 22:29:08 2025 From: justin.lu at oracle.com (Justin Lu) Date: Mon, 10 Nov 2025 22:29:08 +0000 Subject: Proposal: 8338093: Localization of yes/no options in console input In-Reply-To: References: <19a6dbae0ad.7e56af0a221616.1073185985223008803@peya.tokyo> <12b66ef8-0802-41ae-8d34-84a414e51e43@oracle.com> <823F82ED-F242-48AC-9145-83747AE5BAC0@oracle.com> <6e8a4971-f702-44e7-8621-566d1273382a@oracle.com> Message-ID: Weijun is right that we do not manually update the localized files ourselves. I would suggest leaving a comment in the English properties file on the line above the key/val with the options that should not be translated. For example, "#L10N: do not localize: [no]?. Thanks, Justin > Hello, D.Yamazaki, > Welcome to contributing to JDK. For your patch, please only update the English properties file, I think there is a policy that translations should always be handled by dedicated teams. > I assume you are already familiar with the key sections of the OpenJDK Developers' Guide [1] and the OCA [2]. > Thanks, > Weijun > [1] https://openjdk.org/guide/ > [2] https://oca.opensource.oracle.com/?ojr=faq Confidential- Oracle Internal -------------- next part -------------- An HTML attachment was scrubbed... URL: From pminborg at openjdk.org Tue Nov 11 08:01:08 2025 From: pminborg at openjdk.org (Per Minborg) Date: Tue, 11 Nov 2025 08:01:08 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v24] In-Reply-To: References: Message-ID: On Mon, 10 Nov 2025 14:59:03 GMT, Per Minborg wrote: >> Implement JEP 526: Lazy Constants (Second Preview) >> >> The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. >> >> The old benchmarks are not moved/renamed to allow comparison with previous releases. >> >> `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. > > Per Minborg has updated the pull request incrementally with one additional commit since the last revision: > > Add @AOTSafeClassInitializer As per https://github.com/openjdk/jdk/pull/27605/commits/e479cb4bbe54f3e0caa129cc45aec2ec2bffd9cf, this PR passes tier 1-4 on multiple platforms. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27605#issuecomment-3515424778 From d.yamazaki at peya.tokyo Tue Nov 11 11:17:48 2025 From: d.yamazaki at peya.tokyo (Daisuke Yamazaki) Date: Tue, 11 Nov 2025 20:17:48 +0900 Subject: Proposal: 8338093: Localization of yes/no options in console input In-Reply-To: References: <19a6dbae0ad.7e56af0a221616.1073185985223008803@peya.tokyo> <12b66ef8-0802-41ae-8d34-84a414e51e43@oracle.com> <823F82ED-F242-48AC-9145-83747AE5BAC0@oracle.com> <6e8a4971-f702-44e7-8621-566d1273382a@oracle.com> Message-ID: <19a72a2e116.34c3587b964650.6882619064763357505@peya.tokyo> Thanks Weijun and Justin for the clarification. I will leave the localised files as they are and let the dedicated localisation team handle them. Best regards, D. Yamazaki ---- On Tue, 11 Nov 2025 07:29:08 +0900 Justin Lu wrote --- > Weijun is right that we do not manually update the localized files ourselves. I would suggest leaving a comment in the English properties file on the line above the key/val with the options that should not be translated. For example, "#L10N: do not localize: > [no]?. > > Thanks, > Justin From sherman at openjdk.org Wed Nov 12 01:40:11 2025 From: sherman at openjdk.org (Xueming Shen) Date: Wed, 12 Nov 2025 01:40:11 GMT Subject: RFR: 8365675: Add String Unicode Case-Folding Support [v7] In-Reply-To: References: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> Message-ID: On Fri, 7 Nov 2025 22:11:30 GMT, Roger Riggs wrote: >> Xueming Shen has updated the pull request incrementally with one additional commit since the last revision: >> >> update to use value long for folding > > src/java.base/share/classes/jdk/internal/lang/CaseFolding.java.template line 152: > >> 150: } >> 151: } >> 152: } > > If expanded_case_cps was sorted, Array.binarySearch could be used to find the index of the first character in the range. > And the loop could break when cp reaches the end of the range. This is the existing implementation. I will leave it to the next round when we are back to the regex. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2516389642 From sherman at openjdk.org Wed Nov 12 01:52:04 2025 From: sherman at openjdk.org (Xueming Shen) Date: Wed, 12 Nov 2025 01:52:04 GMT Subject: RFR: 8365675: Add String Unicode Case-Folding Support [v7] In-Reply-To: References: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> Message-ID: On Fri, 7 Nov 2025 22:14:51 GMT, Roger Riggs wrote: >> Xueming Shen has updated the pull request incrementally with one additional commit since the last revision: >> >> update to use value long for folding > > src/java.base/share/classes/jdk/internal/lang/CaseFolding.java.template line 169: > >> 167: private static final int HASH_NEXT = 2; >> 168: >> 169: private static int[][] hashKeys(int[] keys) { > > It may be worthwhile to round up the hash modulo to a prime number to avoid unfortunate hash collisions. I did try several prime numbers. It doesn?t really help because the code points in the table are mostly sequential within one continuous category range; if there?s a hash collision, using a different prime will likely just move the collision to the next code point. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2516418571 From sherman at openjdk.org Wed Nov 12 03:24:42 2025 From: sherman at openjdk.org (Xueming Shen) Date: Wed, 12 Nov 2025 03:24:42 GMT Subject: RFR: 8365675: Add String Unicode Case-Folding Support [v8] In-Reply-To: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> References: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> Message-ID: > ### Summary > > Case folding is a key operation for case-insensitive matching (e.g., string equality, regex matching), where the goal is to eliminate case distinctions without applying locale or language specific conversions. > > Currently, the JDK does not expose a direct API for Unicode-compliant case folding. Developers now rely on methods such as: > > **String.equalsIgnoreCase(String)** > > - Unicode-aware, locale-independent. > - Implementation uses Character.toLowerCase(Character.toUpperCase(int)) per code point. > - Limited: does not support 1:M mapping defined in Unicode case folding. > > **Character.toLowerCase(int) / Character.toUpperCase(int)** > > - Locale-independent, single code point only. > - No support for 1:M mappings. > > **String.toLowerCase(Locale.ROOT) / String.toUpperCase(Locale.ROOT)** > > - Based on Unicode SpecialCasing.txt, supports 1:M mappings. > - Intended primarily for presentation/display, not structural case-insensitive matching. > - Requires full string conversion before comparison, which is less efficient and not intended for structural matching. > > **1:M mapping example, U+00DF (?)** > > - String.toUpperCase(Locale.ROOT, "?") ? "SS" > - Case folding produces "ss", matching Unicode caseless comparison rules. > > > jshell> "\u00df".equalsIgnoreCase("ss") > $22 ==> false > > jshell> "\u00df".toUpperCase(Locale.ROOT).toLowerCase(Locale.ROOT).equals("ss") > $24 ==> true > > > ### Motivation & Direction > > Add Unicode standard-compliant case-less comparison methods to the String class, enabling & improving reliable and efficient Unicode-aware/compliant case-insensitive matching. > > - Unicode-compliant **full** case folding. > - Simpler, stable and more efficient case-less matching without workarounds. > - Brings Java's string comparison handling in line with other programming languages/libraries. > > This PR proposes to introduce the following comparison methods in `String` class > > - boolean equalsFoldCase(String anotherString) > - int compareToFoldCase(String anotherString) > - Comparator UNICODE_CASEFOLD_ORDER > > These methods are intended to be the preferred choice when Unicode-compliant case-less matching is required. > > *Note: An early draft also proposed a String.toCaseFold() method returning a new case-folded string. > However, during review this was considered error-prone, as the resulting string could easily be mistaken for a general transformation like toLowerCase() and then passed into APIs where case-folding semantics are not appropriate. > > ### The New API > > See CSR https://bugs.openjd... Xueming Shen has updated the pull request incrementally with one additional commit since the last revision: update with new test cases ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27628/files - new: https://git.openjdk.org/jdk/pull/27628/files/c21de111..6a01bf7c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27628&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27628&range=06-07 Stats: 8 lines in 3 files changed: 3 ins; 2 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27628.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27628/head:pull/27628 PR: https://git.openjdk.org/jdk/pull/27628 From duke at openjdk.org Wed Nov 12 05:48:00 2025 From: duke at openjdk.org (Pratiksha.Sawant) Date: Wed, 12 Nov 2025 05:48:00 GMT Subject: RFR: 8371339: Illegal pattern char 'B' with locale.providers as HOST on macOS for Taiwanese In-Reply-To: <30ThkifrSqifpcv8THhqYLuq535cHggNmDFIGim8F0k=.e5ea6c2c-1704-4fb7-8296-9c5756cd4b6c@github.com> References: <30ThkifrSqifpcv8THhqYLuq535cHggNmDFIGim8F0k=.e5ea6c2c-1704-4fb7-8296-9c5756cd4b6c@github.com> Message-ID: On Thu, 6 Nov 2025 19:35:06 GMT, Naoto Sato wrote: > This is a leftover when we introduced "dayperiods" in the JDK ([JDK-8247781](https://bugs.openjdk.org/browse/JDK-8247781)). The CLDR Converter was modified to generate patterns for SimpleDateFormat for dayperiods (simply replacing them with ampm), and the same processing should have been applied to Host provider on mac, which also uses LDML patterns. As in the bug report, macos recently started using dayperiods, thus the issue was revealed. Regression test is not provided as it would require the macos's default locale should be configured to zh_TW. I have manually confirmed that the proposed fix would work for the problem case. @RogerRiggs Could you please review this PR. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28181#issuecomment-3520129064 From pminborg at openjdk.org Wed Nov 12 10:07:39 2025 From: pminborg at openjdk.org (Per Minborg) Date: Wed, 12 Nov 2025 10:07:39 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v25] In-Reply-To: References: Message-ID: > Implement JEP 526: Lazy Constants (Second Preview) > > The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. > > The old benchmarks are not moved/renamed to allow comparison with previous releases. > > `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 112 commits: - Clarify toString spec - Merge branch 'master' into lazy-constants - Add @AOTSafeClassInitializer - Address comments in PR - Fix merge mistake - Merge master - Rework toString implementations - Update after doc comments - Merge branch 'master' into lazy-constants - Revert the AbstractMap.keySet @Stable annotation - ... and 102 more: https://git.openjdk.org/jdk/compare/76a1109d...1f439bec ------------- Changes: https://git.openjdk.org/jdk/pull/27605/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27605&range=24 Stats: 8445 lines in 60 files changed: 3836 ins; 4490 del; 119 mod Patch: https://git.openjdk.org/jdk/pull/27605.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27605/head:pull/27605 PR: https://git.openjdk.org/jdk/pull/27605 From jvernee at openjdk.org Wed Nov 12 16:39:57 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Wed, 12 Nov 2025 16:39:57 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v25] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 10:07:39 GMT, Per Minborg wrote: >> Implement JEP 526: Lazy Constants (Second Preview) >> >> The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. >> >> The old benchmarks are not moved/renamed to allow comparison with previous releases. >> >> `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. > > Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 112 commits: > > - Clarify toString spec > - Merge branch 'master' into lazy-constants > - Add @AOTSafeClassInitializer > - Address comments in PR > - Fix merge mistake > - Merge master > - Rework toString implementations > - Update after doc comments > - Merge branch 'master' into lazy-constants > - Revert the AbstractMap.keySet @Stable annotation > - ... and 102 more: https://git.openjdk.org/jdk/compare/76a1109d...1f439bec Some initial comments on the spec and implementation. I still need to look at the tests. src/java.base/share/classes/java/lang/LazyConstant.java line 48: > 46: * (provided at construction) will be invoked and the result will be used to initialize > 47: * the constant. Once a lazy constant is initialized, its contents can never change > 48: * and will be retrieved over and over again upon subsequent {@linkplain #get() get} Are the above links to `#get()` also intended to have a the plain `get` text? src/java.base/share/classes/java/lang/LazyConstant.java line 169: > 167: * a lazy constant {@linkplain java.lang.ref##reachability strongly references} > 168: * it contents. Hence, a lazy constant will hold its contents until > 169: * the lazy constant itself is collected (if ever). Maybe you could avoid the word 'collected' here, as there are no other references to the GC in this section, and no link to what GC is/does. i.e. I think 'collected' is not well-defined enough to be used here. Suggestion: * it contents. Hence, the contents of a lazy constant will be reachable as long * as the lazy constant itself is reachable. src/java.base/share/classes/java/lang/LazyConstant.java line 249: > 247: > 248: /** > 249: * {@return the {@linkplain System#identityHashCode(Object)} for this lazy constant} How does this link render? It doesn't have any plain text. Maybe it's missing? Suggestion: * {@return the {@linkplain System#identityHashCode(Object) identity hash code} for this lazy constant} src/java.base/share/classes/java/lang/LazyConstant.java line 257: > 255: > 256: /** > 257: * {@return a non-initializing string suitable for debugging} What is a 'non-initializing string'? ;) I think the second paragraph already covers this aspect, so you can leave it out here. src/java.base/share/classes/java/lang/LazyConstant.java line 275: > 273: /** > 274: * {@return a lazy constant to be computed later via the provided > 275: * {@code computingFunction}} The function computes the contents, not the LC itself, so: Suggestion: * {@return a lazy constant whose contents is to be computed later via the provided * {@code computingFunction}} src/java.base/share/classes/java/util/LazyCollections.java line 55: > 53: > 54: // Unsafe allows LazyCollection classes to be used early in the boot sequence > 55: static final Unsafe UNSAFE = Unsafe.getUnsafe(); Suggestion: private static final Unsafe UNSAFE = Unsafe.getUnsafe(); src/java.base/share/classes/java/util/LazyCollections.java line 66: > 64: // using `elements.length`. > 65: @Stable > 66: private final int size; Is this really that important? What about the extra footprint added by the `int` field? We might have many instances of this class, but only one copy of the bytecode. src/java.base/share/classes/java/util/LazyCollections.java line 199: > 197: final int size = base.size(); > 198: subListRangeCheck(fromIndex, toIndex, size); > 199: return new ReverseOrderLazyListView<>(base.subList(size - toIndex, size - fromIndex)); Why not this? (maybe add a comment?) Suggestion: return new ReverseOrderLazyListView<>(base.subList(fromIndex, toIndex)); src/java.base/share/classes/java/util/LazyCollections.java line 264: > 262: > 263: @Stable > 264: private final Map indexMapper; This index mapper is a clever solution that avoids implementing a hashing function again. Lookups through this map can be folded because it is created using `Map.ofEntries`. I think you should put that in a comment here as well. src/java.base/share/classes/java/util/LazyCollections.java line 433: > 431: @Override public V getValue() { > 432: final int index = map.indexFor(getKey); > 433: final V v = map.getAcquire(getKey); I suppose you could use `orElseCompute` here, since you already have the index src/java.base/share/classes/java/util/LazyCollections.java line 488: > 486: static final class Mutexes { > 487: > 488: static final Object TOMB_STONE = new Object(); Suggestion: private static final Object TOMB_STONE = new Object(); src/java.base/share/classes/java/util/LazyCollections.java line 578: > 576: if (t == null) { > 577: final T newValue = switch (functionHolder.function()) { > 578: case Supplier sup -> (T) sup.get(); Is the held function ever a Supplier? I don't see a FunctionHolder being created with one. src/java.base/share/classes/java/util/LazyCollections.java line 607: > 605: assert Thread.holdsLock(mutex) : index + "didn't hold " + mutex; > 606: // We know we hold the monitor here so plain semantic is enough > 607: if (array[index] == null) { This should always be true when we get here, right? src/java.base/share/classes/java/util/List.java line 1222: > 1220: *

> 1221: * Any {@link List#subList(int, int) subList()} or {@link List#reversed()} views > 1222: * of the returned list are also lazily computed. Is this really about the views itself? Or about the elements? (AFAIK these views are typically lazily computed/created for others List impls as well) Suggestion: * The elements of any {@link List#subList(int, int) subList()} or {@link List#reversed()} views * of the returned list are also lazily computed. src/java.base/share/classes/java/util/Map.java line 1765: > 1763: * at most once per key, even in a multi-threaded environment. Competing > 1764: * threads accessing a value already under computation will block until an element > 1765: * is computed or an exception is thrown by the computing thread. I think technically it's more correct to say something like '... or the computing function completes abnormally'. Since, if an exception is throw inside the computing function (by the computing thread), it may be caught and handled inside the computing function as well. src/java.base/share/classes/java/util/Map.java line 1778: > 1776: *

> 1777: * Any {@link Map#values()} or {@link Map#entrySet()} views of the returned map are > 1778: * also lazily computed. Suggestion: * The values of any {@link Map#values()} or {@link Map#entrySet()} views of the returned map are * also lazily computed. src/java.base/share/classes/java/util/Map.java line 1817: > 1815: final Set keyCopies = Set.copyOf(keys); > 1816: Objects.requireNonNull(computingFunction); > 1817: if (keys instanceof EnumSet && !keys.isEmpty()) { The fact that `keys` is being used here and not `keyCopies` looks a bit fishy. In general we should use the validated copy of our data in subsequent processing. Since `EnumSet` is mutable, it seems that these two could go out of sync. ------------- PR Review: https://git.openjdk.org/jdk/pull/27605#pullrequestreview-3448944313 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518699095 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518745565 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518765422 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518768972 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518779499 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518885149 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518897461 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518919343 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518968294 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518950708 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518970767 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2519007486 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2519002745 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518813240 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518832566 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518837814 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518880555 From jvernee at openjdk.org Wed Nov 12 16:39:58 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Wed, 12 Nov 2025 16:39:58 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v25] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 15:23:25 GMT, Jorn Vernee wrote: >> Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 112 commits: >> >> - Clarify toString spec >> - Merge branch 'master' into lazy-constants >> - Add @AOTSafeClassInitializer >> - Address comments in PR >> - Fix merge mistake >> - Merge master >> - Rework toString implementations >> - Update after doc comments >> - Merge branch 'master' into lazy-constants >> - Revert the AbstractMap.keySet @Stable annotation >> - ... and 102 more: https://git.openjdk.org/jdk/compare/76a1109d...1f439bec > > src/java.base/share/classes/java/lang/LazyConstant.java line 169: > >> 167: * a lazy constant {@linkplain java.lang.ref##reachability strongly references} >> 168: * it contents. Hence, a lazy constant will hold its contents until >> 169: * the lazy constant itself is collected (if ever). > > Maybe you could avoid the word 'collected' here, as there are no other references to the GC in this section, and no link to what GC is/does. i.e. I think 'collected' is not well-defined enough to be used here. > > Suggestion: > > * it contents. Hence, the contents of a lazy constant will be reachable as long > * as the lazy constant itself is reachable. Alternatively you could say something like 'becomes eligible for garbage collection', but I think defining the spec in terms of reachability is better, since that has a better definition in `java.lang.ref##reachability`. > src/java.base/share/classes/java/util/Map.java line 1765: > >> 1763: * at most once per key, even in a multi-threaded environment. Competing >> 1764: * threads accessing a value already under computation will block until an element >> 1765: * is computed or an exception is thrown by the computing thread. > > I think technically it's more correct to say something like '... or the computing function completes abnormally'. Since, if an exception is throw inside the computing function (by the computing thread), it may be caught and handled inside the computing function as well. (Same for List) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518789003 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518834700 From jvernee at openjdk.org Wed Nov 12 16:39:59 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Wed, 12 Nov 2025 16:39:59 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v25] In-Reply-To: References: <-lErHk2PzyJCaPQGrEwCt3nObTrTHs7_p53eBXspUGE=.50dc2375-8769-49a5-9308-ab40132bbd19@github.com> Message-ID: On Mon, 13 Oct 2025 11:25:04 GMT, Per Minborg wrote: >> Usually a null sentinel is used when null indicates something different. I think maybe to allow folding the empty case, we should probably add a new annotation or a new element-value to indicate this status and properly handle it in C1/C2 (similar to the field trusting in ciField) > > I've added two new benchmarks: > > > private static final LazyConstant> OPTIONAL_42 = LazyConstant.of(() -> Optional.of(42)); > private static final LazyConstant> OPTIONAL_42_2 = LazyConstant.of(() -> Optional.of(42)); > private static final LazyConstant> OPTIONAL_EMPTY = LazyConstant.of(Optional::empty); > private static final LazyConstant> OPTIONAL_EMPTY2 = LazyConstant.of(Optional::empty); > > ... > > @Benchmark > public int staticOptional42() { > return OPTIONAL_42.get().orElseThrow() + OPTIONAL_42_2.get().orElseThrow(); > } > > @Benchmark > public boolean staticOptionalEmpty() { > return OPTIONAL_EMPTY.get().isEmpty() ^ OPTIONAL_EMPTY2.get().isEmpty(); > } > > > > > Which gives: > > > Benchmark Mode Cnt Score Error Units > StableValueBenchmark.staticOptional42 avgt 10 0.354 ? 0.045 ns/op > > Benchmark Mode Cnt Score Error Units > StableValueBenchmark.staticOptionalEmpty avgt 10 0.370 ? 0.030 ns/op > > > So, both `Optional` variants appears to support constant folding. I don't think we can drawn that conclusion just based on the speed. For the non-constant folded cases, this would be 2 loads and an xor. I don't see how C2 would be allowed to constant fold the loads if the value is `null`, since that's explicitly forbidden by `@Stable` (and there's no easy way around that AFAIK, since the JIT thread may see a partially initialized object, so it conservatively ignores default values). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2514951017 From jvernee at openjdk.org Wed Nov 12 16:40:02 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Wed, 12 Nov 2025 16:40:02 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v24] In-Reply-To: References: Message-ID: On Mon, 10 Nov 2025 14:59:03 GMT, Per Minborg wrote: >> Implement JEP 526: Lazy Constants (Second Preview) >> >> The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. >> >> The old benchmarks are not moved/renamed to allow comparison with previous releases. >> >> `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. > > Per Minborg has updated the pull request incrementally with one additional commit since the last revision: > > Add @AOTSafeClassInitializer src/java.base/share/classes/jdk/internal/lang/LazyConstantImpl.java line 47: > 45: > 46: // Unsafe allows `LazyConstant` instances to be used early in the boot sequence > 47: static final Unsafe UNSAFE = Unsafe.getUnsafe(); Suggestion: private static final Unsafe UNSAFE = Unsafe.getUnsafe(); test/jdk/java/lang/LazyConstant/LazyConstantSafePublicationTest.java line 117: > 115: @Test > 116: void mainTest() { > 117: CONSTANTS.set(constants()); Instead of passing this through a static field, why not just pass it through the constructor of Producer and Consumer? (which are created below) test/micro/org/openjdk/bench/java/lang/stable/StableMapSingleBenchmark.java line 66: > 64: private static final Map MAP_ENUM = Map.ofLazy(EnumSet.allOf(MyEnum.class), MyEnum::ordinal); > 65: private static final Map> MAP_ENUM_OPTIONAL = Map.ofLazy(EnumSet.allOf(MyEnum.class), e -> Optional.of(e.ordinal())); > 66: private static final Function FUNCTION = MAP::get; I suppose the function variants are not very interesting to test, since they just delegate to Map::get, Maybe consider removing them ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2514957700 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2514930623 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2514913683 From rriggs at openjdk.org Wed Nov 12 18:37:07 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Wed, 12 Nov 2025 18:37:07 GMT Subject: RFR: 8371732: [redo] Change java.time month/day field types to 'byte' Message-ID: Redo change (8371732) that failed when the updated class objects were incompatible. The fields of classes are changed to allow a more compact form of storage. To ensure compatibility of the class objects, the fields are explicitly declared in SerialPersistentFields with the original field types. The fields are marked `transient` to indicate the field declarations are not used for serialization. The affected classes are java.time.LocalDate, MonthDay, and YearMonth. Tests are added to verify the types and names of serialized fields of each class. HijrahDate only changes the field types, the fields are transient and there is no change to the serialized from of the HijrahDate.class object. ------------- Commit messages: - Change some java.time fields from int or short to byte to save on heap size. Changes: https://git.openjdk.org/jdk/pull/28274/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28274&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8371732 Stats: 124 lines in 7 files changed: 100 ins; 0 del; 24 mod Patch: https://git.openjdk.org/jdk/pull/28274.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28274/head:pull/28274 PR: https://git.openjdk.org/jdk/pull/28274 From duke at openjdk.org Wed Nov 12 21:49:10 2025 From: duke at openjdk.org (ExE Boss) Date: Wed, 12 Nov 2025 21:49:10 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v25] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 10:07:39 GMT, Per Minborg wrote: >> Implement JEP 526: Lazy Constants (Second Preview) >> >> The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. >> >> The old benchmarks are not moved/renamed to allow comparison with previous releases. >> >> `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. > > Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 112 commits: > > - Clarify toString spec > - Merge branch 'master' into lazy-constants > - Add @AOTSafeClassInitializer > - Address comments in PR > - Fix merge mistake > - Merge master > - Rework toString implementations > - Update after doc comments > - Merge branch 'master' into lazy-constants > - Revert the AbstractMap.keySet @Stable annotation > - ... and 102 more: https://git.openjdk.org/jdk/compare/76a1109d...1f439bec src/java.base/share/classes/java/util/LazyCollections.java line 509: > 507: return mutex; > 508: } > 509: // Protect against racy stores of mutexe candidates Suggestion: // Protect against racy stores of mutex candidates ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2518540555 From duke at openjdk.org Wed Nov 12 21:49:12 2025 From: duke at openjdk.org (ExE Boss) Date: Wed, 12 Nov 2025 21:49:12 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v25] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 16:33:40 GMT, Jorn Vernee wrote: >> Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 112 commits: >> >> - Clarify toString spec >> - Merge branch 'master' into lazy-constants >> - Add @AOTSafeClassInitializer >> - Address comments in PR >> - Fix merge mistake >> - Merge master >> - Rework toString implementations >> - Update after doc comments >> - Merge branch 'master' into lazy-constants >> - Revert the AbstractMap.keySet @Stable annotation >> - ... and 102 more: https://git.openjdk.org/jdk/compare/76a1109d...1f439bec > > src/java.base/share/classes/java/util/LazyCollections.java line 578: > >> 576: if (t == null) { >> 577: final T newValue = switch (functionHolder.function()) { >> 578: case Supplier sup -> (T) sup.get(); > > Is the held function ever a Supplier? I don't see a FunctionHolder being created with one. This?is from?when `FunctionHolder` was?located in?the?`jdk.internal.lang.stable` package in?[GH?25878], and?was?used to?implement the?computing?function freeing?mechanism in?[`StableValue?::supplier(?)`]. [GH?25878]: https://github.com/openjdk/jdk/pull/25878 [`StableValue?::supplier(?)`]: https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/StableValue.html#supplier(java.util.function.Supplier) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2519902578 From rriggs at openjdk.org Wed Nov 12 23:44:06 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Wed, 12 Nov 2025 23:44:06 GMT Subject: RFR: 8371339: Illegal pattern char 'B' with locale.providers as HOST on macOS for Taiwanese In-Reply-To: <30ThkifrSqifpcv8THhqYLuq535cHggNmDFIGim8F0k=.e5ea6c2c-1704-4fb7-8296-9c5756cd4b6c@github.com> References: <30ThkifrSqifpcv8THhqYLuq535cHggNmDFIGim8F0k=.e5ea6c2c-1704-4fb7-8296-9c5756cd4b6c@github.com> Message-ID: On Thu, 6 Nov 2025 19:35:06 GMT, Naoto Sato wrote: > This is a leftover when we introduced "dayperiods" in the JDK ([JDK-8247781](https://bugs.openjdk.org/browse/JDK-8247781)). The CLDR Converter was modified to generate patterns for SimpleDateFormat for dayperiods (simply replacing them with ampm), and the same processing should have been applied to Host provider on mac, which also uses LDML patterns. As in the bug report, macos recently started using dayperiods, thus the issue was revealed. Regression test is not provided as it would require the macos's default locale should be configured to zh_TW. I have manually confirmed that the proposed fix would work for the problem case. Looks good. ------------- Marked as reviewed by rriggs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28181#pullrequestreview-3456048793 From naoto at openjdk.org Thu Nov 13 00:34:15 2025 From: naoto at openjdk.org (Naoto Sato) Date: Thu, 13 Nov 2025 00:34:15 GMT Subject: RFR: 8371339: Illegal pattern char 'B' with locale.providers as HOST on macOS for Taiwanese In-Reply-To: <30ThkifrSqifpcv8THhqYLuq535cHggNmDFIGim8F0k=.e5ea6c2c-1704-4fb7-8296-9c5756cd4b6c@github.com> References: <30ThkifrSqifpcv8THhqYLuq535cHggNmDFIGim8F0k=.e5ea6c2c-1704-4fb7-8296-9c5756cd4b6c@github.com> Message-ID: On Thu, 6 Nov 2025 19:35:06 GMT, Naoto Sato wrote: > This is a leftover when we introduced "dayperiods" in the JDK ([JDK-8247781](https://bugs.openjdk.org/browse/JDK-8247781)). The CLDR Converter was modified to generate patterns for SimpleDateFormat for dayperiods (simply replacing them with ampm), and the same processing should have been applied to Host provider on mac, which also uses LDML patterns. As in the bug report, macos recently started using dayperiods, thus the issue was revealed. Regression test is not provided as it would require the macos's default locale should be configured to zh_TW. I have manually confirmed that the proposed fix would work for the problem case. Thanks for the reviews! ------------- PR Comment: https://git.openjdk.org/jdk/pull/28181#issuecomment-3524517311 From naoto at openjdk.org Thu Nov 13 00:34:15 2025 From: naoto at openjdk.org (Naoto Sato) Date: Thu, 13 Nov 2025 00:34:15 GMT Subject: Integrated: 8371339: Illegal pattern char 'B' with locale.providers as HOST on macOS for Taiwanese In-Reply-To: <30ThkifrSqifpcv8THhqYLuq535cHggNmDFIGim8F0k=.e5ea6c2c-1704-4fb7-8296-9c5756cd4b6c@github.com> References: <30ThkifrSqifpcv8THhqYLuq535cHggNmDFIGim8F0k=.e5ea6c2c-1704-4fb7-8296-9c5756cd4b6c@github.com> Message-ID: On Thu, 6 Nov 2025 19:35:06 GMT, Naoto Sato wrote: > This is a leftover when we introduced "dayperiods" in the JDK ([JDK-8247781](https://bugs.openjdk.org/browse/JDK-8247781)). The CLDR Converter was modified to generate patterns for SimpleDateFormat for dayperiods (simply replacing them with ampm), and the same processing should have been applied to Host provider on mac, which also uses LDML patterns. As in the bug report, macos recently started using dayperiods, thus the issue was revealed. Regression test is not provided as it would require the macos's default locale should be configured to zh_TW. I have manually confirmed that the proposed fix would work for the problem case. This pull request has now been integrated. Changeset: d2571ea7 Author: Naoto Sato URL: https://git.openjdk.org/jdk/commit/d2571ea76ae5a9ccb7053bfec24bf3aedd366084 Stats: 12 lines in 1 file changed: 11 ins; 0 del; 1 mod 8371339: Illegal pattern char 'B' with locale.providers as HOST on macOS for Taiwanese Reviewed-by: jlu, rriggs ------------- PR: https://git.openjdk.org/jdk/pull/28181 From naoto at openjdk.org Thu Nov 13 22:05:55 2025 From: naoto at openjdk.org (Naoto Sato) Date: Thu, 13 Nov 2025 22:05:55 GMT Subject: RFR: 8346944: Update Unicode Data Files to 17.0.0 Message-ID: Updates the JDK to use the latest Unicode 17.0.0, which also updates the ICU4J along with it ([8346947](https://bugs.openjdk.org/browse/JDK-8346947) Update ICU4J to Version 78.1). The corresponding CSR has already been approved. ------------- Commit messages: - icudata path fix - Update versions - icu4j final - .md file changes - 17.0 final - icudata78b(binary) - CaseFolding.text -> 17, copyright symbol as is - icudt78b - 17-beta - initial commit Changes: https://git.openjdk.org/jdk/pull/28093/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28093&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346944 Stats: 2977 lines in 35 files changed: 1345 ins; 650 del; 982 mod Patch: https://git.openjdk.org/jdk/pull/28093.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28093/head:pull/28093 PR: https://git.openjdk.org/jdk/pull/28093 From mcimadamore at openjdk.org Fri Nov 14 09:48:28 2025 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Fri, 14 Nov 2025 09:48:28 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v25] In-Reply-To: References: Message-ID: <_twwdOdK3jZMnAaDPFubJhbEbR_FEK99I4obbpttveU=.21e193fa-067e-4df1-8cff-4cd0fc704e4f@github.com> On Wed, 12 Nov 2025 10:07:39 GMT, Per Minborg wrote: >> Implement JEP 526: Lazy Constants (Second Preview) >> >> The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. >> >> The old benchmarks are not moved/renamed to allow comparison with previous releases. >> >> `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. > > Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 112 commits: > > - Clarify toString spec > - Merge branch 'master' into lazy-constants > - Add @AOTSafeClassInitializer > - Address comments in PR > - Fix merge mistake > - Merge master > - Rework toString implementations > - Update after doc comments > - Merge branch 'master' into lazy-constants > - Revert the AbstractMap.keySet @Stable annotation > - ... and 102 more: https://git.openjdk.org/jdk/compare/76a1109d...1f439bec src/java.base/share/classes/java/lang/LazyConstant.java line 241: > 239: > 240: /** > 241: * {@return if this lazy constant is the same as the provided {@code obj}} maybe add (either in this PR or as follow up) a clarification saying that two different lazy constant that point to the same contents are **not** equals src/java.base/share/classes/java/lang/LazyConstant.java line 280: > 278: * {@code computingFunction} at least until initialization completes successfully. > 279: *

> 280: * If the provided computing function is already an instance of Not sure how I feel about that -- it seems to soft-break equals... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2526752889 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2526762818 From mcimadamore at openjdk.org Fri Nov 14 09:55:14 2025 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Fri, 14 Nov 2025 09:55:14 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v25] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 10:07:39 GMT, Per Minborg wrote: >> Implement JEP 526: Lazy Constants (Second Preview) >> >> The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. >> >> The old benchmarks are not moved/renamed to allow comparison with previous releases. >> >> `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. > > Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 112 commits: > > - Clarify toString spec > - Merge branch 'master' into lazy-constants > - Add @AOTSafeClassInitializer > - Address comments in PR > - Fix merge mistake > - Merge master > - Rework toString implementations > - Update after doc comments > - Merge branch 'master' into lazy-constants > - Revert the AbstractMap.keySet @Stable annotation > - ... and 102 more: https://git.openjdk.org/jdk/compare/76a1109d...1f439bec Looks great -- just a couple more javadoc tweaks ;-) src/java.base/share/classes/java/util/List.java line 1233: > 1231: * The returned list's {@linkplain Object#equals(Object) equals()} and > 1232: * {@linkplain Object#hashCode() hashCode()} methods may trigger initialization of one > 1233: * or more lazy elements. The returned list's {@linkplain Object#toString() toString()} I thought we have concluded that all Object methods should behave as those in any other list, to maximize migration opportunities. ------------- PR Review: https://git.openjdk.org/jdk/pull/27605#pullrequestreview-3464050345 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2526787780 From pminborg at openjdk.org Fri Nov 14 13:35:17 2025 From: pminborg at openjdk.org (Per Minborg) Date: Fri, 14 Nov 2025 13:35:17 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v25] In-Reply-To: References: <-lErHk2PzyJCaPQGrEwCt3nObTrTHs7_p53eBXspUGE=.50dc2375-8769-49a5-9308-ab40132bbd19@github.com> Message-ID: On Tue, 11 Nov 2025 16:48:58 GMT, Jorn Vernee wrote: >> I've added two new benchmarks: >> >> >> private static final LazyConstant> OPTIONAL_42 = LazyConstant.of(() -> Optional.of(42)); >> private static final LazyConstant> OPTIONAL_42_2 = LazyConstant.of(() -> Optional.of(42)); >> private static final LazyConstant> OPTIONAL_EMPTY = LazyConstant.of(Optional::empty); >> private static final LazyConstant> OPTIONAL_EMPTY2 = LazyConstant.of(Optional::empty); >> >> ... >> >> @Benchmark >> public int staticOptional42() { >> return OPTIONAL_42.get().orElseThrow() + OPTIONAL_42_2.get().orElseThrow(); >> } >> >> @Benchmark >> public boolean staticOptionalEmpty() { >> return OPTIONAL_EMPTY.get().isEmpty() ^ OPTIONAL_EMPTY2.get().isEmpty(); >> } >> >> >> >> >> Which gives: >> >> >> Benchmark Mode Cnt Score Error Units >> StableValueBenchmark.staticOptional42 avgt 10 0.354 ? 0.045 ns/op >> >> Benchmark Mode Cnt Score Error Units >> StableValueBenchmark.staticOptionalEmpty avgt 10 0.370 ? 0.030 ns/op >> >> >> So, both `Optional` variants appears to support constant folding. > > I don't think we can drawn that conclusion just based on the speed. For the non-constant folded cases, this would be 2 loads and an xor. > > I don't see how C2 would be allowed to constant fold the loads if the value is `null`, since that's explicitly forbidden by `@Stable` (and there's no easy way around that AFAIK, since the JIT thread may see a partially initialized object, so it conservatively ignores default values). Yes. I think you are right @JornVernee. I've explored several ways to fix this and the simplest one might be to have a sentinel value instead of `null` to flag emptiness. Splitting the class into a bimorphic implementation would not be good for `value` classes (at least not for now), even though the C2 might otherwise be able to optimize the two variants. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2527523848 From pminborg at openjdk.org Fri Nov 14 14:44:49 2025 From: pminborg at openjdk.org (Per Minborg) Date: Fri, 14 Nov 2025 14:44:49 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v25] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 16:02:05 GMT, Jorn Vernee wrote: >> Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 112 commits: >> >> - Clarify toString spec >> - Merge branch 'master' into lazy-constants >> - Add @AOTSafeClassInitializer >> - Address comments in PR >> - Fix merge mistake >> - Merge master >> - Rework toString implementations >> - Update after doc comments >> - Merge branch 'master' into lazy-constants >> - Revert the AbstractMap.keySet @Stable annotation >> - ... and 102 more: https://git.openjdk.org/jdk/compare/76a1109d...1f439bec > > src/java.base/share/classes/java/util/LazyCollections.java line 66: > >> 64: // using `elements.length`. >> 65: @Stable >> 66: private final int size; > > Is this really that important? What about the extra footprint added by the `int` field? We might have many instances of this class, but only one copy of the bytecode. Hrrm. I wonder if the C2 compiler will end up producing equivalent code for the two variants? But there are merits to your argument. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2527753354 From pminborg at openjdk.org Fri Nov 14 15:15:51 2025 From: pminborg at openjdk.org (Per Minborg) Date: Fri, 14 Nov 2025 15:15:51 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v25] In-Reply-To: References: Message-ID: <7emI0lI9l1ZnKE89i3hDeQl4KiaE_GutmkDoIu772Ik=.276d7422-4102-425a-a92f-439134945f60@github.com> On Wed, 12 Nov 2025 16:08:19 GMT, Jorn Vernee wrote: >> Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 112 commits: >> >> - Clarify toString spec >> - Merge branch 'master' into lazy-constants >> - Add @AOTSafeClassInitializer >> - Address comments in PR >> - Fix merge mistake >> - Merge master >> - Rework toString implementations >> - Update after doc comments >> - Merge branch 'master' into lazy-constants >> - Revert the AbstractMap.keySet @Stable annotation >> - ... and 102 more: https://git.openjdk.org/jdk/compare/76a1109d...1f439bec > > src/java.base/share/classes/java/util/LazyCollections.java line 199: > >> 197: final int size = base.size(); >> 198: subListRangeCheck(fromIndex, toIndex, size); >> 199: return new ReverseOrderLazyListView<>(base.subList(size - toIndex, size - fromIndex)); > > Why not this? (maybe add a comment?) > Suggestion: > > return new ReverseOrderLazyListView<>(base.subList(fromIndex, toIndex)); Actually, now that toString() evaluates, we could just get rid of these classes and use the ones in the base class. Great! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2527855543 From pminborg at openjdk.org Fri Nov 14 15:35:03 2025 From: pminborg at openjdk.org (Per Minborg) Date: Fri, 14 Nov 2025 15:35:03 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v25] In-Reply-To: References: Message-ID: On Wed, 12 Nov 2025 16:17:37 GMT, Jorn Vernee wrote: >> Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 112 commits: >> >> - Clarify toString spec >> - Merge branch 'master' into lazy-constants >> - Add @AOTSafeClassInitializer >> - Address comments in PR >> - Fix merge mistake >> - Merge master >> - Rework toString implementations >> - Update after doc comments >> - Merge branch 'master' into lazy-constants >> - Revert the AbstractMap.keySet @Stable annotation >> - ... and 102 more: https://git.openjdk.org/jdk/compare/76a1109d...1f439bec > > src/java.base/share/classes/java/util/LazyCollections.java line 433: > >> 431: @Override public V getValue() { >> 432: final int index = map.indexFor(getKey); >> 433: final V v = map.getAcquire(getKey); > > I suppose you could use `orElseCompute` here, since you already have the index Nice. Then we can get rid of the getAquire() method as well. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2527915904 From pminborg at openjdk.org Fri Nov 14 15:41:36 2025 From: pminborg at openjdk.org (Per Minborg) Date: Fri, 14 Nov 2025 15:41:36 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v25] In-Reply-To: References: Message-ID: <6zrll105lMejyo1PAG6cfBFzYt3N2-_9lIK6uP-Wl8A=.3e7908a7-71da-452e-8703-c4b7b5d661c3@github.com> On Wed, 12 Nov 2025 16:32:28 GMT, Jorn Vernee wrote: >> Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 112 commits: >> >> - Clarify toString spec >> - Merge branch 'master' into lazy-constants >> - Add @AOTSafeClassInitializer >> - Address comments in PR >> - Fix merge mistake >> - Merge master >> - Rework toString implementations >> - Update after doc comments >> - Merge branch 'master' into lazy-constants >> - Revert the AbstractMap.keySet @Stable annotation >> - ... and 102 more: https://git.openjdk.org/jdk/compare/76a1109d...1f439bec > > src/java.base/share/classes/java/util/LazyCollections.java line 607: > >> 605: assert Thread.holdsLock(mutex) : index + "didn't hold " + mutex; >> 606: // We know we hold the monitor here so plain semantic is enough >> 607: if (array[index] == null) { > > This should always be true when we get here, right? This is just an extra safety net to emulate a CAS op (while we are holding the monitor). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2527936851 From sherman at openjdk.org Fri Nov 14 23:55:04 2025 From: sherman at openjdk.org (Xueming Shen) Date: Fri, 14 Nov 2025 23:55:04 GMT Subject: RFR: 8365675: Add String Unicode Case-Folding Support [v9] In-Reply-To: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> References: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> Message-ID: > ### Summary > > Case folding is a key operation for case-insensitive matching (e.g., string equality, regex matching), where the goal is to eliminate case distinctions without applying locale or language specific conversions. > > Currently, the JDK does not expose a direct API for Unicode-compliant case folding. Developers now rely on methods such as: > > **String.equalsIgnoreCase(String)** > > - Unicode-aware, locale-independent. > - Implementation uses Character.toLowerCase(Character.toUpperCase(int)) per code point. > - Limited: does not support 1:M mapping defined in Unicode case folding. > > **Character.toLowerCase(int) / Character.toUpperCase(int)** > > - Locale-independent, single code point only. > - No support for 1:M mappings. > > **String.toLowerCase(Locale.ROOT) / String.toUpperCase(Locale.ROOT)** > > - Based on Unicode SpecialCasing.txt, supports 1:M mappings. > - Intended primarily for presentation/display, not structural case-insensitive matching. > - Requires full string conversion before comparison, which is less efficient and not intended for structural matching. > > **1:M mapping example, U+00DF (?)** > > - String.toUpperCase(Locale.ROOT, "?") ? "SS" > - Case folding produces "ss", matching Unicode caseless comparison rules. > > > jshell> "\u00df".equalsIgnoreCase("ss") > $22 ==> false > > jshell> "\u00df".toUpperCase(Locale.ROOT).toLowerCase(Locale.ROOT).equals("ss") > $24 ==> true > > > ### Motivation & Direction > > Add Unicode standard-compliant case-less comparison methods to the String class, enabling & improving reliable and efficient Unicode-aware/compliant case-insensitive matching. > > - Unicode-compliant **full** case folding. > - Simpler, stable and more efficient case-less matching without workarounds. > - Brings Java's string comparison handling in line with other programming languages/libraries. > > This PR proposes to introduce the following comparison methods in `String` class > > - boolean equalsFoldCase(String anotherString) > - int compareToFoldCase(String anotherString) > - Comparator UNICODE_CASEFOLD_ORDER > > These methods are intended to be the preferred choice when Unicode-compliant case-less matching is required. > > *Note: An early draft also proposed a String.toCaseFold() method returning a new case-folded string. > However, during review this was considered error-prone, as the resulting string could easily be mistaken for a general transformation like toLowerCase() and then passed into APIs where case-folding semantics are not appropriate. > > ### The New API > > See CSR https://bugs.openjd... Xueming Shen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits: - update string class doc - Merge remote-tracking branch 'upstream/master' into JDK-8365675 sync with master - update with new test cases - update to use value long for folding - small update - update - test case update - performance update - minor api doc updates - Merge branch 'master' of https://git.openjdk.org/jdk into JDK-8365675 - ... and 1 more: https://git.openjdk.org/jdk/compare/7aff8e15...057ea814 ------------- Changes: https://git.openjdk.org/jdk/pull/27628/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27628&range=08 Stats: 1448 lines in 13 files changed: 1236 ins; 207 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/27628.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27628/head:pull/27628 PR: https://git.openjdk.org/jdk/pull/27628 From sherman at openjdk.org Fri Nov 14 23:57:11 2025 From: sherman at openjdk.org (Xueming Shen) Date: Fri, 14 Nov 2025 23:57:11 GMT Subject: RFR: 8365675: Add String Unicode Case-Folding Support [v7] In-Reply-To: References: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> Message-ID: On Fri, 7 Nov 2025 22:19:03 GMT, Roger Riggs wrote: >> Xueming Shen has updated the pull request incrementally with one additional commit since the last revision: >> >> update to use value long for folding > > test/jdk/java/lang/String/UnicodeCaseFoldingTest.java line 31: > >> 29: * @compile --add-exports java.base/jdk.internal.lang=ALL-UNNAMED >> 30: * UnicodeCaseFoldingTest.java >> 31: * @run junit/othervm --add-exports java.base/jdk.internal.lang=ALL-UNNAMED > > The @module directive can replace the explicit --add-exports and the explicit @compile may be unnecessary. > > * @modules java.base/jdk.internal.lang:+open updated as suggested ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2529280093 From sherman at openjdk.org Sat Nov 15 01:22:12 2025 From: sherman at openjdk.org (Xueming Shen) Date: Sat, 15 Nov 2025 01:22:12 GMT Subject: RFR: 8365675: Add String Unicode Case-Folding Support [v7] In-Reply-To: References: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> Message-ID: <9jpJ-i9OwkJeyIcrnzm5wk9Pic_ObsGw-S-xcEI7vpA=.0aab5db7-b801-473c-90f7-a8c6bd92364c@github.com> On Fri, 7 Nov 2025 21:40:24 GMT, Roger Riggs wrote: >> Xueming Shen has updated the pull request incrementally with one additional commit since the last revision: >> >> update to use value long for folding > > src/java.base/share/classes/jdk/internal/lang/CaseFolding.java.template line 136: > >> 134: * >> 135: *

>> 136: * @spec https://www.unicode.org/reports/tr18/#Simple_Loose_Matches > > I'd put @spec after @return. updated according ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2529363242 From pminborg at openjdk.org Sun Nov 16 09:40:19 2025 From: pminborg at openjdk.org (Per Minborg) Date: Sun, 16 Nov 2025 09:40:19 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v25] In-Reply-To: <_twwdOdK3jZMnAaDPFubJhbEbR_FEK99I4obbpttveU=.21e193fa-067e-4df1-8cff-4cd0fc704e4f@github.com> References: <_twwdOdK3jZMnAaDPFubJhbEbR_FEK99I4obbpttveU=.21e193fa-067e-4df1-8cff-4cd0fc704e4f@github.com> Message-ID: On Fri, 14 Nov 2025 09:45:39 GMT, Maurizio Cimadamore wrote: >> Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 112 commits: >> >> - Clarify toString spec >> - Merge branch 'master' into lazy-constants >> - Add @AOTSafeClassInitializer >> - Address comments in PR >> - Fix merge mistake >> - Merge master >> - Rework toString implementations >> - Update after doc comments >> - Merge branch 'master' into lazy-constants >> - Revert the AbstractMap.keySet @Stable annotation >> - ... and 102 more: https://git.openjdk.org/jdk/compare/76a1109d...1f439bec > > src/java.base/share/classes/java/lang/LazyConstant.java line 280: > >> 278: * {@code computingFunction} at least until initialization completes successfully. >> 279: *

>> 280: * If the provided computing function is already an instance of > > Not sure how I feel about that -- it seems to soft-break equals... Let's think about this once more. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2531779955 From pminborg at openjdk.org Mon Nov 17 09:32:02 2025 From: pminborg at openjdk.org (Per Minborg) Date: Mon, 17 Nov 2025 09:32:02 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v26] In-Reply-To: References: Message-ID: > Implement JEP 526: Lazy Constants (Second Preview) > > The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. > > The old benchmarks are not moved/renamed to allow comparison with previous releases. > > `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 125 commits: - Merge branch 'master' into lazy-constants - Merge master - Fix tests and improve docs - Remove inner classes in LazyList - Fix TOC TOU issue - Improve documentation for List and Map factories - Improve doc details - Improve text for hashCode() - Refine text about reachabilit of the contents - Align doc links for get() - ... and 115 more: https://git.openjdk.org/jdk/compare/69e30244...3c26e095 ------------- Changes: https://git.openjdk.org/jdk/pull/27605/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27605&range=25 Stats: 8347 lines in 60 files changed: 3738 ins; 4490 del; 119 mod Patch: https://git.openjdk.org/jdk/pull/27605.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27605/head:pull/27605 PR: https://git.openjdk.org/jdk/pull/27605 From mcimadamore at openjdk.org Mon Nov 17 11:19:15 2025 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Mon, 17 Nov 2025 11:19:15 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v26] In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 09:32:02 GMT, Per Minborg wrote: >> Implement JEP 526: Lazy Constants (Second Preview) >> >> The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. >> >> The old benchmarks are not moved/renamed to allow comparison with previous releases. >> >> `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. > > Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 125 commits: > > - Merge branch 'master' into lazy-constants > - Merge master > - Fix tests and improve docs > - Remove inner classes in LazyList > - Fix TOC TOU issue > - Improve documentation for List and Map factories > - Improve doc details > - Improve text for hashCode() > - Refine text about reachabilit of the contents > - Align doc links for get() > - ... and 115 more: https://git.openjdk.org/jdk/compare/69e30244...3c26e095 src/java.base/share/classes/java/lang/LazyConstant.java line 244: > 242: *

> 243: * In other words, equals compares the identity of this lazy constant and {@code obj} > 244: * to determine equality. Hence, two lazy constant with the same contents are Suggestion: * to determine equality. Hence, two lazy constants with the same contents are ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2533674027 From pminborg at openjdk.org Mon Nov 17 11:29:03 2025 From: pminborg at openjdk.org (Per Minborg) Date: Mon, 17 Nov 2025 11:29:03 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v27] In-Reply-To: References: Message-ID: > Implement JEP 526: Lazy Constants (Second Preview) > > The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. > > The old benchmarks are not moved/renamed to allow comparison with previous releases. > > `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. Per Minborg has updated the pull request incrementally with one additional commit since the last revision: Fix forgotten text about (List|Map)::toString ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27605/files - new: https://git.openjdk.org/jdk/pull/27605/files/3c26e095..2d8f98fe Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27605&range=26 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27605&range=25-26 Stats: 10 lines in 2 files changed: 0 ins; 0 del; 10 mod Patch: https://git.openjdk.org/jdk/pull/27605.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27605/head:pull/27605 PR: https://git.openjdk.org/jdk/pull/27605 From pminborg at openjdk.org Mon Nov 17 11:38:03 2025 From: pminborg at openjdk.org (Per Minborg) Date: Mon, 17 Nov 2025 11:38:03 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v28] In-Reply-To: References: Message-ID: > Implement JEP 526: Lazy Constants (Second Preview) > > The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. > > The old benchmarks are not moved/renamed to allow comparison with previous releases. > > `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. Per Minborg has updated the pull request incrementally with one additional commit since the last revision: Fix typo ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27605/files - new: https://git.openjdk.org/jdk/pull/27605/files/2d8f98fe..e5399c5f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27605&range=27 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27605&range=26-27 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27605.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27605/head:pull/27605 PR: https://git.openjdk.org/jdk/pull/27605 From mcimadamore at openjdk.org Mon Nov 17 11:38:04 2025 From: mcimadamore at openjdk.org (Maurizio Cimadamore) Date: Mon, 17 Nov 2025 11:38:04 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v28] In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 11:34:21 GMT, Per Minborg wrote: >> Implement JEP 526: Lazy Constants (Second Preview) >> >> The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. >> >> The old benchmarks are not moved/renamed to allow comparison with previous releases. >> >> `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. > > Per Minborg has updated the pull request incrementally with one additional commit since the last revision: > > Fix typo Great work! ------------- Marked as reviewed by mcimadamore (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27605#pullrequestreview-3472270393 From duke at openjdk.org Mon Nov 17 13:26:20 2025 From: duke at openjdk.org (David Beaumont) Date: Mon, 17 Nov 2025 13:26:20 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v28] In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 11:38:03 GMT, Per Minborg wrote: >> Implement JEP 526: Lazy Constants (Second Preview) >> >> The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. >> >> The old benchmarks are not moved/renamed to allow comparison with previous releases. >> >> `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. > > Per Minborg has updated the pull request incrementally with one additional commit since the last revision: > > Fix typo I've had a look mostly at the docs, everything I'm saying is optional (though I'd really like to see the Logger example changed). src/java.base/share/classes/java/lang/LazyConstant.java line 42: > 40: * A lazy constant is created using the factory method > 41: * {@linkplain LazyConstant#of(Supplier) LazyConstant.of({@code })}. > 42: * When created, the lazy constant is not initialized, meaning it has no contents. Subjectively, might this be clearer as a bulleted list? This is a sequence of statements about the state transitions after all.

  • On creation the lazy constant is not initialized ...
  • The first time {@linkplain #get() get()} is called ...
  • Once a lazy constant is initialized ... Or just splitting by paragraph. src/java.base/share/classes/java/lang/LazyConstant.java line 60: > 58: * private final LazyConstant logger = > 59: * // @link substring="of" target="#of" : > 60: * LazyConstant.of( () -> Logger.create(Component.class) ); We had previously talked about whether the `Logger` example is a good one. Personally I think it's a bad example if it encourages people to use loggers this way since: * non static loggers aren't suitable to logging in static methods. * The Logger framework has a perfectly functional mechanism for injecting static logger instances. * Over-use of non-static logger instances pollutes internal APIs and ends up leaking a dependency on a specific logger instance, making refactoring hard. src/java.base/share/classes/java/lang/LazyConstant.java line 66: > 64: * // ... > 65: * } > 66: * } Arguably weird/wrong indents on closing '}' ? src/java.base/share/classes/java/lang/LazyConstant.java line 241: > 239: > 240: /** > 241: * {@return if this lazy constant is the same as the provided {@code obj}} Maybe say "is the same instance as ...", then you might be able to shorten the "In other words" paragraph below as they sort of say the same thing in almost the same words. As a reader I'm more interested in *why* this slightly unexpected behaviour happens. Maybe a section in the class level docs, linked from here, explaining the issues with using the content for equals/hashCode would be better (that can also talk about lazy constants being mostly unsuitable as key types). src/java.base/share/classes/java/lang/LazyConstant.java line 283: > 281: *

    > 282: * The returned lazy constant strongly references the provided > 283: * {@code computingFunction} at least until initialization completes successfully. As a reader I'm a bit nervous that I don't know if it will ever drop the function. Suppose my init relies on something chunky I want to be sure has gone away? src/java.base/share/classes/java/nio/charset/Charset.java line 1: > 1: /* Side note: I'm slightly surprised to see the introduction and the usage happening in the same PR. Is this really being submitting in one go? src/java.base/share/classes/java/nio/charset/Charset.java line 619: > 617: > 618: private static final LazyConstant defaultCharset = LazyConstant.of( > 619: new Supplier<>() { public Charset get() { return defaultCharset0(); }}); Can these not be done with lambdas? src/java.base/share/classes/java/util/List.java line 1210: > 1208: * invoked at most once per list index, even in a multi-threaded environment. > 1209: * Competing threads accessing an element already under computation will block until > 1210: * an element is computed or the computing function completes abnormally Missing full-stop. src/java.base/share/classes/java/util/List.java line 1238: > 1236: *

    > 1237: * The returned lazy list strongly references its computing > 1238: * function used to compute elements at least so long as there are uninitialized "at least so long as" sounds weird to me. I think you would say either: * "... at least *as* long as there are uninitialized elmements." * "... so long as there are uninitialized elmements." But you could always say: * "... while there are uninitialized elements" ------------- PR Review: https://git.openjdk.org/jdk/pull/27605#pullrequestreview-3472336926 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2533786705 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2533801082 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2533773546 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2533830776 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2533836397 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2533841573 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2533846906 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2533855814 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2533865784 From pminborg at openjdk.org Mon Nov 17 13:34:30 2025 From: pminborg at openjdk.org (Per Minborg) Date: Mon, 17 Nov 2025 13:34:30 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v28] In-Reply-To: References: Message-ID: <6LpdzFJhGUHodyEKeOMXvKH9nYsPhz7oDM6k4NpNsNE=.2f8b7bd1-2886-48b7-9f97-22b3b8ed7368@github.com> On Mon, 17 Nov 2025 12:16:52 GMT, David Beaumont wrote: >> Per Minborg has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix typo > > src/java.base/share/classes/java/nio/charset/Charset.java line 1: > >> 1: /* > > Side note: I'm slightly surprised to see the introduction and the usage happening in the same PR. Is this really being submitting in one go? I've replaced `StableValue` with `LazyConstant`. So there is no new introduction, but just an adaptation. > src/java.base/share/classes/java/nio/charset/Charset.java line 619: > >> 617: >> 618: private static final LazyConstant defaultCharset = LazyConstant.of( >> 619: new Supplier<>() { public Charset get() { return defaultCharset0(); }}); > > Can these not be done with lambdas? They can, but I wanted to keep it verbatim to the existing code. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2534085547 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2534087249 From jvernee at openjdk.org Mon Nov 17 16:52:17 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Mon, 17 Nov 2025 16:52:17 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v28] In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 11:38:03 GMT, Per Minborg wrote: >> Implement JEP 526: Lazy Constants (Second Preview) >> >> The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. >> >> The old benchmarks are not moved/renamed to allow comparison with previous releases. >> >> `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. > > Per Minborg has updated the pull request incrementally with one additional commit since the last revision: > > Fix typo test/jdk/java/lang/LazyConstant/LazyConstantTest.java line 234: > 232: return new Lazy<>(LazyConstant.of(computingFunction)); > 233: } > 234: } This appears to be unused? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2534822362 From jvernee at openjdk.org Mon Nov 17 17:11:14 2025 From: jvernee at openjdk.org (Jorn Vernee) Date: Mon, 17 Nov 2025 17:11:14 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v28] In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 11:38:03 GMT, Per Minborg wrote: >> Implement JEP 526: Lazy Constants (Second Preview) >> >> The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. >> >> The old benchmarks are not moved/renamed to allow comparison with previous releases. >> >> `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. > > Per Minborg has updated the pull request incrementally with one additional commit since the last revision: > > Fix typo Marked as reviewed by jvernee (Reviewer). test/jdk/java/lang/LazyConstant/LazyListTest.java line 27: > 25: * @summary Basic tests for lazy list methods > 26: * @enablePreview > 27: * @run junit/othervm --add-opens java.base/java.util=ALL-UNNAMED LazyListTest I think you can do this with Suggestion: * @modules java.base/java.util:+open * @run junit LazyListTest ------------- PR Review: https://git.openjdk.org/jdk/pull/27605#pullrequestreview-3473667773 PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2534826477 From naoto at openjdk.org Mon Nov 17 19:15:50 2025 From: naoto at openjdk.org (Naoto Sato) Date: Mon, 17 Nov 2025 19:15:50 GMT Subject: RFR: 8346944: Update Unicode Data Files to 17.0.0 [v2] In-Reply-To: References: Message-ID: > Updates the JDK to use the latest Unicode 17.0.0, which also updates the ICU4J along with it ([8346947](https://bugs.openjdk.org/browse/JDK-8346947) > Update ICU4J to Version 78.1). The corresponding CSR has already been approved. Naoto Sato 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 11 additional commits since the last revision: - Merge branch 'master' into JDK-8346944-Unicode-17 - icudata path fix - Update versions - icu4j final - .md file changes - 17.0 final - icudata78b(binary) - CaseFolding.text -> 17, copyright symbol as is - icudt78b - 17-beta - ... and 1 more: https://git.openjdk.org/jdk/compare/c26db986...088cdaea ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28093/files - new: https://git.openjdk.org/jdk/pull/28093/files/d9cff00a..088cdaea Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28093&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28093&range=00-01 Stats: 7827 lines in 200 files changed: 5016 ins; 1574 del; 1237 mod Patch: https://git.openjdk.org/jdk/pull/28093.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28093/head:pull/28093 PR: https://git.openjdk.org/jdk/pull/28093 From joehw at openjdk.org Tue Nov 18 05:11:13 2025 From: joehw at openjdk.org (Joe Wang) Date: Tue, 18 Nov 2025 05:11:13 GMT Subject: RFR: 8346944: Update Unicode Data Files to 17.0.0 [v2] In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 19:15:50 GMT, Naoto Sato wrote: >> Updates the JDK to use the latest Unicode 17.0.0, which also updates the ICU4J along with it ([8346947](https://bugs.openjdk.org/browse/JDK-8346947) >> Update ICU4J to Version 78.1). The corresponding CSR has already been approved. > > Naoto Sato 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 11 additional commits since the last revision: > > - Merge branch 'master' into JDK-8346944-Unicode-17 > - icudata path fix > - Update versions > - icu4j final > - .md file changes > - 17.0 final > - icudata78b(binary) > - CaseFolding.text -> 17, copyright symbol as is > - icudt78b > - 17-beta > - ... and 1 more: https://git.openjdk.org/jdk/compare/2b28d8c0...088cdaea LGTM. src/java.base/share/classes/jdk/internal/icu/util/VersionInfo.java line 57: > 55: */ > 56: @Deprecated > 57: public static final String ICU_DATA_VERSION_PATH = "78b"; Now with fixed path "icudata", this seems to be no longer used. ------------- Marked as reviewed by joehw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28093#pullrequestreview-3475474397 PR Review Comment: https://git.openjdk.org/jdk/pull/28093#discussion_r2536321176 From duke at openjdk.org Tue Nov 18 11:14:53 2025 From: duke at openjdk.org (ExE Boss) Date: Tue, 18 Nov 2025 11:14:53 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v28] In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 11:38:03 GMT, Per Minborg wrote: >> Implement JEP 526: Lazy Constants (Second Preview) >> >> The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. >> >> The old benchmarks are not moved/renamed to allow comparison with previous releases. >> >> `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. > > Per Minborg has updated the pull request incrementally with one additional commit since the last revision: > > Fix typo Wrt. replacing?`StableValue` with?a?`VarHandle` access?mode, that?has the?downside of?the?variable not?being constant?foldable[^1], as?the?`@Stable`?annotation is?only?available to?the?system?domain class?loaders (bootstrap?and?platform). [^1]: Without making?use of?`-Xbootclasspath/a:?`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27605#issuecomment-3547013114 From pminborg at openjdk.org Tue Nov 18 12:19:34 2025 From: pminborg at openjdk.org (Per Minborg) Date: Tue, 18 Nov 2025 12:19:34 GMT Subject: RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v28] In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 11:38:03 GMT, Per Minborg wrote: >> Implement JEP 526: Lazy Constants (Second Preview) >> >> The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. >> >> The old benchmarks are not moved/renamed to allow comparison with previous releases. >> >> `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. > > Per Minborg has updated the pull request incrementally with one additional commit since the last revision: > > Fix typo > Wrt. replacing?`StableValue` with?a?`VarHandle` access?mode, that?has the?downside of?the?variable not?being constant?foldable[1](#user-content-fn-1-dd52c5569368829688622e7b8db815eb), as?the?`@Stable`?annotation is?only?available to?the?system?domain class?loaders (bootstrap?and?platform). We think we can solve that. Stay tuned. I will integrate this PR now. There are outstanding comments in this PR that I will address in a separate follow-up PR. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27605#issuecomment-3547354435 PR Comment: https://git.openjdk.org/jdk/pull/27605#issuecomment-3547357897 From pminborg at openjdk.org Tue Nov 18 12:24:52 2025 From: pminborg at openjdk.org (Per Minborg) Date: Tue, 18 Nov 2025 12:24:52 GMT Subject: Integrated: 8366178: Implement JEP 526: Lazy Constants (Second Preview) In-Reply-To: References: Message-ID: On Thu, 2 Oct 2025 10:51:08 GMT, Per Minborg wrote: > Implement JEP 526: Lazy Constants (Second Preview) > > The lazy list/map implementations are broken out from `ImmutableCollections` to a separate class. > > The old benchmarks are not moved/renamed to allow comparison with previous releases. > > `java.util.Optional` is updated so that its field is annotated with `@Stable`. This is to allow `Optional` instances to be held in lazy constants and still provide constant folding. This pull request has now been integrated. Changeset: f9464499 Author: Per Minborg URL: https://git.openjdk.org/jdk/commit/f94644999766e752f7d60ce52c14a7db79005035 Stats: 8347 lines in 60 files changed: 3738 ins; 4490 del; 119 mod 8366178: Implement JEP 526: Lazy Constants (Second Preview) 8371882: Improve documentation for JEP 526: Lazy Constants Reviewed-by: jvernee, mcimadamore ------------- PR: https://git.openjdk.org/jdk/pull/27605 From naoto at openjdk.org Tue Nov 18 16:01:37 2025 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 18 Nov 2025 16:01:37 GMT Subject: RFR: 8346944: Update Unicode Data Files to 17.0.0 [v2] In-Reply-To: References: Message-ID: On Tue, 18 Nov 2025 05:08:10 GMT, Joe Wang wrote: >> Naoto Sato 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 11 additional commits since the last revision: >> >> - Merge branch 'master' into JDK-8346944-Unicode-17 >> - icudata path fix >> - Update versions >> - icu4j final >> - .md file changes >> - 17.0 final >> - icudata78b(binary) >> - CaseFolding.text -> 17, copyright symbol as is >> - icudt78b >> - 17-beta >> - ... and 1 more: https://git.openjdk.org/jdk/compare/1164d56b...088cdaea > > src/java.base/share/classes/jdk/internal/icu/util/VersionInfo.java line 57: > >> 55: */ >> 56: @Deprecated >> 57: public static final String ICU_DATA_VERSION_PATH = "78b"; > > Now with fixed path "icudata", this seems to be no longer used. Correct. The change was in the upstream which was just merged to our codebase: https://github.com/unicode-org/icu/commit/d93b8bb3443e02c4845eaf31859194ebeaa05232#diff-2d49053b635edae3d63d88a8b058994e7b156a50d5056ac0fb3bbfe5daa7c4e4L242 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28093#discussion_r2538755579 From naoto at openjdk.org Tue Nov 18 18:35:08 2025 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 18 Nov 2025 18:35:08 GMT Subject: RFR: 8346944: Update Unicode Data Files to 17.0.0 [v2] In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 19:15:50 GMT, Naoto Sato wrote: >> Updates the JDK to use the latest Unicode 17.0.0, which also updates the ICU4J along with it ([8346947](https://bugs.openjdk.org/browse/JDK-8346947) >> Update ICU4J to Version 78.1). The corresponding CSR has already been approved. > > Naoto Sato 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 11 additional commits since the last revision: > > - Merge branch 'master' into JDK-8346944-Unicode-17 > - icudata path fix > - Update versions > - icu4j final > - .md file changes > - 17.0 final > - icudata78b(binary) > - CaseFolding.text -> 17, copyright symbol as is > - icudt78b > - 17-beta > - ... and 1 more: https://git.openjdk.org/jdk/compare/5b5b354e...088cdaea Thanks for the review! ------------- PR Comment: https://git.openjdk.org/jdk/pull/28093#issuecomment-3549048474 From naoto at openjdk.org Tue Nov 18 18:39:20 2025 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 18 Nov 2025 18:39:20 GMT Subject: Integrated: 8346944: Update Unicode Data Files to 17.0.0 In-Reply-To: References: Message-ID: On Fri, 31 Oct 2025 20:53:16 GMT, Naoto Sato wrote: > Updates the JDK to use the latest Unicode 17.0.0, which also updates the ICU4J along with it ([8346947](https://bugs.openjdk.org/browse/JDK-8346947) > Update ICU4J to Version 78.1). The corresponding CSR has already been approved. This pull request has now been integrated. Changeset: 4a975637 Author: Naoto Sato URL: https://git.openjdk.org/jdk/commit/4a975637a144fa8aa449a1419e656721833513b5 Stats: 2977 lines in 35 files changed: 1345 ins; 650 del; 982 mod 8346944: Update Unicode Data Files to 17.0.0 8346947: Update ICU4J to Version 78.1 Reviewed-by: joehw ------------- PR: https://git.openjdk.org/jdk/pull/28093 From jlu at openjdk.org Tue Nov 18 18:51:19 2025 From: jlu at openjdk.org (Justin Lu) Date: Tue, 18 Nov 2025 18:51:19 GMT Subject: RFR: 8346944: Update Unicode Data Files to 17.0.0 [v2] In-Reply-To: References: Message-ID: On Mon, 17 Nov 2025 19:15:50 GMT, Naoto Sato wrote: >> Updates the JDK to use the latest Unicode 17.0.0, which also updates the ICU4J along with it ([8346947](https://bugs.openjdk.org/browse/JDK-8346947) >> Update ICU4J to Version 78.1). The corresponding CSR has already been approved. > > Naoto Sato 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 11 additional commits since the last revision: > > - Merge branch 'master' into JDK-8346944-Unicode-17 > - icudata path fix > - Update versions > - icu4j final > - .md file changes > - 17.0 final > - icudata78b(binary) > - CaseFolding.text -> 17, copyright symbol as is > - icudt78b > - 17-beta > - ... and 1 more: https://git.openjdk.org/jdk/compare/40595ac9...088cdaea lgtm. (Looks like I missed integration by a few minutes; perhaps my comment can go into Unicode 18) src/java.base/share/classes/java/lang/Character.java line 746: > 744: public static final class UnicodeBlock extends Subset { > 745: /** > 746: * NUM_ENTITIES should match the total number of UnicodeBlocks. I thought at first `NUM_ENTITIES` should be 790 due to 8 new `UnicodeBlock`s being added. However, it does go up to 804, becasue the total number includes the identifiers _and_ aliases (which is still a single `UnicodeBlock`). I think that distinction is worth correcting in the comment. ------------- PR Review: https://git.openjdk.org/jdk/pull/28093#pullrequestreview-3479235676 PR Review Comment: https://git.openjdk.org/jdk/pull/28093#discussion_r2539282547 From naoto at openjdk.org Tue Nov 18 19:31:20 2025 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 18 Nov 2025 19:31:20 GMT Subject: RFR: 8346944: Update Unicode Data Files to 17.0.0 [v2] In-Reply-To: References: Message-ID: On Tue, 18 Nov 2025 18:35:07 GMT, Justin Lu wrote: >> Naoto Sato 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 11 additional commits since the last revision: >> >> - Merge branch 'master' into JDK-8346944-Unicode-17 >> - icudata path fix >> - Update versions >> - icu4j final >> - .md file changes >> - 17.0 final >> - icudata78b(binary) >> - CaseFolding.text -> 17, copyright symbol as is >> - icudt78b >> - 17-beta >> - ... and 1 more: https://git.openjdk.org/jdk/compare/e05cdfee...088cdaea > > src/java.base/share/classes/java/lang/Character.java line 746: > >> 744: public static final class UnicodeBlock extends Subset { >> 745: /** >> 746: * NUM_ENTITIES should match the total number of UnicodeBlocks. > > I thought at first `NUM_ENTITIES` should be 790 due to 8 new `UnicodeBlock`s being added. However, it does go up to 804, becasue the total number includes the identifiers _and_ aliases (which is still a single `UnicodeBlock`). I think that distinction is worth correcting in the comment. Good point. Filed: https://bugs.openjdk.org/browse/JDK-8372117 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28093#discussion_r2539417303 From naoto at openjdk.org Wed Nov 19 19:52:11 2025 From: naoto at openjdk.org (Naoto Sato) Date: Wed, 19 Nov 2025 19:52:11 GMT Subject: RFR: 8372117: Correct the misleading comment in Character.UnicodeBlock Message-ID: Trivial comment fix in `Character.UnicodeBlock` ------------- Commit messages: - initial commit Changes: https://git.openjdk.org/jdk/pull/28401/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28401&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8372117 Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28401.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28401/head:pull/28401 PR: https://git.openjdk.org/jdk/pull/28401 From bpb at openjdk.org Wed Nov 19 20:13:23 2025 From: bpb at openjdk.org (Brian Burkhalter) Date: Wed, 19 Nov 2025 20:13:23 GMT Subject: RFR: 8372117: Correct the misleading comment in Character.UnicodeBlock In-Reply-To: References: Message-ID: On Wed, 19 Nov 2025 19:45:34 GMT, Naoto Sato wrote: > Trivial comment fix in `Character.UnicodeBlock` Looks all right to me. ------------- Marked as reviewed by bpb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28401#pullrequestreview-3484556929 From joehw at openjdk.org Wed Nov 19 21:28:22 2025 From: joehw at openjdk.org (Joe Wang) Date: Wed, 19 Nov 2025 21:28:22 GMT Subject: RFR: 8372117: Correct the misleading comment in Character.UnicodeBlock In-Reply-To: References: Message-ID: On Wed, 19 Nov 2025 19:45:34 GMT, Naoto Sato wrote: > Trivial comment fix in `Character.UnicodeBlock` Marked as reviewed by joehw (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28401#pullrequestreview-3484801309 From jlu at openjdk.org Wed Nov 19 21:44:56 2025 From: jlu at openjdk.org (Justin Lu) Date: Wed, 19 Nov 2025 21:44:56 GMT Subject: RFR: 8372117: Correct the misleading comment in Character.UnicodeBlock In-Reply-To: References: Message-ID: On Wed, 19 Nov 2025 19:45:34 GMT, Naoto Sato wrote: > Trivial comment fix in `Character.UnicodeBlock` Marked as reviewed by jlu (Committer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28401#pullrequestreview-3484852437 From dfuchs at openjdk.org Thu Nov 20 12:26:21 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Thu, 20 Nov 2025 12:26:21 GMT Subject: RFR: 8372198: Avoid closing PlainHttpConnection while holding a lock [v2] In-Reply-To: References: Message-ID: > An experimental change to SelectorManager::shutdown unveil a potential deadlock between the SelectorManager thread trying to stop the HttpClientImpl, and an executor thread concurrently trying to return a connection to the pool. > > The issue seems to be caused by the ConnectionPool::returnToPool trying to close the returned connection when stopping, while holding the ConnectionPool state lock, and the SelectorManager thread trying to close a pooled connection, holding the connection stateLock and trying to close the channel, which caused the CleanupTrigger to fire and attempt to remove the connection from the pool. > > This problem was observed once with the java/net/httpclient/ThrowingSubscribersAsLimitingAsync.java test. > > To avoid the problem, the proposed fix is to wait until the ConnectionPool::stateLock has been released before actually closing the connection, and to wait until the PlainHttpConnection::stateLock has been released before actually closing the channel. Indeed, there should be no need to close those while holding the lock. Daniel Fuchs 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 'SelectorManagerVT-8372159' into ConnectionCloseLock-8372198 - 8372198: Avoid closing PlainHttpConnection while holding a lock ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28421/files - new: https://git.openjdk.org/jdk/pull/28421/files/177e7ee3..97ce3737 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28421&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28421&range=00-01 Stats: 19751 lines in 348 files changed: 10987 ins; 5712 del; 3052 mod Patch: https://git.openjdk.org/jdk/pull/28421.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28421/head:pull/28421 PR: https://git.openjdk.org/jdk/pull/28421 From dfuchs at openjdk.org Thu Nov 20 12:26:22 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Thu, 20 Nov 2025 12:26:22 GMT Subject: RFR: 8372198: Avoid closing PlainHttpConnection while holding a lock In-Reply-To: References: Message-ID: On Thu, 20 Nov 2025 10:38:08 GMT, Daniel Fuchs wrote: > An experimental change to SelectorManager::shutdown unveil a potential deadlock between the SelectorManager thread trying to stop the HttpClientImpl, and an executor thread concurrently trying to return a connection to the pool. > > The issue seems to be caused by the ConnectionPool::returnToPool trying to close the returned connection when stopping, while holding the ConnectionPool state lock, and the SelectorManager thread trying to close a pooled connection, holding the connection stateLock and trying to close the channel, which caused the CleanupTrigger to fire and attempt to remove the connection from the pool. > > This problem was observed once with the java/net/httpclient/ThrowingSubscribersAsLimitingAsync.java test. > > To avoid the problem, the proposed fix is to wait until the ConnectionPool::stateLock has been released before actually closing the connection, and to wait until the PlainHttpConnection::stateLock has been released before actually closing the channel. Indeed, there should be no need to close those while holding the lock. Something went wrong when I tried to merge the main PR branch in the dependent PR branch. I'm going to withdraw this PR and start again. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28421#issuecomment-3557752299 From dfuchs at openjdk.org Thu Nov 20 12:26:23 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Thu, 20 Nov 2025 12:26:23 GMT Subject: Withdrawn: 8372198: Avoid closing PlainHttpConnection while holding a lock In-Reply-To: References: Message-ID: On Thu, 20 Nov 2025 10:38:08 GMT, Daniel Fuchs wrote: > An experimental change to SelectorManager::shutdown unveil a potential deadlock between the SelectorManager thread trying to stop the HttpClientImpl, and an executor thread concurrently trying to return a connection to the pool. > > The issue seems to be caused by the ConnectionPool::returnToPool trying to close the returned connection when stopping, while holding the ConnectionPool state lock, and the SelectorManager thread trying to close a pooled connection, holding the connection stateLock and trying to close the channel, which caused the CleanupTrigger to fire and attempt to remove the connection from the pool. > > This problem was observed once with the java/net/httpclient/ThrowingSubscribersAsLimitingAsync.java test. > > To avoid the problem, the proposed fix is to wait until the ConnectionPool::stateLock has been released before actually closing the connection, and to wait until the PlainHttpConnection::stateLock has been released before actually closing the channel. Indeed, there should be no need to close those while holding the lock. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/28421 From naoto at openjdk.org Thu Nov 20 18:57:39 2025 From: naoto at openjdk.org (Naoto Sato) Date: Thu, 20 Nov 2025 18:57:39 GMT Subject: Integrated: 8372117: Correct the misleading comment in Character.UnicodeBlock In-Reply-To: References: Message-ID: On Wed, 19 Nov 2025 19:45:34 GMT, Naoto Sato wrote: > Trivial comment fix in `Character.UnicodeBlock` This pull request has now been integrated. Changeset: 41d6dc3a Author: Naoto Sato URL: https://git.openjdk.org/jdk/commit/41d6dc3a15fd3041aaee7b9b7f7980ede5f7940d Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod 8372117: Correct the misleading comment in Character.UnicodeBlock Reviewed-by: bpb, joehw, jlu ------------- PR: https://git.openjdk.org/jdk/pull/28401 From naoto at openjdk.org Thu Nov 20 18:57:38 2025 From: naoto at openjdk.org (Naoto Sato) Date: Thu, 20 Nov 2025 18:57:38 GMT Subject: RFR: 8372117: Correct the misleading comment in Character.UnicodeBlock In-Reply-To: References: Message-ID: On Wed, 19 Nov 2025 19:45:34 GMT, Naoto Sato wrote: > Trivial comment fix in `Character.UnicodeBlock` Thanks for the reviews! ------------- PR Comment: https://git.openjdk.org/jdk/pull/28401#issuecomment-3559565354 From jlu at openjdk.org Thu Nov 20 23:03:50 2025 From: jlu at openjdk.org (Justin Lu) Date: Thu, 20 Nov 2025 23:03:50 GMT Subject: RFR: 8368001: java/text/Format/NumberFormat/NumberRoundTrip.java timed out Message-ID: JDK-8260555 exposed test/jdk/java/text/Format/NumberFormat/NumberRoundTrip.java as being susceptible to timeouts. While the timeout factor is reverted, this test was testing too many inputs, and should be changed. Originally, it was testing (~1000 locales * 4 factories) against ~30 numeric inputs. The test does not need to be exhaustive to this degree. The total amount of locales is changed to sample around a 1/4 of those provided by the provider. The numeric inputs are reduced to about ~20. (The fixed ones remain, and the random ones are cut in half.) Locally, I observe average execution for this test to be about ~1.3 seconds, compared to ~3.4 seconds previously. The PR also does a drive-by clean up of the test, i.e. getting rid of the unnecessary escaping + string manipulation/printing and separating the test inputs from the actual testing work done. ------------- Commit messages: - init Changes: https://git.openjdk.org/jdk/pull/28443/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28443&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8368001 Stats: 225 lines in 1 file changed: 54 ins; 131 del; 40 mod Patch: https://git.openjdk.org/jdk/pull/28443.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28443/head:pull/28443 PR: https://git.openjdk.org/jdk/pull/28443 From rgiulietti at openjdk.org Fri Nov 21 13:10:53 2025 From: rgiulietti at openjdk.org (Raffaello Giulietti) Date: Fri, 21 Nov 2025 13:10:53 GMT Subject: RFR: 8368001: java/text/Format/NumberFormat/NumberRoundTrip.java timed out In-Reply-To: References: Message-ID: <0KRtSwwkeSYFhfOzbHgRyl1M_1tG4lCdVfCt0tm_UF8=.0a88331a-2385-4c1b-abbb-a84757bd1fa6@github.com> On Thu, 20 Nov 2025 22:55:41 GMT, Justin Lu wrote: > JDK-8260555 exposed test/jdk/java/text/Format/NumberFormat/NumberRoundTrip.java as being susceptible to timeouts. > While the timeout factor is reverted, this test was testing too many inputs, and should be changed. > Originally, it was testing (~1000 locales * 4 factories) against ~30 numeric inputs. The test does not need to be exhaustive to this degree. > > The total amount of locales is changed to sample around a 1/4 of those provided by the provider. The numeric inputs are reduced to about ~20. (The fixed ones remain, and the random ones are cut in half.) > > Locally, I observe average execution for this test to be about ~1.3 seconds, compared to ~3.4 seconds previously. The PR also does a drive-by clean up of the test, i.e. getting rid of the unnecessary escaping + string manipulation/printing and separating the test inputs from the actual testing work done. test/jdk/java/text/Format/NumberFormat/NumberRoundTrip.java line 143: > 141: // Return a random value from -range..+range. > 142: private static double randomDouble(double range) { > 143: double a = Math.random(); I would suggest using `jdk.test.lib.RandomFactory`, as this supports reproducible values in case of a randomised test failure. import jdk.test.lib.RandomFactory; ... * @library /test/lib * @build jdk.test.lib.RandomFactory ... private static final Random RANDOM = RandomFactory.getRandom(); ... private static double randomDouble(double range) { double a = RANDOM.nextDouble(); ... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28443#discussion_r2549709717 From jlu at openjdk.org Fri Nov 21 17:47:43 2025 From: jlu at openjdk.org (Justin Lu) Date: Fri, 21 Nov 2025 17:47:43 GMT Subject: RFR: 8368001: java/text/Format/NumberFormat/NumberRoundTrip.java timed out [v2] In-Reply-To: References: Message-ID: <_7ucLGYWHQwIJ8KPWgpamZ19-VkYxbsc-eLiMKom2js=.ccc81eab-7be0-4d6d-98f5-b315ab4c05a5@github.com> > JDK-8260555 exposed test/jdk/java/text/Format/NumberFormat/NumberRoundTrip.java as being susceptible to timeouts. > While the timeout factor is reverted, this test was testing too many inputs, and should be changed. > Originally, it was testing (~1000 locales * 4 factories) against ~30 numeric inputs. The test does not need to be exhaustive to this degree. > > The total amount of locales is changed to sample around a 1/4 of those provided by the provider. The numeric inputs are reduced to about ~20. (The fixed ones remain, and the random ones are cut in half.) > > Locally, I observe average execution for this test to be about ~1.3 seconds, compared to ~3.4 seconds previously. The PR also does a drive-by clean up of the test, i.e. getting rid of the unnecessary escaping + string manipulation/printing and separating the test inputs from the actual testing work done. Justin Lu has updated the pull request incrementally with one additional commit since the last revision: Use jdk.test.lib.RandomFactory ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28443/files - new: https://git.openjdk.org/jdk/pull/28443/files/bf14ea50..dca988e7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28443&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28443&range=00-01 Stats: 9 lines in 1 file changed: 6 ins; 1 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/28443.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28443/head:pull/28443 PR: https://git.openjdk.org/jdk/pull/28443 From jlu at openjdk.org Fri Nov 21 17:47:44 2025 From: jlu at openjdk.org (Justin Lu) Date: Fri, 21 Nov 2025 17:47:44 GMT Subject: RFR: 8368001: java/text/Format/NumberFormat/NumberRoundTrip.java timed out [v2] In-Reply-To: <0KRtSwwkeSYFhfOzbHgRyl1M_1tG4lCdVfCt0tm_UF8=.0a88331a-2385-4c1b-abbb-a84757bd1fa6@github.com> References: <0KRtSwwkeSYFhfOzbHgRyl1M_1tG4lCdVfCt0tm_UF8=.0a88331a-2385-4c1b-abbb-a84757bd1fa6@github.com> Message-ID: On Fri, 21 Nov 2025 13:07:26 GMT, Raffaello Giulietti wrote: >> Justin Lu has updated the pull request incrementally with one additional commit since the last revision: >> >> Use jdk.test.lib.RandomFactory > > test/jdk/java/text/Format/NumberFormat/NumberRoundTrip.java line 143: > >> 141: // Return a random value from -range..+range. >> 142: private static double randomDouble(double range) { >> 143: double a = Math.random(); > > I would suggest using `jdk.test.lib.RandomFactory`, as this supports reproducible values in case of a randomised test failure. > > > import jdk.test.lib.RandomFactory; > ... > * @library /test/lib > * @build jdk.test.lib.RandomFactory > ... > private static final Random RANDOM = RandomFactory.getRandom(); > ... > private static double randomDouble(double range) { > double a = RANDOM.nextDouble(); > ... Thanks for the improvement, updated in https://github.com/openjdk/jdk/pull/28443/commits/dca988e7ddb51306c2f791eae5e9071c85796eb7. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28443#discussion_r2550523057 From naoto at openjdk.org Fri Nov 21 18:49:56 2025 From: naoto at openjdk.org (Naoto Sato) Date: Fri, 21 Nov 2025 18:49:56 GMT Subject: RFR: 8368001: java/text/Format/NumberFormat/NumberRoundTrip.java timed out [v2] In-Reply-To: <_7ucLGYWHQwIJ8KPWgpamZ19-VkYxbsc-eLiMKom2js=.ccc81eab-7be0-4d6d-98f5-b315ab4c05a5@github.com> References: <_7ucLGYWHQwIJ8KPWgpamZ19-VkYxbsc-eLiMKom2js=.ccc81eab-7be0-4d6d-98f5-b315ab4c05a5@github.com> Message-ID: On Fri, 21 Nov 2025 17:47:43 GMT, Justin Lu wrote: >> JDK-8260555 exposed test/jdk/java/text/Format/NumberFormat/NumberRoundTrip.java as being susceptible to timeouts. >> While the timeout factor is reverted, this test was testing too many inputs, and should be changed. >> Originally, it was testing (~1000 locales * 4 factories) against ~30 numeric inputs. The test does not need to be exhaustive to this degree. >> >> The total amount of locales is changed to sample around a 1/4 of those provided by the provider. The numeric inputs are reduced to about ~20. (The fixed ones remain, and the random ones are cut in half.) >> >> Locally, I observe average execution for this test to be about ~1.3 seconds, compared to ~3.4 seconds previously. The PR also does a drive-by clean up of the test, i.e. getting rid of the unnecessary escaping + string manipulation/printing and separating the test inputs from the actual testing work done. > > Justin Lu has updated the pull request incrementally with one additional commit since the last revision: > > Use jdk.test.lib.RandomFactory Good refactoring. One minor comment below test/jdk/java/text/Format/NumberFormat/NumberRoundTrip.java line 29: > 27: * @summary NumberFormat round trip testing of parsing and formatting. > 28: * This test checks 4 factory instances per locale against ~20 numeric inputs. > 29: * Samples ~1/4 of the available locales from NumberFormat SPI. Nit: it is not using SPI ------------- PR Review: https://git.openjdk.org/jdk/pull/28443#pullrequestreview-3493973259 PR Review Comment: https://git.openjdk.org/jdk/pull/28443#discussion_r2550667418 From jlu at openjdk.org Fri Nov 21 19:07:26 2025 From: jlu at openjdk.org (Justin Lu) Date: Fri, 21 Nov 2025 19:07:26 GMT Subject: RFR: 8368001: java/text/Format/NumberFormat/NumberRoundTrip.java timed out [v3] In-Reply-To: References: Message-ID: > JDK-8260555 exposed test/jdk/java/text/Format/NumberFormat/NumberRoundTrip.java as being susceptible to timeouts. > While the timeout factor is reverted, this test was testing too many inputs, and should be changed. > Originally, it was testing (~1000 locales * 4 factories) against ~30 numeric inputs. The test does not need to be exhaustive to this degree. > > The total amount of locales is changed to sample around a 1/4 of those provided by the provider. The numeric inputs are reduced to about ~20. (The fixed ones remain, and the random ones are cut in half.) > > Locally, I observe average execution for this test to be about ~1.3 seconds, compared to ~3.4 seconds previously. The PR also does a drive-by clean up of the test, i.e. getting rid of the unnecessary escaping + string manipulation/printing and separating the test inputs from the actual testing work done. Justin Lu has updated the pull request incrementally with one additional commit since the last revision: terminology correction ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28443/files - new: https://git.openjdk.org/jdk/pull/28443/files/dca988e7..271dfc78 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28443&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28443&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/28443.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28443/head:pull/28443 PR: https://git.openjdk.org/jdk/pull/28443 From naoto at openjdk.org Fri Nov 21 19:34:09 2025 From: naoto at openjdk.org (Naoto Sato) Date: Fri, 21 Nov 2025 19:34:09 GMT Subject: RFR: 8368001: java/text/Format/NumberFormat/NumberRoundTrip.java timed out [v3] In-Reply-To: References: Message-ID: <1aQpcTDphKqw4_dfhCdh_lNgT6WSvcZLDmXAjtwIat0=.91bd3b7d-526b-4a2b-ad40-d8b913d39250@github.com> On Fri, 21 Nov 2025 19:07:26 GMT, Justin Lu wrote: >> JDK-8260555 exposed test/jdk/java/text/Format/NumberFormat/NumberRoundTrip.java as being susceptible to timeouts. >> While the timeout factor is reverted, this test was testing too many inputs, and should be changed. >> Originally, it was testing (~1000 locales * 4 factories) against ~30 numeric inputs. The test does not need to be exhaustive to this degree. >> >> The total amount of locales is changed to sample around a 1/4 of those provided by the provider. The numeric inputs are reduced to about ~20. (The fixed ones remain, and the random ones are cut in half.) >> >> Locally, I observe average execution for this test to be about ~1.3 seconds, compared to ~3.4 seconds previously. The PR also does a drive-by clean up of the test, i.e. getting rid of the unnecessary escaping + string manipulation/printing and separating the test inputs from the actual testing work done. > > Justin Lu has updated the pull request incrementally with one additional commit since the last revision: > > terminology correction Marked as reviewed by naoto (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28443#pullrequestreview-3494104119 From sherman at openjdk.org Fri Nov 21 23:56:05 2025 From: sherman at openjdk.org (Xueming Shen) Date: Fri, 21 Nov 2025 23:56:05 GMT Subject: RFR: 8365675: Add String Unicode Case-Folding Support [v10] In-Reply-To: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> References: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> Message-ID: <_VpQ_oPGP6BR3DP_ZfSDtevk2cwePjo95duU3NQloOk=.5d80b35b-fc4b-441d-8a0e-9e038047fff5@github.com> > ### Summary > > Case folding is a key operation for case-insensitive matching (e.g., string equality, regex matching), where the goal is to eliminate case distinctions without applying locale or language specific conversions. > > Currently, the JDK does not expose a direct API for Unicode-compliant case folding. Developers now rely on methods such as: > > **String.equalsIgnoreCase(String)** > > - Unicode-aware, locale-independent. > - Implementation uses Character.toLowerCase(Character.toUpperCase(int)) per code point. > - Limited: does not support 1:M mapping defined in Unicode case folding. > > **Character.toLowerCase(int) / Character.toUpperCase(int)** > > - Locale-independent, single code point only. > - No support for 1:M mappings. > > **String.toLowerCase(Locale.ROOT) / String.toUpperCase(Locale.ROOT)** > > - Based on Unicode SpecialCasing.txt, supports 1:M mappings. > - Intended primarily for presentation/display, not structural case-insensitive matching. > - Requires full string conversion before comparison, which is less efficient and not intended for structural matching. > > **1:M mapping example, U+00DF (?)** > > - String.toUpperCase(Locale.ROOT, "?") ? "SS" > - Case folding produces "ss", matching Unicode caseless comparison rules. > > > jshell> "\u00df".equalsIgnoreCase("ss") > $22 ==> false > > jshell> "\u00df".toUpperCase(Locale.ROOT).toLowerCase(Locale.ROOT).equals("ss") > $24 ==> true > > > ### Motivation & Direction > > Add Unicode standard-compliant case-less comparison methods to the String class, enabling & improving reliable and efficient Unicode-aware/compliant case-insensitive matching. > > - Unicode-compliant **full** case folding. > - Simpler, stable and more efficient case-less matching without workarounds. > - Brings Java's string comparison handling in line with other programming languages/libraries. > > This PR proposes to introduce the following comparison methods in `String` class > > - boolean equalsFoldCase(String anotherString) > - int compareToFoldCase(String anotherString) > - Comparator UNICODE_CASEFOLD_ORDER > > These methods are intended to be the preferred choice when Unicode-compliant case-less matching is required. > > *Note: An early draft also proposed a String.toCaseFold() method returning a new case-folded string. > However, during review this was considered error-prone, as the resulting string could easily be mistaken for a general transformation like toLowerCase() and then passed into APIs where case-folding semantics are not appropriate. > > ### The New API > > See CSR https://bugs.openjd... Xueming Shen has updated the pull request incrementally with one additional commit since the last revision: doc update - add spec tag ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27628/files - new: https://git.openjdk.org/jdk/pull/27628/files/057ea814..0aafb674 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27628&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27628&range=08-09 Stats: 6 lines in 1 file changed: 4 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/27628.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27628/head:pull/27628 PR: https://git.openjdk.org/jdk/pull/27628 From rriggs at openjdk.org Mon Nov 24 14:25:41 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Mon, 24 Nov 2025 14:25:41 GMT Subject: RFR: 8365675: Add String Unicode Case-Folding Support [v10] In-Reply-To: <_VpQ_oPGP6BR3DP_ZfSDtevk2cwePjo95duU3NQloOk=.5d80b35b-fc4b-441d-8a0e-9e038047fff5@github.com> References: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> <_VpQ_oPGP6BR3DP_ZfSDtevk2cwePjo95duU3NQloOk=.5d80b35b-fc4b-441d-8a0e-9e038047fff5@github.com> Message-ID: On Fri, 21 Nov 2025 23:56:05 GMT, Xueming Shen wrote: >> ### Summary >> >> Case folding is a key operation for case-insensitive matching (e.g., string equality, regex matching), where the goal is to eliminate case distinctions without applying locale or language specific conversions. >> >> Currently, the JDK does not expose a direct API for Unicode-compliant case folding. Developers now rely on methods such as: >> >> **String.equalsIgnoreCase(String)** >> >> - Unicode-aware, locale-independent. >> - Implementation uses Character.toLowerCase(Character.toUpperCase(int)) per code point. >> - Limited: does not support 1:M mapping defined in Unicode case folding. >> >> **Character.toLowerCase(int) / Character.toUpperCase(int)** >> >> - Locale-independent, single code point only. >> - No support for 1:M mappings. >> >> **String.toLowerCase(Locale.ROOT) / String.toUpperCase(Locale.ROOT)** >> >> - Based on Unicode SpecialCasing.txt, supports 1:M mappings. >> - Intended primarily for presentation/display, not structural case-insensitive matching. >> - Requires full string conversion before comparison, which is less efficient and not intended for structural matching. >> >> **1:M mapping example, U+00DF (?)** >> >> - String.toUpperCase(Locale.ROOT, "?") ? "SS" >> - Case folding produces "ss", matching Unicode caseless comparison rules. >> >> >> jshell> "\u00df".equalsIgnoreCase("ss") >> $22 ==> false >> >> jshell> "\u00df".toUpperCase(Locale.ROOT).toLowerCase(Locale.ROOT).equals("ss") >> $24 ==> true >> >> >> ### Motivation & Direction >> >> Add Unicode standard-compliant case-less comparison methods to the String class, enabling & improving reliable and efficient Unicode-aware/compliant case-insensitive matching. >> >> - Unicode-compliant **full** case folding. >> - Simpler, stable and more efficient case-less matching without workarounds. >> - Brings Java's string comparison handling in line with other programming languages/libraries. >> >> This PR proposes to introduce the following comparison methods in `String` class >> >> - boolean equalsFoldCase(String anotherString) >> - int compareToFoldCase(String anotherString) >> - Comparator UNICODE_CASEFOLD_ORDER >> >> These methods are intended to be the preferred choice when Unicode-compliant case-less matching is required. >> >> *Note: An early draft also proposed a String.toCaseFold() method returning a new case-folded string. >> However, during review this was considered error-prone, as the resulting string could easily be mistaken for a general transformation like toLowerCase() and then pass... > > Xueming Shen has updated the pull request incrementally with one additional commit since the last revision: > > doc update - add spec tag Looks good, a couple of javadoc formatting changes would clean up the formatted javadoc. src/java.base/share/classes/java/lang/String.java line 2243: > 2241: * per-character mapping performed by {@code equalsIgnoreCase}. > 2242: * For example: > 2243: *

    {@snippet lang=java :
    
    
     and 
    are unnecessary, @snippet handles the formatting. src/java.base/share/classes/java/lang/String.java line 2445: > 2443: * {@code compareToIgnoreCase}. > 2444: * For example: > 2445: *
    {@snippet lang=java :
    
    
     and 
    are redundant and should be removed. @snippet handles all the formatting. ------------- PR Review: https://git.openjdk.org/jdk/pull/27628#pullrequestreview-3500569860 PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2556436806 PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2556430920 From jlu at openjdk.org Mon Nov 24 21:25:09 2025 From: jlu at openjdk.org (Justin Lu) Date: Mon, 24 Nov 2025 21:25:09 GMT Subject: Integrated: 8368001: java/text/Format/NumberFormat/NumberRoundTrip.java timed out In-Reply-To: References: Message-ID: <7_obcIOpQ_NcANkYryTmj9TsYahuluoMPa4RwmI8r04=.77cecfa4-d60a-4f60-b608-b6776980825e@github.com> On Thu, 20 Nov 2025 22:55:41 GMT, Justin Lu wrote: > JDK-8260555 exposed test/jdk/java/text/Format/NumberFormat/NumberRoundTrip.java as being susceptible to timeouts. > While the timeout factor is reverted, this test was testing too many inputs, and should be changed. > Originally, it was testing (~1000 locales * 4 factories) against ~30 numeric inputs. The test does not need to be exhaustive to this degree. > > The total amount of locales is changed to sample around a 1/4 of those provided by the provider. The numeric inputs are reduced to about ~20. (The fixed ones remain, and the random ones are cut in half.) > > Locally, I observe average execution for this test to be about ~1.3 seconds, compared to ~3.4 seconds previously. The PR also does a drive-by clean up of the test, i.e. getting rid of the unnecessary escaping + string manipulation/printing and separating the test inputs from the actual testing work done. This pull request has now been integrated. Changeset: 507a6d32 Author: Justin Lu URL: https://git.openjdk.org/jdk/commit/507a6d327f1c613a130273727ee4154b5b4d7ca4 Stats: 230 lines in 1 file changed: 60 ins; 132 del; 38 mod 8368001: java/text/Format/NumberFormat/NumberRoundTrip.java timed out Reviewed-by: naoto ------------- PR: https://git.openjdk.org/jdk/pull/28443 From swen at openjdk.org Tue Nov 25 06:32:34 2025 From: swen at openjdk.org (Shaojin Wen) Date: Tue, 25 Nov 2025 06:32:34 GMT Subject: RFR: 8372460: Use EnumMap instead of HashMap for DateTimeFormatter parsing to improve performance Message-ID: This PR optimizes the parsing performance of DateTimeFormatter by replacing HashMap with EnumMap in scenarios where the keys are exclusively ChronoField enum values. When parsing date/time strings, DateTimeFormatter creates HashMaps to store intermediate parsed values. HashMap has more overhead for operations compared to specialized map implementations. Since ChronoField is an enum and all keys in these maps are ChronoField instances, we can use EnumMap instead, which provides better performance for enum keys due to its optimized internal structure. Parsing scenarios show improvements from 12% to 95% ------------- Commit messages: - bug fix, form @liach - use EnumMap - add benchmark Changes: https://git.openjdk.org/jdk/pull/28471/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28471&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8372460 Stats: 153 lines in 5 files changed: 149 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/28471.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28471/head:pull/28471 PR: https://git.openjdk.org/jdk/pull/28471 From liach at openjdk.org Tue Nov 25 06:32:36 2025 From: liach at openjdk.org (Chen Liang) Date: Tue, 25 Nov 2025 06:32:36 GMT Subject: RFR: 8372460: Use EnumMap instead of HashMap for DateTimeFormatter parsing to improve performance In-Reply-To: References: Message-ID: On Mon, 24 Nov 2025 08:02:35 GMT, Shaojin Wen wrote: > This PR optimizes the parsing performance of DateTimeFormatter by replacing HashMap with EnumMap in scenarios where the keys are exclusively ChronoField enum values. > > When parsing date/time strings, DateTimeFormatter creates HashMaps to store intermediate parsed values. HashMap has more overhead for operations compared to specialized map implementations. > > Since ChronoField is an enum and all keys in these maps are ChronoField instances, we can use EnumMap instead, which provides better performance for enum keys due to its optimized internal structure. > > Parsing scenarios show improvements from 12% to 95% Changes requested by liach (Reviewer). src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 2593: > 2591: for (DateTimePrinterParser pp : printerParsers) { > 2592: if ((pp instanceof NumberPrinterParser npp && !(npp.field instanceof ChronoField)) > 2593: || (pp instanceof CompositePrinterParser cpp && !cpp.onlyChronoField())) { Missing check for `TextPrinterParser` src/java.base/share/classes/java/time/format/Parsed.java line 134: > 132: if (onlyChronoField) { > 133: return new HashMap<>(); > 134: } else { Is this condition inverted :thinking: seems like it but how do you get the performance numbers ------------- PR Review: https://git.openjdk.org/jdk/pull/28471#pullrequestreview-3502735627 PR Review Comment: https://git.openjdk.org/jdk/pull/28471#discussion_r2558118611 PR Review Comment: https://git.openjdk.org/jdk/pull/28471#discussion_r2558120676 From swen at openjdk.org Tue Nov 25 06:32:37 2025 From: swen at openjdk.org (Shaojin Wen) Date: Tue, 25 Nov 2025 06:32:37 GMT Subject: RFR: 8372460: Use EnumMap instead of HashMap for DateTimeFormatter parsing to improve performance In-Reply-To: References: Message-ID: <-1FtUeUFm9JM8dRl4kyOMwYASWBnVxKgAvLZclN480Q=.13cac2c7-f9b7-4397-8415-1a7fb3aec078@github.com> On Mon, 24 Nov 2025 08:02:35 GMT, Shaojin Wen wrote: > This PR optimizes the parsing performance of DateTimeFormatter by replacing HashMap with EnumMap in scenarios where the keys are exclusively ChronoField enum values. > > When parsing date/time strings, DateTimeFormatter creates HashMaps to store intermediate parsed values. HashMap has more overhead for operations compared to specialized map implementations. > > Since ChronoField is an enum and all keys in these maps are ChronoField instances, we can use EnumMap instead, which provides better performance for enum keys due to its optimized internal structure. > > Parsing scenarios show improvements from 12% to 95% # 1. Shell We run the following Shell command # master git checkout b6495573e9dc5470df268b63f8e7a93f38406cd2 make test TEST="micro:java.time.format.DateTimeFormatterParse" # this pr git checkout d8742d7514abfe0e36f105fa7310fdb1755ae546 make test TEST="micro:java.time.format.DateTimeFormatterParse" # 2. Raw Benchmark Data Performance data running on a MacBook M1 Pro: # b649557 (master) Benchmark Mode Cnt Score Error Units DateTimeFormatterParse.parseInstant thrpt 15 2066.130 ? 126.134 ops/ms DateTimeFormatterParse.parseLocalDate thrpt 15 5014.987 ? 424.759 ops/ms DateTimeFormatterParse.parseLocalDateTime thrpt 15 3821.083 ? 390.928 ops/ms DateTimeFormatterParse.parseLocalDateTimeWithNano thrpt 15 3529.090 ? 209.195 ops/ms DateTimeFormatterParse.parseLocalTime thrpt 15 4275.904 ? 335.752 ops/ms DateTimeFormatterParse.parseLocalTimeWithNano thrpt 15 4596.255 ? 195.175 ops/ms DateTimeFormatterParse.parseOffsetDateTime thrpt 15 2330.924 ? 152.061 ops/ms DateTimeFormatterParse.parseZonedDateTime thrpt 15 1837.753 ? 107.873 ops/ms # d8742d7 (this pr) Benchmark Mode Cnt Score Error Units DateTimeFormatterParse.parseInstant thrpt 15 2900.168 ? 56.079 ops/ms DateTimeFormatterParse.parseLocalDate thrpt 15 9787.592 ? 384.437 ops/ms DateTimeFormatterParse.parseLocalDateTime thrpt 15 5046.838 ? 271.451 ops/ms DateTimeFormatterParse.parseLocalDateTimeWithNano thrpt 15 3963.050 ? 434.662 ops/ms DateTimeFormatterParse.parseLocalTime thrpt 15 8196.707 ? 329.547 ops/ms DateTimeFormatterParse.parseLocalTimeWithNano thrpt 15 8387.213 ? 652.292 ops/ms DateTimeFormatterParse.parseOffsetDateTime thrpt 15 3291.076 ? 294.889 ops/ms DateTimeFormatterParse.parseZonedDateTime thrpt 15 2069.595 ? 293.385 ops/ms # 3. Performance Comparison Performance Comparison: b6495573e9dc5470df268b63f8e7a93f38406cd2 vs d8742d7514abfe0e36f105fa7310fdb1755ae546 | Benchmark | b6495573e9dc5470df268b63f8e7a93f38406cd2 | d8742d7514abfe0e36f105fa7310fdb1755ae546 | Improvement Factor | | --- | --- | --- | --- | | DateTimeFormatterParse.parseInstant | 2066.130 ? 126.134 | 2900.168 ? 56.079 | 1.404x | | DateTimeFormatterParse.parseLocalDate | 5014.987 ? 424.759 | 9787.592 ? 384.437 | 1.952x | | DateTimeFormatterParse.parseLocalDateTime | 3821.083 ? 390.928 | 5046.838 ? 271.451 | 1.321x | | DateTimeFormatterParse.parseLocalDateTimeWithNano | 3529.090 ? 209.195 | 3963.050 ? 434.662 | 1.123x | | DateTimeFormatterParse.parseLocalTime | 4275.904 ? 335.752 | 8196.707 ? 329.547 | 1.919x | | DateTimeFormatterParse.parseLocalTimeWithNano | 4596.255 ? 195.175 | 8387.213 ? 652.292 | 1.825x | | DateTimeFormatterParse.parseOffsetDateTime | 2330.924 ? 152.061 | 3291.076 ? 294.889 | 1.412x | | DateTimeFormatterParse.parseZonedDateTime | 1837.753 ? 107.873 | 2069.595 ? 293.385 | 1.126x | java/time/tck/java/time/temporal/TCKWeekFields.java java/time/tck/java/time/temporal/TCKIsoFields.java java/time/tck/java/time/temporal/TCKJulianFields.java java/time/tck/java/time/format/TCKDateTimeParseResolver.java java/time/tck/java/time/format/TCKLocalizedFieldParser.java java/time/tck/java/time/format/TCKDateTimeFormatters.java java/time/tck/java/time/format/TCKDateTimeFormatterBuilder.java The existing tests above can cover the cases where there are no non-ChronoFields, so no additional tests are needed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28471#issuecomment-3571582110 PR Comment: https://git.openjdk.org/jdk/pull/28471#issuecomment-3573936930 From swen at openjdk.org Tue Nov 25 06:32:38 2025 From: swen at openjdk.org (Shaojin Wen) Date: Tue, 25 Nov 2025 06:32:38 GMT Subject: RFR: 8372460: Use EnumMap instead of HashMap for DateTimeFormatter parsing to improve performance In-Reply-To: References: Message-ID: On Tue, 25 Nov 2025 00:31:27 GMT, Chen Liang wrote: >> This PR optimizes the parsing performance of DateTimeFormatter by replacing HashMap with EnumMap in scenarios where the keys are exclusively ChronoField enum values. >> >> When parsing date/time strings, DateTimeFormatter creates HashMaps to store intermediate parsed values. HashMap has more overhead for operations compared to specialized map implementations. >> >> Since ChronoField is an enum and all keys in these maps are ChronoField instances, we can use EnumMap instead, which provides better performance for enum keys due to its optimized internal structure. >> >> Parsing scenarios show improvements from 12% to 95% > > src/java.base/share/classes/java/time/format/Parsed.java line 134: > >> 132: if (onlyChronoField) { >> 133: return new HashMap<>(); >> 134: } else { > > Is this condition inverted :thinking: seems like it but how do you get the performance numbers You're right, it's reversed, it's written incorrectly. And this should be in the constructor, not here. The placement is wrong, but it's still using EnumMap, so the performance is still improved. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28471#discussion_r2558252666 From swen at openjdk.org Tue Nov 25 06:44:57 2025 From: swen at openjdk.org (Shaojin Wen) Date: Tue, 25 Nov 2025 06:44:57 GMT Subject: RFR: 8372460: Use EnumMap instead of HashMap for DateTimeFormatter parsing to improve performance [v2] In-Reply-To: References: Message-ID: > This PR optimizes the parsing performance of DateTimeFormatter by replacing HashMap with EnumMap in scenarios where the keys are exclusively ChronoField enum values. > > When parsing date/time strings, DateTimeFormatter creates HashMaps to store intermediate parsed values. HashMap has more overhead for operations compared to specialized map implementations. > > Since ChronoField is an enum and all keys in these maps are ChronoField instances, we can use EnumMap instead, which provides better performance for enum keys due to its optimized internal structure. > > Parsing scenarios show improvements from 12% to 95% Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: copyright ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28471/files - new: https://git.openjdk.org/jdk/pull/28471/files/5a050fe9..7137d9ec Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28471&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28471&range=00-01 Stats: 3 lines in 2 files changed: 1 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/28471.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28471/head:pull/28471 PR: https://git.openjdk.org/jdk/pull/28471 From sherman at openjdk.org Tue Nov 25 20:21:26 2025 From: sherman at openjdk.org (Xueming Shen) Date: Tue, 25 Nov 2025 20:21:26 GMT Subject: RFR: 8365675: Add String Unicode Case-Folding Support [v11] In-Reply-To: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> References: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> Message-ID: > ### Summary > > Case folding is a key operation for case-insensitive matching (e.g., string equality, regex matching), where the goal is to eliminate case distinctions without applying locale or language specific conversions. > > Currently, the JDK does not expose a direct API for Unicode-compliant case folding. Developers now rely on methods such as: > > **String.equalsIgnoreCase(String)** > > - Unicode-aware, locale-independent. > - Implementation uses Character.toLowerCase(Character.toUpperCase(int)) per code point. > - Limited: does not support 1:M mapping defined in Unicode case folding. > > **Character.toLowerCase(int) / Character.toUpperCase(int)** > > - Locale-independent, single code point only. > - No support for 1:M mappings. > > **String.toLowerCase(Locale.ROOT) / String.toUpperCase(Locale.ROOT)** > > - Based on Unicode SpecialCasing.txt, supports 1:M mappings. > - Intended primarily for presentation/display, not structural case-insensitive matching. > - Requires full string conversion before comparison, which is less efficient and not intended for structural matching. > > **1:M mapping example, U+00DF (?)** > > - String.toUpperCase(Locale.ROOT, "?") ? "SS" > - Case folding produces "ss", matching Unicode caseless comparison rules. > > > jshell> "\u00df".equalsIgnoreCase("ss") > $22 ==> false > > jshell> "\u00df".toUpperCase(Locale.ROOT).toLowerCase(Locale.ROOT).equals("ss") > $24 ==> true > > > ### Motivation & Direction > > Add Unicode standard-compliant case-less comparison methods to the String class, enabling & improving reliable and efficient Unicode-aware/compliant case-insensitive matching. > > - Unicode-compliant **full** case folding. > - Simpler, stable and more efficient case-less matching without workarounds. > - Brings Java's string comparison handling in line with other programming languages/libraries. > > This PR proposes to introduce the following comparison methods in `String` class > > - boolean equalsFoldCase(String anotherString) > - int compareToFoldCase(String anotherString) > - Comparator UNICODE_CASEFOLD_ORDER > > These methods are intended to be the preferred choice when Unicode-compliant case-less matching is required. > > *Note: An early draft also proposed a String.toCaseFold() method returning a new case-folded string. > However, during review this was considered error-prone, as the resulting string could easily be mistaken for a general transformation like toLowerCase() and then passed into APIs where case-folding semantics are not appropriate. > > ### The New API > > See CSR https://bugs.openjd... Xueming Shen has updated the pull request incrementally with one additional commit since the last revision: minor doc formatting update ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27628/files - new: https://git.openjdk.org/jdk/pull/27628/files/0aafb674..e5da752f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27628&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27628&range=09-10 Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/27628.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27628/head:pull/27628 PR: https://git.openjdk.org/jdk/pull/27628 From rriggs at openjdk.org Tue Nov 25 21:13:15 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Tue, 25 Nov 2025 21:13:15 GMT Subject: RFR: 8365675: Add String Unicode Case-Folding Support [v11] In-Reply-To: References: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> Message-ID: <-caDaiJwJQ_T1kM5_TjsEe8HsNj40wfIparhZaLfZa4=.8c0248ea-04e7-42d3-bb7f-0f811d8d2813@github.com> On Tue, 25 Nov 2025 20:21:26 GMT, Xueming Shen wrote: >> ### Summary >> >> Case folding is a key operation for case-insensitive matching (e.g., string equality, regex matching), where the goal is to eliminate case distinctions without applying locale or language specific conversions. >> >> Currently, the JDK does not expose a direct API for Unicode-compliant case folding. Developers now rely on methods such as: >> >> **String.equalsIgnoreCase(String)** >> >> - Unicode-aware, locale-independent. >> - Implementation uses Character.toLowerCase(Character.toUpperCase(int)) per code point. >> - Limited: does not support 1:M mapping defined in Unicode case folding. >> >> **Character.toLowerCase(int) / Character.toUpperCase(int)** >> >> - Locale-independent, single code point only. >> - No support for 1:M mappings. >> >> **String.toLowerCase(Locale.ROOT) / String.toUpperCase(Locale.ROOT)** >> >> - Based on Unicode SpecialCasing.txt, supports 1:M mappings. >> - Intended primarily for presentation/display, not structural case-insensitive matching. >> - Requires full string conversion before comparison, which is less efficient and not intended for structural matching. >> >> **1:M mapping example, U+00DF (?)** >> >> - String.toUpperCase(Locale.ROOT, "?") ? "SS" >> - Case folding produces "ss", matching Unicode caseless comparison rules. >> >> >> jshell> "\u00df".equalsIgnoreCase("ss") >> $22 ==> false >> >> jshell> "\u00df".toUpperCase(Locale.ROOT).toLowerCase(Locale.ROOT).equals("ss") >> $24 ==> true >> >> >> ### Motivation & Direction >> >> Add Unicode standard-compliant case-less comparison methods to the String class, enabling & improving reliable and efficient Unicode-aware/compliant case-insensitive matching. >> >> - Unicode-compliant **full** case folding. >> - Simpler, stable and more efficient case-less matching without workarounds. >> - Brings Java's string comparison handling in line with other programming languages/libraries. >> >> This PR proposes to introduce the following comparison methods in `String` class >> >> - boolean equalsFoldCase(String anotherString) >> - int compareToFoldCase(String anotherString) >> - Comparator UNICODE_CASEFOLD_ORDER >> >> These methods are intended to be the preferred choice when Unicode-compliant case-less matching is required. >> >> *Note: An early draft also proposed a String.toCaseFold() method returning a new case-folded string. >> However, during review this was considered error-prone, as the resulting string could easily be mistaken for a general transformation like toLowerCase() and then pass... > > Xueming Shen has updated the pull request incrementally with one additional commit since the last revision: > > minor doc formatting update Looks good. ------------- Marked as reviewed by rriggs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27628#pullrequestreview-3506820703 From rriggs at openjdk.org Tue Nov 25 21:31:38 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Tue, 25 Nov 2025 21:31:38 GMT Subject: RFR: 8365675: Add String Unicode Case-Folding Support [v11] In-Reply-To: References: <3tMaotmLtDYKP4cADaC8DEISDKEJEaWHXr2dYDtZXY8=.22820982-951a-4e91-96a0-d21397c8494d@github.com> Message-ID: On Tue, 25 Nov 2025 20:21:26 GMT, Xueming Shen wrote: >> ### Summary >> >> Case folding is a key operation for case-insensitive matching (e.g., string equality, regex matching), where the goal is to eliminate case distinctions without applying locale or language specific conversions. >> >> Currently, the JDK does not expose a direct API for Unicode-compliant case folding. Developers now rely on methods such as: >> >> **String.equalsIgnoreCase(String)** >> >> - Unicode-aware, locale-independent. >> - Implementation uses Character.toLowerCase(Character.toUpperCase(int)) per code point. >> - Limited: does not support 1:M mapping defined in Unicode case folding. >> >> **Character.toLowerCase(int) / Character.toUpperCase(int)** >> >> - Locale-independent, single code point only. >> - No support for 1:M mappings. >> >> **String.toLowerCase(Locale.ROOT) / String.toUpperCase(Locale.ROOT)** >> >> - Based on Unicode SpecialCasing.txt, supports 1:M mappings. >> - Intended primarily for presentation/display, not structural case-insensitive matching. >> - Requires full string conversion before comparison, which is less efficient and not intended for structural matching. >> >> **1:M mapping example, U+00DF (?)** >> >> - String.toUpperCase(Locale.ROOT, "?") ? "SS" >> - Case folding produces "ss", matching Unicode caseless comparison rules. >> >> >> jshell> "\u00df".equalsIgnoreCase("ss") >> $22 ==> false >> >> jshell> "\u00df".toUpperCase(Locale.ROOT).toLowerCase(Locale.ROOT).equals("ss") >> $24 ==> true >> >> >> ### Motivation & Direction >> >> Add Unicode standard-compliant case-less comparison methods to the String class, enabling & improving reliable and efficient Unicode-aware/compliant case-insensitive matching. >> >> - Unicode-compliant **full** case folding. >> - Simpler, stable and more efficient case-less matching without workarounds. >> - Brings Java's string comparison handling in line with other programming languages/libraries. >> >> This PR proposes to introduce the following comparison methods in `String` class >> >> - boolean equalsFoldCase(String anotherString) >> - int compareToFoldCase(String anotherString) >> - Comparator UNICODE_CASEFOLD_ORDER >> >> These methods are intended to be the preferred choice when Unicode-compliant case-less matching is required. >> >> *Note: An early draft also proposed a String.toCaseFold() method returning a new case-folded string. >> However, during review this was considered error-prone, as the resulting string could easily be mistaken for a general transformation like toLowerCase() and then pass... > > Xueming Shen has updated the pull request incrementally with one additional commit since the last revision: > > minor doc formatting update Try again for information on the issue. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27628#issuecomment-3577662129 From jlu at openjdk.org Wed Nov 26 18:40:58 2025 From: jlu at openjdk.org (Justin Lu) Date: Wed, 26 Nov 2025 18:40:58 GMT Subject: RFR: 8372609: Bug4944439 does not enforce locale correctly Message-ID: <2VqV11GIXj4tLaLVuCgE5bpjin12Va6BH1GM2vd8VRw=.d05ea835-f7f2-4b24-bea4-cee7c2046595@github.com> This PR fixes a test bug where a `DecimalFormat` is instantiated in a static field (with the current default locale) before the test updates the system default to `Locale.US`. As a result, it may fail under various other locales, since a `Locale.US` configured `DecimalFormat` is not actually retrieved and the test expects one. In general, the preservation and restoring of the system locale is an obsolete process. The test is instead updated to just retrieve a `DecimalFormat` using a locale accepting factory method. I have manually confirmed that the tests passes with `-Duser.language=en -Duser.country=NL` on my machine, (which is the locale used in the reproducer). ------------- Commit messages: - init Changes: https://git.openjdk.org/jdk/pull/28514/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28514&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8372609 Stats: 21 lines in 1 file changed: 0 ins; 17 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/28514.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28514/head:pull/28514 PR: https://git.openjdk.org/jdk/pull/28514 From liach at openjdk.org Wed Nov 26 18:44:53 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 26 Nov 2025 18:44:53 GMT Subject: RFR: 8372609: Bug4944439 does not enforce locale correctly In-Reply-To: <2VqV11GIXj4tLaLVuCgE5bpjin12Va6BH1GM2vd8VRw=.d05ea835-f7f2-4b24-bea4-cee7c2046595@github.com> References: <2VqV11GIXj4tLaLVuCgE5bpjin12Va6BH1GM2vd8VRw=.d05ea835-f7f2-4b24-bea4-cee7c2046595@github.com> Message-ID: <-s62C3uRO9LEkSPJAuFU6TFWjS1QPET7MYOajC2sVvs=.23b92f93-7012-4f76-ae06-5e6d8373ba23@github.com> On Wed, 26 Nov 2025 18:35:40 GMT, Justin Lu wrote: > This PR fixes a test bug where a `DecimalFormat` is instantiated in a static field (with the current default locale) before the test updates the system default to `Locale.US`. As a result, it may fail under various other locales, since a `Locale.US` configured `DecimalFormat` is not actually retrieved and the test expects one. > > In general, the preservation and restoring of the system locale is an obsolete process. The test is instead updated to just retrieve a `DecimalFormat` using a locale accepting factory method. > > I have manually confirmed that the tests passes with `-Duser.language=en -Duser.country=NL` on my machine, (which is the locale used in the reproducer). Marked as reviewed by liach (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28514#pullrequestreview-3512304444 From jpai at openjdk.org Thu Nov 27 02:06:46 2025 From: jpai at openjdk.org (Jaikiran Pai) Date: Thu, 27 Nov 2025 02:06:46 GMT Subject: RFR: 8372609: Bug4944439 does not enforce locale correctly In-Reply-To: <2VqV11GIXj4tLaLVuCgE5bpjin12Va6BH1GM2vd8VRw=.d05ea835-f7f2-4b24-bea4-cee7c2046595@github.com> References: <2VqV11GIXj4tLaLVuCgE5bpjin12Va6BH1GM2vd8VRw=.d05ea835-f7f2-4b24-bea4-cee7c2046595@github.com> Message-ID: On Wed, 26 Nov 2025 18:35:40 GMT, Justin Lu wrote: > This PR fixes a test bug where a `DecimalFormat` is instantiated in a static field (with the current default locale) before the test updates the system default to `Locale.US`. As a result, it may fail under various other locales, since a `Locale.US` configured `DecimalFormat` is not actually retrieved and the test expects one. > > In general, the preservation and restoring of the system locale is an obsolete process. The test is instead updated to just retrieve a `DecimalFormat` using a locale accepting factory method. > > I have manually confirmed that the tests passes with `-Duser.language=en -Duser.country=NL` on my machine, (which is the locale used in the reproducer). Hello Justin, the change looks reasonable to me. I'm guessing the call to `NumberFormat.getInstance(...)` would still return and exercise a `DecimalFormat` instance, and thus the original intent of the test for JDK-4944439 would be preserved? ------------- Marked as reviewed by jpai (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28514#pullrequestreview-3513312964 From liach at openjdk.org Sun Nov 30 05:36:47 2025 From: liach at openjdk.org (Chen Liang) Date: Sun, 30 Nov 2025 05:36:47 GMT Subject: RFR: 8372460: Use EnumMap instead of HashMap for DateTimeFormatter parsing to improve performance [v2] In-Reply-To: References: Message-ID: <-M2fXk0-NVQKUcMw8Wyx0ENjNr3584l41Bwa3tv-bW8=.ad669cec-e0a1-442a-ba93-6ccf729b7ed5@github.com> On Tue, 25 Nov 2025 06:44:57 GMT, Shaojin Wen wrote: >> This PR optimizes the parsing performance of DateTimeFormatter by replacing HashMap with EnumMap in scenarios where the keys are exclusively ChronoField enum values. >> >> When parsing date/time strings, DateTimeFormatter creates HashMaps to store intermediate parsed values. HashMap has more overhead for operations compared to specialized map implementations. >> >> Since ChronoField is an enum and all keys in these maps are ChronoField instances, we can use EnumMap instead, which provides better performance for enum keys due to its optimized internal structure. >> >> Parsing scenarios show improvements from 12% to 95% > > Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: > > copyright I think instead of checking each component printer parser, we should check the public methods on `DateTimeFormatterBuilder` that can take a `TemporalField` and track the `onlyChronoField` there. This is better because this is where users can actaully pass in non-ChronoField. For example, I last time discovered text printer parser, and now have discovered DefaultValueParser is problematic too. So I believe guarding where users can pass custom TemporalField and adding a boolean field on a DateTimeFormatterBuilder to keep track of this is better. ------------- Changes requested by liach (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28471#pullrequestreview-3521038435