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

ListFormat::format specification could be made clearer regarding handling IllegalArgumentException.

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 22
    • core-libs
    • None
    • minimal
    • This is simply a spec clarification.
    • Java API
    • SE

      Summary

      Clarify the @throws IllegalArgumentException clause of 3-arg ListFormat::format()

      Problem

      The current wording is a bit unclear when the exception is thrown.

      Solution

      Explicitly define the conditions for the exception, i.e., IllegalArgumentException is thrown if the given object is neither a List nor an array of Objects, or its length is zero.

      Specification

      Change the @throws clause in the method description as follows:

      -      * @throws    IllegalArgumentException if the given object cannot
      -      *               be formatted
      +      * @throws    IllegalArgumentException if {@code obj} is neither a {@code List}
      +      *               nor an array of {@code Object}s, or its length is zero.

            naoto Naoto Sato
            kganapureddy Krushnareddy Ganapureddy
            Joe Wang, Roger Riggs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: