From iris at openjdk.org Tue Aug 1 01:48:54 2023 From: iris at openjdk.org (Iris Clark) Date: Tue, 1 Aug 2023 01:48:54 GMT Subject: [jdk21] RFR: 8039165: [Doc] MessageFormat null locale generates NullPointerException In-Reply-To: References: Message-ID: On Mon, 31 Jul 2023 21:13:16 GMT, Justin Lu wrote: > Please review this change which contains a backport of commit [c6396dce](https://github.com/openjdk/jdk/commit/c6396dceb9a64578d5b335af27ad1d968190a1fa) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. > > This PR is a java.text doc/test-only change. > > The commit being backported was authored by Justin Lu on 25 Jul 2023 and was reviewed by Naoto Sato. > > Thanks! Marked as reviewed by iris (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk21/pull/154#pullrequestreview-1556044570 From naoto at openjdk.org Tue Aug 1 20:21:11 2023 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 1 Aug 2023 20:21:11 GMT Subject: RFR: 8309622: Re-examine the cache mechanism in BaseLocale [v5] In-Reply-To: <5MqmN4P1TLKDCfXPhKWrH1b2FTgOXmjtKgd1bVXDd_M=.2000f20d-365d-48dc-bc37-45d8bcb9447f@github.com> References: <5MqmN4P1TLKDCfXPhKWrH1b2FTgOXmjtKgd1bVXDd_M=.2000f20d-365d-48dc-bc37-45d8bcb9447f@github.com> Message-ID: > This is stemming from the PR: https://github.com/openjdk/jdk/pull/14211 where aggressive GC can cause NPE in `BaseLocale$Key` class. I refactored the in-house cache with WeakHashMap, and removed the Key class as it is no longer needed (thus the original NPE will no longer be possible). Also with the new JMH test case, it gains some performance improvement: > > (w/o fix) > > Benchmark Mode Cnt Score Error Units > LocaleCache.testForLanguageTag avgt 20 5781.275 ? 569.580 ns/op > LocaleCache.testLocaleOf avgt 20 62564.079 ? 406.697 ns/op > > (w/ fix) > Benchmark Mode Cnt Score Error Units > LocaleCache.testForLanguageTag avgt 20 4801.175 ? 371.830 ns/op > LocaleCache.testLocaleOf avgt 20 60394.652 ? 352.471 ns/op Naoto Sato has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 29 commits: - Merge branch 'master' of https://git.openjdk.org/jdk into JDK-8309622-Cache-BaseLocale - small cleanup - Merge branch 'pull/14684' into JDK-8309622-Cache-BaseLocale - Update ReferencedKeyTest.java - Simple versions of create - Add flag for reference queue type - Merge branch 'master' into 8310913 - Update to use VirtualThread friendly stale queue. - Merge branch 'pull/14684' into JDK-8309622-Cache-BaseLocale - Remove warning tied to String Templates - ... and 19 more: https://git.openjdk.org/jdk/compare/7ba8c69a...0e435898 ------------- Changes: https://git.openjdk.org/jdk/pull/14404/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14404&range=04 Stats: 697 lines in 7 files changed: 129 ins; 441 del; 127 mod Patch: https://git.openjdk.org/jdk/pull/14404.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/14404/head:pull/14404 PR: https://git.openjdk.org/jdk/pull/14404 From jlu at openjdk.org Tue Aug 1 23:04:04 2023 From: jlu at openjdk.org (Justin Lu) Date: Tue, 1 Aug 2023 23:04:04 GMT Subject: [jdk21] Integrated: 8039165: [Doc] MessageFormat null locale generates NullPointerException In-Reply-To: References: Message-ID: On Mon, 31 Jul 2023 21:13:16 GMT, Justin Lu wrote: > Please review this change which contains a backport of commit [c6396dce](https://github.com/openjdk/jdk/commit/c6396dceb9a64578d5b335af27ad1d968190a1fa) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. > > This PR is a java.text doc/test-only change. > > The commit being backported was authored by Justin Lu on 25 Jul 2023 and was reviewed by Naoto Sato. > > Thanks! This pull request has now been integrated. Changeset: f34ac12a Author: Justin Lu URL: https://git.openjdk.org/jdk21/commit/f34ac12aa7c2b932bf2f4c7a58e4dfdf228edfd2 Stats: 164 lines in 3 files changed: 97 ins; 64 del; 3 mod 8039165: [Doc] MessageFormat null locale generates NullPointerException Reviewed-by: naoto, iris Backport-of: c6396dceb9a64578d5b335af27ad1d968190a1fa ------------- PR: https://git.openjdk.org/jdk21/pull/154 From naoto at openjdk.org Wed Aug 2 23:29:52 2023 From: naoto at openjdk.org (Naoto Sato) Date: Wed, 2 Aug 2023 23:29:52 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns Message-ID: Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html ------------- Commit messages: - Initial commit Changes: https://git.openjdk.org/jdk/pull/15130/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8041488 Stats: 679 lines in 6 files changed: 671 ins; 0 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/15130.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15130/head:pull/15130 PR: https://git.openjdk.org/jdk/pull/15130 From jlu at openjdk.org Wed Aug 2 23:32:23 2023 From: jlu at openjdk.org (Justin Lu) Date: Wed, 2 Aug 2023 23:32:23 GMT Subject: RFR: 8174722: Wrong behavior of DecimalFormat with RoundingMode.UP in special case [v3] In-Reply-To: References: Message-ID: > Please review this PR, which addresses a case where Decimal Format would violate certain RoundingMode contracts given the right pattern and input decimal String. > > For example, > > > DecimalFormat df = new DecimalFormat(); > df.setRoundingMode(RoundingMode.UP); > double small = 0.0001; > double big = 1.0001; > df.applyPattern("0.00"); > df.format(small); // returns 0.00, which violates UP > df.format(big); // returns 1.01, which does not violate UP > > > In this example `0.0001` becomes `0.00`, a decrease in magnitude. This violates the RoundingMode.UP contract as RoundingMode.UP states "Note that this rounding mode never decreases the magnitude of the calculated value." > > This edge case is a result of when input decimal String values smaller than the absolute value of `.1` have more leading zeros between the decimal and the first non-zero digit (_0.0001 -> **3**_) than maximum fractional digits in the pattern (_0.00 -> **2**_). > > The test validates the change by using data from larger counterparts. For example, If we are testing `0.0009`, we can format `1.0009` with the same pattern and mode that we use on `0.0009`, then compare the fractional portions to each other and ensure they are equal. Justin Lu has updated the pull request incrementally with one additional commit since the last revision: Refactor underflowToZero ------------- Changes: - all: https://git.openjdk.org/jdk/pull/14110/files - new: https://git.openjdk.org/jdk/pull/14110/files/a8e1a81b..ed889741 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=14110&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=14110&range=01-02 Stats: 39 lines in 1 file changed: 2 ins; 22 del; 15 mod Patch: https://git.openjdk.org/jdk/pull/14110.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/14110/head:pull/14110 PR: https://git.openjdk.org/jdk/pull/14110 From naoto at openjdk.org Wed Aug 2 23:40:31 2023 From: naoto at openjdk.org (Naoto Sato) Date: Wed, 2 Aug 2023 23:40:31 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v2] In-Reply-To: References: Message-ID: > Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Added test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15130/files - new: https://git.openjdk.org/jdk/pull/15130/files/7340a0f7..8e7181f2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=00-01 Stats: 207 lines in 1 file changed: 207 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/15130.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15130/head:pull/15130 PR: https://git.openjdk.org/jdk/pull/15130 From jlu at openjdk.org Thu Aug 3 16:38:36 2023 From: jlu at openjdk.org (Justin Lu) Date: Thu, 3 Aug 2023 16:38:36 GMT Subject: RFR: 8313702: Update IANA Language Subtag Registry to Version 2023-08-02 Message-ID: Please review this PR which updates the IANA data from version 05-11-2023 to version [08-02-2023](https://mm.icann.org/pipermail/ietf-languages-announcements/2023-August/000088.html). The contents of the update added variant subtag ?blasl? to the language subtag registry. ------------- Commit messages: - Support 08-02-23 Changes: https://git.openjdk.org/jdk/pull/15142/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15142&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8313702 Stats: 12 lines in 2 files changed: 9 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/15142.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15142/head:pull/15142 PR: https://git.openjdk.org/jdk/pull/15142 From naoto at openjdk.org Thu Aug 3 18:48:30 2023 From: naoto at openjdk.org (Naoto Sato) Date: Thu, 3 Aug 2023 18:48:30 GMT Subject: RFR: 8313702: Update IANA Language Subtag Registry to Version 2023-08-02 In-Reply-To: References: Message-ID: On Thu, 3 Aug 2023 16:31:01 GMT, Justin Lu wrote: > Please review this PR which updates the IANA data from version 05-11-2023 to version [08-02-2023](https://mm.icann.org/pipermail/ietf-languages-announcements/2023-August/000088.html). > > The contents of the update added variant subtag ?blasl? to the language subtag registry. Marked as reviewed by naoto (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/15142#pullrequestreview-1561671988 From iris at openjdk.org Thu Aug 3 20:27:29 2023 From: iris at openjdk.org (Iris Clark) Date: Thu, 3 Aug 2023 20:27:29 GMT Subject: RFR: 8313702: Update IANA Language Subtag Registry to Version 2023-08-02 In-Reply-To: References: Message-ID: On Thu, 3 Aug 2023 16:31:01 GMT, Justin Lu wrote: > Please review this PR which updates the IANA data from version 05-11-2023 to version [08-02-2023](https://mm.icann.org/pipermail/ietf-languages-announcements/2023-August/000088.html). > > The contents of the update added variant subtag ?blasl? to the language subtag registry. Marked as reviewed by iris (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/15142#pullrequestreview-1561806378 From naoto at openjdk.org Thu Aug 3 21:25:45 2023 From: naoto at openjdk.org (Naoto Sato) Date: Thu, 3 Aug 2023 21:25:45 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v3] In-Reply-To: References: Message-ID: > Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Wording fixes ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15130/files - new: https://git.openjdk.org/jdk/pull/15130/files/8e7181f2..cf3dddba Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=01-02 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/15130.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15130/head:pull/15130 PR: https://git.openjdk.org/jdk/pull/15130 From naoto at openjdk.org Fri Aug 4 21:09:13 2023 From: naoto at openjdk.org (Naoto Sato) Date: Fri, 4 Aug 2023 21:09:13 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v4] In-Reply-To: References: Message-ID: > Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: parsePosition update ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15130/files - new: https://git.openjdk.org/jdk/pull/15130/files/cf3dddba..50ba267c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=02-03 Stats: 42 lines in 2 files changed: 40 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/15130.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15130/head:pull/15130 PR: https://git.openjdk.org/jdk/pull/15130 From jlu at openjdk.org Mon Aug 7 17:13:39 2023 From: jlu at openjdk.org (Justin Lu) Date: Mon, 7 Aug 2023 17:13:39 GMT Subject: Integrated: 8313702: Update IANA Language Subtag Registry to Version 2023-08-02 In-Reply-To: References: Message-ID: On Thu, 3 Aug 2023 16:31:01 GMT, Justin Lu wrote: > Please review this PR which updates the IANA data from version 05-11-2023 to version [08-02-2023](https://mm.icann.org/pipermail/ietf-languages-announcements/2023-August/000088.html). > > The contents of the update added variant subtag ?blasl? to the language subtag registry. This pull request has now been integrated. Changeset: 1da82a34 Author: Justin Lu URL: https://git.openjdk.org/jdk/commit/1da82a34b14189814e45a93c68620ccb51427111 Stats: 12 lines in 2 files changed: 9 ins; 0 del; 3 mod 8313702: Update IANA Language Subtag Registry to Version 2023-08-02 Reviewed-by: naoto, iris ------------- PR: https://git.openjdk.org/jdk/pull/15142 From naoto at openjdk.org Tue Aug 8 17:19:55 2023 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 8 Aug 2023 17:19:55 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v5] In-Reply-To: References: Message-ID: <9S5QinT9cgHGGL26AXkWN8ENRVxL1Le1fwZ_rdTz-F4=.684308dc-e1b8-4dee-9eff-3690b327e29b@github.com> > Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html 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 five additional commits since the last revision: - Merge branch 'master' into JDK-8041488-ListPatterns-PR - parsePosition update - Wording fixes - Added test - Initial commit ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15130/files - new: https://git.openjdk.org/jdk/pull/15130/files/50ba267c..a98e1e1f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=03-04 Stats: 8981 lines in 435 files changed: 3504 ins; 2284 del; 3193 mod Patch: https://git.openjdk.org/jdk/pull/15130.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15130/head:pull/15130 PR: https://git.openjdk.org/jdk/pull/15130 From rriggs at openjdk.org Tue Aug 8 20:01:41 2023 From: rriggs at openjdk.org (Roger Riggs) Date: Tue, 8 Aug 2023 20:01:41 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v5] In-Reply-To: <9S5QinT9cgHGGL26AXkWN8ENRVxL1Le1fwZ_rdTz-F4=.684308dc-e1b8-4dee-9eff-3690b327e29b@github.com> References: <9S5QinT9cgHGGL26AXkWN8ENRVxL1Le1fwZ_rdTz-F4=.684308dc-e1b8-4dee-9eff-3690b327e29b@github.com> Message-ID: On Tue, 8 Aug 2023 17:19:55 GMT, Naoto Sato wrote: >> Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html > > 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 five additional commits since the last revision: > > - Merge branch 'master' into JDK-8041488-ListPatterns-PR > - parsePosition update > - Wording fixes > - Added test > - Initial commit src/java.base/share/classes/java/text/ListFormat.java line 199: > 197: * @param locale Locale to be used, not null > 198: * @param type type of the list format. One of STANDARD/OR/UNIT, not null > 199: * @param style style of the list format. One of FULL/SHORT/NARROW, not null It would be ease navigation in the javadoc if there was a link to the ListFormat.Type and ListFormat.Style classes, perhaps Locale also. Use the normal prose form STANDARD, OR, or UNIT, instead of the "/" shorthand. Here and throughout the javadoc. Ditto FULL, SHORT, or NARROW. Also use Locale, Type, and Style instead of the shorthand. src/java.base/share/classes/java/text/ListFormat.java line 213: > 211: /** > 212: * {@return the list format for the specified patterns} > 213: *

LDML includes a section on the "Gender of Lists"; If later support was desired, is this API extensible to include that? https://www.unicode.org/reports/tr35/tr35-general.html#List_Gender src/java.base/share/classes/java/text/ListFormat.java line 234: > 232: * If parsing of the pattern string for start/middle/end fails, it throws an > 233: * {@code IllegalArgumentException}. If two/three pattern string is empty, or > 234: * fails on parsing, it falls back to I don't see code to try to parse the TWO or THREE patterns, where it could detect incorrectly formatted (user supplied) patterns. If I understand correctly, a bad TWO or THREE pattern would not be detected until it is used in format or parse. src/java.base/share/classes/java/text/ListFormat.java line 350: > 348: * {@code "a", "b", "c"}. > 349: * > 350: * @param source the String to parse, not null. String does not need to be capitalized. src/java.base/share/classes/java/text/ListFormat.java line 365: > 363: > 364: /** > 365: * Parses text from a string to produce a list of {@code String}s. No need to capitalize String if list is not capitalized. (or be consistent) src/java.base/share/classes/java/text/ListFormat.java line 428: > 426: return Arrays.asList(objs); > 427: } > 428: throw new InternalError("MessageFormat.parseObject() should return Object[]"); The error message is inconsistent with line 426, returning a List. src/java.base/share/classes/java/text/ListFormat.java line 442: > 440: > 441: /** > 442: * {@inheritDoc} The javadoc from Object.equals doesn't give any information about what constituted equals for a ListFormat. Namely, that the locale and patterns are equal. src/java.base/share/classes/java/text/ListFormat.java line 480: > 478: var len = input.length; > 479: return switch (len) { > 480: case 0 -> throw new IllegalArgumentException("There should at least be one input string"); It is unfortunate that LDML did not consider the case of an empty list. For example, to supply "NONE" or "n/a" or similar. The developer will need to deal with that separately. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1287548046 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1287623678 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1287564928 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1287624574 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1287626211 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1287627985 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1287630232 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1287622614 From naoto at openjdk.org Tue Aug 8 21:45:33 2023 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 8 Aug 2023 21:45:33 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v5] In-Reply-To: References: <9S5QinT9cgHGGL26AXkWN8ENRVxL1Le1fwZ_rdTz-F4=.684308dc-e1b8-4dee-9eff-3690b327e29b@github.com> Message-ID: <-DjQ2TurFbzd3vc0Iz2AHv0EfjCvLJRsU2c5XC8acPo=.c79bef39-07f5-4bef-b4c7-44bfbbdb82f7@github.com> On Tue, 8 Aug 2023 19:49:19 GMT, Roger Riggs 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 five additional commits since the last revision: >> >> - Merge branch 'master' into JDK-8041488-ListPatterns-PR >> - parsePosition update >> - Wording fixes >> - Added test >> - Initial commit > > src/java.base/share/classes/java/text/ListFormat.java line 213: > >> 211: /** >> 212: * {@return the list format for the specified patterns} >> 213: *

> > LDML includes a section on the "Gender of Lists"; If later support was desired, is this API extensible to include that? https://www.unicode.org/reports/tr35/tr35-general.html#List_Gender IIUC, although it is described within "list patterns" in LDML, it is orthogonal to "list patterns." The purpose of the "Gender of Lists" seems to me the resulting gender of the whole list of names, e.g., "Tom and Mary" is "other" in English, but it is "male" in Arabic (I just used the sample XML in the spec). So I believe it is not an extension of the class. > src/java.base/share/classes/java/text/ListFormat.java line 234: > >> 232: * If parsing of the pattern string for start/middle/end fails, it throws an >> 233: * {@code IllegalArgumentException}. If two/three pattern string is empty, or >> 234: * fails on parsing, it falls back to > > I don't see code to try to parse the TWO or THREE patterns, where it could detect incorrectly formatted (user supplied) patterns. > If I understand correctly, a bad TWO or THREE pattern would not be detected until it is used in format or parse. Right. Will provide validation for them > src/java.base/share/classes/java/text/ListFormat.java line 442: > >> 440: >> 441: /** >> 442: * {@inheritDoc} > > The javadoc from Object.equals doesn't give any information about what constituted equals for a ListFormat. > Namely, that the locale and patterns are equal. Will add those ListFormat specific considerations. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1287716917 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1287716871 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1287717003 From naoto at openjdk.org Tue Aug 8 22:21:04 2023 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 8 Aug 2023 22:21:04 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v6] In-Reply-To: References: Message-ID: > Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Reflects review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15130/files - new: https://git.openjdk.org/jdk/pull/15130/files/a98e1e1f..516c00c7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=04-05 Stats: 59 lines in 2 files changed: 40 ins; 1 del; 18 mod Patch: https://git.openjdk.org/jdk/pull/15130.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15130/head:pull/15130 PR: https://git.openjdk.org/jdk/pull/15130 From naoto at openjdk.org Wed Aug 9 00:46:58 2023 From: naoto at openjdk.org (Naoto Sato) Date: Wed, 9 Aug 2023 00:46:58 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v7] In-Reply-To: References: Message-ID: <1rFouxpbzGLybnxXGslNTnoMIZC7MjrEU1zvDCKaqi0=.d3566682-582f-4a26-81c2-76f35f6fed5c@github.com> > Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Small cleanup ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15130/files - new: https://git.openjdk.org/jdk/pull/15130/files/516c00c7..7760656a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=05-06 Stats: 4 lines in 1 file changed: 0 ins; 2 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/15130.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15130/head:pull/15130 PR: https://git.openjdk.org/jdk/pull/15130 From joehw at openjdk.org Thu Aug 10 00:03:58 2023 From: joehw at openjdk.org (Joe Wang) Date: Thu, 10 Aug 2023 00:03:58 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v7] In-Reply-To: <1rFouxpbzGLybnxXGslNTnoMIZC7MjrEU1zvDCKaqi0=.d3566682-582f-4a26-81c2-76f35f6fed5c@github.com> References: <1rFouxpbzGLybnxXGslNTnoMIZC7MjrEU1zvDCKaqi0=.d3566682-582f-4a26-81c2-76f35f6fed5c@github.com> Message-ID: On Wed, 9 Aug 2023 00:46:58 GMT, Naoto Sato wrote: >> Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Small cleanup src/java.base/share/classes/java/text/ListFormat.java line 58: > 56: * .format(List.of("Foo", "Bar", "Baz")) > 57: * } > 58: * This will produce the concatenated list string, "Foo, Bar, and Baz" as seen in With this sample code, if the Style is changed to SHORT, it would produce the same string. Would it be better to use the weekdays instead of Foo, Bar and Baz (as in the Unicode spec)? Esp. with the UNIT type, those examples explained it better, e.g. NARROW produces 3? 7?. Also, if the instance is of STANDARD/SHORT, does it format List.of("January", "February", "March") and return "Jan., Feb., and Mar.", or 3 feet, 7 inches to 3 ft, 7 in? The format method states simply "Returns the string that consists of the input strings, concatenated with the patterns of this ListFormat." I wonder if it'd be helpful to explain a bit more or add one more sample. src/java.base/share/classes/java/text/ListFormat.java line 71: > 69: * STANDARD > 70: * Foo, Bar, and Baz > 71: * Foo, Bar, & Baz Is "&" a typo? It's still "and" in the Unicode spec's "standard-short" format, e.g. "Jan., Feb., and Mar." src/java.base/share/classes/java/text/ListFormat.java line 408: > 406: var em = endPattern.matcher(source); > 407: Object parsed = null; > 408: if (sm.find(parsePos.index) && em.find(parsePos.index)) { Would it be better to call getIndex() instead? (same below) test/jdk/java/text/Format/ListFormat/TestListFormat.java line 157: > 155: "foo, bar, baz", true), > 156: arguments(Locale.US, ListFormat.Type.OR, ListFormat.Style.NARROW, > 157: "foo, bar, or baz", true), Same as in the ListFormat class, the expected results are the same "foo, bar, or baz" when different Styles are specified. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1289362909 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1289364452 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1289352495 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1289365866 From naoto at openjdk.org Thu Aug 10 17:31:28 2023 From: naoto at openjdk.org (Naoto Sato) Date: Thu, 10 Aug 2023 17:31:28 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v8] In-Reply-To: References: Message-ID: > Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Reflecting review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15130/files - new: https://git.openjdk.org/jdk/pull/15130/files/7760656a..5b536fab Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=06-07 Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/15130.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15130/head:pull/15130 PR: https://git.openjdk.org/jdk/pull/15130 From naoto at openjdk.org Thu Aug 10 17:34:59 2023 From: naoto at openjdk.org (Naoto Sato) Date: Thu, 10 Aug 2023 17:34:59 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v7] In-Reply-To: References: <1rFouxpbzGLybnxXGslNTnoMIZC7MjrEU1zvDCKaqi0=.d3566682-582f-4a26-81c2-76f35f6fed5c@github.com> Message-ID: <67BVzHBTdGjXFSXWq06oYJ_RcWGNc0E01jQO2RvWp1w=.c66ffd69-25a5-484c-8aa8-c6d548363857@github.com> On Wed, 9 Aug 2023 23:39:24 GMT, Joe Wang wrote: >> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: >> >> Small cleanup > > src/java.base/share/classes/java/text/ListFormat.java line 58: > >> 56: * .format(List.of("Foo", "Bar", "Baz")) >> 57: * } >> 58: * This will produce the concatenated list string, "Foo, Bar, and Baz" as seen in > > With this sample code, if the Style is changed to SHORT, it would produce the same string. Would it be better to use the weekdays instead of Foo, Bar and Baz (as in the Unicode spec)? Esp. with the UNIT type, those examples explained it better, e.g. NARROW produces 3? 7?. > > Also, if the instance is of STANDARD/SHORT, does it format List.of("January", "February", "March") and return "Jan., Feb., and Mar.", or 3 feet, 7 inches to 3 ft, 7 in? The format method states simply "Returns the string that consists of the input strings, concatenated with the patterns of this ListFormat." I wonder if it'd be helpful to explain a bit more or add one more sample. In fact, the sample in LDML's page seems to be incorrect. `standard-short` in English is defined as: {0}, {1} {0}, {1} {0}, & {1} {0} & {1} in `en.xml` file. So `&` is expected rather than `and`. > Also, if the instance is of STANDARD/SHORT, does it format List.of("January", "February", "March") and return "Jan., Feb., and Mar.", or 3 feet, 7 inches to 3 ft, 7 in? No it does not. The `format()` method does not alter the passed input strings, so it would not convert "January" to "Jan." even if `SHORT` Style is specified. I have added some extra explanations, that those patterns vary depending on the locale providers. > src/java.base/share/classes/java/text/ListFormat.java line 71: > >> 69: * STANDARD >> 70: * Foo, Bar, and Baz >> 71: * Foo, Bar, & Baz > > Is "&" a typo? It's still "and" in the Unicode spec's "standard-short" format, e.g. "Jan., Feb., and Mar." Again `ampersand` is the correct pattern for `SHORT` in English. > src/java.base/share/classes/java/text/ListFormat.java line 408: > >> 406: var em = endPattern.matcher(source); >> 407: Object parsed = null; >> 408: if (sm.find(parsePos.index) && em.find(parsePos.index)) { > > Would it be better to call getIndex() instead? (same below) Fixed. > test/jdk/java/text/Format/ListFormat/TestListFormat.java line 157: > >> 155: "foo, bar, baz", true), >> 156: arguments(Locale.US, ListFormat.Type.OR, ListFormat.Style.NARROW, >> 157: "foo, bar, or baz", true), > > Same as in the ListFormat class, the expected results are the same "foo, bar, or baz" when different Styles are specified. Yes, those are exactly what are defined in CLDR. (They could have chosen `|` for SHORT style, but that would be not so common in plain English I guess) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1290428317 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1290428359 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1290428267 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1290428459 From joehw at openjdk.org Thu Aug 10 22:02:58 2023 From: joehw at openjdk.org (Joe Wang) Date: Thu, 10 Aug 2023 22:02:58 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v7] In-Reply-To: <67BVzHBTdGjXFSXWq06oYJ_RcWGNc0E01jQO2RvWp1w=.c66ffd69-25a5-484c-8aa8-c6d548363857@github.com> References: <1rFouxpbzGLybnxXGslNTnoMIZC7MjrEU1zvDCKaqi0=.d3566682-582f-4a26-81c2-76f35f6fed5c@github.com> <67BVzHBTdGjXFSXWq06oYJ_RcWGNc0E01jQO2RvWp1w=.c66ffd69-25a5-484c-8aa8-c6d548363857@github.com> Message-ID: On Thu, 10 Aug 2023 16:59:14 GMT, Naoto Sato wrote: >> src/java.base/share/classes/java/text/ListFormat.java line 58: >> >>> 56: * .format(List.of("Foo", "Bar", "Baz")) >>> 57: * } >>> 58: * This will produce the concatenated list string, "Foo, Bar, and Baz" as seen in >> >> With this sample code, if the Style is changed to SHORT, it would produce the same string. Would it be better to use the weekdays instead of Foo, Bar and Baz (as in the Unicode spec)? Esp. with the UNIT type, those examples explained it better, e.g. NARROW produces 3? 7?. >> >> Also, if the instance is of STANDARD/SHORT, does it format List.of("January", "February", "March") and return "Jan., Feb., and Mar.", or 3 feet, 7 inches to 3 ft, 7 in? The format method states simply "Returns the string that consists of the input strings, concatenated with the patterns of this ListFormat." I wonder if it'd be helpful to explain a bit more or add one more sample. > > In fact, the sample in LDML's page seems to be incorrect. `standard-short` in English is defined as: > > > {0}, {1} > {0}, {1} > {0}, & {1} > {0} & {1} > > > in `en.xml` file. So `&` is expected rather than `and`. > >> Also, if the instance is of STANDARD/SHORT, does it format List.of("January", "February", "March") and return "Jan., Feb., and Mar.", or 3 feet, 7 inches to 3 ft, 7 in? > > No it does not. The `format()` method does not alter the passed input strings, so it would not convert "January" to "Jan." even if `SHORT` Style is specified. I have added some extra explanations, that those patterns vary depending on the locale providers. Ah, I see. Those samples did give an impression that the format does more than concatenation. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1290711203 From erikj at openjdk.org Fri Aug 18 14:30:54 2023 From: erikj at openjdk.org (Erik Joelsson) Date: Fri, 18 Aug 2023 14:30:54 GMT Subject: RFR: 8314483: Optionally override copyright header in generated source Message-ID: In the JDK build we have various build tools that generate source code from data files. For most of these tools, the source files are based on template files, which already have copyright headers, but for some, the complete source file is generated by the tool, which is providing the copyright header programatically. For the latter, we would like to implement an override mechanism in each tool so that we can change the copyright header from a custom makefile. ------------- Commit messages: - JDK-8314483 Changes: https://git.openjdk.org/jdk/pull/15346/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15346&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8314483 Stats: 43 lines in 4 files changed: 34 ins; 1 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/15346.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15346/head:pull/15346 PR: https://git.openjdk.org/jdk/pull/15346 From rriggs at openjdk.org Fri Aug 18 20:06:38 2023 From: rriggs at openjdk.org (Roger Riggs) Date: Fri, 18 Aug 2023 20:06:38 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v8] In-Reply-To: References: Message-ID: On Thu, 10 Aug 2023 17:31:28 GMT, Naoto Sato wrote: >> Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Reflecting review comments src/java.base/share/classes/java/text/ListFormat.java line 96: > 94: * round-trip with the corresponding formatting. For example, a String list > 95: * "a, b,", "c" will be formatted as "a, b, and c", but may be parsed as > 96: * "a", "b", "c". Suggestion: * round-trip with the corresponding formatting. For example, a two element String list * "a, b,", "c" will be formatted as "a, b, and c", but may be parsed as three elements * "a", "b", "c". src/java.base/share/classes/java/text/ListFormat.java line 240: > 238: * is thrown. > 239: *

> 240: * Each pattern string is first parsed as follows. Patterns in parentheses are optional: The characters in parentheses are arbitrary and literal strings; not really "patterns" in the regex sense. src/java.base/share/classes/java/text/ListFormat.java line 246: > 244: * end := {0}end_between{1}(end_after) > 245: * two := (two_before){0}two_between{1}(two_after) > 246: * three := (three_before){0}three_between{1}three_between{2}(three_after) The use of "three_between" in 2 positions may mislead the developer to think they need to be the same string. Perhaps "three_between1" and "three_between2"? or something to differentiate them. src/java.base/share/classes/java/text/ListFormat.java line 250: > 248: * If parsing of the pattern string for start/middle/end fails, it throws an > 249: * {@code IllegalArgumentException}. If two/three pattern string is empty, or > 250: * fails on parsing, it falls back to The IllegalArgumentException is thrown for a parse failure on any of the start, middle, end, two, or three patterns. The fallback is only if they are null or empty. A more readable form of "start/middle/end" would be "start, middle, or end". Here and elsewhere in the javadoc. src/java.base/share/classes/java/text/ListFormat.java line 262: > 260: * n > 3: (start_before){0}start_between{1}middle_between{2} ... middle_between{m}end_between{n}(end_after) > 261: * > 262: * As an example, the following table shows patterns array which is equivalent to Suggestion: * As an example, the following table shows a pattern array which is equivalent to src/java.base/share/classes/java/text/ListFormat.java line 279: > 277: * 2 > 278: * "{0} and {1}" > 279: * 3 The use of different terms to identify pattern kinds of 2/two and 3/three may be confusing. Unless it is referring to LDML, use "two" and "three" be used consistently. src/java.base/share/classes/java/text/ListFormat.java line 304: > 302: * @param patterns array of patterns, not null > 303: * @throws IllegalArgumentException if the length {@code patterns} array is not 5, or > 304: * any of {@code start}, {@code middle}, {@code end} patterns cannot be parsed. Also throws if two and three patterns can not be parsed. src/java.base/share/classes/java/text/ListFormat.java line 353: > 351: return generateMessageFormat(a).format(a, toAppendTo, DontCareFieldPosition.INSTANCE); > 352: } else { > 353: throw new IllegalArgumentException("The object to format should be an Object list"); Suggestion: throw new IllegalArgumentException("The object to format should be a List or List[] array"); src/java.base/share/classes/java/text/ListFormat.java line 364: > 362: * delimiters. For example, a String list {@code "a, b,", "c"} will be > 363: * formatted as {@code "a, b, and c"}, but may be parsed as > 364: * {@code "a", "b", "c"}. Suggestion: * delimiters. For example, a two element String list {@code "a, b,", "c"} will be * formatted as {@code "a, b, and c"}, but may be parsed as three elements * {@code "a", "b", "c"}. src/java.base/share/classes/java/text/ListFormat.java line 389: > 387: * use all characters up to the end of the string), and the parsed > 388: * object is returned. The updated {@code parsePos} can be used to > 389: * indicate the starting point for the next call to this method. The "this method" seems too specific to ListFormat. Suggestion: * indicate the starting point for the next call to parse additional text. src/java.base/share/classes/java/text/ListFormat.java line 429: > 427: // now try exact number patterns > 428: parsed = new MessageFormat(patterns[TWO], locale).parseObject(source, parsePos); > 429: if (parsed == null && !patterns[THREE].isEmpty()) { patterns[THREE] should never be null/empty. src/java.base/share/classes/java/text/ListFormat.java line 451: > 449: @Override > 450: public AttributedCharacterIterator formatToCharacterIterator(Object arguments) { > 451: if (arguments instanceof List objs) { Should this method also support Object[]. And update the exception message below. src/java.base/share/classes/java/text/ListFormat.java line 510: > 508: } else { > 509: yield new MessageFormat(createMessageFormatString(len), locale); > 510: } TWO and THREE patterns are always generated, so this if/else switch should not be needed. src/java.base/share/classes/java/text/ListFormat.java line 591: > 589: * Suitable for elements, such as, "M", "T", "W", etc. > 590: */ > 591: NARROW The examples here are misleading (without explaining the source of the values). The ListFormat does NOT change the strings supplied, it can only affect the text and punctuation literals that appear before, between, or after the elements of the list. Suggestion: * The {@code FULL} list format style. This is the default style, which typically is the * full description of the text and punctuation that appear between the list elements. * Suitable for elements, such as, "Monday", "Tuesday", "Wednesday", etc. */ FULL, /** * The {@code SHORT} list format style. This style is typically an abbreviation * of the text and punctuation that appear between the list elements. * Suitable for elements, such as, "Mon", "Tue", "Wed", etc. */ SHORT, /** * The {@code NARROW} list format style. This style is typically the shortest description * of the text and punctuation that appear between the list elements. * Suitable for elements, such as, "M", "T", "W", etc. */ NARROW test/jdk/java/text/Format/ListFormat/TestListFormat.java line 261: > 259: assertEquals(input, f.parse(result)); > 260: } > 261: } There should be a test of `formatToCharacterIterator` method. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298790942 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298783724 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298781795 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298628165 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298784506 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298787272 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298791762 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298793675 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298794252 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298673908 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298798096 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298813568 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298642614 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298821495 PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298824618 From rriggs at openjdk.org Fri Aug 18 20:13:27 2023 From: rriggs at openjdk.org (Roger Riggs) Date: Fri, 18 Aug 2023 20:13:27 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v8] In-Reply-To: References: Message-ID: On Thu, 10 Aug 2023 17:31:28 GMT, Naoto Sato wrote: >> Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Reflecting review comments src/java.base/share/classes/java/text/ListFormat.java line 199: > 197: > 198: /** > 199: * {@return the list format object for the default "list format" will read better using the class name `ListFormat`. Here an in other `getInstance` methods. As is, in prose it looks like it returns some kind of list. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15130#discussion_r1298831450 From jlu at openjdk.org Fri Aug 18 21:34:45 2023 From: jlu at openjdk.org (Justin Lu) Date: Fri, 18 Aug 2023 21:34:45 GMT Subject: RFR: 8314604: j.text.DecimalFormat behavior regarding patterns is not clear Message-ID: <4IjlWcNJRJ3nFa3cWecEbIZu8JE6n2MswgQyx_fbYP8=.0686c00f-94ee-499e-b3eb-759f6ad75d55@github.com> Please review this PR and [CSR](https://bugs.openjdk.org/browse/JDK-8314607) which clarifies the behavior of patterns in regards to the max integer digits in j.text.DecimalFormat. The current specification (of `applyPattern`) states that patterns do not set the value of max integer digits. This is incorrect, these methods/constructors do set a value for the max integer digits. If the pattern is in scientific notation, the max integer digits value is derived from the pattern. Otherwise, the pattern is ignored, and the limit is set to `Integer.MAX_VALUE`. See below, DecimalFormat df = new DecimalFormat(); df.applyPattern("000.000E0"); df.getMaximumIntegerDigits(); // ==> 3 df.applyPattern("000.000"); df.getMaximumIntegerDigits(); // ==> 2147483647 DecimalFormat df = new DecimalFormat("000.000"); df.getMaximumIntegerDigits(); // ==> 2147483647 DecimalFormat df = new DecimalFormat("000.000E0"); df.getMaximumIntegerDigits(); // ==> 3 Method descriptions should be fixed, and the relevant constructors need to mention the behavior as well. ------------- Commit messages: - Include constructors - Re-clarify spec - Init Changes: https://git.openjdk.org/jdk/pull/15349/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15349&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8314604 Stats: 28 lines in 1 file changed: 22 ins; 0 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/15349.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15349/head:pull/15349 PR: https://git.openjdk.org/jdk/pull/15349 From prappo at openjdk.org Tue Aug 22 08:50:07 2023 From: prappo at openjdk.org (Pavel Rappo) Date: Tue, 22 Aug 2023 08:50:07 GMT Subject: RFR: 8314738: Remove all occurrences of and support for @revised Message-ID: Please review this simple PR. ------------- Commit messages: - Initial commit Changes: https://git.openjdk.org/jdk/pull/15382/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15382&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8314738 Stats: 124 lines in 28 files changed: 0 ins; 116 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/15382.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15382/head:pull/15382 PR: https://git.openjdk.org/jdk/pull/15382 From prappo at openjdk.org Tue Aug 22 12:28:30 2023 From: prappo at openjdk.org (Pavel Rappo) Date: Tue, 22 Aug 2023 12:28:30 GMT Subject: RFR: 8314738: Remove all occurrences of and support for @revised In-Reply-To: References: Message-ID: On Tue, 22 Aug 2023 12:23:18 GMT, Mark Reinhold wrote: > I wouldn?t update the copyright year as you have in some of these files. I was taught to do it every time when I change a file. Would you like me to revert those changes to copyright years in this case? ------------- PR Comment: https://git.openjdk.org/jdk/pull/15382#issuecomment-1688086627 From mr at openjdk.org Tue Aug 22 12:28:29 2023 From: mr at openjdk.org (Mark Reinhold) Date: Tue, 22 Aug 2023 12:28:29 GMT Subject: RFR: 8314738: Remove all occurrences of and support for @revised In-Reply-To: References: Message-ID: On Tue, 22 Aug 2023 08:42:32 GMT, Pavel Rappo wrote: > Please review this simple PR. Removing `@revised` tags is not a substantive change, so I wouldn?t update the copyright year as you have in some of these files. Otherwise, this looks fine. ------------- Marked as reviewed by mr (Lead). PR Review: https://git.openjdk.org/jdk/pull/15382#pullrequestreview-1589309922 From aturbanov at openjdk.org Tue Aug 22 12:31:04 2023 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Tue, 22 Aug 2023 12:31:04 GMT Subject: RFR: 8312521: Unused field LocaleProviderAdapter#defaultLocaleProviderAdapter could be removed Message-ID: After [JDK-8245241](https://bugs.openjdk.org/browse/JDK-8245241), the field `sun.util.locale.provider.LocaleProviderAdapter#defaultLocaleProviderAdapter` is only written in `` and then is not used after. We can remove it. ------------- Commit messages: - 8312521: Unused field LocaleProviderAdapter#defaultLocaleProviderAdapter could be removed Changes: https://git.openjdk.org/jdk/pull/15388/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15388&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8312521 Stats: 11 lines in 1 file changed: 0 ins; 8 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/15388.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15388/head:pull/15388 PR: https://git.openjdk.org/jdk/pull/15388 From mr at openjdk.org Tue Aug 22 12:40:27 2023 From: mr at openjdk.org (Mark Reinhold) Date: Tue, 22 Aug 2023 12:40:27 GMT Subject: RFR: 8314738: Remove all occurrences of and support for @revised In-Reply-To: References: Message-ID: On Tue, 22 Aug 2023 08:42:32 GMT, Pavel Rappo wrote: > Please review this simple PR. You can leave the copyright years as-is. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15382#issuecomment-1688104170 From prappo at openjdk.org Tue Aug 22 13:05:38 2023 From: prappo at openjdk.org (Pavel Rappo) Date: Tue, 22 Aug 2023 13:05:38 GMT Subject: Integrated: 8314738: Remove all occurrences of and support for @revised In-Reply-To: References: Message-ID: On Tue, 22 Aug 2023 08:42:32 GMT, Pavel Rappo wrote: > Please review this simple PR. This pull request has now been integrated. Changeset: f39fc0aa Author: Pavel Rappo URL: https://git.openjdk.org/jdk/commit/f39fc0aa2de19332fa51af605ece0660891d8c7a Stats: 124 lines in 28 files changed: 0 ins; 116 del; 8 mod 8314738: Remove all occurrences of and support for @revised Reviewed-by: mr ------------- PR: https://git.openjdk.org/jdk/pull/15382 From jlu at openjdk.org Tue Aug 22 19:46:17 2023 From: jlu at openjdk.org (Justin Lu) Date: Tue, 22 Aug 2023 19:46:17 GMT Subject: RFR: 6228794: [Fmt-Ch] Doc: java.text.ChoiceFormat behavior is not well documented. Message-ID: Please review this PR and associated [CSR](https://bugs.openjdk.org/browse/JDK-8314546) which expands on the `java.text.ChoiceFormat` specification regarding its pattern. `j.text.ChoiceFormat` provides an example pattern in the class description, but beyond that it does not specify any well-defined syntax for creating a pattern. In addition, methods related to the pattern String are under-specified and there are undocumented exceptions. The wording for `getLimits()` and `getFormats()` was also adjusted, as there are other ways to set the limits and formats beyond the constructor. The changes may be easier to view -> https://cr.openjdk.org/~jlu/api/java.base/java/text/ChoiceFormat.html ------------- Commit messages: - Clarify ? - Adjust pattern definition - Remove leftover comments - Revert the example changes to focus on the more important changes - Adjust wording of getter methods - Init Changes: https://git.openjdk.org/jdk/pull/15392/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15392&range=00 Issue: https://bugs.openjdk.org/browse/JDK-6228794 Stats: 69 lines in 1 file changed: 46 ins; 7 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/15392.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15392/head:pull/15392 PR: https://git.openjdk.org/jdk/pull/15392 From dholmes at openjdk.org Thu Aug 24 04:50:26 2023 From: dholmes at openjdk.org (David Holmes) Date: Thu, 24 Aug 2023 04:50:26 GMT Subject: RFR: 8314483: Optionally override copyright header in generated source In-Reply-To: References: Message-ID: On Fri, 18 Aug 2023 14:22:49 GMT, Erik Joelsson wrote: > In the JDK build we have various build tools that generate source code from data files. For most of these tools, the source files are based on template files, which already have copyright headers, but for some, the complete source file is generated by the tool, which is providing the copyright header programatically. For the latter, we would like to implement an override mechanism in each tool so that we can change the copyright header from a custom makefile. Seems reasonable. One suggested change to make the tool command-line processing more robust, but up to you whether to take it or not. Thanks. make/jdk/src/classes/build/tools/generatelsrequivmaps/EquivMapsGenerator.java line 62: > 60: StandardCharsets.UTF_8); > 61: i++; > 62: } else if (args.length != 3) { This is not very robust for detecting malformed invocations. It won't even detect a simple typo in the argument name. I would suggest something more elaborate e.g. int i 0; boolean valid = true; if (args.length != 5 && args.length !=3) { valid = false; } else if (args.length == 5) { if ( ! "-jdk-header-template".equals(args[i])) { valid = false; } else { jdkHeaderTemplate = new String(Files.readAllBytes(Paths.get(args[++i])), StandardCharsets.UTF_8); i++; } } if (!valid) { System.err.println(...); System.exit(1); } String lsrFile = args[i++]; ... ------------- Marked as reviewed by dholmes (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/15346#pullrequestreview-1592770524 PR Review Comment: https://git.openjdk.org/jdk/pull/15346#discussion_r1303797947 From erikj at openjdk.org Thu Aug 24 17:36:46 2023 From: erikj at openjdk.org (Erik Joelsson) Date: Thu, 24 Aug 2023 17:36:46 GMT Subject: RFR: 8314483: Optionally override copyright header in generated source [v2] In-Reply-To: References: Message-ID: > In the JDK build we have various build tools that generate source code from data files. For most of these tools, the source files are based on template files, which already have copyright headers, but for some, the complete source file is generated by the tool, which is providing the copyright header programatically. For the latter, we would like to implement an override mechanism in each tool so that we can change the copyright header from a custom makefile. Erik Joelsson has updated the pull request incrementally with one additional commit since the last revision: Suggestion from dholmes ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15346/files - new: https://git.openjdk.org/jdk/pull/15346/files/64bce083..a53cf2f2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15346&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15346&range=00-01 Stats: 13 lines in 1 file changed: 8 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/15346.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15346/head:pull/15346 PR: https://git.openjdk.org/jdk/pull/15346 From erikj at openjdk.org Thu Aug 24 17:40:28 2023 From: erikj at openjdk.org (Erik Joelsson) Date: Thu, 24 Aug 2023 17:40:28 GMT Subject: RFR: 8314483: Optionally override copyright header in generated source [v2] In-Reply-To: References: Message-ID: On Thu, 24 Aug 2023 04:46:31 GMT, David Holmes wrote: >> Erik Joelsson has updated the pull request incrementally with one additional commit since the last revision: >> >> Suggestion from dholmes > > make/jdk/src/classes/build/tools/generatelsrequivmaps/EquivMapsGenerator.java line 62: > >> 60: StandardCharsets.UTF_8); >> 61: i++; >> 62: } else if (args.length != 3) { > > This is not very robust for detecting malformed invocations. It won't even detect a simple typo in the argument name. I would suggest something more elaborate e.g. > > int i 0; > boolean valid = true; > if (args.length != 5 && args.length !=3) { > valid = false; > } else if (args.length == 5) { > if ( ! "-jdk-header-template".equals(args[i])) { > valid = false; > } else { > jdkHeaderTemplate = new String(Files.readAllBytes(Paths.get(args[++i])), > StandardCharsets.UTF_8); > i++; > } > } > if (!valid) { > System.err.println(...); > System.exit(1); > } > String lsrFile = args[i++]; > ... I think it actually will, but your suggestion is clearer to read, so I have applied it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15346#discussion_r1304664443 From iris at openjdk.org Thu Aug 24 17:47:26 2023 From: iris at openjdk.org (Iris Clark) Date: Thu, 24 Aug 2023 17:47:26 GMT Subject: RFR: 8314483: Optionally override copyright header in generated source [v2] In-Reply-To: References: Message-ID: On Thu, 24 Aug 2023 17:36:46 GMT, Erik Joelsson wrote: >> In the JDK build we have various build tools that generate source code from data files. For most of these tools, the source files are based on template files, which already have copyright headers, but for some, the complete source file is generated by the tool, which is providing the copyright header programatically. For the latter, we would like to implement an override mechanism in each tool so that we can change the copyright header from a custom makefile. > > Erik Joelsson has updated the pull request incrementally with one additional commit since the last revision: > > Suggestion from dholmes Marked as reviewed by iris (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/15346#pullrequestreview-1594143141 From dholmes at openjdk.org Fri Aug 25 02:32:09 2023 From: dholmes at openjdk.org (David Holmes) Date: Fri, 25 Aug 2023 02:32:09 GMT Subject: RFR: 8314483: Optionally override copyright header in generated source [v2] In-Reply-To: References: Message-ID: On Thu, 24 Aug 2023 17:36:46 GMT, Erik Joelsson wrote: >> In the JDK build we have various build tools that generate source code from data files. For most of these tools, the source files are based on template files, which already have copyright headers, but for some, the complete source file is generated by the tool, which is providing the copyright header programatically. For the latter, we would like to implement an override mechanism in each tool so that we can change the copyright header from a custom makefile. > > Erik Joelsson has updated the pull request incrementally with one additional commit since the last revision: > > Suggestion from dholmes Looks good. Thanks ------------- Marked as reviewed by dholmes (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/15346#pullrequestreview-1594728150 From aturbanov at openjdk.org Fri Aug 25 06:49:10 2023 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Fri, 25 Aug 2023 06:49:10 GMT Subject: RFR: 8314483: Optionally override copyright header in generated source [v2] In-Reply-To: References: Message-ID: On Thu, 24 Aug 2023 17:36:46 GMT, Erik Joelsson wrote: >> In the JDK build we have various build tools that generate source code from data files. For most of these tools, the source files are based on template files, which already have copyright headers, but for some, the complete source file is generated by the tool, which is providing the copyright header programatically. For the latter, we would like to implement an override mechanism in each tool so that we can change the copyright header from a custom makefile. > > Erik Joelsson has updated the pull request incrementally with one additional commit since the last revision: > > Suggestion from dholmes make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java line 236: > 234: case "-jdk-header-template": > 235: jdkHeaderTemplate = new String( > 236: Files.readAllBytes(Paths.get(args[++i])), Can `java.nio.file.Files#readString(java.nio.file.Path)` be used instead? make/jdk/src/classes/build/tools/generatelsrequivmaps/EquivMapsGenerator.java line 63: > 61: } else if (args.length == 5) { > 62: if ("-jdk-header-template".equals(args[i])) { > 63: jdkHeaderTemplate = new String(Files.readAllBytes(Paths.get(args[++i])), Can be simplified with `Files.readString(java.nio.file.Path)` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15346#discussion_r1305246836 PR Review Comment: https://git.openjdk.org/jdk/pull/15346#discussion_r1305247477 From erikj at openjdk.org Fri Aug 25 13:12:44 2023 From: erikj at openjdk.org (Erik Joelsson) Date: Fri, 25 Aug 2023 13:12:44 GMT Subject: RFR: 8314483: Optionally override copyright header in generated source [v3] In-Reply-To: References: Message-ID: > In the JDK build we have various build tools that generate source code from data files. For most of these tools, the source files are based on template files, which already have copyright headers, but for some, the complete source file is generated by the tool, which is providing the copyright header programatically. For the latter, we would like to implement an override mechanism in each tool so that we can change the copyright header from a custom makefile. Erik Joelsson has updated the pull request incrementally with one additional commit since the last revision: Use Files.readString ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15346/files - new: https://git.openjdk.org/jdk/pull/15346/files/a53cf2f2..8ab213a0 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15346&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15346&range=01-02 Stats: 7 lines in 2 files changed: 0 ins; 5 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/15346.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15346/head:pull/15346 PR: https://git.openjdk.org/jdk/pull/15346 From erikj at openjdk.org Fri Aug 25 13:12:44 2023 From: erikj at openjdk.org (Erik Joelsson) Date: Fri, 25 Aug 2023 13:12:44 GMT Subject: RFR: 8314483: Optionally override copyright header in generated source [v2] In-Reply-To: References: Message-ID: On Fri, 25 Aug 2023 06:45:25 GMT, Andrey Turbanov wrote: >> Erik Joelsson has updated the pull request incrementally with one additional commit since the last revision: >> >> Suggestion from dholmes > > make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java line 236: > >> 234: case "-jdk-header-template": >> 235: jdkHeaderTemplate = new String( >> 236: Files.readAllBytes(Paths.get(args[++i])), > > Can `java.nio.file.Files#readString(java.nio.file.Path)` be used instead? Ah yes, I was looking for that method and didn't find it, but I now realize I was looking in the jdk 8 api. Punished for not setting up an IDE for editing these files. Fixed now, thanks! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15346#discussion_r1305638090 From erikj at openjdk.org Fri Aug 25 20:45:17 2023 From: erikj at openjdk.org (Erik Joelsson) Date: Fri, 25 Aug 2023 20:45:17 GMT Subject: Integrated: 8314483: Optionally override copyright header in generated source In-Reply-To: References: Message-ID: <3x10O7FEG3JRiRXn4LmT3cST7JY7Hv5tJaa1alv5m04=.07ca1039-3c93-4d88-bb8e-ba043b504818@github.com> On Fri, 18 Aug 2023 14:22:49 GMT, Erik Joelsson wrote: > In the JDK build we have various build tools that generate source code from data files. For most of these tools, the source files are based on template files, which already have copyright headers, but for some, the complete source file is generated by the tool, which is providing the copyright header programatically. For the latter, we would like to implement an override mechanism in each tool so that we can change the copyright header from a custom makefile. This pull request has now been integrated. Changeset: 837d2e1c Author: Erik Joelsson URL: https://git.openjdk.org/jdk/commit/837d2e1cac7e006506cd4cff03862d7fbcd42140 Stats: 46 lines in 4 files changed: 37 ins; 1 del; 8 mod 8314483: Optionally override copyright header in generated source Reviewed-by: dholmes, iris ------------- PR: https://git.openjdk.org/jdk/pull/15346 From lkorinth at openjdk.org Mon Aug 28 16:01:53 2023 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 28 Aug 2023 16:01:53 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder Message-ID: Rename createJavaProcessBuilder so that it is not used by mistake instead of createTestJvm. I have used the following sed script: `find -name "*.java" | xargs -n 1 sed -i -e "s/createJavaProcessBuilder(/createJavaProcessBuilderIgnoreTestJavaOpts(/g"` Then I have manually modified ProcessTools.java. In that file I have moved one version of createJavaProcessBuilder so that it is close to the other version. Then I have added a javadoc comment in bold telling: /** * Create ProcessBuilder using the java launcher from the jdk to * be tested. * *

