<i18n dev> RFR: JDK-7061097: [Doc] Inconsistenency between the spec and the implementation for DateFormat.Field

Justin Lu jlu at openjdk.org
Thu Oct 19 21:44:33 UTC 2023


Please review this PR which adjusts the specification of `DateFormat.Field::getCalendarField` to conform to the implementation.

`getCalendarField()` claims that it will return -1 if there is no corresponding `Calendar` constant.

Although the built-in DateFormat.Fields with no associated `Calendar` constant are created with a `calendarField` equal to -1, a subclass can create a DateFormat.Field with no associated `Calendar` constant with `calendarField` equal to anything.

The specification of `getCalendarField()` should be adjusted to reflect this. That is, a separate implementation may or may not return -1 if there is no associated `Calendar` constant.

-------------

Commit messages:
 - this implementation -> the default implementation
 - init

Changes: https://git.openjdk.org/jdk/pull/16279/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16279&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-7061097
  Stats: 6 lines in 1 file changed: 3 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/16279.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16279/head:pull/16279

PR: https://git.openjdk.org/jdk/pull/16279


More information about the i18n-dev mailing list