7061097: [Doc] Inconsistenency between the spec and the implementation for DateFormat.Field

Reviewed-by: naoto
This commit is contained in:
Justin Lu 2023-10-20 17:37:51 +00:00
parent 158293d251
commit 4dfa3799a6

View file

@ -944,9 +944,12 @@ public abstract class DateFormat extends Format {
/** /**
* Returns the {@code Calendar} field associated with this * Returns the {@code Calendar} field associated with this
* attribute. For example, if this represents the hours field of * attribute. For example, if this represents the hours field of
* a {@code Calendar}, this would return * a {@code Calendar}, this method would return {@code Calendar.HOUR}.
* {@code Calendar.HOUR}. If there is no corresponding * The return value of {@code -1} guarantees that this field does not
* {@code Calendar} constant, this will return -1. * 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 * @return Calendar constant for this field
* @see java.util.Calendar * @see java.util.Calendar