From serb at openjdk.java.net Mon Nov 2 09:18:04 2020 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 2 Nov 2020 09:18:04 GMT Subject: RFR: 8211958: Broken links in java.desktop files In-Reply-To: References: Message-ID: <419qL9UPahnCzXx_oOMJVGD_ZT3xVzvYCz7M4m0hTBE=.0cd2c408-3de5-4baf-866c-407219a4c96c@github.com> On Mon, 2 Nov 2020 09:04:39 GMT, Sergey Bylokhov wrote: > Most of the broken links were fixed already by the JDK-8225368 and JDK-8214817 > This change fix just a few. > > Also two cleanups are applied: > - The `../../java/awt/doc-files/` in some cases simplified to `doc-files/` > - The html links to the java classes via `` replaced by the `{@link }` src/java.desktop/share/classes/java/awt/doc-files/DesktopProperties.html line 101: > 99: > 100: The return value is a > 101: Map of Broken link to Map. src/java.desktop/share/classes/javax/print/DocFlavor.java line 159: > 157: * common flavors, the pre-defined *HOST {@code DocFlavors} may be used. > 158: *

> 159: * See character Broken link to the java.base module ------------- PR: https://git.openjdk.java.net/jdk/pull/998 From serb at openjdk.java.net Mon Nov 2 09:18:03 2020 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 2 Nov 2020 09:18:03 GMT Subject: RFR: 8211958: Broken links in java.desktop files Message-ID: Most of the broken links were fixed already by the JDK-8225368 and JDK-8214817 This change fix just a few. Also two cleanups are applied: - The `../../java/awt/doc-files/` in some cases simplified to `doc-files/` - The html links to the java classes via `` replaced by the `{@link }` ------------- Commit messages: - Initial fix Changes: https://git.openjdk.java.net/jdk/pull/998/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=998&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8211958 Stats: 43 lines in 9 files changed: 0 ins; 4 del; 39 mod Patch: https://git.openjdk.java.net/jdk/pull/998.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/998/head:pull/998 PR: https://git.openjdk.java.net/jdk/pull/998 From aivanov at openjdk.java.net Mon Nov 2 13:17:58 2020 From: aivanov at openjdk.java.net (Alexey Ivanov) Date: Mon, 2 Nov 2020 13:17:58 GMT Subject: RFR: 8211958: Broken links in java.desktop files In-Reply-To: References: Message-ID: On Mon, 2 Nov 2020 09:04:39 GMT, Sergey Bylokhov wrote: > Most of the broken links were fixed already by the JDK-8225368 and JDK-8214817 > This change fix just a few. > > Also two cleanups are applied: > - The `../../java/awt/doc-files/` in some cases simplified to `doc-files/` > - The html links to the java classes via `` replaced by the `{@link }` Marked as reviewed by aivanov (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/998 From kravikumar at openjdk.java.net Mon Nov 2 16:38:00 2020 From: kravikumar at openjdk.java.net (Kiran Sidhartha Ravikumar) Date: Mon, 2 Nov 2020 16:38:00 GMT Subject: RFR: 8255226: (tz) Upgrade time-zone data to tzdata2020d Message-ID: Hi Guys, Please review the integration of tzdata2020d to JDK. Details regarding the change can be viewed at - https://mm.icann.org/pipermail/tz-announce/2020-October/000062.html Bug: https://bugs.openjdk.java.net/browse/JDK-8255226 TestZoneInfo310.java test failure is addressed along with it. The last rule affects "Asia/Gaza" and "Asia/Hebron" and therefore excluded from the test. Regression Tests pass along with JCK. Please let me know if the changes are good to push. Thanks, Kiran ------------- Commit messages: - 8255226: (tz) Upgrade time-zone data to tzdata2020d Changes: https://git.openjdk.java.net/jdk/pull/1012/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1012&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8255226 Stats: 54 lines in 4 files changed: 34 ins; 2 del; 18 mod Patch: https://git.openjdk.java.net/jdk/pull/1012.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1012/head:pull/1012 PR: https://git.openjdk.java.net/jdk/pull/1012 From naoto at openjdk.java.net Mon Nov 2 16:53:54 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 2 Nov 2020 16:53:54 GMT Subject: Integrated: 8255671: Bidi.reorderVisually has misleading exception messages In-Reply-To: References: Message-ID: On Fri, 30 Oct 2020 22:23:30 GMT, Naoto Sato wrote: > Hi, > > Please review this simple message fix that follows JDK-8255242. > > Naoto This pull request has now been integrated. Changeset: 6dac8d27 Author: Naoto Sato URL: https://git.openjdk.java.net/jdk/commit/6dac8d27 Stats: 35 lines in 2 files changed: 32 ins; 0 del; 3 mod 8255671: Bidi.reorderVisually has misleading exception messages Reviewed-by: joehw ------------- PR: https://git.openjdk.java.net/jdk/pull/973 From naoto at openjdk.java.net Mon Nov 2 17:18:02 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 2 Nov 2020 17:18:02 GMT Subject: RFR: 8255226: (tz) Upgrade time-zone data to tzdata2020d In-Reply-To: References: Message-ID: On Mon, 2 Nov 2020 16:29:07 GMT, Kiran Sidhartha Ravikumar wrote: > Hi Guys, > > Please review the integration of tzdata2020d to JDK. > > Details regarding the change can be viewed at - https://mm.icann.org/pipermail/tz-announce/2020-October/000062.html > Bug: https://bugs.openjdk.java.net/browse/JDK-8255226 > > TestZoneInfo310.java test failure is addressed along with it. The last rule affects "Asia/Gaza" and "Asia/Hebron" and therefore excluded from the test. > > Regression Tests pass along with JCK. > > Please let me know if the changes are good to push. > > Thanks, > Kiran The test case needs copyright year change to 2020. test/jdk/sun/util/calendar/zi/TestZoneInfo310.java line 201: > 199: zid.equals("Iran") || // last rule mismatch > 200: zid.equals("Asia/Gaza") || // last rule mismatch > 201: zid.equals("Asia/Hebron")) { // last rule mismatch Can you explain why these zones are failing? The criteria for excluding failing tests here is that the zone has negative dst and last rules beyond 2037, and I don't think those newly excluded zones suffice those. ------------- Changes requested by naoto (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/1012 From scolebourne at openjdk.java.net Mon Nov 2 17:44:00 2020 From: scolebourne at openjdk.java.net (Stephen Colebourne) Date: Mon, 2 Nov 2020 17:44:00 GMT Subject: RFR: 8247781: Day periods support [v3] In-Reply-To: References: Message-ID: <96h7JM1OhKA5v5Bx9qj9n08oRHav8V13E6Uor0m8SVw=.6960968e-0e3a-4ceb-95d0-a293838225ba@github.com> On Fri, 30 Oct 2020 11:06:59 GMT, Stephen Colebourne wrote: >> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: >> >> Fixed exception messages. > > src/java.base/share/classes/java/time/format/Parsed.java line 497: > >> 495: AMPM_OF_DAY.checkValidValue(ap); >> 496: } >> 497: updateCheckDayPeriodConflict(AMPM_OF_DAY, midpoint / 720); > > No need to put `AMPM_OF_DAY` back in here because you've already resolved it to `HOUR_OF_DAY` and `MINUTE_OF_HOUR`. There probably does need to be validation to check that the day period agrees with the AM/PM value. Line can still be removed AFAICT ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From scolebourne at openjdk.java.net Mon Nov 2 17:44:02 2020 From: scolebourne at openjdk.java.net (Stephen Colebourne) Date: Mon, 2 Nov 2020 17:44:02 GMT Subject: RFR: 8247781: Day periods support [v3] In-Reply-To: References: Message-ID: On Fri, 30 Oct 2020 22:03:08 GMT, Naoto Sato wrote: >> Hi, >> >> Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: >> >> https://bugs.openjdk.java.net/browse/JDK-8254629 >> >> Naoto > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Fixed exception messages. test/jdk/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java line 656: > 654: {"h B", "11 at night", 23}, > 655: {"h B", "3 at night", 3}, > 656: {"h B", "11 in the morning", 11}, Need tests for "51 in the morning" (which should parse in LENIENT as "3 in the morning" plus 2 days, see how HOUR_OF_DAY=51 works in general. Similar issue with HOUR_OF_AMPM=3 and AMPM_OF_DAY=4. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From scolebourne at openjdk.java.net Mon Nov 2 17:43:59 2020 From: scolebourne at openjdk.java.net (Stephen Colebourne) Date: Mon, 2 Nov 2020 17:43:59 GMT Subject: RFR: 8247781: Day periods support [v3] In-Reply-To: References: Message-ID: On Fri, 30 Oct 2020 21:30:50 GMT, Naoto Sato wrote: >> src/java.base/share/classes/java/time/format/Parsed.java line 472: >> >>> 470: } >>> 471: if (dayPeriod != null) { >>> 472: if (fieldValues.containsKey(HOUR_OF_DAY)) { >> >> Are we certain that the CLDR data does not contain day periods based on minutes as well as hours? This logic does not check against MINUTE_OF_HOUR for example. The logic also conflicts with the spec Javadoc that says MINUTE_OF_HOUR is validated. > > MINUTE_OF_HOUR without HOUR_OF_DAY/HOUR_OF_AMPM may not make any sense, so it is only validated in updateCheckDayPeriodConflict. But can you get a CLDR rule that says "at night" before 05:30 and "In the morning" from 05:30 onwards? If you can then I don't think it is handled, because HOUR_OF_DAY and MINUTE_OF_HOUR are not used together when checking against DayPeriod. >> src/java.base/share/classes/java/time/format/Parsed.java line 500: >> >>> 498: } >>> 499: } >>> 500: } >> >> Looking at the existing logic, the `AMPM_OF_DAY` field is completely ignored if there is no `HOUR_OF_AMPM` field. Thus, there is no validation to check `AMPM_OF_DAY` against `HOUR_OF_DAY`. This seems odd. (AMPM_OF_DAY = 0 and HOUR_OF_DAY=18 does not look like it throws an exception, when it probably should). >> >> On solution would be for `AMPM_OF_DAY` to be resolved to a day period at line 427, checking for conflicts with any parsed day period. (a small bug fix behavioural change) > > There are cases where a period crosses midnight, e.g., 23:00-04:00 so it cannot validate am/pm, so I decided to just override ampm with dayperiod without validating. Pulling on this a little more. As the PR stands, it seems that if the user passes in text with just a day-period of "AM" they get a `LocalTime` of 06:00 but if they pass in `AMPM_OF_DAY` of "AM" the get no `LocalTime` in the result. Is that right? If so, I don't think this is sustainable. Thats why I think `AMPM_OF_DAY` will have to be resolved to a dayPeriod of "am" or "pm". If dayPeriod is more precise than `AMPM_OF_DAY`, then dayPeriod can silently take precedence ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From kravikumar at openjdk.java.net Mon Nov 2 18:09:03 2020 From: kravikumar at openjdk.java.net (Kiran Sidhartha Ravikumar) Date: Mon, 2 Nov 2020 18:09:03 GMT Subject: RFR: 8255226: (tz) Upgrade time-zone data to tzdata2020d In-Reply-To: References: Message-ID: <_-CfMNeat8oHCidIqA-s6I6ZQPcHAa-z8NRg1h9mm4c=.c4846ff2-a653-4a50-b66a-8fd455e2d729@github.com> On Mon, 2 Nov 2020 17:10:34 GMT, Naoto Sato wrote: >> Hi Guys, >> >> Please review the integration of tzdata2020d to JDK. >> >> Details regarding the change can be viewed at - https://mm.icann.org/pipermail/tz-announce/2020-October/000062.html >> Bug: https://bugs.openjdk.java.net/browse/JDK-8255226 >> >> TestZoneInfo310.java test failure is addressed along with it. The last rule affects "Asia/Gaza" and "Asia/Hebron" and therefore excluded from the test. >> >> Regression Tests pass along with JCK. >> >> Please let me know if the changes are good to push. >> >> Thanks, >> Kiran > > test/jdk/sun/util/calendar/zi/TestZoneInfo310.java line 201: > >> 199: zid.equals("Iran") || // last rule mismatch >> 200: zid.equals("Asia/Gaza") || // last rule mismatch >> 201: zid.equals("Asia/Hebron")) { // last rule mismatch > > Can you explain why these zones are failing? The criteria for excluding failing tests here is that the zone has negative dst and last rules beyond 2037, and I don't think those newly excluded zones suffice those. It's probably these last rule what is causing the issue Rule Palestine 2020 max - Mar Sat>=24 0:00 1:00 S Rule Palestine 2020 max - Oct Sat>=24 1:00 0 - The failure seen is ****************************** Asia/Gaza : Asia/Gaza ------------- SimpleTimeZone (NG) stz=java.util.SimpleTimeZone[id=Asia/Gaza,offset=7200000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=7,startTime=0,startTimeMode=0,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=7,endTime=3600000,endTimeMode=0] stz0=java.util.SimpleTimeZone[id=Asia/Gaza,offset=7200000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=24,startDayOfWeek=7,startTime=0,startTimeMode=0,endMode=3,endMonth=9,endDay=24,endDayOfWeek=7,endTime=3600000,endTimeMode=0] ------------- PR: https://git.openjdk.java.net/jdk/pull/1012 From naoto at openjdk.java.net Mon Nov 2 18:18:00 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 2 Nov 2020 18:18:00 GMT Subject: RFR: 8255226: (tz) Upgrade time-zone data to tzdata2020d In-Reply-To: <_-CfMNeat8oHCidIqA-s6I6ZQPcHAa-z8NRg1h9mm4c=.c4846ff2-a653-4a50-b66a-8fd455e2d729@github.com> References: <_-CfMNeat8oHCidIqA-s6I6ZQPcHAa-z8NRg1h9mm4c=.c4846ff2-a653-4a50-b66a-8fd455e2d729@github.com> Message-ID: <3BuHmUaG3MrBs7zQdpb8uiAxEQGUGO8YhdADRKBGaqw=.7276ab51-8823-4f20-be80-6c003212f317@github.com> On Mon, 2 Nov 2020 18:06:28 GMT, Kiran Sidhartha Ravikumar wrote: >> test/jdk/sun/util/calendar/zi/TestZoneInfo310.java line 201: >> >>> 199: zid.equals("Iran") || // last rule mismatch >>> 200: zid.equals("Asia/Gaza") || // last rule mismatch >>> 201: zid.equals("Asia/Hebron")) { // last rule mismatch >> >> Can you explain why these zones are failing? The criteria for excluding failing tests here is that the zone has negative dst and last rules beyond 2037, and I don't think those newly excluded zones suffice those. > > It's probably these last rule what is causing the issue > > Rule Palestine 2020 max - Mar Sat>=24 0:00 1:00 S > Rule Palestine 2020 max - Oct Sat>=24 1:00 0 - > > The failure seen is > > ****************************** > Asia/Gaza : Asia/Gaza > ------------- > SimpleTimeZone (NG) > stz=java.util.SimpleTimeZone[id=Asia/Gaza,offset=7200000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=7,startTime=0,startTimeMode=0,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=7,endTime=3600000,endTimeMode=0] > stz0=java.util.SimpleTimeZone[id=Asia/Gaza,offset=7200000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=24,startDayOfWeek=7,startTime=0,startTimeMode=0,endMode=3,endMonth=9,endDay=24,endDayOfWeek=7,endTime=3600000,endTimeMode=0] My question is why it is failing. Have you figured it? The existing exceptions are either negative DST or last rule beyond 2037, which javazic cannot handle. The changes introduced with 2020d does not meet either of them. Unless we know why it is failing, we cannot be sure we can exclude it. ------------- PR: https://git.openjdk.java.net/jdk/pull/1012 From serb at openjdk.java.net Mon Nov 2 19:38:04 2020 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Mon, 2 Nov 2020 19:38:04 GMT Subject: Integrated: 8211958: Broken links in java.desktop files In-Reply-To: References: Message-ID: On Mon, 2 Nov 2020 09:04:39 GMT, Sergey Bylokhov wrote: > Most of the broken links were fixed already by the JDK-8225368 and JDK-8214817 > This change fix just a few. > > Also two cleanups are applied: > - The `../../java/awt/doc-files/` in some cases simplified to `doc-files/` > - The html links to the java classes via `` replaced by the `{@link }` This pull request has now been integrated. Changeset: acb5f654 Author: Sergey Bylokhov URL: https://git.openjdk.java.net/jdk/commit/acb5f654 Stats: 43 lines in 9 files changed: 0 ins; 4 del; 39 mod 8211958: Broken links in java.desktop files Reviewed-by: aivanov ------------- PR: https://git.openjdk.java.net/jdk/pull/998 From naoto at openjdk.java.net Mon Nov 2 23:17:10 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 2 Nov 2020 23:17:10 GMT Subject: RFR: 8247781: Day periods support [v4] In-Reply-To: References: Message-ID: > Hi, > > Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: > > https://bugs.openjdk.java.net/browse/JDK-8254629 > > Naoto Naoto Sato has updated the pull request incrementally with three additional commits since the last revision: - Addressing https://github.com/openjdk/jdk/pull/938#discussion_r516147298 - Addressing https://github.com/openjdk/jdk/pull/938#discussion_r516123190 - Addressing https://github.com/openjdk/jdk/pull/938#discussion_r516138455 ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/938/files - new: https://git.openjdk.java.net/jdk/pull/938/files/29c47afc..297acc94 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=02-03 Stats: 66 lines in 2 files changed: 53 ins; 3 del; 10 mod Patch: https://git.openjdk.java.net/jdk/pull/938.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/938/head:pull/938 PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Mon Nov 2 23:17:11 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 2 Nov 2020 23:17:11 GMT Subject: RFR: 8247781: Day periods support [v3] In-Reply-To: References: Message-ID: On Mon, 2 Nov 2020 17:27:35 GMT, Stephen Colebourne wrote: >> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: >> >> Fixed exception messages. > > test/jdk/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java line 656: > >> 654: {"h B", "11 at night", 23}, >> 655: {"h B", "3 at night", 3}, >> 656: {"h B", "11 in the morning", 11}, > > Need tests for "51 in the morning" (which should parse in LENIENT as "3 in the morning" plus 2 days, see how HOUR_OF_DAY=51 works in general. > > Similar issue with HOUR_OF_AMPM=3 and AMPM_OF_DAY=4. Fixed. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Mon Nov 2 23:23:57 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 2 Nov 2020 23:23:57 GMT Subject: RFR: 8247781: Day periods support [v4] In-Reply-To: <96h7JM1OhKA5v5Bx9qj9n08oRHav8V13E6Uor0m8SVw=.6960968e-0e3a-4ceb-95d0-a293838225ba@github.com> References: <96h7JM1OhKA5v5Bx9qj9n08oRHav8V13E6Uor0m8SVw=.6960968e-0e3a-4ceb-95d0-a293838225ba@github.com> Message-ID: On Mon, 2 Nov 2020 17:08:10 GMT, Stephen Colebourne wrote: >> src/java.base/share/classes/java/time/format/Parsed.java line 497: >> >>> 495: AMPM_OF_DAY.checkValidValue(ap); >>> 496: } >>> 497: updateCheckDayPeriodConflict(AMPM_OF_DAY, midpoint / 720); >> >> No need to put `AMPM_OF_DAY` back in here because you've already resolved it to `HOUR_OF_DAY` and `MINUTE_OF_HOUR`. There probably does need to be validation to check that the day period agrees with the AM/PM value. > > Line can still be removed AFAICT Fixed. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Mon Nov 2 23:23:56 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 2 Nov 2020 23:23:56 GMT Subject: RFR: 8247781: Day periods support [v4] In-Reply-To: References: Message-ID: <_KS-70pqQG8VavYGtbXCrOlvwfwGl6Nm-lk8SjkEDQI=.1775f0e1-4847-401a-a576-dbb93e080c90@github.com> On Mon, 2 Nov 2020 17:05:40 GMT, Stephen Colebourne wrote: >> MINUTE_OF_HOUR without HOUR_OF_DAY/HOUR_OF_AMPM may not make any sense, so it is only validated in updateCheckDayPeriodConflict. > > But can you get a CLDR rule that says "at night" before 05:30 and "In the morning" from 05:30 onwards? If you can then I don't think it is handled, because HOUR_OF_DAY and MINUTE_OF_HOUR are not used together when checking against DayPeriod. CLDR allows rules that involve MINUTE_OF_HOUR. The validation I meant was within the `updateCheckDayPeriodConflict`: long hod = fieldValues.get(HOUR_OF_DAY); long moh = fieldValues.containsKey(MINUTE_OF_HOUR) ? fieldValues.get(MINUTE_OF_HOUR) : 0; long mod = hod * 60 + moh; if (!dayPeriod.includes(mod)) { throw new DateTimeException("Conflict found: Resolved time %02d:%02d".formatted(hod, moh) + " conflicts with " + dayPeriod); } which checks both hod/moh. moh is assumed zero if `MINUTE_OF_HOUR` does not exist. Are you suggesting `HOUR_OF_DAY` should also be assumed zero if it does not exist? >> There are cases where a period crosses midnight, e.g., 23:00-04:00 so it cannot validate am/pm, so I decided to just override ampm with dayperiod without validating. > > Pulling on this a little more. > > As the PR stands, it seems that if the user passes in text with just a day-period of "AM" they get a `LocalTime` of 06:00 but if they pass in `AMPM_OF_DAY` of "AM" the get no `LocalTime` in the result. Is that right? If so, I don't think this is sustainable. > > Thats why I think `AMPM_OF_DAY` will have to be resolved to a dayPeriod of "am" or "pm". If dayPeriod is more precise than `AMPM_OF_DAY`, then dayPeriod can silently take precedence I implemented what you suggested here in the latest PR, but that would be a behavioral change which requires a CSR, as "AM" would be resolved to 06:00 which was not before. Do you think it would be acceptable? If so, I will reopen the CSR and describe the change. (In fact some TCK failed with this impl) ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From kravikumar at openjdk.java.net Tue Nov 3 00:02:57 2020 From: kravikumar at openjdk.java.net (Kiran Sidhartha Ravikumar) Date: Tue, 3 Nov 2020 00:02:57 GMT Subject: RFR: 8255226: (tz) Upgrade time-zone data to tzdata2020d In-Reply-To: <3BuHmUaG3MrBs7zQdpb8uiAxEQGUGO8YhdADRKBGaqw=.7276ab51-8823-4f20-be80-6c003212f317@github.com> References: <_-CfMNeat8oHCidIqA-s6I6ZQPcHAa-z8NRg1h9mm4c=.c4846ff2-a653-4a50-b66a-8fd455e2d729@github.com> <3BuHmUaG3MrBs7zQdpb8uiAxEQGUGO8YhdADRKBGaqw=.7276ab51-8823-4f20-be80-6c003212f317@github.com> Message-ID: On Mon, 2 Nov 2020 18:14:47 GMT, Naoto Sato wrote: >> It's probably these last rule what is causing the issue >> >> Rule Palestine 2020 max - Mar Sat>=24 0:00 1:00 S >> Rule Palestine 2020 max - Oct Sat>=24 1:00 0 - >> >> The failure seen is >> >> ****************************** >> Asia/Gaza : Asia/Gaza >> ------------- >> SimpleTimeZone (NG) >> stz=java.util.SimpleTimeZone[id=Asia/Gaza,offset=7200000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=7,startTime=0,startTimeMode=0,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=7,endTime=3600000,endTimeMode=0] >> stz0=java.util.SimpleTimeZone[id=Asia/Gaza,offset=7200000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=24,startDayOfWeek=7,startTime=0,startTimeMode=0,endMode=3,endMonth=9,endDay=24,endDayOfWeek=7,endTime=3600000,endTimeMode=0] > > My question is why it is failing. Have you figured it? The existing exceptions are either negative DST or last rule beyond 2037, which javazic cannot handle. The changes introduced with 2020d does not meet either of them. Unless we know why it is failing, we cannot be sure we can exclude it. Thanks for getting back Naoto, I believe this is a long-standing issue - https://bugs.openjdk.java.net/browse/JDK-8227293. Looking back at the integration of tzdata2019a/tzdata2019b, the same issue was addressed by updating the source code - https://hg.openjdk.java.net/jdk/jdk/rev/79036e5e744b#l13.1. Here is some history to the issue - https://mail.openjdk.java.net/pipermail/i18n-dev/2019-July/002887.html Please let me know your thoughts ------------- PR: https://git.openjdk.java.net/jdk/pull/1012 From naoto at openjdk.java.net Tue Nov 3 00:24:00 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Tue, 3 Nov 2020 00:24:00 GMT Subject: RFR: 8255226: (tz) Upgrade time-zone data to tzdata2020d In-Reply-To: References: <_-CfMNeat8oHCidIqA-s6I6ZQPcHAa-z8NRg1h9mm4c=.c4846ff2-a653-4a50-b66a-8fd455e2d729@github.com> <3BuHmUaG3MrBs7zQdpb8uiAxEQGUGO8YhdADRKBGaqw=.7276ab51-8823-4f20-be80-6c003212f317@github.com> Message-ID: On Tue, 3 Nov 2020 00:00:26 GMT, Kiran Sidhartha Ravikumar wrote: >> My question is why it is failing. Have you figured it? The existing exceptions are either negative DST or last rule beyond 2037, which javazic cannot handle. The changes introduced with 2020d does not meet either of them. Unless we know why it is failing, we cannot be sure we can exclude it. > > Thanks for getting back Naoto, I believe this is a long-standing issue - https://bugs.openjdk.java.net/browse/JDK-8227293. > > Looking back at the integration of tzdata2019a/tzdata2019b, the same issue was addressed by updating the source code - https://hg.openjdk.java.net/jdk/jdk/rev/79036e5e744b#l13.1. > > Here is some history to the issue - https://mail.openjdk.java.net/pipermail/i18n-dev/2019-July/002887.html > > Please let me know your thoughts Should we then remove the hack in the ZoneInfoFile.java that excludes Gaza/Hebron instead? ------------- PR: https://git.openjdk.java.net/jdk/pull/1012 From kravikumar at openjdk.java.net Tue Nov 3 15:40:12 2020 From: kravikumar at openjdk.java.net (Kiran Sidhartha Ravikumar) Date: Tue, 3 Nov 2020 15:40:12 GMT Subject: RFR: 8255226: (tz) Upgrade time-zone data to tzdata2020d [v2] In-Reply-To: References: Message-ID: > Hi Guys, > > Please review the integration of tzdata2020d to JDK. > > Details regarding the change can be viewed at - https://mm.icann.org/pipermail/tz-announce/2020-October/000062.html > Bug: https://bugs.openjdk.java.net/browse/JDK-8255226 > > TestZoneInfo310.java test failure is addressed along with it. The last rule affects "Asia/Gaza" and "Asia/Hebron" and therefore excluded from the test. > > Regression Tests pass along with JCK. > > Please let me know if the changes are good to push. > > Thanks, > Kiran Kiran Sidhartha Ravikumar has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: - Merge remote-tracking branch 'origin/master' into JDK-8255226 - 8255226: Updating ZoneInfoFile.java logic to avoid certain zones - 8255226: (tz) Upgrade time-zone data to tzdata2020d ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/1012/files - new: https://git.openjdk.java.net/jdk/pull/1012/files/e859af83..8782181c Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1012&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1012&range=00-01 Stats: 2120 lines in 83 files changed: 1178 ins; 580 del; 362 mod Patch: https://git.openjdk.java.net/jdk/pull/1012.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1012/head:pull/1012 PR: https://git.openjdk.java.net/jdk/pull/1012 From kravikumar at openjdk.java.net Tue Nov 3 15:42:55 2020 From: kravikumar at openjdk.java.net (Kiran Sidhartha Ravikumar) Date: Tue, 3 Nov 2020 15:42:55 GMT Subject: RFR: 8255226: (tz) Upgrade time-zone data to tzdata2020d [v2] In-Reply-To: References: <_-CfMNeat8oHCidIqA-s6I6ZQPcHAa-z8NRg1h9mm4c=.c4846ff2-a653-4a50-b66a-8fd455e2d729@github.com> <3BuHmUaG3MrBs7zQdpb8uiAxEQGUGO8YhdADRKBGaqw=.7276ab51-8823-4f20-be80-6c003212f317@github.com> Message-ID: On Tue, 3 Nov 2020 00:21:16 GMT, Naoto Sato wrote: >> Thanks for getting back Naoto, I believe this is a long-standing issue - https://bugs.openjdk.java.net/browse/JDK-8227293. >> >> Looking back at the integration of tzdata2019a/tzdata2019b, the same issue was addressed by updating the source code - https://hg.openjdk.java.net/jdk/jdk/rev/79036e5e744b#l13.1. >> >> Here is some history to the issue - https://mail.openjdk.java.net/pipermail/i18n-dev/2019-July/002887.html >> >> Please let me know your thoughts > > Should we then remove the hack in the ZoneInfoFile.java that excludes Gaza/Hebron instead? I had made changes to the ZoneInfoFile.java to avoid applying the logic present to Gaza/Hebron. Regression tests executed successfully. ------------- PR: https://git.openjdk.java.net/jdk/pull/1012 From kravikumar at openjdk.java.net Tue Nov 3 15:49:09 2020 From: kravikumar at openjdk.java.net (Kiran Sidhartha Ravikumar) Date: Tue, 3 Nov 2020 15:49:09 GMT Subject: RFR: 8255226: (tz) Upgrade time-zone data to tzdata2020d [v3] In-Reply-To: References: Message-ID: > Hi Guys, > > Please review the integration of tzdata2020d to JDK. > > Details regarding the change can be viewed at - https://mm.icann.org/pipermail/tz-announce/2020-October/000062.html > Bug: https://bugs.openjdk.java.net/browse/JDK-8255226 > > TestZoneInfo310.java test failure is addressed along with it. The last rule affects "Asia/Gaza" and "Asia/Hebron" and therefore excluded from the test. > > Regression Tests pass along with JCK. > > Please let me know if the changes are good to push. > > Thanks, > Kiran Kiran Sidhartha Ravikumar has updated the pull request incrementally with one additional commit since the last revision: 8255226: Fixing whitespaces ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/1012/files - new: https://git.openjdk.java.net/jdk/pull/1012/files/8782181c..e4a565e2 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1012&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1012&range=01-02 Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.java.net/jdk/pull/1012.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1012/head:pull/1012 PR: https://git.openjdk.java.net/jdk/pull/1012 From naoto at openjdk.java.net Tue Nov 3 18:12:03 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Tue, 3 Nov 2020 18:12:03 GMT Subject: RFR: 8255226: (tz) Upgrade time-zone data to tzdata2020d [v3] In-Reply-To: References: Message-ID: On Tue, 3 Nov 2020 15:49:09 GMT, Kiran Sidhartha Ravikumar wrote: >> Hi Guys, >> >> Please review the integration of tzdata2020d to JDK. >> >> Details regarding the change can be viewed at - https://mm.icann.org/pipermail/tz-announce/2020-October/000062.html >> Bug: https://bugs.openjdk.java.net/browse/JDK-8255226 >> >> TestZoneInfo310.java test failure is addressed along with it. The last rule affects "Asia/Gaza" and "Asia/Hebron" and therefore excluded from the test. >> >> Regression Tests pass along with JCK. >> >> Please let me know if the changes are good to push. >> >> Thanks, >> Kiran > > Kiran Sidhartha Ravikumar has updated the pull request incrementally with one additional commit since the last revision: > > 8255226: Fixing whitespaces Looks good. ------------- Marked as reviewed by naoto (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/1012 From naoto at openjdk.java.net Tue Nov 3 18:23:12 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Tue, 3 Nov 2020 18:23:12 GMT Subject: RFR: 8247781: Day periods support [v5] In-Reply-To: References: Message-ID: > Hi, > > Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: > > https://bugs.openjdk.java.net/browse/JDK-8254629 > > Naoto Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Fixed TCK test failures, added the new pattern char description in DateTimeFormatter ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/938/files - new: https://git.openjdk.java.net/jdk/pull/938/files/297acc94..e52fe51f Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=04 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=03-04 Stats: 19 lines in 2 files changed: 1 ins; 0 del; 18 mod Patch: https://git.openjdk.java.net/jdk/pull/938.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/938/head:pull/938 PR: https://git.openjdk.java.net/jdk/pull/938 From joehw at openjdk.java.net Wed Nov 4 18:46:57 2020 From: joehw at openjdk.java.net (Joe Wang) Date: Wed, 4 Nov 2020 18:46:57 GMT Subject: RFR: 8247781: Day periods support [v5] In-Reply-To: References: Message-ID: On Fri, 30 Oct 2020 11:42:49 GMT, Stephen Colebourne wrote: >> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: >> >> Fixed TCK test failures, added the new pattern char description in DateTimeFormatter > > Changes requested by scolebourne (Author). Since 24:00 is not represented in for example LocalTime and H (hour-of-day) 0-23, it seems obvious midnight in the JDK would be 00:00, and the new DayPeriod tests proves that. The CLDR rule for midnight is also obvious, but the LDML spec does state that it "strongly recommend" that implementations provide for the ability to specify whether midnight is supported or not (and for either 00:00 or 24:00 or both). Just wonder whether there is a need to explicitly state the fact about midnight? DateTimeFormatterBuilder::appendInstant() for example, stated clearly how 24:00 is processed, e.g. "The end-of-day time of '24:00' is handled as midnight at the start of the following day." ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Wed Nov 4 20:49:57 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Wed, 4 Nov 2020 20:49:57 GMT Subject: RFR: 8247781: Day periods support [v5] In-Reply-To: References: Message-ID: On Wed, 4 Nov 2020 18:44:33 GMT, Joe Wang wrote: >> Changes requested by scolebourne (Author). > > Since 24:00 is not represented in for example LocalTime and H (hour-of-day) 0-23, it seems obvious midnight in the JDK would be 00:00, and the new DayPeriod tests proves that. The CLDR rule for midnight is also obvious, but the LDML spec does state that it "strongly recommend" that implementations provide for the ability to specify whether midnight is supported or not (and for either 00:00 or 24:00 or both). > > Just wonder whether there is a need to explicitly state the fact about midnight? DateTimeFormatterBuilder::appendInstant() for example, stated clearly how 24:00 is processed, e.g. "The end-of-day time of '24:00' is handled as midnight at the start of the following day." Thanks, Joe. I will incorporate some description about "midnight" in the next update. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Wed Nov 4 22:13:25 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Wed, 4 Nov 2020 22:13:25 GMT Subject: RFR: 8247781: Day periods support [v6] In-Reply-To: References: Message-ID: > Hi, > > Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: > > https://bugs.openjdk.java.net/browse/JDK-8254629 > > Naoto 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 ten additional commits since the last revision: - Merge branch 'master' into dayperiod - Change based on CSR change. - Fixed TCK test failures, added the new pattern char description in DateTimeFormatter - Addressing https://github.com/openjdk/jdk/pull/938#discussion_r516147298 - Addressing https://github.com/openjdk/jdk/pull/938#discussion_r516123190 - Addressing https://github.com/openjdk/jdk/pull/938#discussion_r516138455 - Fixed exception messages. - Addressed the following comments: - https://github.com/openjdk/jdk/pull/938#discussion_r515003422 - https://github.com/openjdk/jdk/pull/938#discussion_r515005296 - https://github.com/openjdk/jdk/pull/938#discussion_r515008862 - https://github.com/openjdk/jdk/pull/938#discussion_r515030268 - https://github.com/openjdk/jdk/pull/938#discussion_r515030880 - https://github.com/openjdk/jdk/pull/938#discussion_r515032002 - https://github.com/openjdk/jdk/pull/938#discussion_r515036803 - https://github.com/openjdk/jdk/pull/938#discussion_r515037626 - https://github.com/openjdk/jdk/pull/938#discussion_r515038069 - https://github.com/openjdk/jdk/pull/938#discussion_r515039056 - 8247781: Day periods support ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/938/files - new: https://git.openjdk.java.net/jdk/pull/938/files/e52fe51f..4aa5b197 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=05 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=04-05 Stats: 12803 lines in 661 files changed: 7123 ins; 3276 del; 2404 mod Patch: https://git.openjdk.java.net/jdk/pull/938.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/938/head:pull/938 PR: https://git.openjdk.java.net/jdk/pull/938 From kravikumar at openjdk.java.net Thu Nov 5 11:31:57 2020 From: kravikumar at openjdk.java.net (Kiran Sidhartha Ravikumar) Date: Thu, 5 Nov 2020 11:31:57 GMT Subject: Integrated: 8255226: (tz) Upgrade time-zone data to tzdata2020d In-Reply-To: References: Message-ID: <4rYwfKPXXlBxc5V7Ij0-lLBvxPDl7qYtyFtJnPTbL5A=.a3d49bd2-db07-4048-bdce-6bbf378ad9c3@github.com> On Mon, 2 Nov 2020 16:29:07 GMT, Kiran Sidhartha Ravikumar wrote: > Hi Guys, > > Please review the integration of tzdata2020d to JDK. > > Details regarding the change can be viewed at - https://mm.icann.org/pipermail/tz-announce/2020-October/000062.html > Bug: https://bugs.openjdk.java.net/browse/JDK-8255226 > > TestZoneInfo310.java test failure is addressed along with it. The last rule affects "Asia/Gaza" and "Asia/Hebron" and therefore excluded from the test. > > Regression Tests pass along with JCK. > > Please let me know if the changes are good to push. > > Thanks, > Kiran This pull request has now been integrated. Changeset: b65ff60a Author: Kiran Sidhartha Ravikumar Committer: Sean Coffey URL: https://git.openjdk.java.net/jdk/commit/b65ff60a Stats: 61 lines in 4 files changed: 38 ins; 2 del; 21 mod 8255226: (tz) Upgrade time-zone data to tzdata2020d Reviewed-by: naoto ------------- PR: https://git.openjdk.java.net/jdk/pull/1012 From rriggs at openjdk.java.net Thu Nov 5 16:11:55 2020 From: rriggs at openjdk.java.net (Roger Riggs) Date: Thu, 5 Nov 2020 16:11:55 GMT Subject: RFR: 8247781: Day periods support [v3] In-Reply-To: References: Message-ID: <7vZA6TYuo_b7Z4_4OUqCSxYAKLRBUB3F3NGqa6osA8E=.e73908ae-349c-42e1-88e5-6e30cf809bef@github.com> On Fri, 30 Oct 2020 22:03:08 GMT, Naoto Sato wrote: >> Hi, >> >> Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: >> >> https://bugs.openjdk.java.net/browse/JDK-8254629 >> >> Naoto > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Fixed exception messages. Marked as reviewed by rriggs (Reviewer). src/java.base/share/classes/java/time/format/Parsed.java line 180: > 178: cloned.chrono = this.chrono; > 179: cloned.leapSecond = this.leapSecond; > 180: cloned.dayPeriod= this.dayPeriod; Add space before "=". ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From rriggs at openjdk.java.net Thu Nov 5 16:12:03 2020 From: rriggs at openjdk.java.net (Roger Riggs) Date: Thu, 5 Nov 2020 16:12:03 GMT Subject: RFR: 8247781: Day periods support [v6] In-Reply-To: References: Message-ID: On Wed, 4 Nov 2020 22:13:25 GMT, Naoto Sato wrote: >> Hi, >> >> Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: >> >> https://bugs.openjdk.java.net/browse/JDK-8254629 >> >> Naoto > > 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 ten additional commits since the last revision: > > - Merge branch 'master' into dayperiod > - Change based on CSR change. > - Fixed TCK test failures, added the new pattern char description in DateTimeFormatter > - Addressing https://github.com/openjdk/jdk/pull/938#discussion_r516147298 > - Addressing https://github.com/openjdk/jdk/pull/938#discussion_r516123190 > - Addressing https://github.com/openjdk/jdk/pull/938#discussion_r516138455 > - Fixed exception messages. > - Addressed the following comments: > - https://github.com/openjdk/jdk/pull/938#discussion_r515003422 > - https://github.com/openjdk/jdk/pull/938#discussion_r515005296 > - https://github.com/openjdk/jdk/pull/938#discussion_r515008862 > - https://github.com/openjdk/jdk/pull/938#discussion_r515030268 > - https://github.com/openjdk/jdk/pull/938#discussion_r515030880 > - https://github.com/openjdk/jdk/pull/938#discussion_r515032002 > - https://github.com/openjdk/jdk/pull/938#discussion_r515036803 > - https://github.com/openjdk/jdk/pull/938#discussion_r515037626 > - https://github.com/openjdk/jdk/pull/938#discussion_r515038069 > - https://github.com/openjdk/jdk/pull/938#discussion_r515039056 > - 8247781: Day periods support src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 1479: > 1477: * for it in the formatter locale is from 21:00 to 06:00, then {@code HOUR_OF_DAY} > 1478: * is set to '1' and {@code MINUTE_OF_HOUR} set to '30'. If {@code AMPM_OF_DAY} exists > 1479: * and no {@code HOUR_OF_DAY} is resolved, the parsed day period takes the precedence. "the precedence" -> "precedence" ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Thu Nov 5 17:12:12 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Thu, 5 Nov 2020 17:12:12 GMT Subject: RFR: 8247781: Day periods support [v3] In-Reply-To: <7vZA6TYuo_b7Z4_4OUqCSxYAKLRBUB3F3NGqa6osA8E=.e73908ae-349c-42e1-88e5-6e30cf809bef@github.com> References: <7vZA6TYuo_b7Z4_4OUqCSxYAKLRBUB3F3NGqa6osA8E=.e73908ae-349c-42e1-88e5-6e30cf809bef@github.com> Message-ID: On Mon, 2 Nov 2020 19:20:10 GMT, Roger Riggs wrote: >> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: >> >> Fixed exception messages. > > src/java.base/share/classes/java/time/format/Parsed.java line 180: > >> 178: cloned.chrono = this.chrono; >> 179: cloned.leapSecond = this.leapSecond; >> 180: cloned.dayPeriod= this.dayPeriod; > > Add space before "=". Fixed. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Thu Nov 5 17:12:11 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Thu, 5 Nov 2020 17:12:11 GMT Subject: RFR: 8247781: Day periods support [v7] In-Reply-To: References: Message-ID: > Hi, > > Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: > > https://bugs.openjdk.java.net/browse/JDK-8254629 > > Naoto Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Fixed typo/grammatical error. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/938/files - new: https://git.openjdk.java.net/jdk/pull/938/files/4aa5b197..b0649899 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=06 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=05-06 Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/938.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/938/head:pull/938 PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Thu Nov 5 17:12:14 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Thu, 5 Nov 2020 17:12:14 GMT Subject: RFR: 8247781: Day periods support [v7] In-Reply-To: References: Message-ID: On Thu, 5 Nov 2020 16:07:30 GMT, Roger Riggs wrote: >> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: >> >> Fixed typo/grammatical error. > > src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 1479: > >> 1477: * for it in the formatter locale is from 21:00 to 06:00, then {@code HOUR_OF_DAY} >> 1478: * is set to '1' and {@code MINUTE_OF_HOUR} set to '30'. If {@code AMPM_OF_DAY} exists >> 1479: * and no {@code HOUR_OF_DAY} is resolved, the parsed day period takes the precedence. > > "the precedence" -> "precedence" Fixed. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From joehw at openjdk.java.net Thu Nov 5 17:21:01 2020 From: joehw at openjdk.java.net (Joe Wang) Date: Thu, 5 Nov 2020 17:21:01 GMT Subject: RFR: 8247781: Day periods support [v7] In-Reply-To: References: Message-ID: On Thu, 5 Nov 2020 17:12:11 GMT, Naoto Sato wrote: >> Hi, >> >> Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: >> >> https://bugs.openjdk.java.net/browse/JDK-8254629 >> >> Naoto > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Fixed typo/grammatical error. Marked as reviewed by joehw (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From scolebourne at openjdk.java.net Thu Nov 5 23:52:02 2020 From: scolebourne at openjdk.java.net (Stephen Colebourne) Date: Thu, 5 Nov 2020 23:52:02 GMT Subject: RFR: 8247781: Day periods support [v7] In-Reply-To: References: Message-ID: On Thu, 5 Nov 2020 17:12:11 GMT, Naoto Sato wrote: >> Hi, >> >> Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: >> >> https://bugs.openjdk.java.net/browse/JDK-8254629 >> >> Naoto > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Fixed typo/grammatical error. test/jdk/java/time/tck/java/time/format/TCKDateTimeParseResolver.java line 858: > 856: return new Object[][]{ > 857: {STRICT, 0, LocalTime.of(6, 0), 0}, > 858: {STRICT, 1, LocalTime.of(18, 0), 1}, As mentioned in my other comment, this seems odd in STRICT mode. src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 5055: > 5053: @Override > 5054: public boolean format(DateTimePrintContext context, StringBuilder buf) { > 5055: Long value = context.getValue(MINUTE_OF_DAY); This does not match the spec: " During formatting, the day period is obtained from {@code HOUR_OF_DAY}, and optionally {@code MINUTE_OF_HOUR} if exist" It is possible and legal to create a Temporal that returns `HOUR_OF_DAY` and `MINUTE_OF_HOUR` but not `MINUTE_OF_DAY`. As such, this method must be changed to follow the spec. ----- In addition, it is possible for `HOUR_OF_DAY` and `MINUTE_OF_HOUR` to be outside their normal bounds. The right behaviour would be to combine the two fields within this method, and then use mod to get the value into the range 0 to 1440 before calling `dayPeriod.include`. (While the fall back behaviour below does cover this, it would be better to do what I propose here.) An example of this is a `TransportTime` class where the day runs from 03:00 to 27:00 each day (because trains run after midnight for no extra cost to the passenger, and it is more convenient for the operator to treat the date that way). A `TransportTime` of 26:30 should still resolve to "night1" rather than fall back to "am". ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From scolebourne at openjdk.java.net Thu Nov 5 23:51:59 2020 From: scolebourne at openjdk.java.net (Stephen Colebourne) Date: Thu, 5 Nov 2020 23:51:59 GMT Subject: RFR: 8247781: Day periods support [v7] In-Reply-To: <_KS-70pqQG8VavYGtbXCrOlvwfwGl6Nm-lk8SjkEDQI=.1775f0e1-4847-401a-a576-dbb93e080c90@github.com> References: <_KS-70pqQG8VavYGtbXCrOlvwfwGl6Nm-lk8SjkEDQI=.1775f0e1-4847-401a-a576-dbb93e080c90@github.com> Message-ID: On Mon, 2 Nov 2020 23:21:22 GMT, Naoto Sato wrote: >> Pulling on this a little more. >> >> As the PR stands, it seems that if the user passes in text with just a day-period of "AM" they get a `LocalTime` of 06:00 but if they pass in `AMPM_OF_DAY` of "AM" the get no `LocalTime` in the result. Is that right? If so, I don't think this is sustainable. >> >> Thats why I think `AMPM_OF_DAY` will have to be resolved to a dayPeriod of "am" or "pm". If dayPeriod is more precise than `AMPM_OF_DAY`, then dayPeriod can silently take precedence > > I implemented what you suggested here in the latest PR, but that would be a behavioral change which requires a CSR, as "AM" would be resolved to 06:00 which was not before. Do you think it would be acceptable? If so, I will reopen the CSR and describe the change. (In fact some TCK failed with this impl) I find the whole "half way between the start and end" behaviour of day periods odd anyway, but if it is to be supported then it should be consistent as you've implemented. Another option I should have thought of earlier would be to simply not support the "half way between the start and end" behaviour of LDML in either dayPeriod or AM/PM. But since LDML defines it, you've implemented it, and it isn't overly harmful I think its OK to leave it in. Would it be possible for STRICT mode to not have the "half way between the start and end" behaviour? ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Fri Nov 6 03:03:59 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Fri, 6 Nov 2020 03:03:59 GMT Subject: RFR: 8247781: Day periods support [v7] In-Reply-To: References: Message-ID: <9g42DltbGQ0tCN99vN_SL3DU2KUlAf6btO749uqifkQ=.d10e88e1-5fb7-4d5f-aa61-07cb4fdacabf@github.com> On Thu, 5 Nov 2020 23:25:38 GMT, Stephen Colebourne wrote: >> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: >> >> Fixed typo/grammatical error. > > test/jdk/java/time/tck/java/time/format/TCKDateTimeParseResolver.java line 858: > >> 856: return new Object[][]{ >> 857: {STRICT, 0, LocalTime.of(6, 0), 0}, >> 858: {STRICT, 1, LocalTime.of(18, 0), 1}, > > As mentioned in my other comment, this seems odd in STRICT mode. Did you mean in STRICT mode, HOUR_OF_AMPM should default to 0, and to 6 in SMART/LENIENT modes? ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From scolebourne at openjdk.java.net Fri Nov 6 09:14:58 2020 From: scolebourne at openjdk.java.net (Stephen Colebourne) Date: Fri, 6 Nov 2020 09:14:58 GMT Subject: RFR: 8247781: Day periods support [v7] In-Reply-To: <9g42DltbGQ0tCN99vN_SL3DU2KUlAf6btO749uqifkQ=.d10e88e1-5fb7-4d5f-aa61-07cb4fdacabf@github.com> References: <9g42DltbGQ0tCN99vN_SL3DU2KUlAf6btO749uqifkQ=.d10e88e1-5fb7-4d5f-aa61-07cb4fdacabf@github.com> Message-ID: On Fri, 6 Nov 2020 03:00:52 GMT, Naoto Sato wrote: >> test/jdk/java/time/tck/java/time/format/TCKDateTimeParseResolver.java line 858: >> >>> 856: return new Object[][]{ >>> 857: {STRICT, 0, LocalTime.of(6, 0), 0}, >>> 858: {STRICT, 1, LocalTime.of(18, 0), 1}, >> >> As mentioned in my other comment, this seems odd in STRICT mode. > > Did you mean in STRICT mode, HOUR_OF_AMPM should default to 0, and to 6 in SMART/LENIENT modes? No. I mean that when resolving AMPM/dayPeriod in strict mode, and there is no HOUR_OF_DAY or HOUR_OF_AMPM, then do not resolve using "half way between"(ie. fail). This will produce a result where `LocalTime` cannot be obtained. var f = DateTimeFormatter.ofPattern("B").withResolverStyle(ResolverStyle.STRICT); var t = LocalTime.from("at night", f); would throw an exception in STRICT mode (whereas SMART or LENIENT would return a `LocalTime`). Same with pattern "a". ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Fri Nov 6 21:12:11 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Fri, 6 Nov 2020 21:12:11 GMT Subject: RFR: 8247781: Day periods support [v8] In-Reply-To: References: Message-ID: > Hi, > > Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: > > https://bugs.openjdk.java.net/browse/JDK-8254629 > > Naoto Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Addressed the following comments: - https://github.com/openjdk/jdk/pull/938#discussion_r518431077 - https://github.com/openjdk/jdk/pull/938#discussion_r518616570 - https://github.com/openjdk/jdk/pull/938#discussion_r518439782 ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/938/files - new: https://git.openjdk.java.net/jdk/pull/938/files/b0649899..8054ce6b Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=07 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=06-07 Stats: 28 lines in 4 files changed: 14 ins; 0 del; 14 mod Patch: https://git.openjdk.java.net/jdk/pull/938.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/938/head:pull/938 PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Fri Nov 6 21:12:11 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Fri, 6 Nov 2020 21:12:11 GMT Subject: RFR: 8247781: Day periods support [v7] In-Reply-To: References: <9g42DltbGQ0tCN99vN_SL3DU2KUlAf6btO749uqifkQ=.d10e88e1-5fb7-4d5f-aa61-07cb4fdacabf@github.com> Message-ID: On Fri, 6 Nov 2020 09:12:38 GMT, Stephen Colebourne wrote: >> Did you mean in STRICT mode, HOUR_OF_AMPM should default to 0, and to 6 in SMART/LENIENT modes? > > No. I mean that when resolving AMPM/dayPeriod in strict mode, and there is no HOUR_OF_DAY or HOUR_OF_AMPM, then do not resolve using "half way between"(ie. fail). This will produce a result where `LocalTime` cannot be obtained. > > var f = DateTimeFormatter.ofPattern("B").withResolverStyle(ResolverStyle.STRICT); > var t = LocalTime.from("at night", f); > would throw an exception in STRICT mode (whereas SMART or LENIENT would return a `LocalTime`). Same with pattern "a". Changed to throw an exception in STRICT mode. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Fri Nov 6 21:12:12 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Fri, 6 Nov 2020 21:12:12 GMT Subject: RFR: 8247781: Day periods support [v7] In-Reply-To: References: Message-ID: <5fowCEUB6fq9jJPqJ-vc3dHPjBFSBLm8PweNV6ISwZE=.683ddc9d-536f-483c-be69-079a3728a12c@github.com> On Thu, 5 Nov 2020 23:49:25 GMT, Stephen Colebourne wrote: >> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: >> >> Fixed typo/grammatical error. > > src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 5055: > >> 5053: @Override >> 5054: public boolean format(DateTimePrintContext context, StringBuilder buf) { >> 5055: Long value = context.getValue(MINUTE_OF_DAY); > > This does not match the spec: " During formatting, the day period is obtained from {@code HOUR_OF_DAY}, and optionally {@code MINUTE_OF_HOUR} if exist" > > It is possible and legal to create a Temporal that returns `HOUR_OF_DAY` and `MINUTE_OF_HOUR` but not `MINUTE_OF_DAY`. As such, this method must be changed to follow the spec. > > ----- > > In addition, it is possible for `HOUR_OF_DAY` and `MINUTE_OF_HOUR` to be outside their normal bounds. The right behaviour would be to combine the two fields within this method, and then use mod to get the value into the range 0 to 1440 before calling `dayPeriod.include`. (While the fall back behaviour below does cover this, it would be better to do what I propose here.) > > An example of this is a `TransportTime` class where the day runs from 03:00 to 27:00 each day (because trains run after midnight for no extra cost to the passenger, and it is more convenient for the operator to treat the date that way). A `TransportTime` of 26:30 should still resolve to "night1" rather than fall back to "am". Fixed. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Fri Nov 6 22:10:11 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Fri, 6 Nov 2020 22:10:11 GMT Subject: RFR: 8247781: Day periods support [v9] In-Reply-To: References: Message-ID: > Hi, > > Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: > > https://bugs.openjdk.java.net/browse/JDK-8254629 > > Naoto Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Fixed a comment. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/938/files - new: https://git.openjdk.java.net/jdk/pull/938/files/8054ce6b..3a9ea64a Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=08 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=07-08 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/938.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/938/head:pull/938 PR: https://git.openjdk.java.net/jdk/pull/938 From scolebourne at openjdk.java.net Sat Nov 7 00:01:58 2020 From: scolebourne at openjdk.java.net (Stephen Colebourne) Date: Sat, 7 Nov 2020 00:01:58 GMT Subject: RFR: 8247781: Day periods support [v9] In-Reply-To: References: <_KS-70pqQG8VavYGtbXCrOlvwfwGl6Nm-lk8SjkEDQI=.1775f0e1-4847-401a-a576-dbb93e080c90@github.com> Message-ID: <_p9FOFl7DOCxiwGk3Ks2OHs-5wbIcPEcFQXBMs0tJfQ=.43913af9-8a74-49ad-9764-89595ecc63fd@github.com> On Thu, 5 Nov 2020 23:24:19 GMT, Stephen Colebourne wrote: >> I implemented what you suggested here in the latest PR, but that would be a behavioral change which requires a CSR, as "AM" would be resolved to 06:00 which was not before. Do you think it would be acceptable? If so, I will reopen the CSR and describe the change. (In fact some TCK failed with this impl) > > I find the whole "half way between the start and end" behaviour of day periods odd anyway, but if it is to be supported then it should be consistent as you've implemented. > > Another option I should have thought of earlier would be to simply not support the "half way between the start and end" behaviour of LDML in either dayPeriod or AM/PM. But since LDML defines it, you've implemented it, and it isn't overly harmful I think its OK to leave it in. > > Would it be possible for STRICT mode to not have the "half way between the start and end" behaviour? I've had a look tonight, but found two more problems! The comments at the start of `resolveTimeLenient()` indicate that setting the midpoint in `resolveTimeFields()` is a bad idea - it needs to be done inside `resolveTimeLenient()`. (This ensures user-defined fields can resolve to ChronoFields IIRC). Thus, the day period resolving would have to be split between the two methods. How important is the midpoint logic? Could it just be dropped? Secondly, we need to ensure that "24:00 midnight" (using HOUR_OF_DAY only) correctly parses to the end of day midnight, not the start of day or an exception. This is related to the problem above. I _think_ (but haven't confirmed everything yet) that the only thing that should be in `resolveTimeFields()` is the resolution of HOUR_OF_AMPM + dayPeriod to HOUR_OF_DAY (with `dayPeriod` then being set to `null`). Everything else should go in `resolveTimeLenient()` - the midpoint logic in the first if block (where time fields are defaulted), and the validation logic at the end of the method. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Mon Nov 9 01:40:12 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 9 Nov 2020 01:40:12 GMT Subject: RFR: 8247781: Day periods support [v10] In-Reply-To: <_p9FOFl7DOCxiwGk3Ks2OHs-5wbIcPEcFQXBMs0tJfQ=.43913af9-8a74-49ad-9764-89595ecc63fd@github.com> References: <_KS-70pqQG8VavYGtbXCrOlvwfwGl6Nm-lk8SjkEDQI=.1775f0e1-4847-401a-a576-dbb93e080c90@github.com> <_p9FOFl7DOCxiwGk3Ks2OHs-5wbIcPEcFQXBMs0tJfQ=.43913af9-8a74-49ad-9764-89595ecc63fd@github.com> Message-ID: On Fri, 6 Nov 2020 23:59:36 GMT, Stephen Colebourne wrote: >> I find the whole "half way between the start and end" behaviour of day periods odd anyway, but if it is to be supported then it should be consistent as you've implemented. >> >> Another option I should have thought of earlier would be to simply not support the "half way between the start and end" behaviour of LDML in either dayPeriod or AM/PM. But since LDML defines it, you've implemented it, and it isn't overly harmful I think its OK to leave it in. >> >> Would it be possible for STRICT mode to not have the "half way between the start and end" behaviour? > > I've had a look tonight, but found two more problems! > > The comments at the start of `resolveTimeLenient()` indicate that setting the midpoint in `resolveTimeFields()` is a bad idea - it needs to be done inside `resolveTimeLenient()`. (This ensures user-defined fields can resolve to ChronoFields IIRC). Thus, the day period resolving would have to be split between the two methods. How important is the midpoint logic? Could it just be dropped? > > Secondly, we need to ensure that "24:00 midnight" (using HOUR_OF_DAY only) correctly parses to the end of day midnight, not the start of day or an exception. This is related to the problem above. > > I _think_ (but haven't confirmed everything yet) that the only thing that should be in `resolveTimeFields()` is the resolution of HOUR_OF_AMPM + dayPeriod to HOUR_OF_DAY (with `dayPeriod` then being set to `null`). Everything else should go in `resolveTimeLenient()` - the midpoint logic in the first if block (where time fields are defaulted), and the validation logic at the end of the method. Thanks for the insights. I believe I fixed both of the issues with the new commit. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Mon Nov 9 01:40:11 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 9 Nov 2020 01:40:11 GMT Subject: RFR: 8247781: Day periods support [v10] In-Reply-To: References: Message-ID: > Hi, > > Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: > > https://bugs.openjdk.java.net/browse/JDK-8254629 > > Naoto Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Addressing https://github.com/openjdk/jdk/pull/938#discussion_r519061476 ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/938/files - new: https://git.openjdk.java.net/jdk/pull/938/files/3a9ea64a..7140ae27 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=09 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=08-09 Stats: 90 lines in 3 files changed: 56 ins; 34 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/938.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/938/head:pull/938 PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Tue Nov 10 00:07:16 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Tue, 10 Nov 2020 00:07:16 GMT Subject: RFR: 8247781: Day periods support [v11] In-Reply-To: References: Message-ID: > Hi, > > Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: > > https://bugs.openjdk.java.net/browse/JDK-8254629 > > Naoto Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Clarified 24:00 for "midnight" type in the spec. Some clean up. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/938/files - new: https://git.openjdk.java.net/jdk/pull/938/files/7140ae27..ccefe70c Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=10 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=09-10 Stats: 8 lines in 1 file changed: 3 ins; 1 del; 4 mod Patch: https://git.openjdk.java.net/jdk/pull/938.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/938/head:pull/938 PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Tue Nov 10 19:52:14 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Tue, 10 Nov 2020 19:52:14 GMT Subject: RFR: 8247781: Day periods support [v12] In-Reply-To: References: Message-ID: > Hi, > > Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: > > https://bugs.openjdk.java.net/browse/JDK-8254629 > > Naoto Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Added a test case for user defined temporal field resolution with day period. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/938/files - new: https://git.openjdk.java.net/jdk/pull/938/files/ccefe70c..a960804f Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=11 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=10-11 Stats: 76 lines in 1 file changed: 76 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/938.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/938/head:pull/938 PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Tue Nov 10 19:58:58 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Tue, 10 Nov 2020 19:58:58 GMT Subject: RFR: 8247781: Day periods support [v12] In-Reply-To: References: <_KS-70pqQG8VavYGtbXCrOlvwfwGl6Nm-lk8SjkEDQI=.1775f0e1-4847-401a-a576-dbb93e080c90@github.com> <_p9FOFl7DOCxiwGk3Ks2OHs-5wbIcPEcFQXBMs0tJfQ=.43913af9-8a74-49ad-9764-89595ecc63fd@github.com> Message-ID: On Mon, 9 Nov 2020 01:37:39 GMT, Naoto Sato wrote: >> I've had a look tonight, but found two more problems! >> >> The comments at the start of `resolveTimeLenient()` indicate that setting the midpoint in `resolveTimeFields()` is a bad idea - it needs to be done inside `resolveTimeLenient()`. (This ensures user-defined fields can resolve to ChronoFields IIRC). Thus, the day period resolving would have to be split between the two methods. How important is the midpoint logic? Could it just be dropped? >> >> Secondly, we need to ensure that "24:00 midnight" (using HOUR_OF_DAY only) correctly parses to the end of day midnight, not the start of day or an exception. This is related to the problem above. >> >> I _think_ (but haven't confirmed everything yet) that the only thing that should be in `resolveTimeFields()` is the resolution of HOUR_OF_AMPM + dayPeriod to HOUR_OF_DAY (with `dayPeriod` then being set to `null`). Everything else should go in `resolveTimeLenient()` - the midpoint logic in the first if block (where time fields are defaulted), and the validation logic at the end of the method. > > Thanks for the insights. I believe I fixed both of the issues with the new commit. Added a test case with the latest commit: https://github.com/openjdk/jdk/commit/a960804ff4d3f7df18e51fe59dcdcaf04542e10a ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From rriggs at openjdk.java.net Thu Nov 12 15:25:01 2020 From: rriggs at openjdk.java.net (Roger Riggs) Date: Thu, 12 Nov 2020 15:25:01 GMT Subject: RFR: 8247781: Day periods support [v12] In-Reply-To: References: Message-ID: On Tue, 10 Nov 2020 19:52:14 GMT, Naoto Sato wrote: >> Hi, >> >> Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: >> >> https://bugs.openjdk.java.net/browse/JDK-8254629 >> >> Naoto > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Added a test case for user defined temporal field resolution with day period. test/jdk/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java line 877: > 875: try { > 876: dtf.parse("0 at night"); > 877: throw new RuntimeException("DateTimeParseException should be thrown"); Testng has `Assert.fail(message)` for this case. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From rriggs at openjdk.java.net Thu Nov 12 15:25:00 2020 From: rriggs at openjdk.java.net (Roger Riggs) Date: Thu, 12 Nov 2020 15:25:00 GMT Subject: RFR: 8247781: Day periods support [v11] In-Reply-To: References: Message-ID: On Tue, 10 Nov 2020 00:07:16 GMT, Naoto Sato wrote: >> Hi, >> >> Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: >> >> https://bugs.openjdk.java.net/browse/JDK-8254629 >> >> Naoto > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Clarified 24:00 for "midnight" type in the spec. Some clean up. src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 1483: > 1481: * exception is thrown and the day period is ignored. > 1482: *

