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

(fmt) IllegalFormatFlagsException cases not described in java.util.Formatter doc

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs
    • x86
    • windows_xp

      A DESCRIPTION OF THE PROBLEM :
      Some flag combinations are illegal and cause an exception to be thrown. Which ones do this is not immediately obvious. The two illegal combinations are:

      '-' with '0'
      '+' with ' '

      In addition, the argument index flag ('<') is not listed in the table of flags.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      In the Flags table, add the '<' flag line:

      '<' y y y y y The argument for the previous format specifier will be re-used

      At the end of the Flags section, just before the Width section, add:

      An IllegalFormatFlagsException will be thrown if any one or both of the following pairs of flags occurs simultaneously:
      '-' and '0' A left-justified result is zero-padded by definition
      '+' and ' ' The result cannot both include a sign ('+' or '-') and a leading space for positive values

      ACTUAL -
      The documentation makes no mention of the illegal flag combinations.

      URL OF FAULTY DOCUMENTATION :
      http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html

            Unassigned Unassigned
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: