Skip to content

Commit

Permalink
7061097: [Doc] Inconsistenency between the spec and the implementatio…
Browse files Browse the repository at this point in the history
…n for DateFormat.Field

Reviewed-by: naoto
  • Loading branch information
Justin Lu committed Oct 20, 2023
1 parent 158293d commit 4dfa379
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/java.base/share/classes/java/text/DateFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -944,9 +944,12 @@ protected Field(String name, int calendarField) {
/**
* Returns the {@code Calendar} field associated with this
* attribute. For example, if this represents the hours field of
* a {@code Calendar}, this would return
* {@code Calendar.HOUR}. If there is no corresponding
* {@code Calendar} constant, this will return -1.
* a {@code Calendar}, this method would return {@code Calendar.HOUR}.
* The return value of {@code -1} guarantees that this field does not
* represent any corresponding constant in {@code Calendar}.
*
* @implSpec The default implementation always returns {@code -1} if it does
* not represent any corresponding constant in {@code Calendar}.
*
* @return Calendar constant for this field
* @see java.util.Calendar
Expand Down

1 comment on commit 4dfa379

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.