Please observe that you likely should use * createTestJvm() instead of this method because createTestJvm() * will add JVM options from "test.vm.opts" and "test.java.opts" * and this method will not do that. * * @param command Arguments to pass to the java command. * @return The ProcessBuilder instance representing the java command. */ I have used the name createJavaProcessBuilderIgnoreTestJavaOpts because of the name of Utils.prependTestJavaOpts that adds those VM flags. If you have a better name I could do a rename of the method. I kind of like that it is long and clumsy, that makes it harder to use... I have run tier 1 testing, and I have started more exhaustive testing. ------------- Commit messages: - 8315097: Rename createJavaProcessBuilder Changes: https://git.openjdk.org/jdk/pull/15452/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15452&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8315097 Stats: 756 lines in 462 files changed: 22 ins; 10 del; 724 mod Patch: https://git.openjdk.org/jdk/pull/15452.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15452/head:pull/15452 PR: https://git.openjdk.org/jdk/pull/15452 From lmesnik at openjdk.org Mon Aug 28 19:06:11 2023 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Mon, 28 Aug 2023 19:06:11 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder In-Reply-To: References: Message-ID: On Mon, 28 Aug 2023 15:54:08 GMT, Leo Korinth wrote: > Rename createJavaProcessBuilder so that it is not used by mistake instead of createTestJvm. > > I have used the following sed script: `find -name "*.java" | xargs -n 1 sed -i -e "s/createJavaProcessBuilder(/createJavaProcessBuilderIgnoreTestJavaOpts(/g"` > > Then I have manually modified ProcessTools.java. In that file I have moved one version of createJavaProcessBuilder so that it is close to the other version. Then I have added a javadoc comment in bold telling: > > /** > * Create ProcessBuilder using the java launcher from the jdk to > * be tested. > * > *

