Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8337039

Examine java.text.Format API for implSpec usage

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 24
    • core-libs
    • None
    • behavioral
    • minimal
    • Doc only update; minimal risk.
    • Java API
    • SE

      Summary

      Add implSpec tags and an apiNote tag to the java.text.Format API where applicable.

      Problem

      There is specification in Format that could be better documented with the implSpec and apiNote Javadoc tags.

      Solution

      Update Format.formatToCharacterIterator(Object obj) with an implSpec and apiNote tag to clarify implementation specific behavior, as well as API commentary.

      Update Format.format(Object obj) with an implSpec tag to clarify implementation specific behavior.

      Specification

      In Format.formatToCharacterIterator(Object obj),

      -     * <p>The default implementation creates an
      -     * {@code AttributedCharacterIterator} with no attributes. Subclasses
      -     * that support fields should override this and create an
      -     * {@code AttributedCharacterIterator} with meaningful attributes.
            *
      +     * @apiNote Subclasses that support fields should override this and create an
      +     * {@code AttributedCharacterIterator} with meaningful attributes.
      +     * @implSpec The default implementation creates an
      +     * {@code AttributedCharacterIterator} with no attributes.

      In Format.format(Object obj),

      -     * This method returns a string that would be equal to the string returned by
      +     *
      +     * @implSpec This method returns a string that would be equal to the string returned by

            jlu Justin Lu
            jlu Justin Lu
            Chen Liang
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: