Re: RFR: 8279185: Support for IsoFields in JapaneseDate/MinguoDate/ThaiBuddhistDate [v7]

2022-04-19 Thread Roger Riggs
On Fri, 15 Apr 2022 18:47:53 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 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 15 additional commits since 
> the last revision:
> 
>  - Revert to use the default method
>  - Merge branch 'master' into JDK-8279185
>  - Removed unnecessary package names
>  - Modified class desc of `IsoFields`
>  - abstract class -> top level interface
>  - interface -> abstract class
>  - Merge branch 'master' into JDK-8279185
>  - Removed the method
>  - Merge branch 'master' into JDK-8279185
>  - Changed to use a type to determine ISO based or not
>  - ... and 5 more: 
> https://git.openjdk.java.net/jdk/compare/5ee1a816...82339ec6

src/java.base/share/classes/java/time/chrono/Chronology.java line 794:

> 792:  * @since 19
> 793:  */
> 794: default boolean isIsoBased() {

Can the description be more specific.  Each of the chronologies mentioned
say they have the same number of months, the number of days in each month, and 
day-of-year and leap years are the same as ISO. The week-based fields in 
IsoFields also depend ISO defined concepts.

Perhaps it should say that this method should return true only if all of the 
fields of IsoFields are supported for the chronology.

The chronology names could be links and omit the @see tags, including 
ISOChronology.

In the @return add ", otherwise return {@code false}."

src/java.base/share/classes/java/time/temporal/IsoFields.java line 600:

> 598: if (!isIsoBased(temporal)) {
> 599: throw new DateTimeException("Resolve requires ISO based 
> chronology: " +
> 600: Chronology.from(temporal));

The name change doesn't add much, I'd leave both `ensureIso` and `isIso` method 
names unchanged.

src/java.base/share/classes/java/time/temporal/IsoFields.java line 739:

> 737: 
> 738: static boolean isIsoBased(TemporalAccessor temporal) {
> 739: return Chronology.from(temporal).isIsoBased();

Can this method be private static?

Also, move the `ensureIso` method to be next to `isIso`.

-

PR: https://git.openjdk.java.net/jdk/pull/7683


Re: RFR: 8279185: Support for IsoFields in JapaneseDate/MinguoDate/ThaiBuddhistDate [v7]

2022-04-15 Thread Naoto Sato
> 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 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 15 additional commits since the 
last revision:

 - Revert to use the default method
 - Merge branch 'master' into JDK-8279185
 - Removed unnecessary package names
 - Modified class desc of `IsoFields`
 - abstract class -> top level interface
 - interface -> abstract class
 - Merge branch 'master' into JDK-8279185
 - Removed the method
 - Merge branch 'master' into JDK-8279185
 - Changed to use a type to determine ISO based or not
 - ... and 5 more: https://git.openjdk.java.net/jdk/compare/0cddf702...82339ec6

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7683/files
  - new: https://git.openjdk.java.net/jdk/pull/7683/files/474dc85a..82339ec6

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=7683=06
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=7683=05-06

  Stats: 13771 lines in 299 files changed: 10278 ins; 2309 del; 1184 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