Please observe that you likely should use > * createTestJvm() instead of this method because createTestJvm() > * will add JVM options from "test.vm.opts" and "test.java.opts" > * and this method will not do that. > * > * @param command Arguments to pass to the java command. > * @return The ProcessBuilder instance representing the java command. > */ > > > I have used the name createJavaProcessBuilderIgnoreTestJavaOpts because of the name of Utils.prependTestJavaOpts that adds those VM flags. If you have a better name I could do a rename of the method. I kind of like that it is long and clumsy, that makes it harder to use... > > I have run tier 1 testing, and I have started more exhaustive testing. The. changes looks good. Please update copyrights for changed filed. I expect that you completed execution of all tests to ensure that nothing is broken. ------------- Marked as reviewed by lmesnik (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/15452#pullrequestreview-1598884378 From aturbanov at openjdk.org Mon Aug 28 19:52:10 2023 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Mon, 28 Aug 2023 19:52:10 GMT Subject: RFR: 8312165: Fix typos in java.desktop In-Reply-To: References: Message-ID: On Wed, 12 Jul 2023 08:33:30 GMT, Andrey Turbanov wrote: > Found many typos in java.desktop by IDEA's inspection `Proofreading | Typo` Keep alive. Let's wait for review a bit longer ------------- PR Comment: https://git.openjdk.org/jdk/pull/14847#issuecomment-1696298666 From naoto at openjdk.org Mon Aug 28 20:02:38 2023 From: naoto at openjdk.org (Naoto Sato) Date: Mon, 28 Aug 2023 20:02:38 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v9] In-Reply-To: References: Message-ID: <7dG6GEy8w0hzvsilNcMt3ggialmCLclYRFyYo7y-x1E=.8ee62abd-5176-4dae-9318-45a9d222c386@github.com> > Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html Naoto Sato has updated the pull request incrementally with four additional commits since the last revision: - Update src/java.base/share/classes/java/text/ListFormat.java Co-authored-by: Roger Riggs - Update src/java.base/share/classes/java/text/ListFormat.java Co-authored-by: Roger Riggs - Update src/java.base/share/classes/java/text/ListFormat.java Co-authored-by: Roger Riggs - Update src/java.base/share/classes/java/text/ListFormat.java Co-authored-by: Roger Riggs ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15130/files - new: https://git.openjdk.org/jdk/pull/15130/files/5b536fab..f651ff7e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=07-08 Stats: 6 lines in 1 file changed: 0 ins; 0 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/15130.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15130/head:pull/15130 PR: https://git.openjdk.org/jdk/pull/15130 From naoto at openjdk.org Mon Aug 28 20:05:41 2023 From: naoto at openjdk.org (Naoto Sato) Date: Mon, 28 Aug 2023 20:05:41 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v10] In-Reply-To: References: Message-ID: > Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Update src/java.base/share/classes/java/text/ListFormat.java Co-authored-by: Roger Riggs ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15130/files - new: https://git.openjdk.org/jdk/pull/15130/files/f651ff7e..7d7aaf48 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=08-09 Stats: 8 lines in 1 file changed: 0 ins; 1 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/15130.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15130/head:pull/15130 PR: https://git.openjdk.org/jdk/pull/15130 From naoto at openjdk.org Mon Aug 28 20:49:12 2023 From: naoto at openjdk.org (Naoto Sato) Date: Mon, 28 Aug 2023 20:49:12 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v10] In-Reply-To: References: Message-ID: <2OcLQsNLR3byAza7ZetDDQKjwtpoUCTxRWoNyvWKW44=.99888069-f14a-49e2-9749-12bc9883d92a@github.com> On Mon, 28 Aug 2023 20:05:41 GMT, Naoto Sato wrote: >> Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Update src/java.base/share/classes/java/text/ListFormat.java > > Co-authored-by: Roger Riggs Thanks, Roger. All comments make sense to me. Will update the PR soon. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15130#issuecomment-1696388823 From jlu at openjdk.org Mon Aug 28 21:22:42 2023 From: jlu at openjdk.org (Justin Lu) Date: Mon, 28 Aug 2023 21:22:42 GMT Subject: RFR: JDK-8314611: Provide more explicative error message parsing Currencies Message-ID: Please review this PR which updates some exceptions in j.util.Currency to have an explicit error message (as opposed to nothing). The exceptions occur in the two static `getInstance()` methods. They are thrown generally when the ISO 4217/3166 currency/country codes are in an invalid form, or do not exist. ------------- Commit messages: - line breaks - Invalid implies not length of 3 - init Changes: https://git.openjdk.org/jdk/pull/15458/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15458&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8314611 Stats: 37 lines in 2 files changed: 26 ins; 0 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/15458.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15458/head:pull/15458 PR: https://git.openjdk.org/jdk/pull/15458 From jlu at openjdk.org Mon Aug 28 21:33:34 2023 From: jlu at openjdk.org (Justin Lu) Date: Mon, 28 Aug 2023 21:33:34 GMT Subject: RFR: 5066247: Refine the spec of equals() and hashCode() for j.text.Format classes Message-ID: Please review this PR which refines the spec of `equals()` and `hashCode()` in `java.text.Format` related classes. The current spec for most of these methods is either "_Overrides _" or are incomplete/wrong (i.e. see `ChoiceFormat`). This fix adjusts the spec to provide a consistent definition for the overridden methods and specify what is being compared/used to generate a hash code value. For implementations that use at most a few fields, the values are stated, otherwise a more general term is used as a substitution (i.e. see `DecimalFormat`). ------------- Commit messages: - Remove additional see tag from dFmt.hashCode() - Include CompactNumberFormat.java - Drop 'Obeys the general contract' wording and further standardizing - Touch up and standardize - Update rest of related classes - Adjust ChoiceFormat (refer to public method) - Update NumberFormat - Update DecimalFormat - Update DateFormat - Adjust ChoiceFormat - ... and 1 more: https://git.openjdk.org/jdk/compare/7c169a42...84bd4708 Changes: https://git.openjdk.org/jdk/pull/15459/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15459&range=00 Issue: https://bugs.openjdk.org/browse/JDK-5066247 Stats: 117 lines in 9 files changed: 92 ins; 1 del; 24 mod Patch: https://git.openjdk.org/jdk/pull/15459.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15459/head:pull/15459 PR: https://git.openjdk.org/jdk/pull/15459 From jlu at openjdk.org Mon Aug 28 21:36:34 2023 From: jlu at openjdk.org (Justin Lu) Date: Mon, 28 Aug 2023 21:36:34 GMT Subject: RFR: JDK-8314611: Provide more explicative error message parsing Currencies [v2] In-Reply-To: References: Message-ID: > Please review this PR which updates some exceptions in j.util.Currency to have an explicit error message (as opposed to nothing). > > The exceptions are thrown when the ISO 4217/3166 currency/country codes are in an invalid form, or do not exist. Justin Lu has updated the pull request incrementally with two additional commits since the last revision: - 4217->3166 - Include the private table methods ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15458/files - new: https://git.openjdk.org/jdk/pull/15458/files/afa2e835..4fe94845 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15458&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15458&range=00-01 Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/15458.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15458/head:pull/15458 PR: https://git.openjdk.org/jdk/pull/15458 From naoto at openjdk.org Mon Aug 28 22:07:09 2023 From: naoto at openjdk.org (Naoto Sato) Date: Mon, 28 Aug 2023 22:07:09 GMT Subject: RFR: JDK-8314611: Provide more explicative error message parsing Currencies [v2] In-Reply-To: References: Message-ID: On Mon, 28 Aug 2023 21:36:34 GMT, Justin Lu wrote: >> Please review this PR which updates some exceptions in j.util.Currency to have an explicit error message (as opposed to nothing). >> >> The exceptions are thrown when the ISO 4217/3166 currency/country codes are in an invalid form, or do not exist. > > Justin Lu has updated the pull request incrementally with two additional commits since the last revision: > > - 4217->3166 > - Include the private table methods Looks good. Minor suggestion to the exception message. src/java.base/share/classes/java/util/Currency.java line 347: > 345: if (ocEntry == null) { > 346: throw new IllegalArgumentException("The input currency code" + > 347: " is not a supported ISO 4217 code"); I think "valid" is more appropriate than "supported." Applies to other locations as well. ------------- PR Review: https://git.openjdk.org/jdk/pull/15458#pullrequestreview-1599192074 PR Review Comment: https://git.openjdk.org/jdk/pull/15458#discussion_r1308004193 From jlu at openjdk.org Mon Aug 28 22:45:40 2023 From: jlu at openjdk.org (Justin Lu) Date: Mon, 28 Aug 2023 22:45:40 GMT Subject: RFR: JDK-8314611: Provide more explicative error message parsing Currencies [v3] In-Reply-To: References: Message-ID: > Please review this PR which updates some exceptions in j.util.Currency to have an explicit error message (as opposed to nothing). > > The exceptions are thrown when the ISO 4217/3166 currency/country codes are in an invalid form, or do not exist. Justin Lu has updated the pull request incrementally with one additional commit since the last revision: Wording: supported -> valid ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15458/files - new: https://git.openjdk.org/jdk/pull/15458/files/4fe94845..d134adf8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15458&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15458&range=01-02 Stats: 5 lines in 1 file changed: 0 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/15458.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15458/head:pull/15458 PR: https://git.openjdk.org/jdk/pull/15458 From naoto at openjdk.org Mon Aug 28 23:34:49 2023 From: naoto at openjdk.org (Naoto Sato) Date: Mon, 28 Aug 2023 23:34:49 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v11] In-Reply-To: References: Message-ID: > Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html 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 17 additional commits since the last revision: - Added tests - Review comments - Merge branch 'master' into JDK-8041488-ListPatterns-PR - Removed unnecessary spaces - Update src/java.base/share/classes/java/text/ListFormat.java Co-authored-by: Roger Riggs - Update src/java.base/share/classes/java/text/ListFormat.java Co-authored-by: Roger Riggs - Update src/java.base/share/classes/java/text/ListFormat.java Co-authored-by: Roger Riggs - Update src/java.base/share/classes/java/text/ListFormat.java Co-authored-by: Roger Riggs - Update src/java.base/share/classes/java/text/ListFormat.java Co-authored-by: Roger Riggs - Reflecting review comments - ... and 7 more: https://git.openjdk.org/jdk/compare/9c462970...36974db7 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15130/files - new: https://git.openjdk.org/jdk/pull/15130/files/7d7aaf48..36974db7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=09-10 Stats: 22411 lines in 951 files changed: 13246 ins; 3823 del; 5342 mod Patch: https://git.openjdk.org/jdk/pull/15130.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15130/head:pull/15130 PR: https://git.openjdk.org/jdk/pull/15130 From dholmes at openjdk.org Tue Aug 29 05:06:08 2023 From: dholmes at openjdk.org (David Holmes) Date: Tue, 29 Aug 2023 05:06:08 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder In-Reply-To: References: Message-ID: On Mon, 28 Aug 2023 15:54:08 GMT, Leo Korinth wrote: > Rename createJavaProcessBuilder so that it is not used by mistake instead of createTestJvm. > > I have used the following sed script: `find -name "*.java" | xargs -n 1 sed -i -e "s/createJavaProcessBuilder(/createJavaProcessBuilderIgnoreTestJavaOpts(/g"` > > Then I have manually modified ProcessTools.java. In that file I have moved one version of createJavaProcessBuilder so that it is close to the other version. Then I have added a javadoc comment in bold telling: > > /** > * Create ProcessBuilder using the java launcher from the jdk to > * be tested. > * > *

Please observe that you likely should use > * createTestJvm() instead of this method because createTestJvm() > * will add JVM options from "test.vm.opts" and "test.java.opts" > * and this method will not do that. > * > * @param command Arguments to pass to the java command. > * @return The ProcessBuilder instance representing the java command. > */ > > > I have used the name createJavaProcessBuilderIgnoreTestJavaOpts because of the name of Utils.prependTestJavaOpts that adds those VM flags. If you have a better name I could do a rename of the method. I kind of like that it is long and clumsy, that makes it harder to use... > > I have run tier 1 testing, and I have started more exhaustive testing. I think the admonition about using this method is a bit strong in that it is natural to use this plain process builder method when a test is going to set its own specific flags for the exec'd process. But I'm okay with renaming to avoid copy'n'paste errors that accidentally use the wrong version. Thanks ------------- Marked as reviewed by dholmes (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/15452#pullrequestreview-1599483514 From lkorinth at openjdk.org Tue Aug 29 09:12:51 2023 From: lkorinth at openjdk.org (Leo Korinth) Date: Tue, 29 Aug 2023 09:12:51 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder [v2] In-Reply-To: References: Message-ID: > Rename createJavaProcessBuilder so that it is not used by mistake instead of createTestJvm. > > I have used the following sed script: `find -name "*.java" | xargs -n 1 sed -i -e "s/createJavaProcessBuilder(/createJavaProcessBuilderIgnoreTestJavaOpts(/g"` > > Then I have manually modified ProcessTools.java. In that file I have moved one version of createJavaProcessBuilder so that it is close to the other version. Then I have added a javadoc comment in bold telling: > > /** > * Create ProcessBuilder using the java launcher from the jdk to > * be tested. > * > *

Please observe that you likely should use > * createTestJvm() instead of this method because createTestJvm() > * will add JVM options from "test.vm.opts" and "test.java.opts" > * and this method will not do that. > * > * @param command Arguments to pass to the java command. > * @return The ProcessBuilder instance representing the java command. > */ > > > I have used the name createJavaProcessBuilderIgnoreTestJavaOpts because of the name of Utils.prependTestJavaOpts that adds those VM flags. If you have a better name I could do a rename of the method. I kind of like that it is long and clumsy, that makes it harder to use... > > I have run tier 1 testing, and I have started more exhaustive testing. Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: copyright ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15452/files - new: https://git.openjdk.org/jdk/pull/15452/files/4b2d1711..f3418c80 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15452&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15452&range=00-01 Stats: 344 lines in 344 files changed: 0 ins; 0 del; 344 mod Patch: https://git.openjdk.org/jdk/pull/15452.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15452/head:pull/15452 PR: https://git.openjdk.org/jdk/pull/15452 From rriggs at openjdk.org Tue Aug 29 14:09:12 2023 From: rriggs at openjdk.org (Roger Riggs) Date: Tue, 29 Aug 2023 14:09:12 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder [v2] In-Reply-To: References: Message-ID: On Tue, 29 Aug 2023 09:12:51 GMT, Leo Korinth wrote: >> Rename createJavaProcessBuilder so that it is not used by mistake instead of createTestJvm. >> >> I have used the following sed script: `find -name "*.java" | xargs -n 1 sed -i -e "s/createJavaProcessBuilder(/createJavaProcessBuilderIgnoreTestJavaOpts(/g"` >> >> Then I have manually modified ProcessTools.java. In that file I have moved one version of createJavaProcessBuilder so that it is close to the other version. Then I have added a javadoc comment in bold telling: >> >> /** >> * Create ProcessBuilder using the java launcher from the jdk to >> * be tested. >> * >> *

Please observe that you likely should use >> * createTestJvm() instead of this method because createTestJvm() >> * will add JVM options from "test.vm.opts" and "test.java.opts" >> * and this method will not do that. >> * >> * @param command Arguments to pass to the java command. >> * @return The ProcessBuilder instance representing the java command. >> */ >> >> >> I have used the name createJavaProcessBuilderIgnoreTestJavaOpts because of the name of Utils.prependTestJavaOpts that adds those VM flags. If you have a better name I could do a rename of the method. I kind of like that it is long and clumsy, that makes it harder to use... >> >> I have run tier 1 testing, and I have started more exhaustive testing. > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > copyright I don't think this is the best change across so many files. It gives a very ugly name to a common test function and affects a very large number of tests. ------------- Changes requested by rriggs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/15452#pullrequestreview-1600512718 From lkorinth at openjdk.org Tue Aug 29 15:13:11 2023 From: lkorinth at openjdk.org (Leo Korinth) Date: Tue, 29 Aug 2023 15:13:11 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder [v2] In-Reply-To: References: Message-ID: On Tue, 29 Aug 2023 14:06:01 GMT, Roger Riggs wrote: >> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: >> >> copyright > > I don't think this is the best change across so many files. > It gives a very ugly name to a common test function and affects a very large number of tests. @RogerRiggs If it is only the name you want changed, maybe you can offer a better name? ------------- PR Comment: https://git.openjdk.org/jdk/pull/15452#issuecomment-1697634872 From naoto at openjdk.org Tue Aug 29 16:28:09 2023 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 29 Aug 2023 16:28:09 GMT Subject: RFR: 8312521: Unused field LocaleProviderAdapter#defaultLocaleProviderAdapter could be removed In-Reply-To: References: Message-ID: On Tue, 22 Aug 2023 12:22:54 GMT, Andrey Turbanov wrote: > After [JDK-8245241](https://bugs.openjdk.org/browse/JDK-8245241), the field `sun.util.locale.provider.LocaleProviderAdapter#defaultLocaleProviderAdapter` is only written in `` and then is not used after. > We can remove it. Thanks for cleaning the leftovers. Looks good. ------------- Marked as reviewed by naoto (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/15388#pullrequestreview-1600838247 From naoto at openjdk.org Tue Aug 29 16:43:12 2023 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 29 Aug 2023 16:43:12 GMT Subject: RFR: JDK-8314611: Provide more explicative error message parsing Currencies [v3] In-Reply-To: References: Message-ID: On Mon, 28 Aug 2023 22:45:40 GMT, Justin Lu wrote: >> Please review this PR which updates some exceptions in j.util.Currency to have an explicit error message (as opposed to nothing). >> >> The exceptions are thrown when the ISO 4217/3166 currency/country codes are in an invalid form, or do not exist. > > Justin Lu has updated the pull request incrementally with one additional commit since the last revision: > > Wording: supported -> valid I think the same wording changes are needed in the test, as it checks the error messages word by word. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15458#issuecomment-1697797322 From rriggs at openjdk.org Tue Aug 29 16:48:15 2023 From: rriggs at openjdk.org (Roger Riggs) Date: Tue, 29 Aug 2023 16:48:15 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder [v2] In-Reply-To: References: Message-ID: <5AjL4PbmGc-9jQdiCK1jd4LDdC-B7NgJ_dwIZW1U-aA=.0ad22596-a1f9-4e87-946f-dceedf0a37e5@github.com> On Tue, 29 Aug 2023 14:06:01 GMT, Roger Riggs wrote: >> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: >> >> copyright > > I don't think this is the best change across so many files. > It gives a very ugly name to a common test function and affects a very large number of tests. > @RogerRiggs If it is only the name you want changed, maybe you can offer a better name? @lkorinth Sorry for the too short comment; I wanted to make sure it wasn't integrated before I could look at it more closely. Neither the bug report or the PR describe the problem and its ramifications, only the solution. Can you elaborate on the conditions that lead to this. (and include them in the bug report). ------------- PR Comment: https://git.openjdk.org/jdk/pull/15452#issuecomment-1697803842 From naoto at openjdk.org Tue Aug 29 16:51:49 2023 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 29 Aug 2023 16:51:49 GMT Subject: RFR: 8041488: Locale-Dependent List Patterns [v12] In-Reply-To: References: Message-ID: > Introducing a new formatting class for locale-dependent list patterns. The class is to provide the functionality from the Unicode Consortium's LDML specification for [list patterns](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, given a list of String as "Monday", "Wednesday", "Friday", its `format` method would produce "Monday, Wednesday, and Friday" in US English. A CSR has also been drafted, and its draft javadoc can be viewed here: https://cr.openjdk.org/~naoto/JDK-8041488-ListPatterns-PR/api.00/java.base/java/text/ListFormat.html Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Removing unnecessary commas ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15130/files - new: https://git.openjdk.org/jdk/pull/15130/files/36974db7..a228a3e3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=11 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15130&range=10-11 Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/15130.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15130/head:pull/15130 PR: https://git.openjdk.org/jdk/pull/15130 From naoto at openjdk.org Tue Aug 29 16:53:38 2023 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 29 Aug 2023 16:53:38 GMT Subject: RFR: JDK-8314611: Provide more explicative error message parsing Currencies [v4] In-Reply-To: References: Message-ID: <9eZj8AETBHiQ2lyHNAWAt_aZr1PmjeWXG126FQ8T7WE=.87c30c06-fa77-4c4b-8c3f-37a0ddbea8a4@github.com> On Tue, 29 Aug 2023 16:48:27 GMT, Justin Lu wrote: >> Please review this PR which updates some exceptions in j.util.Currency to have an explicit error message (as opposed to nothing). >> >> The exceptions are thrown when the ISO 4217/3166 currency/country codes are in an invalid form, or do not exist. > > Justin Lu has updated the pull request incrementally with one additional commit since the last revision: > > Change wording in test as well LGTM ------------- Marked as reviewed by naoto (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/15458#pullrequestreview-1600876737 From jlu at openjdk.org Tue Aug 29 16:53:39 2023 From: jlu at openjdk.org (Justin Lu) Date: Tue, 29 Aug 2023 16:53:39 GMT Subject: RFR: JDK-8314611: Provide more explicative error message parsing Currencies [v3] In-Reply-To: References: Message-ID: On Tue, 29 Aug 2023 16:40:07 GMT, Naoto Sato wrote: > I think the same wording changes are needed in the test, as it checks the error messages word by word. You're totally right, just fixed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15458#issuecomment-1697803949 From jlu at openjdk.org Tue Aug 29 16:53:38 2023 From: jlu at openjdk.org (Justin Lu) Date: Tue, 29 Aug 2023 16:53:38 GMT Subject: RFR: JDK-8314611: Provide more explicative error message parsing Currencies [v4] In-Reply-To: References: Message-ID: > Please review this PR which updates some exceptions in j.util.Currency to have an explicit error message (as opposed to nothing). > > The exceptions are thrown when the ISO 4217/3166 currency/country codes are in an invalid form, or do not exist. Justin Lu has updated the pull request incrementally with one additional commit since the last revision: Change wording in test as well ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15458/files - new: https://git.openjdk.org/jdk/pull/15458/files/d134adf8..96efc13a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15458&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15458&range=02-03 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/15458.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15458/head:pull/15458 PR: https://git.openjdk.org/jdk/pull/15458 From jlu at openjdk.org Tue Aug 29 17:01:32 2023 From: jlu at openjdk.org (Justin Lu) Date: Tue, 29 Aug 2023 17:01:32 GMT Subject: RFR: 8314925: ChoiceFormat does not specify IllegalArgumentExceptions Message-ID: Please review this PR and [CSR](https://bugs.openjdk.org/browse/JDK-8315148) which is a conformance change to specify exceptions in java.text.ChoiceFormat. Makes `IllegalArgumentException` apparent for `applyPattern` and `setChoices`, as well as for the associated constructors that call the methods. This change also improves the error message for the `setChoices` IAE. ------------- Commit messages: - Include constructor + grab exceptions from 'pull/15392' - init Changes: https://git.openjdk.org/jdk/pull/15473/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15473&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8314925 Stats: 9 lines in 1 file changed: 8 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/15473.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15473/head:pull/15473 PR: https://git.openjdk.org/jdk/pull/15473 From jlu at openjdk.org Tue Aug 29 17:01:32 2023 From: jlu at openjdk.org (Justin Lu) Date: Tue, 29 Aug 2023 17:01:32 GMT Subject: RFR: 8314925: ChoiceFormat does not specify IllegalArgumentExceptions In-Reply-To: References: Message-ID: <2aiO0mXFVC_VVSTQFnm_VuNtxqgAXUUQwII6eJlM_L0=.8ea51cc1-e6b0-4c35-9941-a4cddd84a053@github.com> On Tue, 29 Aug 2023 16:53:29 GMT, Justin Lu wrote: > Please review this PR and [CSR](https://bugs.openjdk.org/browse/JDK-8315148) which is a conformance change to specify exceptions in java.text.ChoiceFormat. > > Makes `IllegalArgumentException` apparent for `applyPattern` and `setChoices`, as well as for the associated constructors that call the methods. > > This change also improves the error message for the `setChoices` IAE. src/java.base/share/classes/java/text/ChoiceFormat.java line 180: > 178: * is {@code null} > 179: * @throws IllegalArgumentException if {@code newPattern} > 180: * is invalid This would probably more informative if it was changed to `IllegalArgumentException if {@code newPattern} violates the ChoiceFormat pattern syntax`. However, as of now I kept it this way because there is no defined syntax ATM (although I have a PR for that here -> https://github.com/openjdk/jdk/pull/15392) and the other Format classes all also follow the "... is invalid" wording. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15473#discussion_r1309114867 From naoto at openjdk.org Tue Aug 29 18:06:10 2023 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 29 Aug 2023 18:06:10 GMT Subject: RFR: 8314604: j.text.DecimalFormat behavior regarding patterns is not clear In-Reply-To: <4IjlWcNJRJ3nFa3cWecEbIZu8JE6n2MswgQyx_fbYP8=.0686c00f-94ee-499e-b3eb-759f6ad75d55@github.com> References: <4IjlWcNJRJ3nFa3cWecEbIZu8JE6n2MswgQyx_fbYP8=.0686c00f-94ee-499e-b3eb-759f6ad75d55@github.com> Message-ID: On Fri, 18 Aug 2023 21:28:34 GMT, Justin Lu wrote: > Please review this PR and [CSR](https://bugs.openjdk.org/browse/JDK-8314607) which clarifies the behavior of patterns in regards to the max integer digits in j.text.DecimalFormat. > > The current specification (of `applyPattern`) states that patterns do not set the value of max integer digits. This is incorrect, these methods/constructors do set a value for the max integer digits. If the pattern is in scientific notation, the max integer digits value is derived from the pattern. Otherwise, the pattern is ignored, and the limit is set to `Integer.MAX_VALUE`. > > See below, > > DecimalFormat df = new DecimalFormat(); > df.applyPattern("000.000E0"); > df.getMaximumIntegerDigits(); // ==> 3 > df.applyPattern("000.000"); > df.getMaximumIntegerDigits(); // ==> 2147483647 > > DecimalFormat df = new DecimalFormat("000.000"); > df.getMaximumIntegerDigits(); // ==> 2147483647 > DecimalFormat df = new DecimalFormat("000.000E0"); > df.getMaximumIntegerDigits(); // ==> 3 > > > Method descriptions should be fixed, and the relevant constructors need to mention the behavior as well. src/java.base/share/classes/java/text/DecimalFormat.java line 458: > 456: * is the typical end-user desire. Use {@link #setMaximumIntegerDigits(int)} > 457: * if you want to set a specific limit to integer digits when the > 458: * given pattern is not in scientific notation. It could be simpler if the normal case (Integer.MAX_VALUE) comes first, then the scientific notation case in which you can refer to the max integer digit in the class description. Also, `setMaximumIntegerDigits` can be called on a scientific notation as well, correct? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15349#discussion_r1309181469 From jlu at openjdk.org Tue Aug 29 18:21:09 2023 From: jlu at openjdk.org (Justin Lu) Date: Tue, 29 Aug 2023 18:21:09 GMT Subject: RFR: 8314604: j.text.DecimalFormat behavior regarding patterns is not clear In-Reply-To: References: <4IjlWcNJRJ3nFa3cWecEbIZu8JE6n2MswgQyx_fbYP8=.0686c00f-94ee-499e-b3eb-759f6ad75d55@github.com> Message-ID: On Tue, 29 Aug 2023 18:02:51 GMT, Naoto Sato wrote: >> Please review this PR and [CSR](https://bugs.openjdk.org/browse/JDK-8314607) which clarifies the behavior of patterns in regards to the max integer digits in j.text.DecimalFormat. >> >> The current specification (of `applyPattern`) states that patterns do not set the value of max integer digits. This is incorrect, these methods/constructors do set a value for the max integer digits. If the pattern is in scientific notation, the max integer digits value is derived from the pattern. Otherwise, the pattern is ignored, and the limit is set to `Integer.MAX_VALUE`. >> >> See below, >> >> DecimalFormat df = new DecimalFormat(); >> df.applyPattern("000.000E0"); >> df.getMaximumIntegerDigits(); // ==> 3 >> df.applyPattern("000.000"); >> df.getMaximumIntegerDigits(); // ==> 2147483647 >> >> DecimalFormat df = new DecimalFormat("000.000"); >> df.getMaximumIntegerDigits(); // ==> 2147483647 >> DecimalFormat df = new DecimalFormat("000.000E0"); >> df.getMaximumIntegerDigits(); // ==> 3 >> >> >> Method descriptions should be fixed, and the relevant constructors need to mention the behavior as well. > > src/java.base/share/classes/java/text/DecimalFormat.java line 458: > >> 456: * is the typical end-user desire. Use {@link #setMaximumIntegerDigits(int)} >> 457: * if you want to set a specific limit to integer digits when the >> 458: * given pattern is not in scientific notation. > > It could be simpler if the normal case (Integer.MAX_VALUE) comes first, then the scientific notation case in which you can refer to the max integer digit in the class description. Also, `setMaximumIntegerDigits` can be called on a scientific notation as well, correct? Thank you for the review. Will adjust with your suggestions. > Also, `setMaximumIntegerDigits` can be called on a scientific notation as well, correct? I meant that you pretty much only need to consider calling `setMaximumIntegerDigits` when the pattern is not in scientific notation, not that you are not able to. Will make this clearer. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15349#discussion_r1309195909 From cjplummer at openjdk.org Tue Aug 29 19:25:12 2023 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 29 Aug 2023 19:25:12 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder [v2] In-Reply-To: References: Message-ID: On Tue, 29 Aug 2023 09:12:51 GMT, Leo Korinth wrote: >> Rename createJavaProcessBuilder so that it is not used by mistake instead of createTestJvm. >> >> I have used the following sed script: `find -name "*.java" | xargs -n 1 sed -i -e "s/createJavaProcessBuilder(/createJavaProcessBuilderIgnoreTestJavaOpts(/g"` >> >> Then I have manually modified ProcessTools.java. In that file I have moved one version of createJavaProcessBuilder so that it is close to the other version. Then I have added a javadoc comment in bold telling: >> >> /** >> * Create ProcessBuilder using the java launcher from the jdk to >> * be tested. >> * >> *

Please observe that you likely should use >> * createTestJvm() instead of this method because createTestJvm() >> * will add JVM options from "test.vm.opts" and "test.java.opts" >> * and this method will not do that. >> * >> * @param command Arguments to pass to the java command. >> * @return The ProcessBuilder instance representing the java command. >> */ >> >> >> I have used the name createJavaProcessBuilderIgnoreTestJavaOpts because of the name of Utils.prependTestJavaOpts that adds those VM flags. If you have a better name I could do a rename of the method. I kind of like that it is long and clumsy, that makes it harder to use... >> >> I have run tier 1 testing, and I have started more exhaustive testing. > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > copyright > I kind of like that it is long and clumsy, that makes it harder to use... ...but it's used in 462 files. That implies it is commonly used. Are you suggesting nearly all those uses are incorrect and eventually should be converted to `createTestJvm()`? ------------- PR Comment: https://git.openjdk.org/jdk/pull/15452#issuecomment-1698003837 From aivanov at openjdk.org Tue Aug 29 19:56:42 2023 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 29 Aug 2023 19:56:42 GMT Subject: RFR: 8312165: Fix typos in java.desktop In-Reply-To: References: Message-ID: <2SHwXGKIcwGxcQmaD8kDCAWF1o_ZOvtzc_cltU8mXiw=.9600f497-24ef-4d72-a79e-468b9bdc3a41@github.com> On Wed, 12 Jul 2023 08:33:30 GMT, Andrey Turbanov wrote: > Found many typos in java.desktop by IDEA's inspection `Proofreading | Typo` Please break such changes into smaller batches: reviewing nearly 200 files is tedious and requires lots of time. Changesets consisting of no more than 20 or 40 files would likely be reviewed quicker. src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java line 1417: > 1415: // NOTE: we shouldn't have to do this, since JFileChooser adds > 1416: // the filter to the choosable filters list when the filter > 1417: // is set. Lets be paranoid just in case someone overrides Suggestion: // is set. Let's be paranoid just in case someone overrides src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java line 637: > 635: greyscale images but explicitly resetting it here > 636: is potentially not right thing to do until we have way > 637: to find whether current value was explicitly set by Suggestion: greyscale images but explicitly resetting it here is potentially not the right thing to do until we have a way to find whether the current value was explicitly set by src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java line 1473: > 1471: // NOTE: we shouldn't have to do this, since JFileChooser adds > 1472: // the filter to the choosable filters list when the filter > 1473: // is set. Lets be paranoid just in case someone overrides Suggestion: // is set. Let's be paranoid just in case someone overrides src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java line 778: > 776: if (value != null) { > 777: //This is a workaround as the "slider-length" property has been > 778: //deprecated for GtkScale from gtk 3.20, so default value of 31 Suggestion: //deprecated for GtkScale from gtk 3.20, so the default value of 31 src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java line 781: > 779: //is used and makes rendering of slider wrong. Value 14 is being > 780: //used as default value for Slider.thumbHeight is 14 and making > 781: //width 14 as well makes slider thumb render in proper shape Suggestion: //is used and makes rendering of the slider wrong. Value 14 is //used as the default value for Slider.thumbHeight and making //width 14 as well makes the slider thumb render in proper shape src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java line 831: > 829: // NOTE: we shouldn't have to do this, since JFileChooser adds > 830: // the filter to the choosable filters list when the filter > 831: // is set. Lets be paranoid just in case someone overrides Suggestion: // is set. Let's be paranoid just in case someone overrides src/java.desktop/share/classes/java/awt/FlowLayout.java line 654: > 652: private static final int currentSerialVersion = 1; > 653: /** > 654: * This represent the {@code currentSerialVersion} Suggestion: * This represents the {@code currentSerialVersion} src/java.desktop/share/classes/java/awt/GridLayout.java line 438: > 436: } > 437: // 4370316. To position components in the center we should: > 438: // 1. get an amount of extra space within Container Suggestion: // 1. get the amount of extra space within Container src/java.desktop/share/classes/java/awt/GridLayout.java line 441: > 439: // 2. incorporate half of that value to the left/top position > 440: // Note that we use truncating division for widthOnComponent > 441: // The reminder goes to extraWidthAvailable Suggestion: // The remainder goes to extraWidthAvailable src/java.desktop/share/classes/java/beans/DefaultPersistenceDelegate.java line 300: > 298: > 299: // The ComponentListener is added automatically, when > 300: // Container:add is called on the parent. Suggestion: // Container.add is called on the parent. I believe it refers to the `add` method in `Container` class, in Java we usually use dots to refer to methods. src/java.desktop/share/classes/java/beans/MetaData.java line 307: > 305: > 306: /** > 307: * Invoke Timestamp getNanos. Should it be `Timestamp.getNanos`? src/java.desktop/share/classes/javax/swing/BufferStrategyPaintManager.java line 694: > 692: * > 693: * @param create If true, and the BufferStrategy is currently null, > 694: * one will be created. Suggestion: * @param create If true and the BufferStrategy is currently null, * one will be created. I'm pretty sure the comma shouldn't be here: it means ?if true and *if* the BufferStrategy is??. src/java.desktop/share/classes/javax/swing/JLayeredPane.java line 468: > 466: * @return an int giving the component's position, where 0 is the > 467: * topmost position and the highest index value = the count > 468: * of components at that layer, minus 1 Suggestion: * of components at that layer minus 1 Comma is confusing here, it means ?the count ? minus 1?. src/java.desktop/share/classes/javax/swing/JMenuItem.java line 189: > 187: /** > 188: * Initializes the focusability of the JMenuItem. > 189: * JMenuItem's are focusable, but subclasses may Suggestion: * JMenuItem's are non-focusable, but subclasses may The code calls `setFocusable(false)`; otherwise, the following sentence ?but subclasses may want to be? doesn't make sense. Thus, it implies a negation in the preceding sentence. src/java.desktop/share/classes/javax/swing/JMenuItem.java line 811: > 809: * the AccessibleContext takes the form of an > 810: * AccessibleJMenuItem. > 811: * A new AccessibleJMenuItem instance is created if necessary. Suggestion: * A new AccessibleJMenuItem instance is created if necessary. src/java.desktop/share/classes/javax/swing/JPopupMenu.java line 345: > 343: Point popupLocation = new Point(xPosition, yPosition); > 344: > 345: if(popupPositionFixDisabled == true || GraphicsEnvironment.isHeadless()) { Suggestion: if (popupPositionFixDisabled || GraphicsEnvironment.isHeadless()) { The code below has spaces after 'if'; comparing a boolean value to `true` is redundant. src/java.desktop/share/classes/javax/swing/JTree.java line 3108: > 3106: > 3107: // start search from the next/previous element from the > 3108: // selected element Suggestion: // start search from the next/previous element of the // selected element Does it sound better? src/java.desktop/share/classes/javax/swing/PopupFactory.java line 540: > 538: > 539: /** > 540: * As we recycle the Window, we don't want to dispose it, Suggestion: * As we recycle the Window, we don't want to dispose of it, The verb *?dispose?* requires the preposition *?of?*. src/java.desktop/share/classes/javax/swing/RepaintManager.java line 1868: > 1866: */ > 1867: private final class ProcessingRunnable implements Runnable { > 1868: // If true, we're wanting on the EventQueue. Suggestion: // If true, we're waiting on the EventQueue. src/java.desktop/share/classes/javax/swing/SortingFocusTraversalPolicy.java line 285: > 283: > 284: // Before all the checks below we first see if it's an FTP provider or a focus cycle root. > 285: // If it's the case just go down cycle (if it's set to "implicit"). Suggestion: // If it's the case, just go down cycle (if it's set to "implicit"). src/java.desktop/share/classes/javax/swing/SwingWorker.java line 251: > 249: > 250: /** > 251: * everything is run inside this FutureTask. Also it is used as Suggestion: * Everything is run inside this FutureTask. Also it is used as src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java line 1030: > 1028: if(!lastFocused.requestFocusInWindow()) { > 1029: // Workaround for 4810575. > 1030: // If lastFocused is not in currently focused window Suggestion: // If lastFocused is not in currently focused window, src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java line 1121: > 1119: > 1120: // We use the location from the UI directly, as the location the > 1121: // JSplitPane itself maintains is not necessary correct. Suggestion: // JSplitPane itself maintains is not necessarily correct. src/java.desktop/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java line 341: > 339: } > 340: > 341: // These two methods were overloaded and made public. This was probably a Suggestion: // These two methods were overridden and made public. This was probably a Overloading means a different thing: two or more methods with the same name but with different parameters, doesn't it? src/java.desktop/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java line 414: > 412: > 413: // This method was overloaded and made public. This was probably > 414: // mistake in the implementation. The functionality that they used to Suggestion: // This method was overridden and made public. This was probably a // mistake in the implementation. The functionality that it used to src/java.desktop/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java line 416: > 414: // mistake in the implementation. The functionality that they used to > 415: // provide is no longer necessary and should be removed. However, > 416: // removing them will create an incompatible API change. Suggestion: // removing it will create an incompatible API change. src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java line 1202: > 1200: // NOTE: we shouldn't have to do this, since JFileChooser adds > 1201: // the filter to the choosable filters list when the filter > 1202: // is set. Lets be paranoid just in case someone overrides Suggestion: // is set. Let's be paranoid just in case someone overrides src/java.desktop/share/classes/javax/swing/plaf/nimbus/DropShadowEffect.java line 45: > 43: /** > 44: * Get the type of this effect, one of UNDER,BLENDED,OVER. UNDER means the result of apply effect should be painted > 45: * under the src image. BLENDED means the result of apply effect contains a modified src image so just it should be Suggestion: * under the src image. BLENDED means the result of apply effect contains a modified src image so it should just be It just doesn't sound right. Should it be *?the result of applying the effect?*? src/java.desktop/share/classes/javax/swing/plaf/nimbus/Effect.java line 47: > 45: /** > 46: * Get the type of this effect, one of UNDER,BLENDED,OVER. UNDER means the result of apply effect should be painted > 47: * under the src image. BLENDED means the result of apply effect contains a modified src image so just it should be Suggestion: * under the src image. BLENDED means the result of apply effect contains a modified src image so just it should just be src/java.desktop/share/classes/javax/swing/plaf/nimbus/Effect.java line 48: > 46: * Get the type of this effect, one of UNDER,BLENDED,OVER. UNDER means the result of apply effect should be painted > 47: * under the src image. BLENDED means the result of apply effect contains a modified src image so just it should be > 48: * painted. OVER means the result of apply effect should be painted over the src image. Based on the comment for the `applyEffect` method, it should rather be *?the result of applying the effect?* in all the cases and in `DropShadowEffect.java`. src/java.desktop/share/classes/javax/swing/plaf/nimbus/Effect.java line 71: > 69: * @param h The height of the src image to apply effect to, this allow the src and dst buffers to be bigger than > 70: * the area the need effect applied to it > 71: * @return The result of apply Suggestion: * @return The result of applying the effect src/java.desktop/share/classes/javax/swing/plaf/nimbus/InnerShadowEffect.java line 45: > 43: /** > 44: * Get the type of this effect, one of UNDER,BLENDED,OVER. UNDER means the result of apply effect should be painted > 45: * under the src image. BLENDED means the result of apply effect contains a modified src image so just it should be Suggestion: * under the src image. BLENDED means the result of applying the effect contains a modified src image so it should just be src/java.desktop/share/classes/javax/swing/plaf/nimbus/InnerShadowEffect.java line 48: > 46: * painted. OVER means the result of apply effect should be painted over the src image. > 47: * > 48: * @return The effect type Should we replace this copied javadoc with `{@inheritDoc}`? The text from `Effect.getEffectType` isn't modified at all. This looks the correct fix ? eliminate doc duplication. src/java.desktop/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java line 548: > 546: } > 547: > 548: // if the width is even, bump it up one. This is critical Suggestion: // if the width is even, bump it up by one. This is critical src/java.desktop/share/classes/javax/swing/plaf/synth/SynthParser.java line 185: > 183: > 184: /** > 185: * defaultsProperties are placed here. Suggestion: * Default properties are placed here. Does it sound better? src/java.desktop/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java line 115: > 113: // key "JComponent.sizeVariant" scales for large/small/mini > 114: // components are based on Apples LAF > 115: String scaleKey = (String)scrollbar.getClientProperty( This looks like a duplicate code in `Synth*UI` which boils down to determining the scale based on the value of `scaleKey` and then applying it to a set of variables. Obviously, it's out of scope for this bug, yet it may be worth exploring? src/java.desktop/share/classes/javax/swing/text/CompositeView.java line 47: > 45: *

While CompositeView > 46: * does not impose a layout policy on its child Views, > 47: * it does allow for inserting the child Views Suggestion: * it does allow for insetting the child Views It's non-standard, it refers to applying *insets*. src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java line 1290: > 1288: Position.Bias guessBiasForOffset(int offset, Position.Bias lastBias, > 1289: boolean lastLTR) { > 1290: // There is an ambiguous case here. That if your model looks like: Suggestion: // There is an ambiguous case here. If your model looks like: src/java.desktop/share/classes/javax/swing/text/DefaultCaret.java line 1293: > 1291: // abAB with the cursor at abB]A (visual representation of > 1292: // 3 forward) deleting could either become abB] or > 1293: // ab[B. I'ld actually prefer abB]. But, if I implement that Suggestion: // ab[B. I'd actually prefer abB]. But, if I implement that src/java.desktop/share/classes/javax/swing/text/DefaultFormatter.java line 1: > 1: /* Perhaps, we should leave **?overwrite?** only. A *strike-through* means a line drawn over the text, ~~like this~~. I hardly understand what *?overstrike?* means, see the `setOverwriteMode` method: https://github.com/openjdk/jdk/blob/e22762c010e5cd4c313e5f2816b67d75862935a7/src/java.desktop/share/classes/javax/swing/text/DefaultFormatter.java#L162-L164 As far as I understand, it refers to the **overwrite mode** when typed characters aren't inserted but instead they replace the characters present in the text. To clarify the meaning, * @param overwriteMode Indicates if overwrite or overstrike mode is used */ public void setOverwriteMode(boolean overwriteMode) { src/java.desktop/share/classes/javax/swing/text/DefaultFormatter.java line 67: > 65: private boolean allowsInvalid; > 66: > 67: /** If true, editing mode is in overwrite (or strikethrough). */ Suggestion: /** If true, overwrite mode is enabled. */ src/java.desktop/share/classes/javax/swing/tree/DefaultTreeModel.java line 351: > 349: * the array of the children objects that were removed. > 350: * > 351: * @param node parent node which children were removed Suggestion: * @param node parent node from which children were removed src/java.desktop/share/classes/sun/awt/FontConfiguration.java line 1556: > 1554: } > 1555: > 1556: /* Same as getComponentFontID() except this method returns the fontID define by Suggestion: /* Same as getComponentFontID() except this method returns the fontID defined by src/java.desktop/share/classes/sun/print/ProxyPrintGraphics.java line 95: > 93: /* Spec implies dispose() should flush the page, but the implementation > 94: * has in fact always done this on the getGraphics() call, thereby > 95: * ensuring that multiple pages are cannot be rendered simultaneously. Suggestion: * ensuring that multiple pages cannot be rendered simultaneously. src/java.desktop/share/classes/sun/swing/FilePane.java line 134: > 132: * This component is intended to be used in a subclass of > 133: * javax.swing.plaf.basic.BasicFileChooserUI. It relies heavily on the > 134: * implementation of BasicFileChooserUI, and is intended to be API compatible Suggestion: * implementation of BasicFileChooserUI and is intended to be API compatible Comma is not needed here. src/java.desktop/share/classes/sun/swing/SwingUtilities2.java line 345: > 343: * > 344: * @param c JComponent requesting FontMetrics, may be null > 345: * @param g Graphics Graphics Suggestion: * @param g Graphics src/java.desktop/share/classes/sun/swing/SwingUtilities2.java line 348: > 346: * @param font Font to get FontMetrics for > 347: */ > 348: @SuppressWarnings("deprecation") Just below: - // from the widget to layout out text, otherwise we can get + // from the widget to lay out text, otherwise we can get src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java line 947: > 945: // NOTE: we shouldn't have to do this, since JFileChooser adds > 946: // the filter to the choosable filters list when the filter > 947: // is set. Lets be paranoid just in case someone overrides Suggestion: // is set. Let's be paranoid just in case someone overrides src/java.desktop/unix/classes/sun/awt/X11/XCheckboxMenuItemPeer.java line 52: > 50: ************************************************/ > 51: > 52: //Prom CheckboxMenuItemPeer Suggestion: //From CheckboxMenuItemPeer However, I'd rather remove the comment altogether: the IDE shows that it implements an interface, `CheckboxMenuItemPeer` in this case. src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java line 118: > 116: // use a combination of firstPress and wasDragged variables. > 117: // The only difference in dragging and wasDragged is: last one will not > 118: // set to false on mouse ungrab. It become false after MouseReleased() finishes. Suggestion: // set to false on mouse ungrab. It becomes false after MouseReleased() finishes. src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java line 1133: > 1131: /* Returns true if the MouseEvent coords > 1132: * are inside of the Choice itself (it doesn't depend on > 1133: * if this choice opened or not). Suggestion: * whether this choice opened or not). src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java line 1273: > 1271: // 'Component'-instances are "remembered". And events are dispatched to > 1272: // these remembered components, without checking, if XTextAreaPeer has > 1273: // replaced these instances with another ones. This also applies to Suggestion: // replaced these instances with other ones. This also applies to src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java line 516: > 514: PrintService defService; > 515: if (name != null && (defService = getDefaultPrintService()) != null) { > 516: /* To avoid executing a unix command see if the client is asking Suggestion: /* To avoid executing a unix command, see if the client is asking src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxUI.java line 44: > 42: // NOTE: MetalCheckBoxUI inherits from MetalRadioButtonUI instead > 43: // of BasicCheckBoxUI because we want to pick up all the > 44: // painting changes made in MetalRadioButtonUI. Does it even apply here? Should it be instead? Suggestion: // NOTE: WindowsCheckBoxUI inherits from WindowsRadioButtonUI instead // of BasicCheckBoxUI because we want to pick up all the // painting changes made in WindowsRadioButtonUI. src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java line 1272: > 1270: // NOTE: we shouldn't have to do this, since JFileChooser adds > 1271: // the filter to the choosable filters list when the filter > 1272: // is set. Lets be paranoid just in case someone overrides Suggestion: // is set. Let's be paranoid just in case someone overrides src/java.desktop/windows/classes/sun/java2d/d3d/D3DSurfaceData.java line 961: > 959: void disableAccelerationForSurface() { > 960: // for on-screen surfaces we need to make sure a backup GDI surface is > 961: // is used until a new one is set (which may happen during a resize). We Suggestion: // for on-screen surfaces we need to make sure a backup GDI surface is // used until a new one is set (which may happen during a resize). We src/java.desktop/windows/classes/sun/java2d/d3d/D3DSurfaceData.java line 962: > 960: // for on-screen surfaces we need to make sure a backup GDI surface is > 961: // is used until a new one is set (which may happen during a resize). We > 962: // don't want the screen update manager to replace the surface right way Suggestion: // don't want the screen update manager to replace the surface right away ------------- Changes requested by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/14847#pullrequestreview-1600838079 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309080750 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309086752 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309088644 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309092167 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309093695 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309095668 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309099295 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309100522 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309101492 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309106855 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309109398 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309115662 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309122200 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309127430 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309128217 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309129658 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309135107 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309137008 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309138791 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309159535 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309161535 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309168222 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309170693 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309177171 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309178985 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309179206 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309180019 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309185080 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309187932 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309187686 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309186380 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309189774 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309193940 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309195645 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309196696 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309201277 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309204741 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309205720 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309206307 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309216328 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309217716 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309225940 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309228312 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309256150 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309258032 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309259695 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309261018 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309263760 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309269770 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309271576 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309272085 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309277505 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309281489 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309283345 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309283892 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309286547 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309286878 From naoto at openjdk.org Tue Aug 29 20:21:09 2023 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 29 Aug 2023 20:21:09 GMT Subject: RFR: 5066247: Refine the spec of equals() and hashCode() for j.text.Format classes In-Reply-To: References: Message-ID: <40Xk4qJLPGjJQHhslejdmheMW400kF_cEyGM7M3URI0=.b6e374f2-c08f-4f62-baed-3ec70894e0af@github.com> On Mon, 28 Aug 2023 21:24:18 GMT, Justin Lu wrote: > Please review this PR which refines the spec of `equals()` and `hashCode()` in `java.text.Format` related classes. > > The current spec for most of these methods is either "_Overrides _" or are incomplete/wrong (i.e. see `ChoiceFormat`). > > This fix adjusts the spec to provide a consistent definition for the overridden methods and specify what is being compared/used to generate a hash code value. > > For implementations that use at most a few fields, the values are stated, otherwise a more general term is used as a substitution (i.e. see `DecimalFormat`). src/java.base/share/classes/java/text/ChoiceFormat.java line 501: > 499: * > 500: * The hash code value is based on the values returned by {@link #getLimits()} and > 501: * {@link #getFormats()}. Could this part (and its counterpart in `equals()`) be more generalized? In this method, it spells out the fields to be considered, and in other classes, it simply mentions "same format configuration." Maybe using links to `Serialized Form` and making the sentence more generic? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15459#discussion_r1309312616 From aivanov at openjdk.org Tue Aug 29 20:25:11 2023 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 29 Aug 2023 20:25:11 GMT Subject: RFR: 8312165: Fix typos in java.desktop In-Reply-To: References: Message-ID: On Wed, 12 Jul 2023 08:33:30 GMT, Andrey Turbanov wrote: > Found many typos in java.desktop by IDEA's inspection `Proofreading | Typo` src/java.desktop/share/classes/javax/swing/JLayeredPane.java line 532: > 530: if(curLayer == layer) { > 531: layerCount++; > 532: /// Short circuit the counting when we have them all When used as a verb, it's usually spelt with the hyphen ? *short-circuit* ? as written here, see [?short-circuit? on Merriam Webster](https://www.merriam-webster.com/dictionary/short-circuit), [?short-circuit? on Collin's Dictionary](https://www.collinsdictionary.com/dictionary/english/short-circuit). The [?short-circuit? entry on Wiktionary](https://en.wiktionary.org/wiki/short_circuit#Verb) lists the spelling without the hyphen, however, in notes it is mentioned, Senses 3 and 4 usually use the hyphenated spelling **short-circuit**. I think the word is used in the sense 3. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309316216 From naoto at openjdk.org Tue Aug 29 20:49:12 2023 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 29 Aug 2023 20:49:12 GMT Subject: RFR: 8314925: ChoiceFormat does not specify IllegalArgumentExceptions In-Reply-To: References: Message-ID: <0LguXLM_w0fvTwqzNiT3k4o3sOBEIN3uUR9c7xoLOjs=.e325fac5-035f-4b18-8c1a-33017b9cf32e@github.com> On Tue, 29 Aug 2023 16:53:29 GMT, Justin Lu wrote: > Please review this PR and [CSR](https://bugs.openjdk.org/browse/JDK-8315148) which is a conformance change to specify exceptions in java.text.ChoiceFormat. > > Makes `IllegalArgumentException` apparent for `applyPattern` and `setChoices`, as well as for the associated constructors that call the methods. > > This change also improves the error message for the `setChoices` IAE. Marked as reviewed by naoto (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/15473#pullrequestreview-1601251583 From jlu at openjdk.org Tue Aug 29 21:42:28 2023 From: jlu at openjdk.org (Justin Lu) Date: Tue, 29 Aug 2023 21:42:28 GMT Subject: RFR: 8314604: j.text.DecimalFormat behavior regarding patterns is not clear [v2] In-Reply-To: <4IjlWcNJRJ3nFa3cWecEbIZu8JE6n2MswgQyx_fbYP8=.0686c00f-94ee-499e-b3eb-759f6ad75d55@github.com> References: <4IjlWcNJRJ3nFa3cWecEbIZu8JE6n2MswgQyx_fbYP8=.0686c00f-94ee-499e-b3eb-759f6ad75d55@github.com> Message-ID: > Please review this PR and [CSR](https://bugs.openjdk.org/browse/JDK-8314607) which clarifies the behavior of patterns in regards to the max integer digits in j.text.DecimalFormat. > > The current specification (of `applyPattern`) states that patterns do not set the value of max integer digits. This is incorrect, these methods/constructors do set a value for the max integer digits. If the pattern is in scientific notation, the max integer digits value is derived from the pattern. Otherwise, the pattern is ignored, and the limit is set to `Integer.MAX_VALUE`. > > See below, > > DecimalFormat df = new DecimalFormat(); > df.applyPattern("000.000E0"); > df.getMaximumIntegerDigits(); // ==> 3 > df.applyPattern("000.000"); > df.getMaximumIntegerDigits(); // ==> 2147483647 > > DecimalFormat df = new DecimalFormat("000.000"); > df.getMaximumIntegerDigits(); // ==> 2147483647 > DecimalFormat df = new DecimalFormat("000.000E0"); > df.getMaximumIntegerDigits(); // ==> 3 > > > Method descriptions should be fixed, and the relevant constructors need to mention the behavior as well. Justin Lu has updated the pull request incrementally with one additional commit since the last revision: Reflect review comments: Non sci notation first. Link to Scientific Notation section ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15349/files - new: https://git.openjdk.org/jdk/pull/15349/files/3702f48b..93b0053e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15349&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15349&range=00-01 Stats: 33 lines in 1 file changed: 4 ins; 0 del; 29 mod Patch: https://git.openjdk.org/jdk/pull/15349.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15349/head:pull/15349 PR: https://git.openjdk.org/jdk/pull/15349 From jlu at openjdk.org Tue Aug 29 21:42:29 2023 From: jlu at openjdk.org (Justin Lu) Date: Tue, 29 Aug 2023 21:42:29 GMT Subject: RFR: 8314604: j.text.DecimalFormat behavior regarding patterns is not clear [v2] In-Reply-To: References: <4IjlWcNJRJ3nFa3cWecEbIZu8JE6n2MswgQyx_fbYP8=.0686c00f-94ee-499e-b3eb-759f6ad75d55@github.com> Message-ID: On Tue, 29 Aug 2023 18:02:51 GMT, Naoto Sato wrote: >> Justin Lu has updated the pull request incrementally with one additional commit since the last revision: >> >> Reflect review comments: Non sci notation first. Link to Scientific Notation section > > src/java.base/share/classes/java/text/DecimalFormat.java line 458: > >> 456: * is the typical end-user desire. Use {@link #setMaximumIntegerDigits(int)} >> 457: * if you want to set a specific limit to integer digits when the >> 458: * given pattern is not in scientific notation. > > It could be simpler if the normal case (Integer.MAX_VALUE) comes first, then the scientific notation case in which you can refer to the max integer digit in the class description. Also, `setMaximumIntegerDigits` can be called on a scientific notation as well, correct? @naotoj Updated with your suggestions. Held off on updating CSR as well in case the wording still needs to be further adjusted. I also considered adding these changes to the class description (instead of each method/constructor), but I thought the class description was already quite long, and it could easily be missed if added that way. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15349#discussion_r1309378808 From liach at openjdk.org Wed Aug 30 06:44:27 2023 From: liach at openjdk.org (Chen Liang) Date: Wed, 30 Aug 2023 06:44:27 GMT Subject: RFR: 8309622: Re-examine the cache mechanism in BaseLocale [v5] In-Reply-To: References: <5MqmN4P1TLKDCfXPhKWrH1b2FTgOXmjtKgd1bVXDd_M=.2000f20d-365d-48dc-bc37-45d8bcb9447f@github.com> Message-ID: <48xqGNO8NgBG4Jpewau111hFGsUTjGCroIwy9GPVTGs=.3ea065d6-bde6-45d7-b5aa-a75237c48724@github.com> On Tue, 1 Aug 2023 20:21:11 GMT, Naoto Sato wrote: >> This is stemming from the PR: https://github.com/openjdk/jdk/pull/14211 where aggressive GC can cause NPE in `BaseLocale$Key` class. I refactored the in-house cache with WeakHashMap, and removed the Key class as it is no longer needed (thus the original NPE will no longer be possible). Also with the new JMH test case, it gains some performance improvement: >> >> (w/o fix) >> >> Benchmark Mode Cnt Score Error Units >> LocaleCache.testForLanguageTag avgt 20 5781.275 ? 569.580 ns/op >> LocaleCache.testLocaleOf avgt 20 62564.079 ? 406.697 ns/op >> >> (w/ fix) >> Benchmark Mode Cnt Score Error Units >> LocaleCache.testForLanguageTag avgt 20 4801.175 ? 371.830 ns/op >> LocaleCache.testLocaleOf avgt 20 60394.652 ? 352.471 ns/op > > Naoto Sato has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 29 commits: > > - Merge branch 'master' of https://git.openjdk.org/jdk into JDK-8309622-Cache-BaseLocale > - small cleanup > - Merge branch 'pull/14684' into JDK-8309622-Cache-BaseLocale > - Update ReferencedKeyTest.java > - Simple versions of create > - Add flag for reference queue type > - Merge branch 'master' into 8310913 > - Update to use VirtualThread friendly stale queue. > - Merge branch 'pull/14684' into JDK-8309622-Cache-BaseLocale > - Remove warning tied to String Templates > - ... and 19 more: https://git.openjdk.org/jdk/compare/7ba8c69a...0e435898 src/java.base/share/classes/sun/util/locale/BaseLocale.java line 96: > 94: > 95: // Non-normalized to normalized BaseLocale cache for saving costly normalizations > 96: private static final Map CACHE = ReferencedKeyMap.create(true, ConcurrentHashMap::new); You can now simply use a `ReferencedKeySet` and call [`intern(T, UnaryOperator)`](https://github.com/openjdk/jdk/blob/ce2a7ea40a22c652e5f8559c91d5eea197e2d708/src/java.base/share/classes/jdk/internal/util/ReferencedKeySet.java#L202) to cache a normalized variety computed from a non-normalized base. test/jdk/jdk/internal/util/ReferencedKeyTest.java line 1: > 1: /* Is the test removal intentional? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/14404#discussion_r1309756538 PR Review Comment: https://git.openjdk.org/jdk/pull/14404#discussion_r1309757683 From dholmes at openjdk.org Wed Aug 30 07:22:10 2023 From: dholmes at openjdk.org (David Holmes) Date: Wed, 30 Aug 2023 07:22:10 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder [v2] In-Reply-To: <5AjL4PbmGc-9jQdiCK1jd4LDdC-B7NgJ_dwIZW1U-aA=.0ad22596-a1f9-4e87-946f-dceedf0a37e5@github.com> References: <5AjL4PbmGc-9jQdiCK1jd4LDdC-B7NgJ_dwIZW1U-aA=.0ad22596-a1f9-4e87-946f-dceedf0a37e5@github.com> Message-ID: On Tue, 29 Aug 2023 16:45:12 GMT, Roger Riggs wrote: >> I don't think this is the best change across so many files. >> It gives a very ugly name to a common test function and affects a very large number of tests. > >> @RogerRiggs If it is only the name you want changed, maybe you can offer a better name? > @lkorinth > > Sorry for the too short comment; I wanted to make sure it wasn't integrated before I could look at it more closely. > Neither the bug report or the PR describe the problem and its ramifications, only the solution. > Can you elaborate on the conditions that lead to this. (and include them in the bug report). @RogerRiggs , @plummercj , please see the additional discussion in the parent bug: https://bugs.openjdk.org/browse/JDK-8314823 ------------- PR Comment: https://git.openjdk.org/jdk/pull/15452#issuecomment-1698629345 From aturbanov at openjdk.org Wed Aug 30 08:09:22 2023 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Wed, 30 Aug 2023 08:09:22 GMT Subject: RFR: 8312165: Fix typos in java.desktop In-Reply-To: <2SHwXGKIcwGxcQmaD8kDCAWF1o_ZOvtzc_cltU8mXiw=.9600f497-24ef-4d72-a79e-468b9bdc3a41@github.com> References: <2SHwXGKIcwGxcQmaD8kDCAWF1o_ZOvtzc_cltU8mXiw=.9600f497-24ef-4d72-a79e-468b9bdc3a41@github.com> Message-ID: <7iWl98wmH2RKbdtHdwfnIGlna0et2L6JxbbyPt6zCFU=.2a3bb0c3-ab14-4151-8cad-b317948a2b1b@github.com> On Tue, 29 Aug 2023 18:06:44 GMT, Alexey Ivanov wrote: >> Found many typos in java.desktop by IDEA's inspection `Proofreading | Typo` > > src/java.desktop/share/classes/javax/swing/plaf/nimbus/DropShadowEffect.java line 45: > >> 43: /** >> 44: * Get the type of this effect, one of UNDER,BLENDED,OVER. UNDER means the result of apply effect should be painted >> 45: * under the src image. BLENDED means the result of apply effect contains a modified src image so just it should be > > Suggestion: > > * under the src image. BLENDED means the result of apply effect contains a modified src image so it should just be > > > It just doesn't sound right. Should it be *?the result of applying the effect?*? I agree. Changed wording ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309860950 From aturbanov at openjdk.org Wed Aug 30 08:12:14 2023 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Wed, 30 Aug 2023 08:12:14 GMT Subject: RFR: 8312165: Fix typos in java.desktop In-Reply-To: <2SHwXGKIcwGxcQmaD8kDCAWF1o_ZOvtzc_cltU8mXiw=.9600f497-24ef-4d72-a79e-468b9bdc3a41@github.com> References: <2SHwXGKIcwGxcQmaD8kDCAWF1o_ZOvtzc_cltU8mXiw=.9600f497-24ef-4d72-a79e-468b9bdc3a41@github.com> Message-ID: On Tue, 29 Aug 2023 18:16:35 GMT, Alexey Ivanov wrote: >> Found many typos in java.desktop by IDEA's inspection `Proofreading | Typo` > > src/java.desktop/share/classes/javax/swing/plaf/nimbus/InnerShadowEffect.java line 48: > >> 46: * painted. OVER means the result of apply effect should be painted over the src image. >> 47: * >> 48: * @return The effect type > > Should we replace this copied javadoc with `{@inheritDoc}`? The text from `Effect.getEffectType` isn't modified at all. This looks the correct fix ? eliminate doc duplication. Ok, applied ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309864804 From aturbanov at openjdk.org Wed Aug 30 08:40:04 2023 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Wed, 30 Aug 2023 08:40:04 GMT Subject: RFR: 8312165: Fix typos in java.desktop Swing [v2] In-Reply-To: References: Message-ID: > Found many typos in java.desktop by IDEA's inspection `Proofreading | Typo` Andrey Turbanov has updated the pull request incrementally with two additional commits since the last revision: - 8312165: Fix typos in java.desktop Swing apply suggestions from review - 8312165: Fix typos in java.desktop Swing revert changes from non-swing parts to minimize count of files to review ------------- Changes: - all: https://git.openjdk.org/jdk/pull/14847/files - new: https://git.openjdk.org/jdk/pull/14847/files/5c43b668..0df167fc Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=14847&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=14847&range=00-01 Stats: 233 lines in 112 files changed: 1 ins; 4 del; 228 mod Patch: https://git.openjdk.org/jdk/pull/14847.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/14847/head:pull/14847 PR: https://git.openjdk.org/jdk/pull/14847 From aturbanov at openjdk.org Wed Aug 30 08:40:06 2023 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Wed, 30 Aug 2023 08:40:06 GMT Subject: RFR: 8312165: Fix typos in java.desktop Swing In-Reply-To: References: Message-ID: On Wed, 12 Jul 2023 08:33:30 GMT, Andrey Turbanov wrote: > Found many typos in java.desktop by IDEA's inspection `Proofreading | Typo` I reverted changes in non-Swing parts to reduce amount of files to review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/14847#issuecomment-1698731622 From aturbanov at openjdk.org Wed Aug 30 08:40:09 2023 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Wed, 30 Aug 2023 08:40:09 GMT Subject: RFR: 8312165: Fix typos in java.desktop Swing [v2] In-Reply-To: <2SHwXGKIcwGxcQmaD8kDCAWF1o_ZOvtzc_cltU8mXiw=.9600f497-24ef-4d72-a79e-468b9bdc3a41@github.com> References: <2SHwXGKIcwGxcQmaD8kDCAWF1o_ZOvtzc_cltU8mXiw=.9600f497-24ef-4d72-a79e-468b9bdc3a41@github.com> Message-ID: <0qrchSO0mRz-jfDknwtuXL4ShnwjJT2XotPKw3LdFDs=.2990d9b3-5593-4bfd-947f-067748621b48@github.com> On Tue, 29 Aug 2023 18:41:05 GMT, Alexey Ivanov wrote: >> Andrey Turbanov has updated the pull request incrementally with two additional commits since the last revision: >> >> - 8312165: Fix typos in java.desktop Swing >> >> apply suggestions from review >> - 8312165: Fix typos in java.desktop Swing >> >> revert changes from non-swing parts to minimize count of files to review > > src/java.desktop/share/classes/javax/swing/text/DefaultFormatter.java line 1: > >> 1: /* > > Perhaps, we should leave **?overwrite?** only. A *strike-through* means a line drawn over the text, ~~like this~~. I hardly understand what *?overstrike?* means, see the `setOverwriteMode` method: > > https://github.com/openjdk/jdk/blob/e22762c010e5cd4c313e5f2816b67d75862935a7/src/java.desktop/share/classes/javax/swing/text/DefaultFormatter.java#L162-L164 > > As far as I understand, it refers to the **overwrite mode** when typed characters aren't inserted but instead they replace the characters present in the text. > > To clarify the meaning, > > * @param overwriteMode Indicates if overwrite or overstrike mode is used > */ > public void setOverwriteMode(boolean overwriteMode) { I agree. Changed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1309871095 From aturbanov at openjdk.org Wed Aug 30 08:43:40 2023 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Wed, 30 Aug 2023 08:43:40 GMT Subject: RFR: 8312165: Fix typos in java.desktop Swing [v3] In-Reply-To: References: Message-ID: > Found many typos in java.desktop by IDEA's inspection `Proofreading | Typo` Andrey Turbanov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: - Merge remote-tracking branch 'origin/master' into fix_typos_java.desktop - 8312165: Fix typos in java.desktop Swing apply suggestions from review - 8312165: Fix typos in java.desktop Swing revert changes from non-swing parts to minimize count of files to review - [PATCH] Fix typos in java.desktop - [PATCH] Fix typos in java.desktop update copyrights - [PATCH] Fix typos in java.desktop ------------- Changes: - all: https://git.openjdk.org/jdk/pull/14847/files - new: https://git.openjdk.org/jdk/pull/14847/files/0df167fc..241a2203 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=14847&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=14847&range=01-02 Stats: 94728 lines in 2499 files changed: 52833 ins; 27529 del; 14366 mod Patch: https://git.openjdk.org/jdk/pull/14847.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/14847/head:pull/14847 PR: https://git.openjdk.org/jdk/pull/14847 From lkorinth at openjdk.org Wed Aug 30 09:23:55 2023 From: lkorinth at openjdk.org (Leo Korinth) Date: Wed, 30 Aug 2023 09:23:55 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder [v3] In-Reply-To: References: Message-ID: > Rename createJavaProcessBuilder so that it is not used by mistake instead of createTestJvm. > > I have used the following sed script: `find -name "*.java" | xargs -n 1 sed -i -e "s/createJavaProcessBuilder(/createJavaProcessBuilderIgnoreTestJavaOpts(/g"` > > Then I have manually modified ProcessTools.java. In that file I have moved one version of createJavaProcessBuilder so that it is close to the other version. Then I have added a javadoc comment in bold telling: > > /** > * Create ProcessBuilder using the java launcher from the jdk to > * be tested. > * > *

Please observe that you likely should use > * createTestJvm() instead of this method because createTestJvm() > * will add JVM options from "test.vm.opts" and "test.java.opts" > * and this method will not do that. > * > * @param command Arguments to pass to the java command. > * @return The ProcessBuilder instance representing the java command. > */ > > > I have used the name createJavaProcessBuilderIgnoreTestJavaOpts because of the name of Utils.prependTestJavaOpts that adds those VM flags. If you have a better name I could do a rename of the method. I kind of like that it is long and clumsy, that makes it harder to use... > > I have run tier 1 testing, and I have started more exhaustive testing. Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: fix static import ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15452/files - new: https://git.openjdk.org/jdk/pull/15452/files/f3418c80..27da7150 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15452&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15452&range=01-02 Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/15452.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15452/head:pull/15452 PR: https://git.openjdk.org/jdk/pull/15452 From msheppar at openjdk.org Wed Aug 30 11:34:12 2023 From: msheppar at openjdk.org (Mark Sheppard) Date: Wed, 30 Aug 2023 11:34:12 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder [v3] In-Reply-To: References: Message-ID: On Wed, 30 Aug 2023 09:23:55 GMT, Leo Korinth wrote: >> Rename createJavaProcessBuilder so that it is not used by mistake instead of createTestJvm. >> >> I have used the following sed script: `find -name "*.java" | xargs -n 1 sed -i -e "s/createJavaProcessBuilder(/createJavaProcessBuilderIgnoreTestJavaOpts(/g"` >> >> Then I have manually modified ProcessTools.java. In that file I have moved one version of createJavaProcessBuilder so that it is close to the other version. Then I have added a javadoc comment in bold telling: >> >> /** >> * Create ProcessBuilder using the java launcher from the jdk to >> * be tested. >> * >> *

Please observe that you likely should use >> * createTestJvm() instead of this method because createTestJvm() >> * will add JVM options from "test.vm.opts" and "test.java.opts" >> * and this method will not do that. >> * >> * @param command Arguments to pass to the java command. >> * @return The ProcessBuilder instance representing the java command. >> */ >> >> >> I have used the name createJavaProcessBuilderIgnoreTestJavaOpts because of the name of Utils.prependTestJavaOpts that adds those VM flags. If you have a better name I could do a rename of the method. I kind of like that it is long and clumsy, that makes it harder to use... >> >> I have run tier 1 testing, and I have started more exhaustive testing. > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > fix static import I don't think a name change is required. The method is createJavaProcessBuilder with a "list" of argurments and a builder is returned. As such, there is no inference, in the name, that test args will be propagated. Adding the additional java doc description should be sufficient to dispell any misconceptions. The createTestJvm is a misnomer as it returns a ProcessBulder rather than a Process, which is what I would expected from createTestJvm, without looking at its signature. So you could create a single createJavaProcessBuilder with add an additional parameter boolean addTestOpts e.g. createJavaProcessBuilder(List command, boolean addTestOpts) { ... } createProcessBuilderIgnoreJavaTestOpt(cmdArgs) maps to createJavaProcessBuilder(cmdArgs, false) createTestJvm(cmdArgs) maps to createJavaProcessBuilder(cmdArgs, true) But this is a lot more work. alternatively change createTestJvm to createTestJavaProcessBuilder or createJavaProcessBuilderAddTestOpts ------------- PR Comment: https://git.openjdk.org/jdk/pull/15452#issuecomment-1698985460 From aivanov at openjdk.org Wed Aug 30 14:11:14 2023 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 30 Aug 2023 14:11:14 GMT Subject: RFR: 8312165: Fix typos in java.desktop Swing In-Reply-To: References: Message-ID: On Wed, 30 Aug 2023 08:33:47 GMT, Andrey Turbanov wrote: > I reverted changes in non-Swing parts to reduce amount of files to review. I'm unsure it's the right decision, I reviewed them already. On the other hand, 100 files is a smaller chunk, someone could also take a look. Thanks for fixing typos, by the way. ------------- PR Comment: https://git.openjdk.org/jdk/pull/14847#issuecomment-1699260264 From rriggs at openjdk.org Wed Aug 30 15:10:13 2023 From: rriggs at openjdk.org (Roger Riggs) Date: Wed, 30 Aug 2023 15:10:13 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder [v3] In-Reply-To: References: Message-ID: On Wed, 30 Aug 2023 09:23:55 GMT, Leo Korinth wrote: >> Rename createJavaProcessBuilder so that it is not used by mistake instead of createTestJvm. >> >> I have used the following sed script: `find -name "*.java" | xargs -n 1 sed -i -e "s/createJavaProcessBuilder(/createJavaProcessBuilderIgnoreTestJavaOpts(/g"` >> >> Then I have manually modified ProcessTools.java. In that file I have moved one version of createJavaProcessBuilder so that it is close to the other version. Then I have added a javadoc comment in bold telling: >> >> /** >> * Create ProcessBuilder using the java launcher from the jdk to >> * be tested. >> * >> *

Please observe that you likely should use >> * createTestJvm() instead of this method because createTestJvm() >> * will add JVM options from "test.vm.opts" and "test.java.opts" >> * and this method will not do that. >> * >> * @param command Arguments to pass to the java command. >> * @return The ProcessBuilder instance representing the java command. >> */ >> >> >> I have used the name createJavaProcessBuilderIgnoreTestJavaOpts because of the name of Utils.prependTestJavaOpts that adds those VM flags. If you have a better name I could do a rename of the method. I kind of like that it is long and clumsy, that makes it harder to use... >> >> I have run tier 1 testing, and I have started more exhaustive testing. > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > fix static import In the context of the goal is to declaratively identify tests that do or do not benefit from additional test flags renaming the `createjavaProcessBuilder` method does not further that goal. The method name and javadoc of `createjavaProcessBuilder` do not imply that the test options are consulted or used; it only says it creates a ProcessBuilder, and does not promise or document more than that. The javadoc should probably describe the use of the the three properties that modify the way that the java is launched. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15452#issuecomment-1699362435 From aivanov at openjdk.org Wed Aug 30 16:16:23 2023 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 30 Aug 2023 16:16:23 GMT Subject: RFR: 8312165: Fix typos in java.desktop Swing [v3] In-Reply-To: References: Message-ID: <2CSpWBfmnbAzRDmUOxdWLDYRVzk_4IJQhIXrjJnLmMY=.ec4b5a9d-8df5-4302-80d5-ac38a2a14d6c@github.com> On Wed, 30 Aug 2023 08:43:40 GMT, Andrey Turbanov wrote: >> Found many typos in java.desktop by IDEA's inspection `Proofreading | Typo` > > Andrey Turbanov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - Merge remote-tracking branch 'origin/master' into fix_typos_java.desktop > - 8312165: Fix typos in java.desktop Swing > > apply suggestions from review > - 8312165: Fix typos in java.desktop Swing > > revert changes from non-swing parts to minimize count of files to review > - [PATCH] Fix typos in java.desktop > - [PATCH] Fix typos in java.desktop > > update copyrights > - [PATCH] Fix typos in java.desktop Changes requested by aivanov (Reviewer). src/java.desktop/share/classes/javax/swing/JLayeredPane.java line 558: > 556: if(curLayer == layer) { > 557: results[layerCount++] = getComponent(i); > 558: /// Short circuit the counting when we have them all You should revert this instance too. Suggestion: /// Short-circuit the counting when we have them all src/java.desktop/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java line 342: > 340: > 341: // These two methods were overridden and made public. This was probably a > 342: // mistake in the implementation. The functionality that they used to Suggestion: // These two methods were overridden and made public. This was probably // a mistake in the implementation. The functionality that they used to For consistency with the same text below. src/java.desktop/share/classes/javax/swing/plaf/nimbus/DropShadowEffect.java line 46: > 44: * {@inheritDoc} > 45: * > 46: * @return The effect type Suggestion: * @return {@inheritDoc} src/java.desktop/share/classes/javax/swing/plaf/nimbus/Effect.java line 46: > 44: > 45: /** > 46: * Get the type of this effect, one of UNDER,BLENDED,OVER. Suggestion: * Get the type of this effect, one of UNDER, BLENDED, OVER. However, I'd also put them into `{@ }` if you don't mind. Suggestion: * Get the type of this effect, one of {@code UNDER}, {@code BLENDED}, {@code OVER}. src/java.desktop/share/classes/javax/swing/plaf/nimbus/Effect.java line 49: > 47: * UNDER means the result of applying the effect should be painted under the src image. > 48: * BLENDED means the result of applying the effect contains a modified src image, so it should just be painted. > 49: * OVER means the result of applying the effect should be painted over the src image. A list would work even better: Suggestion: *

    *
  • {@code UNDER} means the result of applying the effect should be painted under the src image.
  • *
  • {@code BLENDED} means the result of applying the effect contains a modified src image, so it should just be painted.
  • *
  • {@code OVER} means the result of applying the effect should be painted over the src image.
  • *
The above requires some wrapping to avoid long lines. I think it looks better and clearer this way, even though it would be seen rarely, if ever. :) src/java.desktop/share/classes/javax/swing/plaf/nimbus/InnerShadowEffect.java line 46: > 44: * {@inheritDoc} > 45: * > 46: * @return The effect type Suggestion: * @return {@inheritDoc} src/java.desktop/share/classes/javax/swing/plaf/synth/SynthParser.java line 185: > 183: > 184: /** > 185: * Defaults properties are placed here. Suggestion: * Default properties are placed here. I think the word ?default? should be in singular here. Or rather ?*Default property values* are placed here.? ------------- PR Review: https://git.openjdk.org/jdk/pull/14847#pullrequestreview-1602440243 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1310344522 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1310086730 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1310087560 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1310094841 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1310096873 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1310099902 PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1310103857 From aivanov at openjdk.org Wed Aug 30 16:16:24 2023 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 30 Aug 2023 16:16:24 GMT Subject: RFR: 8312165: Fix typos in java.desktop Swing [v3] In-Reply-To: <2CSpWBfmnbAzRDmUOxdWLDYRVzk_4IJQhIXrjJnLmMY=.ec4b5a9d-8df5-4302-80d5-ac38a2a14d6c@github.com> References: <2CSpWBfmnbAzRDmUOxdWLDYRVzk_4IJQhIXrjJnLmMY=.ec4b5a9d-8df5-4302-80d5-ac38a2a14d6c@github.com> Message-ID: On Wed, 30 Aug 2023 14:09:20 GMT, Alexey Ivanov wrote: >> Andrey Turbanov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: >> >> - Merge remote-tracking branch 'origin/master' into fix_typos_java.desktop >> - 8312165: Fix typos in java.desktop Swing >> >> apply suggestions from review >> - 8312165: Fix typos in java.desktop Swing >> >> revert changes from non-swing parts to minimize count of files to review >> - [PATCH] Fix typos in java.desktop >> - [PATCH] Fix typos in java.desktop >> >> update copyrights >> - [PATCH] Fix typos in java.desktop > > src/java.desktop/share/classes/javax/swing/JLayeredPane.java line 558: > >> 556: if(curLayer == layer) { >> 557: results[layerCount++] = getComponent(i); >> 558: /// Short circuit the counting when we have them all > > You should revert this instance too. > Suggestion: > > /// Short-circuit the counting when we have them all Shall we drop the third slash too? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/14847#discussion_r1310345925 From lkorinth at openjdk.org Wed Aug 30 17:13:53 2023 From: lkorinth at openjdk.org (Leo Korinth) Date: Wed, 30 Aug 2023 17:13:53 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder [v3] In-Reply-To: References: Message-ID: <3xqrbByJLBJTDN1-C_aG0wwe6PFy09-tMyL0TwEn4Gc=.88dbe2a2-ad5d-4545-ab30-4a9e5312641f@github.com> On Wed, 30 Aug 2023 09:23:55 GMT, Leo Korinth wrote: >> Rename createJavaProcessBuilder so that it is not used by mistake instead of createTestJvm. >> >> I have used the following sed script: `find -name "*.java" | xargs -n 1 sed -i -e "s/createJavaProcessBuilder(/createJavaProcessBuilderIgnoreTestJavaOpts(/g"` >> >> Then I have manually modified ProcessTools.java. In that file I have moved one version of createJavaProcessBuilder so that it is close to the other version. Then I have added a javadoc comment in bold telling: >> >> /** >> * Create ProcessBuilder using the java launcher from the jdk to >> * be tested. >> * >> *

Please observe that you likely should use >> * createTestJvm() instead of this method because createTestJvm() >> * will add JVM options from "test.vm.opts" and "test.java.opts" >> * and this method will not do that. >> * >> * @param command Arguments to pass to the java command. >> * @return The ProcessBuilder instance representing the java command. >> */ >> >> >> I have used the name createJavaProcessBuilderIgnoreTestJavaOpts because of the name of Utils.prependTestJavaOpts that adds those VM flags. If you have a better name I could do a rename of the method. I kind of like that it is long and clumsy, that makes it harder to use... >> >> I have run tier 1 testing, and I have started more exhaustive testing. > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > fix static import I have some ideas that I will work on that might lead to a new proposal. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15452#issuecomment-1699542111 From stefank at openjdk.org Wed Aug 30 17:40:33 2023 From: stefank at openjdk.org (Stefan Karlsson) Date: Wed, 30 Aug 2023 17:40:33 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder [v3] In-Reply-To: References: Message-ID: On Wed, 30 Aug 2023 09:23:55 GMT, Leo Korinth wrote: >> Rename createJavaProcessBuilder so that it is not used by mistake instead of createTestJvm. >> >> I have used the following sed script: `find -name "*.java" | xargs -n 1 sed -i -e "s/createJavaProcessBuilder(/createJavaProcessBuilderIgnoreTestJavaOpts(/g"` >> >> Then I have manually modified ProcessTools.java. In that file I have moved one version of createJavaProcessBuilder so that it is close to the other version. Then I have added a javadoc comment in bold telling: >> >> /** >> * Create ProcessBuilder using the java launcher from the jdk to >> * be tested. >> * >> *

