Re: RFR: 8279185: Support for IsoFields in JapaneseDate/MinguoDate/ThaiBuddhistDate [v2]
On Fri, 4 Mar 2022 21:26:57 GMT, Joe Wang wrote: > Is the public API change, adding the isIsoLike() method, necessary? Yes, I believe so. Without a means to tell whether the `TemporalAccessor`, such as `LocalDate`, supports `IsoFields`, `IsoFields` would have to hard-code which temporal accessor is supporting `IsoFields` fields. - PR: https://git.openjdk.java.net/jdk/pull/7683
Re: RFR: 8279185: Support for IsoFields in JapaneseDate/MinguoDate/ThaiBuddhistDate [v2]
On Fri, 4 Mar 2022 05:02:37 GMT, Naoto Sato wrote: >> Supporting `IsoFields` temporal fields in chronologies that are similar to >> ISO chronology. Corresponding CSR has also been drafted. > > Naoto Sato has updated the pull request incrementally with one additional > commit since the last revision: > > copyright year fix > - PR: https://git.openjdk.java.net/jdk/pull/7683
Re: RFR: 8279185: Support for IsoFields in JapaneseDate/MinguoDate/ThaiBuddhistDate [v2]
On Fri, 4 Mar 2022 05:02:37 GMT, Naoto Sato wrote: >> Supporting `IsoFields` temporal fields in chronologies that are similar to >> ISO chronology. Corresponding CSR has also been drafted. > > Naoto Sato has updated the pull request incrementally with one additional > commit since the last revision: > > copyright year fix src/java.base/share/classes/java/time/chrono/Chronology.java line 792: > 790: * @since 19 > 791: */ > 792: default boolean isIsoLike() { Maybe a bit late for a name change... How about the method name being: `supportsIsoFields()`. IsoLike seem pretty wishy washy. src/java.base/share/classes/java/time/chrono/IsoChronology.java line 682: > 680: > //--- > 681: /** > 682: * {@inheritDoc} I would rather see the statement indicating that ISOChronology returns true; not a generic sentence. (For each of the Chronologies). "IsoChronology supports ISO based fields, such as DAY_OF_QUARTER and QUARTER_OF_YEAR." src/java.base/share/classes/java/time/temporal/IsoFields.java line 599: > 597: private static void ensureIsoLike(TemporalAccessor temporal) { > 598: if (!isIsoLike(temporal)) { > 599: throw new DateTimeException("Resolve requires ISO-like > Chronology"); Would the exception be easier to debug with if it mentioned the chronology that is not ISO-like? test/jdk/java/time/test/java/time/temporal/TestIsoWeekFields.java line 132: > 130: public void test_Unit_isSupportedBy_ISO() { > 131: > assertEquals(IsoFields.WEEK_BASED_YEARS.isSupportedBy(LocalDate.now()),true); > 132: > assertEquals(IsoFields.WEEK_BASED_YEARS.isSupportedBy(ThaiBuddhistDate.now()),true); Typically, comma (",") is followed by space. - PR: https://git.openjdk.java.net/jdk/pull/7683
Re: RFR: 8279185: Support for IsoFields in JapaneseDate/MinguoDate/ThaiBuddhistDate [v2]
On Fri, 4 Mar 2022 05:02:37 GMT, Naoto Sato wrote: >> Supporting `IsoFields` temporal fields in chronologies that are similar to >> ISO chronology. Corresponding CSR has also been drafted. > > Naoto Sato has updated the pull request incrementally with one additional > commit since the last revision: > > copyright year fix Is the public API change, adding the isIsoLike() method, necessary? It seems to me we already have the isSupported method​ for that purpose and plus isSupportedBy​ from the IsoFields. Would making sure the IsoFields are supported at the implementation level be sufficient? - PR: https://git.openjdk.java.net/jdk/pull/7683
Re: RFR: 8279185: Support for IsoFields in JapaneseDate/MinguoDate/ThaiBuddhistDate [v2]
> Supporting `IsoFields` temporal fields in chronologies that are similar to > ISO chronology. Corresponding CSR has also been drafted. Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: copyright year fix - Changes: - all: https://git.openjdk.java.net/jdk/pull/7683/files - new: https://git.openjdk.java.net/jdk/pull/7683/files/28d93903..12c6212a Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7683&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7683&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk/pull/7683.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7683/head:pull/7683 PR: https://git.openjdk.java.net/jdk/pull/7683