> 1483: * "midnight" type allows both "00:00" as the start-of-day and "24:00" as the Editorial: Add "The " at the beginning of the sentence. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From rriggs at openjdk.java.net Thu Nov 12 15:45:05 2020 From: rriggs at openjdk.java.net (Roger Riggs) Date: Thu, 12 Nov 2020 15:45:05 GMT Subject: RFR: 8247781: Day periods support [v12] In-Reply-To: References: Message-ID: On Tue, 10 Nov 2020 19:52:14 GMT, Naoto Sato wrote: >> Hi, >> >> Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: >> >> https://bugs.openjdk.java.net/browse/JDK-8254629 >> >> Naoto > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Added a test case for user defined temporal field resolution with day period. Marked as reviewed by rriggs (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From scolebourne at openjdk.java.net Thu Nov 12 17:07:05 2020 From: scolebourne at openjdk.java.net (Stephen Colebourne) Date: Thu, 12 Nov 2020 17:07:05 GMT Subject: RFR: 8247781: Day periods support [v12] In-Reply-To: References: Message-ID: On Tue, 10 Nov 2020 19:52:14 GMT, Naoto Sato wrote: >> Hi, >> >> Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: >> >> https://bugs.openjdk.java.net/browse/JDK-8254629 >> >> Naoto > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Added a test case for user defined temporal field resolution with day period. src/java.base/share/classes/java/time/format/Parsed.java line 550: > 548: long midpoint = dayPeriod.mid(); > 549: fieldValues.put(HOUR_OF_DAY, midpoint / 60); > 550: fieldValues.put(MINUTE_OF_HOUR, midpoint % 60); Set `dayPeriod = null` here, as it has been successfully used. src/java.base/share/classes/java/time/format/Parsed.java line 502: > 500: HOUR_OF_AMPM.checkValidValue(hoap); > 501: } > 502: if (dayPeriod.includes((hoap % 24 + 12) * 60)) { Pretty sure the 24 should be 12. Also, it should use `Math.floorMod()` to handle `HOUR_OF_AMPM = -1` (which is 11 o'clock). Also, this doesn't take into account minutes. So if the day period rule is afternoon1 to 18:30 and evening1 after 18:30, and the input is `HOUR_OF_AMPM = 6, MINUTE_OF_HOUR = 45`, this will fail to resolve, Something like this should work (no need for `updateCheckDayPeriodConflict`): long hoap = fieldValues.remove(HOUR_OF_AMPM); if (resolverStyle == ResolverStyle.LENIENT) { HOUR_OF_AMPM.checkValidValue(hoap); } Long mohObj = fieldValues.get(MINUTE_OF_HOUR); long moh = mohObj != null ? Math.floorMod(mohObj, 60) : 0; long excessHours = dayPeriod.includes(Math.floorMod(hoap, 12) + 12 * 60 + moh ? 12 : 0; long hod = Math.addExact(hoap, excessHours); updateCheckConflict(HOUR_OF_AMPM, HOUR_OF_DAY, hod); dayPeriod = null; src/java.base/share/classes/java/time/format/Parsed.java line 546: > 544: > 545: // Set the hour-of-day, if not exist and not in STRICT, to the mid point of the day period or am/pm. > 546: if (!fieldValues.containsKey(HOUR_OF_DAY) && resolverStyle != ResolverStyle.STRICT) { Since this logic replaces both `HOUR_OF_DAY` and `MINUTE_OF_HOUR` I think it should only be invoked if both do not exist. Beyond that, it doesn't really make sense to do this logic if second/sub-second are present. Thus, it needs to check all four fields and can then directly set the time. if (!fieldValues.containsKey(HOUR_OF_DAY) && !fieldValues.containsKey(MINUTE_OF_HOUR) && !fieldValues.containsKey(SECOND_OF_MINUTE) && !fieldValues.containsKey(NANO_OF_SECOND) && resolverStyle != ResolverStyle.STRICT) { if (dayPeriod != null) { long midpoint = dayPeriod.mid(); resolveTime(midpoint / 60, midpoint % 60, 0, 0); dayPeriod = null; } else if (fieldValues.containsKey(AMPM_OF_DAY)) { long ap = fieldValues.remove(AMPM_OF_DAY); if (resolverStyle == ResolverStyle.LENIENT) { resolveTime(Math.addExact(Math.multiplyExact(ap, 12), 6), 0, 0, 0); } else { // SMART AMPM_OF_DAY.checkValidValue(ap); resolveTime(ap * 12 + 6, 0, 0, 0); } src/java.base/share/classes/java/time/format/Parsed.java line 568: > 566: if (dayPeriod != null) { > 567: // Check whether the hod is within the day period > 568: updateCheckDayPeriodConflict(HOUR_OF_DAY, hod); With the other changes, this is the only use of this method and it can therefore be simplified (no need to check for conflicts, just whether it matches the day period). test/jdk/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java line 778: > 776: {"h B", ResolverStyle.SMART, "59 in the morning", 11}, > 777: > 778: {"H B", ResolverStyle.LENIENT, "47 at night", 23}, This test should be split in two - smart (fails) and lenient (succeeds). The lenient tests should ensure that `p.query(DateTimeFormatter.parsedExcessDays())` returns the expected number of excess days. I'd also add a test for a negative value such as "-2 at night" ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From herrick at openjdk.java.net Thu Nov 12 18:32:02 2020 From: herrick at openjdk.java.net (Andy Herrick) Date: Thu, 12 Nov 2020 18:32:02 GMT Subject: RFR: JDK-8189198: Add "forRemoval = true" to Applet APIs In-Reply-To: References: Message-ID: On Mon, 9 Nov 2020 13:56:33 GMT, Andy Herrick wrote: > JDK-8189198: Add "forRemoval = true" to Applet APIs preliminary changes for JDK-8189198 for evaluation ------------- PR: https://git.openjdk.java.net/jdk/pull/1127 From herrick at openjdk.java.net Thu Nov 12 18:32:02 2020 From: herrick at openjdk.java.net (Andy Herrick) Date: Thu, 12 Nov 2020 18:32:02 GMT Subject: RFR: JDK-8189198: Add "forRemoval = true" to Applet APIs Message-ID: JDK-8189198: Add "forRemoval = true" to Applet APIs ------------- Commit messages: - Merge branch 'master' into JDK-8189198 - JDK-8189198: Add "forRemoval = true" to Applet APIs - JDK-8189198: Add "forRemoval = true" to Applet APIs - JDK-8189198: Add "forRemoval = true" to Applet APIs Changes: https://git.openjdk.java.net/jdk/pull/1127/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1127&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8189198 Stats: 61 lines in 20 files changed: 10 ins; 0 del; 51 mod Patch: https://git.openjdk.java.net/jdk/pull/1127.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1127/head:pull/1127 PR: https://git.openjdk.java.net/jdk/pull/1127 From kcr at openjdk.java.net Thu Nov 12 19:22:01 2020 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Thu, 12 Nov 2020 19:22:01 GMT Subject: RFR: JDK-8189198: Add "forRemoval = true" to Applet APIs In-Reply-To: References: Message-ID: On Mon, 9 Nov 2020 13:57:32 GMT, Andy Herrick wrote: >> JDK-8189198: Add "forRemoval = true" to Applet APIs > > preliminary changes for JDK-8189198 for evaluation The following field, which is currently deprecated (not for removal) should probably also be marked as deprecated for removal:: javax.naming.Context: static final String APPLET The CSR and JEP should be updated accordingly. Also, what about the following? javax.swing.text.html.parser.DTD Element applet ------------- PR: https://git.openjdk.java.net/jdk/pull/1127 From iris at openjdk.java.net Thu Nov 12 19:40:54 2020 From: iris at openjdk.java.net (Iris Clark) Date: Thu, 12 Nov 2020 19:40:54 GMT Subject: RFR: JDK-8189198: Add "forRemoval = true" to Applet APIs In-Reply-To: References: Message-ID: <1hu3mjRsBg1gnnWXUNl9TQ8PoPFjmGOaXkr6Vdd4mOo=.7ead6f18-6b34-42e4-adfb-756ada49eb61@github.com> On Mon, 9 Nov 2020 13:56:33 GMT, Andy Herrick wrote: > JDK-8189198: Add "forRemoval = true" to Applet APIs Since all APIs in the java.applet package are deprecated "forRemoval = true", consider adding a brief deprecation note to java/applet/package-info.java too. As an example, when all of the APIs in package java.rmi.activation were similarly deprecated in JDK 15, the following note was added: https://docs.oracle.com/en/java/javase/15/docs/api/java.rmi/java/rmi/activation/package-summary.html . Thanks! Iris ------------- Marked as reviewed by iris (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/1127 From naoto at openjdk.java.net Thu Nov 12 20:03:14 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Thu, 12 Nov 2020 20:03:14 GMT Subject: RFR: 8247781: Day periods support [v13] In-Reply-To: References: Message-ID: > Hi, > > Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: > > https://bugs.openjdk.java.net/browse/JDK-8254629 > > Naoto Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Addressed the following comments: - https://github.com/openjdk/jdk/pull/938#discussion_r522185469 - https://github.com/openjdk/jdk/pull/938#discussion_r522187931 - https://github.com/openjdk/jdk/pull/938#discussion_r522203757 - https://github.com/openjdk/jdk/pull/938#discussion_r522211444 - https://github.com/openjdk/jdk/pull/938#discussion_r522244221 - https://github.com/openjdk/jdk/pull/938#discussion_r522262379 - https://github.com/openjdk/jdk/pull/938#discussion_r522266836 ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/938/files - new: https://git.openjdk.java.net/jdk/pull/938/files/a960804f..570b4582 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=12 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=11-12 Stats: 75 lines in 3 files changed: 23 ins; 23 del; 29 mod Patch: https://git.openjdk.java.net/jdk/pull/938.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/938/head:pull/938 PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Thu Nov 12 20:09:08 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Thu, 12 Nov 2020 20:09:08 GMT Subject: RFR: 8247781: Day periods support [v12] In-Reply-To: References: Message-ID: On Thu, 12 Nov 2020 15:41:56 GMT, Stephen Colebourne wrote: >> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: >> >> Added a test case for user defined temporal field resolution with day period. > > src/java.base/share/classes/java/time/format/Parsed.java line 550: > >> 548: long midpoint = dayPeriod.mid(); >> 549: fieldValues.put(HOUR_OF_DAY, midpoint / 60); >> 550: fieldValues.put(MINUTE_OF_HOUR, midpoint % 60); > > Set `dayPeriod = null` here, as it has been successfully used. Fixed. > src/java.base/share/classes/java/time/format/Parsed.java line 502: > >> 500: HOUR_OF_AMPM.checkValidValue(hoap); >> 501: } >> 502: if (dayPeriod.includes((hoap % 24 + 12) * 60)) { > > Pretty sure the 24 should be 12. > > Also, it should use `Math.floorMod()` to handle `HOUR_OF_AMPM = -1` (which is 11 o'clock). > > Also, this doesn't take into account minutes. So if the day period rule is afternoon1 to 18:30 and evening1 after 18:30, and the input is `HOUR_OF_AMPM = 6, MINUTE_OF_HOUR = 45`, this will fail to resolve, > > Something like this should work (no need for `updateCheckDayPeriodConflict`): > > long hoap = fieldValues.remove(HOUR_OF_AMPM); > if (resolverStyle == ResolverStyle.LENIENT) { > HOUR_OF_AMPM.checkValidValue(hoap); > } > Long mohObj = fieldValues.get(MINUTE_OF_HOUR); > long moh = mohObj != null ? Math.floorMod(mohObj, 60) : 0; > long excessHours = dayPeriod.includes(Math.floorMod(hoap, 12) + 12 * 60 + moh ? 12 : 0; > long hod = Math.addExact(hoap, excessHours); > updateCheckConflict(HOUR_OF_AMPM, HOUR_OF_DAY, hod); > dayPeriod = null; Fixed. > src/java.base/share/classes/java/time/format/Parsed.java line 546: > >> 544: >> 545: // Set the hour-of-day, if not exist and not in STRICT, to the mid point of the day period or am/pm. >> 546: if (!fieldValues.containsKey(HOUR_OF_DAY) && resolverStyle != ResolverStyle.STRICT) { > > Since this logic replaces both `HOUR_OF_DAY` and `MINUTE_OF_HOUR` I think it should only be invoked if both do not exist. Beyond that, it doesn't really make sense to do this logic if second/sub-second are present. Thus, it needs to check all four fields and can then directly set the time. > > if (!fieldValues.containsKey(HOUR_OF_DAY) && > !fieldValues.containsKey(MINUTE_OF_HOUR) && > !fieldValues.containsKey(SECOND_OF_MINUTE) && > !fieldValues.containsKey(NANO_OF_SECOND) && > resolverStyle != ResolverStyle.STRICT) { > > if (dayPeriod != null) { > long midpoint = dayPeriod.mid(); > resolveTime(midpoint / 60, midpoint % 60, 0, 0); > dayPeriod = null; > } else if (fieldValues.containsKey(AMPM_OF_DAY)) { > long ap = fieldValues.remove(AMPM_OF_DAY); > if (resolverStyle == ResolverStyle.LENIENT) { > resolveTime(Math.addExact(Math.multiplyExact(ap, 12), 6), 0, 0, 0); > } else { // SMART > AMPM_OF_DAY.checkValidValue(ap); > resolveTime(ap * 12 + 6, 0, 0, 0); > } Fixed. > src/java.base/share/classes/java/time/format/Parsed.java line 568: > >> 566: if (dayPeriod != null) { >> 567: // Check whether the hod is within the day period >> 568: updateCheckDayPeriodConflict(HOUR_OF_DAY, hod); > > With the other changes, this is the only use of this method and it can therefore be simplified (no need to check for conflicts, just whether it matches the day period). Fixed. > test/jdk/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java line 778: > >> 776: {"h B", ResolverStyle.SMART, "59 in the morning", 11}, >> 777: >> 778: {"H B", ResolverStyle.LENIENT, "47 at night", 23}, > > This test should be split in two - smart (fails) and lenient (succeeds). The lenient tests should ensure that `p.query(DateTimeFormatter.parsedExcessDays())` returns the expected number of excess days. > > I'd also add a test for a negative value such as "-2 at night" Fixed. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Thu Nov 12 20:09:05 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Thu, 12 Nov 2020 20:09:05 GMT Subject: RFR: 8247781: Day periods support [v12] In-Reply-To: References: Message-ID: On Thu, 12 Nov 2020 15:21:52 GMT, Roger Riggs wrote: >> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: >> >> Added a test case for user defined temporal field resolution with day period. > > test/jdk/java/time/test/java/time/format/TestDateTimeFormatterBuilder.java line 877: > >> 875: try { >> 876: dtf.parse("0 at night"); >> 877: throw new RuntimeException("DateTimeParseException should be thrown"); > > Testng has `Assert.fail(message)` for this case. Fixed. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Thu Nov 12 20:09:04 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Thu, 12 Nov 2020 20:09:04 GMT Subject: RFR: 8247781: Day periods support [v11] In-Reply-To: References: Message-ID: On Thu, 12 Nov 2020 15:18:44 GMT, Roger Riggs wrote: >> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: >> >> Clarified 24:00 for "midnight" type in the spec. Some clean up. > > src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 1483: > >> 1481: * exception is thrown and the day period is ignored. >> 1482: *