Please observe that you likely should use >> * createTestJvm() instead of this method because createTestJvm() >> * will add JVM options from "test.vm.opts" and "test.java.opts" >> * and this method will not do that. >> * >> * @param command Arguments to pass to the java command. >> * @return The ProcessBuilder instance representing the java command. >> */ >> >> >> I have used the name createJavaProcessBuilderIgnoreTestJavaOpts because of the name of Utils.prependTestJavaOpts that adds those VM flags. If you have a better name I could do a rename of the method. I kind of like that it is long and clumsy, that makes it harder to use... >> >> I have run tier 1 testing, and I have started more exhaustive testing. > > Leo Korinth has updated the pull request incrementally with one additional commit since the last revision: > > fix static import >From talking to other HotSpot devs it is quite clear that the different names lead to mistakes when writing (copy-n-pasting) tests, so I'm happy that we try to figure out some way to make it more obvious when we prepend the extra test options and when we don't. I agree with @msheppar that `createTestJvm` isn't a good name and I wouldn't be opposed to changing that name instead of `createJavaProcessBuilder`. However, if we do rename that function I strongly urge us to also rename the corresponding `executeTestJvm` function. I also think it is too obscure that functions with *Test* in the name prepend the extra test options, and those without *Test* don't, so I'd like to get rid of that convention. I wouldn't be opposed to a change that: * Keeps the `createJavaProcessBuilder` name * Renames `createTestJvm` to `createJavaProcessBuilderPrependTestOpts` * Renames `executeTestJvm` to `executeJavaPrependTestOpts` * Removes `createTestJava` * Removes `executeTestJava` ------------- PR Comment: https://git.openjdk.org/jdk/pull/15452#issuecomment-1699588853 From naoto at openjdk.org Wed Aug 30 18:47:27 2023 From: naoto at openjdk.org (Naoto Sato) Date: Wed, 30 Aug 2023 18:47:27 GMT Subject: RFR: 8314604: j.text.DecimalFormat behavior regarding patterns is not clear [v2] In-Reply-To: References: <4IjlWcNJRJ3nFa3cWecEbIZu8JE6n2MswgQyx_fbYP8=.0686c00f-94ee-499e-b3eb-759f6ad75d55@github.com> Message-ID: On Tue, 29 Aug 2023 21:42:28 GMT, Justin Lu wrote: >> Please review this PR and [CSR](https://bugs.openjdk.org/browse/JDK-8314607) which clarifies the behavior of patterns in regards to the max integer digits in j.text.DecimalFormat. >> >> The current specification (of `applyPattern`) states that patterns do not set the value of max integer digits. This is incorrect, these methods/constructors do set a value for the max integer digits. If the pattern is in scientific notation, the max integer digits value is derived from the pattern. Otherwise, the pattern is ignored, and the limit is set to `Integer.MAX_VALUE`. >> >> See below, >> >> DecimalFormat df = new DecimalFormat(); >> df.applyPattern("000.000E0"); >> df.getMaximumIntegerDigits(); // ==> 3 >> df.applyPattern("000.000"); >> df.getMaximumIntegerDigits(); // ==> 2147483647 >> >> DecimalFormat df = new DecimalFormat("000.000"); >> df.getMaximumIntegerDigits(); // ==> 2147483647 >> DecimalFormat df = new DecimalFormat("000.000E0"); >> df.getMaximumIntegerDigits(); // ==> 3 >> >> >> Method descriptions should be fixed, and the relevant constructors need to mention the behavior as well. > > Justin Lu has updated the pull request incrementally with one additional commit since the last revision: > > Reflect review comments: Non sci notation first. Link to Scientific Notation section Thanks for the changes. ------------- Marked as reviewed by naoto (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/15349#pullrequestreview-1603303466 From naoto at openjdk.org Wed Aug 30 20:37:42 2023 From: naoto at openjdk.org (Naoto Sato) Date: Wed, 30 Aug 2023 20:37:42 GMT Subject: RFR: 8309622: Re-examine the cache mechanism in BaseLocale [v5] In-Reply-To: <48xqGNO8NgBG4Jpewau111hFGsUTjGCroIwy9GPVTGs=.3ea065d6-bde6-45d7-b5aa-a75237c48724@github.com> References: <5MqmN4P1TLKDCfXPhKWrH1b2FTgOXmjtKgd1bVXDd_M=.2000f20d-365d-48dc-bc37-45d8bcb9447f@github.com> <48xqGNO8NgBG4Jpewau111hFGsUTjGCroIwy9GPVTGs=.3ea065d6-bde6-45d7-b5aa-a75237c48724@github.com> Message-ID: On Wed, 30 Aug 2023 06:40:40 GMT, Chen Liang wrote: >> Naoto Sato has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 29 commits: >> >> - Merge branch 'master' of https://git.openjdk.org/jdk into JDK-8309622-Cache-BaseLocale >> - small cleanup >> - Merge branch 'pull/14684' into JDK-8309622-Cache-BaseLocale >> - Update ReferencedKeyTest.java >> - Simple versions of create >> - Add flag for reference queue type >> - Merge branch 'master' into 8310913 >> - Update to use VirtualThread friendly stale queue. >> - Merge branch 'pull/14684' into JDK-8309622-Cache-BaseLocale >> - Remove warning tied to String Templates >> - ... and 19 more: https://git.openjdk.org/jdk/compare/7ba8c69a...0e435898 > > src/java.base/share/classes/sun/util/locale/BaseLocale.java line 96: > >> 94: >> 95: // Non-normalized to normalized BaseLocale cache for saving costly normalizations >> 96: private static final Map CACHE = ReferencedKeyMap.create(true, ConcurrentHashMap::new); > > You can now simply use a `ReferencedKeySet` and call [`intern(T, UnaryOperator)`](https://github.com/openjdk/jdk/blob/ce2a7ea40a22c652e5f8559c91d5eea197e2d708/src/java.base/share/classes/jdk/internal/util/ReferencedKeySet.java#L202) to cache a normalized variety computed from a non-normalized base. I need to double-check that it won't cause performance regression, will be visiting this later. > test/jdk/jdk/internal/util/ReferencedKeyTest.java line 1: > >> 1: /* > > Is the test removal intentional? Ah, thanks. My bad for unintentionally removing the test. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/14404#discussion_r1310790705 PR Review Comment: https://git.openjdk.org/jdk/pull/14404#discussion_r1310790739 From naoto at openjdk.org Wed Aug 30 22:35:43 2023 From: naoto at openjdk.org (Naoto Sato) Date: Wed, 30 Aug 2023 22:35:43 GMT Subject: RFR: 8309622: Re-examine the cache mechanism in BaseLocale [v6] In-Reply-To: <5MqmN4P1TLKDCfXPhKWrH1b2FTgOXmjtKgd1bVXDd_M=.2000f20d-365d-48dc-bc37-45d8bcb9447f@github.com> References: <5MqmN4P1TLKDCfXPhKWrH1b2FTgOXmjtKgd1bVXDd_M=.2000f20d-365d-48dc-bc37-45d8bcb9447f@github.com> Message-ID: <-g3xZNoboLRPlrTcQv17TGig7R0WNUJ0oJDAIWc0lwo=.f7946875-077b-4d15-a5a9-bb415b3ab062@github.com> > This is stemming from the PR: https://github.com/openjdk/jdk/pull/14211 where aggressive GC can cause NPE in `BaseLocale$Key` class. I refactored the in-house cache with WeakHashMap, and removed the Key class as it is no longer needed (thus the original NPE will no longer be possible). Also with the new JMH test case, it gains some performance improvement: > > (w/o fix) > > Benchmark Mode Cnt Score Error Units > LocaleCache.testForLanguageTag avgt 20 5781.275 ? 569.580 ns/op > LocaleCache.testLocaleOf avgt 20 62564.079 ? 406.697 ns/op > > (w/ fix) > Benchmark Mode Cnt Score Error Units > LocaleCache.testForLanguageTag avgt 20 4801.175 ? 371.830 ns/op > LocaleCache.testLocaleOf avgt 20 60394.652 ? 352.471 ns/op Naoto Sato has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 31 commits: - Restored the test - Merge branch 'master' into JDK-8309622-Cache-BaseLocale - Merge branch 'master' of https://git.openjdk.org/jdk into JDK-8309622-Cache-BaseLocale - small cleanup - Merge branch 'pull/14684' into JDK-8309622-Cache-BaseLocale - Update ReferencedKeyTest.java - Simple versions of create - Add flag for reference queue type - Merge branch 'master' into 8310913 - Update to use VirtualThread friendly stale queue. - ... and 21 more: https://git.openjdk.org/jdk/compare/99ea8bf2...b1f64e93 ------------- Changes: https://git.openjdk.org/jdk/pull/14404/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14404&range=05 Stats: 522 lines in 6 files changed: 129 ins; 266 del; 127 mod Patch: https://git.openjdk.org/jdk/pull/14404.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/14404/head:pull/14404 PR: https://git.openjdk.org/jdk/pull/14404 From jlu at openjdk.org Wed Aug 30 23:43:14 2023 From: jlu at openjdk.org (Justin Lu) Date: Wed, 30 Aug 2023 23:43:14 GMT Subject: Integrated: JDK-8314611: Provide more explicative error message parsing Currencies In-Reply-To: References: Message-ID: <1qmZCAyTUjpxddrISbU-5RofxRlarpuXjvx5RvMpy9Y=.6a96f41c-9d1c-4120-a4a8-1109c6ddfc7f@github.com> On Mon, 28 Aug 2023 21:14:53 GMT, Justin Lu wrote: > Please review this PR which updates some exceptions in j.util.Currency to have an explicit error message (as opposed to nothing). > > The exceptions are thrown when the ISO 4217/3166 currency/country codes are in an invalid form, or do not exist. This pull request has now been integrated. Changeset: 3c8a6678 Author: Justin Lu URL: https://git.openjdk.org/jdk/commit/3c8a6678feac8e3225bc1c44593a78d9e7c4d77c Stats: 41 lines in 2 files changed: 28 ins; 0 del; 13 mod 8314611: Provide more explicative error message parsing Currencies Reviewed-by: naoto ------------- PR: https://git.openjdk.org/jdk/pull/15458 From dholmes at openjdk.org Thu Aug 31 05:48:04 2023 From: dholmes at openjdk.org (David Holmes) Date: Thu, 31 Aug 2023 05:48:04 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder [v3] In-Reply-To: References: Message-ID: On Wed, 30 Aug 2023 11:31:20 GMT, Mark Sheppard wrote: > So you could create a single createJavaProcessBuilder with add an additional parameter boolean addTestOpts e.g. createJavaProcessBuilder(List command, boolean addTestOpts) { ... } @msheppar that is actually where we started, and it was then split into two differently named methods to "make it clear" which one included the test opts without having to remember the name of the parameter that the true/false argument was bound to. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15452#issuecomment-1700402301 From alanb at openjdk.org Thu Aug 31 06:51:00 2023 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 31 Aug 2023 06:51:00 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder [v3] In-Reply-To: References: Message-ID: On Wed, 30 Aug 2023 17:38:01 GMT, Stefan Karlsson wrote: > I wouldn't be opposed to a change that: > > * Keeps the `createJavaProcessBuilder` name > * Renames `createTestJvm` to `createJavaProcessBuilderPrependTestOpts` > * Renames `executeTestJvm` to `executeJavaPrependTestOpts` > * Removes `createTestJava` > * Removes `executeTestJava` The good thing with this is that it very explicit at the use-sites where the test opts are prepended. Also moving from "Jvm" to "Java" is probably right as it executes the "java" launcher, the options are a mix of java launcher options (that the VM doesn't know about) and VM options. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15452#issuecomment-1700459277 From msheppar at openjdk.org Thu Aug 31 10:11:02 2023 From: msheppar at openjdk.org (Mark Sheppard) Date: Thu, 31 Aug 2023 10:11:02 GMT Subject: RFR: 8315097: Rename createJavaProcessBuilder [v3] In-Reply-To: References: Message-ID: On Thu, 31 Aug 2023 05:45:27 GMT, David Holmes wrote: > > So you could create a single createJavaProcessBuilder with add an additional parameter boolean addTestOpts e.g. > > createJavaProcessBuilder(List command, boolean addTestOpts) { ... } > > @msheppar that is actually where we started, and it was then split into two differently named methods to "make it clear" which one included the test opts without having to remember the name of the parameter that the true/false argument was bound to. cheers David thanks for the clarification on background ------------- PR Comment: https://git.openjdk.org/jdk/pull/15452#issuecomment-1700749844 From darcy at openjdk.org Thu Aug 31 19:04:01 2023 From: darcy at openjdk.org (Joe Darcy) Date: Thu, 31 Aug 2023 19:04:01 GMT Subject: RFR: 5066247: Refine the spec of equals() and hashCode() for j.text.Format classes In-Reply-To: References: Message-ID: On Mon, 28 Aug 2023 21:24:18 GMT, Justin Lu wrote: > Please review this PR which refines the spec of `equals()` and `hashCode()` in `java.text.Format` related classes. > > The current spec for most of these methods is either "_Overrides _" or are incomplete/wrong (i.e. see `ChoiceFormat`). > > This fix adjusts the spec to provide a consistent definition for the overridden methods and specify what is being compared/used to generate a hash code value. > > For implementations that use at most a few fields, the values are stated, otherwise a more general term is used as a substitution (i.e. see `DecimalFormat`). This class hierarchy is based around a getClass based notion of class identity rather than an instanceof notion of class identity. The drawbacks of doing this are discussed in "Effective Java, 3rd edition" item 10. Regardless, getClass vs instanceof cannot be changed now for behavioral compatibility. However, this should be better documented so that subclass outside of the JDK could be written to do the right things in their own equals methods. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15459#issuecomment-1701599344 From aturbanov at openjdk.org Thu Aug 31 20:11:42 2023 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Thu, 31 Aug 2023 20:11:42 GMT Subject: RFR: 8312165: Fix typos in java.desktop Swing [v4] In-Reply-To: References: Message-ID: > Found many typos in java.desktop by IDEA's inspection `Proofreading | Typo` Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: 8312165: Fix typos in java.desktop Swing apply suggestions from review ------------- Changes: - all: https://git.openjdk.org/jdk/pull/14847/files - new: https://git.openjdk.org/jdk/pull/14847/files/241a2203..9e65ef06 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=14847&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=14847&range=02-03 Stats: 14 lines in 5 files changed: 5 ins; 0 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/14847.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/14847/head:pull/14847 PR: https://git.openjdk.org/jdk/pull/14847 From aturbanov at openjdk.org Thu Aug 31 20:13:09 2023 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Thu, 31 Aug 2023 20:13:09 GMT Subject: Integrated: 8312521: Unused field LocaleProviderAdapter#defaultLocaleProviderAdapter could be removed In-Reply-To: References: Message-ID: <_CMDvItq5vBz2bK6Aho2dlRjywhpenRyoF0-AFTGJi0=.601dba4f-f9a6-4e62-a97d-5da291848ca9@github.com> On Tue, 22 Aug 2023 12:22:54 GMT, Andrey Turbanov wrote: > After [JDK-8245241](https://bugs.openjdk.org/browse/JDK-8245241), the field `sun.util.locale.provider.LocaleProviderAdapter#defaultLocaleProviderAdapter` is only written in `` and then is not used after. > We can remove it. This pull request has now been integrated. Changeset: c12ca885 Author: Andrey Turbanov URL: https://git.openjdk.org/jdk/commit/c12ca885cc96b510c9ee2d54b520b7d4a98a0434 Stats: 11 lines in 1 file changed: 0 ins; 8 del; 3 mod 8312521: Unused field LocaleProviderAdapter#defaultLocaleProviderAdapter could be removed Reviewed-by: naoto ------------- PR: https://git.openjdk.org/jdk/pull/15388 From jlu at openjdk.org Thu Aug 31 23:05:48 2023 From: jlu at openjdk.org (Justin Lu) Date: Thu, 31 Aug 2023 23:05:48 GMT Subject: Integrated: 8314925: ChoiceFormat does not specify IllegalArgumentExceptions In-Reply-To: References: Message-ID: On Tue, 29 Aug 2023 16:53:29 GMT, Justin Lu wrote: > Please review this PR and [CSR](https://bugs.openjdk.org/browse/JDK-8315148) which is a conformance change to specify exceptions in java.text.ChoiceFormat. > > Makes `IllegalArgumentException` apparent for `applyPattern` and `setChoices`, as well as for the associated constructors that call the methods. > > This change also improves the error message for the `setChoices` IAE. This pull request has now been integrated. Changeset: 7754ac05 Author: Justin Lu URL: https://git.openjdk.org/jdk/commit/7754ac05062c698b8601048ae447849d982c8dbe Stats: 9 lines in 1 file changed: 8 ins; 0 del; 1 mod 8314925: ChoiceFormat does not specify IllegalArgumentExceptions Reviewed-by: naoto ------------- PR: https://git.openjdk.org/jdk/pull/15473