>> 1483: * "midnight" type allows both "00:00" as the start-of-day and "24:00" as the > > Editorial: Add "The " at the beginning of the sentence. Fixed. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From herrick at openjdk.java.net Thu Nov 12 20:48:13 2020 From: herrick at openjdk.java.net (Andy Herrick) Date: Thu, 12 Nov 2020 20:48:13 GMT Subject: RFR: JDK-8189198: Add "forRemoval = true" to Applet APIs [v2] In-Reply-To: References: Message-ID: > JDK-8189198: Add "forRemoval = true" to Applet APIs Andy Herrick 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: - JDK-8189198: Add "forRemoval = true" to Applet APIs - Merge branch 'master' into JDK-8189198 - Merge branch 'master' into JDK-8189198 - JDK-8189198: Add "forRemoval = true" to Applet APIs - JDK-8189198: Add "forRemoval = true" to Applet APIs - JDK-8189198: Add "forRemoval = true" to Applet APIs ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/1127/files - new: https://git.openjdk.java.net/jdk/pull/1127/files/a74deeee..d9850cd8 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1127&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1127&range=00-01 Stats: 7753 lines in 89 files changed: 4891 ins; 1603 del; 1259 mod Patch: https://git.openjdk.java.net/jdk/pull/1127.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1127/head:pull/1127 PR: https://git.openjdk.java.net/jdk/pull/1127 From scolebourne at openjdk.java.net Thu Nov 12 22:01:01 2020 From: scolebourne at openjdk.java.net (Stephen Colebourne) Date: Thu, 12 Nov 2020 22:01:01 GMT Subject: RFR: 8247781: Day periods support [v13] In-Reply-To: References: Message-ID: On Thu, 12 Nov 2020 20:03:14 GMT, Naoto Sato wrote: >> Hi, >> >> Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: >> >> https://bugs.openjdk.java.net/browse/JDK-8254629 >> >> Naoto > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Addressed the following comments: > - https://github.com/openjdk/jdk/pull/938#discussion_r522185469 > - https://github.com/openjdk/jdk/pull/938#discussion_r522187931 > - https://github.com/openjdk/jdk/pull/938#discussion_r522203757 > - https://github.com/openjdk/jdk/pull/938#discussion_r522211444 > - https://github.com/openjdk/jdk/pull/938#discussion_r522244221 > - https://github.com/openjdk/jdk/pull/938#discussion_r522262379 > - https://github.com/openjdk/jdk/pull/938#discussion_r522266836 Approved with one overflow to fix. The spec could do with some rewording too. It might be better to explicitly mention the "resolving phase" with the three parts: > The day period is combined with other fields to make a `LocalTime` in the resolving phase. If the `HOUR_OF_AMPM` field is present, it is combined with the day period to make `HOUR_OF_DAY` taking into account any `MINUTE_OF_HOUR` value. If `HOUR_OF_DAY` is present, it is validated against the day period taking into account any `MINUTE_OF_HOUR` value. If a day period is present without `HOUR_OF_DAY`, `MINUTE_OF_HOUR`, `SECOND_OF_MINUTE` and `NANO_OF_SECOND` then the midpoint of the day period is set as the time. Note that the above is incomplete, and it doesn't describe STRICT/LENIENT, so the actual words will be more complex, src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 5063: > 5061: } > 5062: Long moh = context.getValue(MINUTE_OF_HOUR); > 5063: long value = (hod * 60 + (moh != null ? moh : 0)) % 1_440; `long value = Math.floorMod(hod, 24) * 60 + (moh != null ? Math.floorMod(moh, 60) : 0);` and remove the next three lines ------------- Marked as reviewed by scolebourne (Author). PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Thu Nov 12 23:11:15 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Thu, 12 Nov 2020 23:11:15 GMT Subject: RFR: 8247781: Day periods support [v13] In-Reply-To: References: Message-ID: On Thu, 12 Nov 2020 21:49:16 GMT, Stephen Colebourne wrote: >> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: >> >> Addressed the following comments: >> - https://github.com/openjdk/jdk/pull/938#discussion_r522185469 >> - https://github.com/openjdk/jdk/pull/938#discussion_r522187931 >> - https://github.com/openjdk/jdk/pull/938#discussion_r522203757 >> - https://github.com/openjdk/jdk/pull/938#discussion_r522211444 >> - https://github.com/openjdk/jdk/pull/938#discussion_r522244221 >> - https://github.com/openjdk/jdk/pull/938#discussion_r522262379 >> - https://github.com/openjdk/jdk/pull/938#discussion_r522266836 > > src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 5063: > >> 5061: } >> 5062: Long moh = context.getValue(MINUTE_OF_HOUR); >> 5063: long value = (hod * 60 + (moh != null ? moh : 0)) % 1_440; > > `long value = Math.floorMod(hod, 24) * 60 + (moh != null ? Math.floorMod(moh, 60) : 0);` > > and remove the next three lines Thanks, Stephen. I made the changes based on your comments. ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Thu Nov 12 23:11:14 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Thu, 12 Nov 2020 23:11:14 GMT Subject: RFR: 8247781: Day periods support [v14] In-Reply-To: References: Message-ID: > Hi, > > Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: > > https://bugs.openjdk.java.net/browse/JDK-8254629 > > Naoto Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Re-worded the spec of appendDayPeriodText, refactored calculation of minute-of-day. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/938/files - new: https://git.openjdk.java.net/jdk/pull/938/files/570b4582..1aa3134f Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=13 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=12-13 Stats: 18 lines in 1 file changed: 0 ins; 3 del; 15 mod Patch: https://git.openjdk.java.net/jdk/pull/938.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/938/head:pull/938 PR: https://git.openjdk.java.net/jdk/pull/938 From almatvee at openjdk.java.net Thu Nov 12 23:52:56 2020 From: almatvee at openjdk.java.net (Alexander Matveev) Date: Thu, 12 Nov 2020 23:52:56 GMT Subject: RFR: JDK-8189198: Add "forRemoval = true" to Applet APIs [v2] In-Reply-To: References: Message-ID: On Thu, 12 Nov 2020 20:48:13 GMT, Andy Herrick wrote: >> JDK-8189198: Add "forRemoval = true" to Applet APIs > > Andy Herrick 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: > > - JDK-8189198: Add "forRemoval = true" to Applet APIs > - Merge branch 'master' into JDK-8189198 > - Merge branch 'master' into JDK-8189198 > - JDK-8189198: Add "forRemoval = true" to Applet APIs > - JDK-8189198: Add "forRemoval = true" to Applet APIs > - JDK-8189198: Add "forRemoval = true" to Applet APIs Marked as reviewed by almatvee (Committer). ------------- PR: https://git.openjdk.java.net/jdk/pull/1127 From kcr at openjdk.java.net Fri Nov 13 00:27:58 2020 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Fri, 13 Nov 2020 00:27:58 GMT Subject: RFR: JDK-8189198: Add "forRemoval = true" to Applet APIs In-Reply-To: References: Message-ID: On Mon, 9 Nov 2020 13:56:33 GMT, Andy Herrick wrote: > JDK-8189198: Add "forRemoval = true" to Applet APIs @andyherrick can you enter the `/csr needed` command? I would, but it needs to be done by either the author of the PR or a Reviewer. ------------- PR: https://git.openjdk.java.net/jdk/pull/1127 From alanb at openjdk.java.net Fri Nov 13 09:35:00 2020 From: alanb at openjdk.java.net (Alan Bateman) Date: Fri, 13 Nov 2020 09:35:00 GMT Subject: RFR: JDK-8189198: Add "forRemoval = true" to Applet APIs [v2] In-Reply-To: References: Message-ID: <3GqHzIv1CUYpxhZUBOoX5m2C2a-E9h_N77-MxvYKUQY=.3a9aa402-2e45-4d8c-a513-fb1e65157fbe@github.com> On Thu, 12 Nov 2020 20:48:13 GMT, Andy Herrick wrote: >> JDK-8189198: Add "forRemoval = true" to Applet APIs > > Andy Herrick 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: > > - JDK-8189198: Add "forRemoval = true" to Applet APIs > - Merge branch 'master' into JDK-8189198 > - Merge branch 'master' into JDK-8189198 > - JDK-8189198: Add "forRemoval = true" to Applet APIs > - JDK-8189198: Add "forRemoval = true" to Applet APIs > - JDK-8189198: Add "forRemoval = true" to Applet APIs src/java.naming/share/classes/javax/naming/Context.java line 1087: > 1085: @Deprecated(since="16", forRemoval=true) > 1086: String APPLET = "java.naming.applet"; > 1087: }; Probably should be since="9" (the deprecation in JDK-8051422 pre-dates the enhanced deprecation work). ------------- PR: https://git.openjdk.java.net/jdk/pull/1127 From herrick at openjdk.java.net Fri Nov 13 15:05:15 2020 From: herrick at openjdk.java.net (Andy Herrick) Date: Fri, 13 Nov 2020 15:05:15 GMT Subject: RFR: JDK-8189198: Add "forRemoval = true" to Applet APIs [v3] In-Reply-To: References: Message-ID: > JDK-8189198: Add "forRemoval = true" to Applet APIs Andy Herrick has updated the pull request incrementally with one additional commit since the last revision: JDK-8189198: Add "forRemoval = true" to Applet APIs ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/1127/files - new: https://git.openjdk.java.net/jdk/pull/1127/files/d9850cd8..c6ea7714 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1127&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1127&range=01-02 Stats: 6 lines in 2 files changed: 4 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/1127.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1127/head:pull/1127 PR: https://git.openjdk.java.net/jdk/pull/1127 From kcr at openjdk.java.net Fri Nov 13 18:03:59 2020 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Fri, 13 Nov 2020 18:03:59 GMT Subject: RFR: JDK-8189198: Add "forRemoval = true" to Applet APIs [v2] In-Reply-To: <3GqHzIv1CUYpxhZUBOoX5m2C2a-E9h_N77-MxvYKUQY=.3a9aa402-2e45-4d8c-a513-fb1e65157fbe@github.com> References: <3GqHzIv1CUYpxhZUBOoX5m2C2a-E9h_N77-MxvYKUQY=.3a9aa402-2e45-4d8c-a513-fb1e65157fbe@github.com> Message-ID: On Fri, 13 Nov 2020 09:31:53 GMT, Alan Bateman wrote: >> Andy Herrick 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: >> >> - JDK-8189198: Add "forRemoval = true" to Applet APIs >> - Merge branch 'master' into JDK-8189198 >> - Merge branch 'master' into JDK-8189198 >> - JDK-8189198: Add "forRemoval = true" to Applet APIs >> - JDK-8189198: Add "forRemoval = true" to Applet APIs >> - JDK-8189198: Add "forRemoval = true" to Applet APIs > > src/java.naming/share/classes/javax/naming/Context.java line 1087: > >> 1085: @Deprecated(since="16", forRemoval=true) >> 1086: String APPLET = "java.naming.applet"; >> 1087: }; > > Probably should be since="9" (the deprecation in JDK-8051422 pre-dates the enhanced deprecation work). Good point, since it was in fact deprecated in 9. ------------- PR: https://git.openjdk.java.net/jdk/pull/1127 From kcr at openjdk.java.net Fri Nov 13 18:23:02 2020 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Fri, 13 Nov 2020 18:23:02 GMT Subject: RFR: JDK-8189198: Add "forRemoval = true" to Applet APIs [v3] In-Reply-To: References: Message-ID: <2YW5WLSFQN87oSb4c-t2jsiflm8TmSyLH_ByIc9lq2U=.647a0363-4fea-4550-bb90-91603e5b842c@github.com> On Fri, 13 Nov 2020 15:05:15 GMT, Andy Herrick wrote: >> JDK-8189198: Add "forRemoval = true" to Applet APIs > > Andy Herrick has updated the pull request incrementally with one additional commit since the last revision: > > JDK-8189198: Add "forRemoval = true" to Applet APIs src/java.desktop/share/classes/java/applet/package-info.java line 40: > 38: *

> 39: * Deprecated. > 40: * This package has been deprecated and may be removed in a future version of the Java Platform. That should be `@deprecated This package ...`. See [java/rmi/activation/package-info.java#L41](https://github.com/openjdk/jdk/blob/master/src/java.rmi/share/classes/java/rmi/activation/package-info.java#L41). ------------- PR: https://git.openjdk.java.net/jdk/pull/1127 From herrick at openjdk.java.net Fri Nov 13 18:22:59 2020 From: herrick at openjdk.java.net (Andy Herrick) Date: Fri, 13 Nov 2020 18:22:59 GMT Subject: RFR: JDK-8189198: Add "forRemoval = true" to Applet APIs [v2] In-Reply-To: References: <3GqHzIv1CUYpxhZUBOoX5m2C2a-E9h_N77-MxvYKUQY=.3a9aa402-2e45-4d8c-a513-fb1e65157fbe@github.com> Message-ID: On Fri, 13 Nov 2020 18:01:18 GMT, Kevin Rushforth wrote: >> src/java.naming/share/classes/javax/naming/Context.java line 1087: >> >>> 1085: @Deprecated(since="16", forRemoval=true) >>> 1086: String APPLET = "java.naming.applet"; >>> 1087: }; >> >> Probably should be since="9" (the deprecation in JDK-8051422 pre-dates the enhanced deprecation work). > > Good point, since it was in fact deprecated in 9. yes - changed to since="9" this morning ------------- PR: https://git.openjdk.java.net/jdk/pull/1127 From igraves at openjdk.java.net Fri Nov 13 22:32:17 2020 From: igraves at openjdk.java.net (Ian Graves) Date: Fri, 13 Nov 2020 22:32:17 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v6] In-Reply-To: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: <2mQzlvikTfBI9wGHRly2GopMAJ1YQwYvkmap-Kz4Ilc=.37dc7834-f1f3-49c8-8ff6-4bbb4b9b7b87@github.com> > The `java.util.Formatter` format specifies support for field widths, argument indexes, or precision lengths of a field that relate to the variadic arguments supplied to the formatter. These numbers are specified by integers, sometimes negative. For argument index, it's specified in the documentation that the highest allowed argument is limited by the largest possible index of an array (ie the largest possible variadic index), but for the other two it's not defined. Moreover, what happens when a number field in a string is too large or too small to be represented by a 32-bit integer type is not defined. > > This fix adds documentation to specify what error behavior occurs during these cases. Additionally it adds an additional exception type to throw when an invalid argument index is observed. > > A CSR will be required for this PR. Ian Graves 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 14 additional commits since the last revision: - Merge branch 'format-string-numeric-bound' of github.com:igraves/jdk into format-string-numeric-bound - Additional specificity around width - Tweaking verbiage - Updating docs specifying exception for 0 indices - Throwing exceptions for zeroth indexes - Updating docs - Updating docs and throwing errors accordingly - Making IllegalFormatArgumentIndexException package private - Additional specificity around width - Tweaking verbiage - ... and 4 more: https://git.openjdk.java.net/jdk/compare/96b6dcaf...a84d3f2f ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/516/files - new: https://git.openjdk.java.net/jdk/pull/516/files/0526ef43..a84d3f2f Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=05 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=04-05 Stats: 302178 lines in 580 files changed: 296317 ins; 3588 del; 2273 mod Patch: https://git.openjdk.java.net/jdk/pull/516.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/516/head:pull/516 PR: https://git.openjdk.java.net/jdk/pull/516 From igraves at openjdk.java.net Fri Nov 13 23:10:08 2020 From: igraves at openjdk.java.net (Ian Graves) Date: Fri, 13 Nov 2020 23:10:08 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v7] In-Reply-To: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: > The `java.util.Formatter` format specifies support for field widths, argument indexes, or precision lengths of a field that relate to the variadic arguments supplied to the formatter. These numbers are specified by integers, sometimes negative. For argument index, it's specified in the documentation that the highest allowed argument is limited by the largest possible index of an array (ie the largest possible variadic index), but for the other two it's not defined. Moreover, what happens when a number field in a string is too large or too small to be represented by a 32-bit integer type is not defined. > > This fix adds documentation to specify what error behavior occurs during these cases. Additionally it adds an additional exception type to throw when an invalid argument index is observed. > > A CSR will be required for this PR. Ian Graves has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits: - Making IllegalFormatArgumentIndexException package private - Additional specificity around width - Tweaking verbiage - Updating docs specifying exception for 0 indices - Throwing exceptions for zeroth indexes - Updating docs - Updating docs and throwing errors accordingly ------------- Changes: https://git.openjdk.java.net/jdk/pull/516/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=06 Stats: 94 lines in 4 files changed: 86 ins; 0 del; 8 mod Patch: https://git.openjdk.java.net/jdk/pull/516.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/516/head:pull/516 PR: https://git.openjdk.java.net/jdk/pull/516 From igraves at openjdk.java.net Fri Nov 13 23:12:56 2020 From: igraves at openjdk.java.net (Ian Graves) Date: Fri, 13 Nov 2020 23:12:56 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v7] In-Reply-To: References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: On Tue, 6 Oct 2020 19:10:46 GMT, Ian Graves wrote: >> Is the new exception type useful? yes, it matches the previous pattern. >> But it does not (and none of the IllegalFormatException subclasses) produce a readable message with the offending value. So the developer will not see anything useful. >> The fine grained exceptions provide little value. > > I've been on the fence about this, personally. The Formatter uses pretty fine-grained exception types for error conditions. I'd be okay discontinuing this practice here, but am not sure what to replace this with. Perhaps we enable `IllegalFormatException` to be, itself, public and instantiable ? Updates (including cleaning up some git weirdness with rebasing) include adherence to the new CSR draft proposal. This makes the new exception type package-private. ------------- PR: https://git.openjdk.java.net/jdk/pull/516 From serb at openjdk.java.net Fri Nov 13 23:29:59 2020 From: serb at openjdk.java.net (Sergey Bylokhov) Date: Fri, 13 Nov 2020 23:29:59 GMT Subject: RFR: JDK-8189198: Add "forRemoval = true" to Applet APIs [v3] In-Reply-To: <2YW5WLSFQN87oSb4c-t2jsiflm8TmSyLH_ByIc9lq2U=.647a0363-4fea-4550-bb90-91603e5b842c@github.com> References: <2YW5WLSFQN87oSb4c-t2jsiflm8TmSyLH_ByIc9lq2U=.647a0363-4fea-4550-bb90-91603e5b842c@github.com> Message-ID: On Fri, 13 Nov 2020 18:20:37 GMT, Kevin Rushforth wrote: >> Andy Herrick has updated the pull request incrementally with one additional commit since the last revision: >> >> JDK-8189198: Add "forRemoval = true" to Applet APIs > > src/java.desktop/share/classes/java/applet/package-info.java line 40: > >> 38: *

>> 39: * Deprecated. >> 40: * This package has been deprecated and may be removed in a future version of the Java Platform. > > That should be `@deprecated This package ...`. See [java/rmi/activation/package-info.java#L41](https://github.com/openjdk/jdk/blob/master/src/java.rmi/share/classes/java/rmi/activation/package-info.java#L41). The deprecation description should point to the new API which might be used instead of the deprecated ones. So the text "deprecated without replacement" was intentionally added, it will be good to preserve it. ------------- PR: https://git.openjdk.java.net/jdk/pull/1127 From igraves at openjdk.java.net Fri Nov 13 23:31:12 2020 From: igraves at openjdk.java.net (Ian Graves) Date: Fri, 13 Nov 2020 23:31:12 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v8] In-Reply-To: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: <3S4BAXFZ25C4FF_O6igaXEQmYOiJ4-XtiPoQ5j1x38M=.56d9a12c-8b9a-474a-a198-e81d6f67d1ee@github.com> > The `java.util.Formatter` format specifies support for field widths, argument indexes, or precision lengths of a field that relate to the variadic arguments supplied to the formatter. These numbers are specified by integers, sometimes negative. For argument index, it's specified in the documentation that the highest allowed argument is limited by the largest possible index of an array (ie the largest possible variadic index), but for the other two it's not defined. Moreover, what happens when a number field in a string is too large or too small to be represented by a 32-bit integer type is not defined. > > This fix adds documentation to specify what error behavior occurs during these cases. Additionally it adds an additional exception type to throw when an invalid argument index is observed. > > A CSR will be required for this PR. Ian Graves has updated the pull request incrementally with one additional commit since the last revision: Moving additional methods to package private ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/516/files - new: https://git.openjdk.java.net/jdk/pull/516/files/4bcb053e..5a0effe1 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=07 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=06-07 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/516.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/516/head:pull/516 PR: https://git.openjdk.java.net/jdk/pull/516 From herrick at openjdk.java.net Sun Nov 15 19:09:07 2020 From: herrick at openjdk.java.net (Andy Herrick) Date: Sun, 15 Nov 2020 19:09:07 GMT Subject: RFR: JDK-8189198: Add "forRemoval = true" to Applet APIs [v4] In-Reply-To: References: Message-ID: > JDK-8189198: Add "forRemoval = true" to Applet APIs Andy Herrick has updated the pull request incrementally with one additional commit since the last revision: JDK-8189198: Add "forRemoval = true" to Applet APIs ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/1127/files - new: https://git.openjdk.java.net/jdk/pull/1127/files/c6ea7714..bc781bea Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1127&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1127&range=02-03 Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.java.net/jdk/pull/1127.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1127/head:pull/1127 PR: https://git.openjdk.java.net/jdk/pull/1127 From naoto at openjdk.java.net Mon Nov 16 18:28:46 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 16 Nov 2020 18:28:46 GMT Subject: RFR: 8247781: Day periods support [v15] In-Reply-To: References: Message-ID: > Hi, > > Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: > > https://bugs.openjdk.java.net/browse/JDK-8254629 > > Naoto 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 18 additional commits since the last revision: - Merge branch 'master' into dayperiod - Re-worded the spec of appendDayPeriodText, refactored calculation of minute-of-day. - Addressed the following comments: - https://github.com/openjdk/jdk/pull/938#discussion_r522185469 - https://github.com/openjdk/jdk/pull/938#discussion_r522187931 - https://github.com/openjdk/jdk/pull/938#discussion_r522203757 - https://github.com/openjdk/jdk/pull/938#discussion_r522211444 - https://github.com/openjdk/jdk/pull/938#discussion_r522244221 - https://github.com/openjdk/jdk/pull/938#discussion_r522262379 - https://github.com/openjdk/jdk/pull/938#discussion_r522266836 - Added a test case for user defined temporal field resolution with day period. - Clarified 24:00 for "midnight" type in the spec. Some clean up. - Addressing https://github.com/openjdk/jdk/pull/938#discussion_r519061476 - Fixed a comment. - Addressed the following comments: - https://github.com/openjdk/jdk/pull/938#discussion_r518431077 - https://github.com/openjdk/jdk/pull/938#discussion_r518616570 - https://github.com/openjdk/jdk/pull/938#discussion_r518439782 - Fixed typo/grammatical error. - Merge branch 'master' into dayperiod - ... and 8 more: https://git.openjdk.java.net/jdk/compare/0278aec9...e5db226c ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/938/files - new: https://git.openjdk.java.net/jdk/pull/938/files/1aa3134f..e5db226c Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=14 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=938&range=13-14 Stats: 74639 lines in 1037 files changed: 41843 ins; 21966 del; 10830 mod Patch: https://git.openjdk.java.net/jdk/pull/938.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/938/head:pull/938 PR: https://git.openjdk.java.net/jdk/pull/938 From naoto at openjdk.java.net Mon Nov 16 23:16:19 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 16 Nov 2020 23:16:19 GMT Subject: Integrated: 8247781: Day periods support In-Reply-To: References: Message-ID: On Thu, 29 Oct 2020 15:59:51 GMT, Naoto Sato wrote: > Hi, > > Please review the changes for the subject issue. This is to enhance the java.time package to support day periods, such as "in the morning", defined in CLDR. It will add a new pattern character 'B' and its supporting builder method. The motivation and its spec are in this CSR: > > https://bugs.openjdk.java.net/browse/JDK-8254629 > > Naoto This pull request has now been integrated. Changeset: bf84dac4 Author: Naoto Sato URL: https://git.openjdk.java.net/jdk/commit/bf84dac4 Stats: 1243 lines in 20 files changed: 1039 ins; 87 del; 117 mod 8247781: Day periods support Reviewed-by: scolebourne, rriggs, joehw ------------- PR: https://git.openjdk.java.net/jdk/pull/938 From igraves at openjdk.java.net Tue Nov 17 19:58:29 2020 From: igraves at openjdk.java.net (Ian Graves) Date: Tue, 17 Nov 2020 19:58:29 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v9] In-Reply-To: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: > The `java.util.Formatter` format specifies support for field widths, argument indexes, or precision lengths of a field that relate to the variadic arguments supplied to the formatter. These numbers are specified by integers, sometimes negative. For argument index, it's specified in the documentation that the highest allowed argument is limited by the largest possible index of an array (ie the largest possible variadic index), but for the other two it's not defined. Moreover, what happens when a number field in a string is too large or too small to be represented by a 32-bit integer type is not defined. > > This fix adds documentation to specify what error behavior occurs during these cases. Additionally it adds an additional exception type to throw when an invalid argument index is observed. > > A CSR will be required for this PR. Ian Graves has updated the pull request incrementally with one additional commit since the last revision: Adding test coverage. Tweaking wording in docs. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/516/files - new: https://git.openjdk.java.net/jdk/pull/516/files/5a0effe1..aaa35af2 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=08 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=07-08 Stats: 106 lines in 4 files changed: 103 ins; 0 del; 3 mod Patch: https://git.openjdk.java.net/jdk/pull/516.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/516/head:pull/516 PR: https://git.openjdk.java.net/jdk/pull/516 From rriggs at openjdk.java.net Tue Nov 17 21:44:08 2020 From: rriggs at openjdk.java.net (Roger Riggs) Date: Tue, 17 Nov 2020 21:44:08 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v9] In-Reply-To: References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: On Tue, 17 Nov 2020 19:58:29 GMT, Ian Graves wrote: >> The `java.util.Formatter` format specifies support for field widths, argument indexes, or precision lengths of a field that relate to the variadic arguments supplied to the formatter. These numbers are specified by integers, sometimes negative. For argument index, it's specified in the documentation that the highest allowed argument is limited by the largest possible index of an array (ie the largest possible variadic index), but for the other two it's not defined. Moreover, what happens when a number field in a string is too large or too small to be represented by a 32-bit integer type is not defined. >> >> This fix adds documentation to specify what error behavior occurs during these cases. Additionally it adds an additional exception type to throw when an invalid argument index is observed. >> >> A CSR will be required for this PR. > > Ian Graves has updated the pull request incrementally with one additional commit since the last revision: > > Adding test coverage. Tweaking wording in docs. test/jdk/java/util/IllegalFormatException/ArgumentIndexException.java line 52: > 50: } > 51: } > 52: throw new RuntimeException("Expected IllegalFormatException for zero argument index."); The wording of errors around exceptions can be misinterpreted. Did an expected exception occur or not? If all you saw was the exception without the line of code, would it be unambiguous? src/java.base/share/classes/java/util/Formatter.java line 2802: > 2800: // skip the trailing '$' > 2801: index = Integer.parseInt(s, start, end - 1, 10); > 2802: if(index <= 0) { Add a space after 'if' please. test/jdk/java/util/IllegalFormatException/ArgumentIndexException.java line 1: > 1: /* Typically, using the TestNG framework is preferable for new tests. In addition to a convenient set of Asserts that check and print expected vs actual and message it includes patterns for testing for expected exceptions. test/jdk/java/util/IllegalFormatException/ArgumentIndexException.java line 98: > 96: } > 97: > 98: } Add a newline at end-of-file. src/java.base/share/classes/java/util/IllegalFormatArgumentIndexException.java line 64: > 62: public String getMessage() { > 63: return String.format("Illegal format argument index = %d", getIndex()); > 64: } The exception with a very large negative number isn't going to easy to recognize. Can the exception message say (for the Integer.MIN_VALUE) that the index is not valid index. Its probably too much to ask have an indication where in the format string the offending index occurs. ------------- PR: https://git.openjdk.java.net/jdk/pull/516 From naoto at openjdk.java.net Tue Nov 17 23:28:21 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Tue, 17 Nov 2020 23:28:21 GMT Subject: RFR: 8251317: Support for CLDR version 38 Message-ID: Hi, Please review the changes for upgrading the CLDR data to version 38. The vast majority of the changes are simply the changes in CLDR upstream, and others are mainly test changes due to the locale data change. ------------- Commit messages: - Updated the version in `cldr.md` files - Merge branch 'master' into cldr - 8251317: Support for CLDR version 38 Changes: https://git.openjdk.java.net/jdk/pull/1279/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1279&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8251317 Stats: 57338 lines in 209 files changed: 41958 ins; 4932 del; 10448 mod Patch: https://git.openjdk.java.net/jdk/pull/1279.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1279/head:pull/1279 PR: https://git.openjdk.java.net/jdk/pull/1279 From smarks at openjdk.java.net Tue Nov 17 23:57:13 2020 From: smarks at openjdk.java.net (Stuart Marks) Date: Tue, 17 Nov 2020 23:57:13 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v9] In-Reply-To: References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: On Tue, 17 Nov 2020 21:21:47 GMT, Roger Riggs wrote: >> Ian Graves has updated the pull request incrementally with one additional commit since the last revision: >> >> Adding test coverage. Tweaking wording in docs. > > test/jdk/java/util/IllegalFormatException/ArgumentIndexException.java line 1: > >> 1: /* > > Typically, using the TestNG framework is preferable for new tests. > In addition to a convenient set of Asserts that check and print expected vs actual and message > it includes patterns for testing for expected exceptions. Yes, these tests are amenable to TestNG's `assertThrows` method. That might be all you need; we generally aren't too concerned about the exact content and formatting of the exception's message. However, if you want to make additional assertions over the thrown exception, it can be obtained using `expectThrows` instead of `assertThrows`. ------------- PR: https://git.openjdk.java.net/jdk/pull/516 From naoto at openjdk.java.net Wed Nov 18 02:07:01 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Wed, 18 Nov 2020 02:07:01 GMT Subject: RFR: 8251317: Support for CLDR version 38 In-Reply-To: References: Message-ID: On Tue, 17 Nov 2020 23:19:23 GMT, Naoto Sato wrote: > Hi, > > Please review the changes for upgrading the CLDR data to version 38. The vast majority of the changes are simply the changes in CLDR upstream, and others are mainly test changes due to the locale data change. Looks like the generated webrev is empty, possibly due to this issue (https://bugs.openjdk.java.net/browse/SKARA-732). Here is the one manually generated: https://cr.openjdk.java.net/~naoto/cldr/webrev.00/ ------------- PR: https://git.openjdk.java.net/jdk/pull/1279 From erikj at openjdk.java.net Wed Nov 18 13:36:07 2020 From: erikj at openjdk.java.net (Erik Joelsson) Date: Wed, 18 Nov 2020 13:36:07 GMT Subject: RFR: 8251317: Support for CLDR version 38 In-Reply-To: References: Message-ID: <6y-uJZl6ZqCrkPzq84kdwWndQbhVLGWbl5k9Hl0lv4A=.a843d0d5-e2be-41e2-be22-86021da9f00f@github.com> On Tue, 17 Nov 2020 23:19:23 GMT, Naoto Sato wrote: > Hi, > > Please review the changes for upgrading the CLDR data to version 38. The vast majority of the changes are simply the changes in CLDR upstream, and others are mainly test changes due to the locale data change. Looks fine from a build point of view. ------------- Marked as reviewed by erikj (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/1279 From igraves at openjdk.java.net Wed Nov 18 20:57:26 2020 From: igraves at openjdk.java.net (Ian Graves) Date: Wed, 18 Nov 2020 20:57:26 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v10] In-Reply-To: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: > The `java.util.Formatter` format specifies support for field widths, argument indexes, or precision lengths of a field that relate to the variadic arguments supplied to the formatter. These numbers are specified by integers, sometimes negative. For argument index, it's specified in the documentation that the highest allowed argument is limited by the largest possible index of an array (ie the largest possible variadic index), but for the other two it's not defined. Moreover, what happens when a number field in a string is too large or too small to be represented by a 32-bit integer type is not defined. > > This fix adds documentation to specify what error behavior occurs during these cases. Additionally it adds an additional exception type to throw when an invalid argument index is observed. > > A CSR will be required for this PR. Ian Graves has updated the pull request incrementally with one additional commit since the last revision: Docfixes, exception messages, formatting and moving tests to testng ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/516/files - new: https://git.openjdk.java.net/jdk/pull/516/files/aaa35af2..03d55944 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=09 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=08-09 Stats: 177 lines in 5 files changed: 77 ins; 98 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/516.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/516/head:pull/516 PR: https://git.openjdk.java.net/jdk/pull/516 From bchristi at openjdk.java.net Wed Nov 18 21:18:05 2020 From: bchristi at openjdk.java.net (Brent Christian) Date: Wed, 18 Nov 2020 21:18:05 GMT Subject: RFR: 8251317: Support for CLDR version 38 In-Reply-To: References: Message-ID: On Tue, 17 Nov 2020 23:19:23 GMT, Naoto Sato wrote: > Hi, > > Please review the changes for upgrading the CLDR data to version 38. The vast majority of the changes are simply the changes in CLDR upstream, and others are mainly test changes due to the locale data change. Changes seem fine to me. ------------- Marked as reviewed by bchristi (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/1279 From igraves at openjdk.java.net Wed Nov 18 22:09:21 2020 From: igraves at openjdk.java.net (Ian Graves) Date: Wed, 18 Nov 2020 22:09:21 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v11] In-Reply-To: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: > The `java.util.Formatter` format specifies support for field widths, argument indexes, or precision lengths of a field that relate to the variadic arguments supplied to the formatter. These numbers are specified by integers, sometimes negative. For argument index, it's specified in the documentation that the highest allowed argument is limited by the largest possible index of an array (ie the largest possible variadic index), but for the other two it's not defined. Moreover, what happens when a number field in a string is too large or too small to be represented by a 32-bit integer type is not defined. > > This fix adds documentation to specify what error behavior occurs during these cases. Additionally it adds an additional exception type to throw when an invalid argument index is observed. > > A CSR will be required for this PR. Ian Graves has updated the pull request incrementally with one additional commit since the last revision: Exception message tweak ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/516/files - new: https://git.openjdk.java.net/jdk/pull/516/files/03d55944..36e8d3a3 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=10 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=09-10 Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/516.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/516/head:pull/516 PR: https://git.openjdk.java.net/jdk/pull/516 From rriggs at openjdk.java.net Wed Nov 18 22:34:06 2020 From: rriggs at openjdk.java.net (Roger Riggs) Date: Wed, 18 Nov 2020 22:34:06 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v11] In-Reply-To: References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: On Wed, 18 Nov 2020 22:09:21 GMT, Ian Graves wrote: >> The `java.util.Formatter` format specifies support for field widths, argument indexes, or precision lengths of a field that relate to the variadic arguments supplied to the formatter. These numbers are specified by integers, sometimes negative. For argument index, it's specified in the documentation that the highest allowed argument is limited by the largest possible index of an array (ie the largest possible variadic index), but for the other two it's not defined. Moreover, what happens when a number field in a string is too large or too small to be represented by a 32-bit integer type is not defined. >> >> This fix adds documentation to specify what error behavior occurs during these cases. Additionally it adds an additional exception type to throw when an invalid argument index is observed. >> >> A CSR will be required for this PR. > > Ian Graves has updated the pull request incrementally with one additional commit since the last revision: > > Exception message tweak Marked as reviewed by rriggs (Reviewer). src/java.base/share/classes/java/util/IllegalFormatArgumentIndexException.java line 66: > 64: > 65: if (index == Integer.MIN_VALUE) { > 66: return "Format argument index: (unrepresentable as int)"; Perhaps "(not representable as int)" is more readable. ------------- PR: https://git.openjdk.java.net/jdk/pull/516 From igraves at openjdk.java.net Wed Nov 18 22:52:07 2020 From: igraves at openjdk.java.net (Ian Graves) Date: Wed, 18 Nov 2020 22:52:07 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v11] In-Reply-To: References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: On Wed, 18 Nov 2020 22:30:21 GMT, Roger Riggs wrote: >> Ian Graves has updated the pull request incrementally with one additional commit since the last revision: >> >> Exception message tweak > > src/java.base/share/classes/java/util/IllegalFormatArgumentIndexException.java line 66: > >> 64: >> 65: if (index == Integer.MIN_VALUE) { >> 66: return "Format argument index: (unrepresentable as int)"; > > Perhaps "(not representable as int)" is more readable. After reading it a few times, I agree. ------------- PR: https://git.openjdk.java.net/jdk/pull/516 From igraves at openjdk.java.net Wed Nov 18 22:57:19 2020 From: igraves at openjdk.java.net (Ian Graves) Date: Wed, 18 Nov 2020 22:57:19 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v12] In-Reply-To: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: > The `java.util.Formatter` format specifies support for field widths, argument indexes, or precision lengths of a field that relate to the variadic arguments supplied to the formatter. These numbers are specified by integers, sometimes negative. For argument index, it's specified in the documentation that the highest allowed argument is limited by the largest possible index of an array (ie the largest possible variadic index), but for the other two it's not defined. Moreover, what happens when a number field in a string is too large or too small to be represented by a 32-bit integer type is not defined. > > This fix adds documentation to specify what error behavior occurs during these cases. Additionally it adds an additional exception type to throw when an invalid argument index is observed. > > A CSR will be required for this PR. Ian Graves has updated the pull request incrementally with one additional commit since the last revision: 'unrepresentable' to 'not representable' ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/516/files - new: https://git.openjdk.java.net/jdk/pull/516/files/36e8d3a3..223282d4 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=11 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=10-11 Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/516.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/516/head:pull/516 PR: https://git.openjdk.java.net/jdk/pull/516 From rriggs at openjdk.java.net Wed Nov 18 23:54:11 2020 From: rriggs at openjdk.java.net (Roger Riggs) Date: Wed, 18 Nov 2020 23:54:11 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v12] In-Reply-To: References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: On Wed, 18 Nov 2020 22:57:19 GMT, Ian Graves wrote: >> The `java.util.Formatter` format specifies support for field widths, argument indexes, or precision lengths of a field that relate to the variadic arguments supplied to the formatter. These numbers are specified by integers, sometimes negative. For argument index, it's specified in the documentation that the highest allowed argument is limited by the largest possible index of an array (ie the largest possible variadic index), but for the other two it's not defined. Moreover, what happens when a number field in a string is too large or too small to be represented by a 32-bit integer type is not defined. >> >> This fix adds documentation to specify what error behavior occurs during these cases. Additionally it adds an additional exception type to throw when an invalid argument index is observed. >> >> A CSR will be required for this PR. > > Ian Graves has updated the pull request incrementally with one additional commit since the last revision: > > 'unrepresentable' to 'not representable' Marked as reviewed by rriggs (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/516 From smarks at openjdk.java.net Thu Nov 19 00:42:05 2020 From: smarks at openjdk.java.net (Stuart Marks) Date: Thu, 19 Nov 2020 00:42:05 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v12] In-Reply-To: References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: On Wed, 18 Nov 2020 22:57:19 GMT, Ian Graves wrote: >> The `java.util.Formatter` format specifies support for field widths, argument indexes, or precision lengths of a field that relate to the variadic arguments supplied to the formatter. These numbers are specified by integers, sometimes negative. For argument index, it's specified in the documentation that the highest allowed argument is limited by the largest possible index of an array (ie the largest possible variadic index), but for the other two it's not defined. Moreover, what happens when a number field in a string is too large or too small to be represented by a 32-bit integer type is not defined. >> >> This fix adds documentation to specify what error behavior occurs during these cases. Additionally it adds an additional exception type to throw when an invalid argument index is observed. >> >> A CSR will be required for this PR. > > Ian Graves has updated the pull request incrementally with one additional commit since the last revision: > > 'unrepresentable' to 'not representable' Marked as reviewed by smarks (Reviewer). test/jdk/java/util/IllegalFormatException/TestFormatSpecifierBounds.java line 48: > 46: String r = String.format("%2147483648$s", "A", "B"); > 47: }); > 48: //assertEquals(e.getMessage(), "Illegal format argument index = " + Integer.MIN_VALUE); Extraneous comment? ------------- PR: https://git.openjdk.java.net/jdk/pull/516 From igraves at openjdk.java.net Thu Nov 19 00:58:21 2020 From: igraves at openjdk.java.net (Ian Graves) Date: Thu, 19 Nov 2020 00:58:21 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v13] In-Reply-To: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: <5IpbSrdcuKa4kWC2OEozS7TkcDl_UrQ23ypTugtXWvw=.5e8f3c17-337d-4e73-8901-3480b852763c@github.com> > The `java.util.Formatter` format specifies support for field widths, argument indexes, or precision lengths of a field that relate to the variadic arguments supplied to the formatter. These numbers are specified by integers, sometimes negative. For argument index, it's specified in the documentation that the highest allowed argument is limited by the largest possible index of an array (ie the largest possible variadic index), but for the other two it's not defined. Moreover, what happens when a number field in a string is too large or too small to be represented by a 32-bit integer type is not defined. > > This fix adds documentation to specify what error behavior occurs during these cases. Additionally it adds an additional exception type to throw when an invalid argument index is observed. > > A CSR will be required for this PR. Ian Graves has updated the pull request incrementally with one additional commit since the last revision: Comment cleanup ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/516/files - new: https://git.openjdk.java.net/jdk/pull/516/files/223282d4..78fc8176 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=12 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=516&range=11-12 Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/516.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/516/head:pull/516 PR: https://git.openjdk.java.net/jdk/pull/516 From igraves at openjdk.java.net Thu Nov 19 00:58:22 2020 From: igraves at openjdk.java.net (Ian Graves) Date: Thu, 19 Nov 2020 00:58:22 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v12] In-Reply-To: References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: On Thu, 19 Nov 2020 00:38:49 GMT, Stuart Marks wrote: >> Ian Graves has updated the pull request incrementally with one additional commit since the last revision: >> >> 'unrepresentable' to 'not representable' > > test/jdk/java/util/IllegalFormatException/TestFormatSpecifierBounds.java line 48: > >> 46: String r = String.format("%2147483648$s", "A", "B"); >> 47: }); >> 48: //assertEquals(e.getMessage(), "Illegal format argument index = " + Integer.MIN_VALUE); > > Extraneous comment? So it would seem! ------------- PR: https://git.openjdk.java.net/jdk/pull/516 From joehw at openjdk.java.net Thu Nov 19 01:42:08 2020 From: joehw at openjdk.java.net (Joe Wang) Date: Thu, 19 Nov 2020 01:42:08 GMT Subject: RFR: 8251317: Support for CLDR version 38 In-Reply-To: References: Message-ID: On Tue, 17 Nov 2020 23:19:23 GMT, Naoto Sato wrote: > Hi, > > Please review the changes for upgrading the CLDR data to version 38. The vast majority of the changes are simply the changes in CLDR upstream, and others are mainly test changes due to the locale data change. Looks good to me. ------------- Marked as reviewed by joehw (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/1279 From naoto at openjdk.java.net Thu Nov 19 17:53:11 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Thu, 19 Nov 2020 17:53:11 GMT Subject: RFR: 8211449" Correction to the spec of implicit negative subpattern in DecimalFormat Message-ID: Hi, Please review this doc only fix to the class description of `DecimalFormat` class. `localized minus sign` has never been (and should never be) used in the implicit negative subpattern. Actual implementation correctly uses ascii minus sign for that purpose, so there won't be any compatibility issues. ------------- Commit messages: - 8211449: Correction to the spec of implicit negative subpattern in DecimalFormat Changes: https://git.openjdk.java.net/jdk/pull/1325/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1325&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8211449 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/1325.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1325/head:pull/1325 PR: https://git.openjdk.java.net/jdk/pull/1325 From bpb at openjdk.java.net Thu Nov 19 18:04:04 2020 From: bpb at openjdk.java.net (Brian Burkhalter) Date: Thu, 19 Nov 2020 18:04:04 GMT Subject: RFR: 8211449: Correction to the spec of implicit negative subpattern in DecimalFormat In-Reply-To: References: Message-ID: On Thu, 19 Nov 2020 17:15:11 GMT, Naoto Sato wrote: > Hi, > > Please review this doc only fix to the class description of `DecimalFormat` class. `localized minus sign` has never been (and should never be) used in the implicit negative subpattern. Actual implementation correctly uses ascii minus sign for that purpose, so there won't be any compatibility issues. Marked as reviewed by bpb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/1325 From lancea at openjdk.java.net Thu Nov 19 18:20:06 2020 From: lancea at openjdk.java.net (Lance Andersen) Date: Thu, 19 Nov 2020 18:20:06 GMT Subject: RFR: 8211449: Correction to the spec of implicit negative subpattern in DecimalFormat In-Reply-To: References: Message-ID: On Thu, 19 Nov 2020 17:15:11 GMT, Naoto Sato wrote: > Hi, > > Please review this doc only fix to the class description of `DecimalFormat` class. `localized minus sign` has never been (and should never be) used in the implicit negative subpattern. Actual implementation correctly uses ascii minus sign for that purpose, so there won't be any compatibility issues. Looks fine, pending CSR approval :-) ------------- PR: https://git.openjdk.java.net/jdk/pull/1325 From smarks at openjdk.java.net Thu Nov 19 20:21:05 2020 From: smarks at openjdk.java.net (Stuart Marks) Date: Thu, 19 Nov 2020 20:21:05 GMT Subject: RFR: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly [v13] In-Reply-To: <5IpbSrdcuKa4kWC2OEozS7TkcDl_UrQ23ypTugtXWvw=.5e8f3c17-337d-4e73-8901-3480b852763c@github.com> References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> <5IpbSrdcuKa4kWC2OEozS7TkcDl_UrQ23ypTugtXWvw=.5e8f3c17-337d-4e73-8901-3480b852763c@github.com> Message-ID: <_3RAvXY8Ua9Bs_WM9tnoTrv8viowc2JoxGp8p0afA3I=.2afe8051-5db6-4c1c-9f43-04a50507f48a@github.com> On Thu, 19 Nov 2020 00:58:21 GMT, Ian Graves wrote: >> The `java.util.Formatter` format specifies support for field widths, argument indexes, or precision lengths of a field that relate to the variadic arguments supplied to the formatter. These numbers are specified by integers, sometimes negative. For argument index, it's specified in the documentation that the highest allowed argument is limited by the largest possible index of an array (ie the largest possible variadic index), but for the other two it's not defined. Moreover, what happens when a number field in a string is too large or too small to be represented by a 32-bit integer type is not defined. >> >> This fix adds documentation to specify what error behavior occurs during these cases. Additionally it adds an additional exception type to throw when an invalid argument index is observed. >> >> A CSR will be required for this PR. > > Ian Graves has updated the pull request incrementally with one additional commit since the last revision: > > Comment cleanup Marked as reviewed by smarks (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/516 From igraves at openjdk.java.net Thu Nov 19 20:24:04 2020 From: igraves at openjdk.java.net (Ian Graves) Date: Thu, 19 Nov 2020 20:24:04 GMT Subject: Integrated: 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly In-Reply-To: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> References: <3aYgWcp1IVMM0vQT5UMLSnc2JA1uK9cbtRe283RF37g=.fc2049ef-cdbe-4948-a24b-fdb88cc87a1c@github.com> Message-ID: On Mon, 5 Oct 2020 22:23:56 GMT, Ian Graves wrote: > The `java.util.Formatter` format specifies support for field widths, argument indexes, or precision lengths of a field that relate to the variadic arguments supplied to the formatter. These numbers are specified by integers, sometimes negative. For argument index, it's specified in the documentation that the highest allowed argument is limited by the largest possible index of an array (ie the largest possible variadic index), but for the other two it's not defined. Moreover, what happens when a number field in a string is too large or too small to be represented by a 32-bit integer type is not defined. > > This fix adds documentation to specify what error behavior occurs during these cases. Additionally it adds an additional exception type to throw when an invalid argument index is observed. > > A CSR will be required for this PR. This pull request has now been integrated. Changeset: 080c707a Author: Ian Graves Committer: Stuart Marks URL: https://git.openjdk.java.net/jdk/commit/080c707a Stats: 175 lines in 5 files changed: 167 ins; 0 del; 8 mod 8253459: Formatter treats index, width and precision > Integer.MAX_VALUE incorrectly Reviewed-by: rriggs, smarks ------------- PR: https://git.openjdk.java.net/jdk/pull/516 From naoto at openjdk.java.net Thu Nov 19 22:44:08 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Thu, 19 Nov 2020 22:44:08 GMT Subject: Integrated: 8251317: Support for CLDR version 38 In-Reply-To: References: Message-ID: On Tue, 17 Nov 2020 23:19:23 GMT, Naoto Sato wrote: > Hi, > > Please review the changes for upgrading the CLDR data to version 38. The vast majority of the changes are simply the changes in CLDR upstream, and others are mainly test changes due to the locale data change. This pull request has now been integrated. Changeset: 68138893 Author: Naoto Sato URL: https://git.openjdk.java.net/jdk/commit/68138893 Stats: 57338 lines in 209 files changed: 41958 ins; 4932 del; 10448 mod 8251317: Support for CLDR version 38 Reviewed-by: erikj, bchristi, joehw ------------- PR: https://git.openjdk.java.net/jdk/pull/1279 From naoto at openjdk.java.net Fri Nov 20 17:13:04 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Fri, 20 Nov 2020 17:13:04 GMT Subject: Integrated: 8211449: Correction to the spec of implicit negative subpattern in DecimalFormat In-Reply-To: References: Message-ID: <8fTrEiipobLTkkVHLQM0BsfQLJYZ9-sW2Rv36NHBnpY=.c40adcfc-aa8f-4772-9cd3-0d01d5a9d14e@github.com> On Thu, 19 Nov 2020 17:15:11 GMT, Naoto Sato wrote: > Hi, > > Please review this doc only fix to the class description of `DecimalFormat` class. `localized minus sign` has never been (and should never be) used in the implicit negative subpattern. Actual implementation correctly uses ascii minus sign for that purpose, so there won't be any compatibility issues. This pull request has now been integrated. Changeset: 2c3a2bed Author: Naoto Sato URL: https://git.openjdk.java.net/jdk/commit/2c3a2bed Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod 8211449: Correction to the spec of implicit negative subpattern in DecimalFormat Reviewed-by: bpb ------------- PR: https://git.openjdk.java.net/jdk/pull/1325 From naoto at openjdk.java.net Fri Nov 20 18:01:14 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Fri, 20 Nov 2020 18:01:14 GMT Subject: RFR: 8247432: Update IANA Language Subtag Registry to Version 2020-09-29 Message-ID: Hi, Please review the changes to the subject issue. This is to incorporate the latest language subtag registry definition into the JDK. ------------- Commit messages: - LSR 2020-09-29 - LSR 2020-07-17 Changes: https://git.openjdk.java.net/jdk/pull/1357/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1357&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8247432 Stats: 52 lines in 2 files changed: 44 ins; 5 del; 3 mod Patch: https://git.openjdk.java.net/jdk/pull/1357.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/1357/head:pull/1357 PR: https://git.openjdk.java.net/jdk/pull/1357 From joehw at openjdk.java.net Fri Nov 20 21:48:05 2020 From: joehw at openjdk.java.net (Joe Wang) Date: Fri, 20 Nov 2020 21:48:05 GMT Subject: RFR: 8247432: Update IANA Language Subtag Registry to Version 2020-09-29 In-Reply-To: References: Message-ID: On Fri, 20 Nov 2020 17:55:55 GMT, Naoto Sato wrote: > Hi, > > Please review the changes to the subject issue. This is to incorporate the latest language subtag registry definition into the JDK. Marked as reviewed by joehw (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/1357 From naoto at openjdk.java.net Mon Nov 23 16:44:56 2020 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 23 Nov 2020 16:44:56 GMT Subject: Integrated: 8247432: Update IANA Language Subtag Registry to Version 2020-09-29 In-Reply-To: References: Message-ID: On Fri, 20 Nov 2020 17:55:55 GMT, Naoto Sato wrote: > Hi, > > Please review the changes to the subject issue. This is to incorporate the latest language subtag registry definition into the JDK. This pull request has now been integrated. Changeset: ae0ca743 Author: Naoto Sato URL: https://git.openjdk.java.net/jdk/commit/ae0ca743 Stats: 52 lines in 2 files changed: 44 ins; 5 del; 3 mod 8247432: Update IANA Language Subtag Registry to Version 2020-09-29 Reviewed-by: joehw ------------- PR: https://git.openjdk.java.net/jdk/pull/1357