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

(fmt) missing exception for "%#s" format specifier

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 7
    • 5.0, 6
    • core-libs
    • b70
    • generic
    • solaris_8, windows_xp

      The formatter spec says of the 's' general conversion:

       If the '#' flag is given and the argument is not a Formattable,
       then a FormatFlagsConversionMismatchException will be thrown.

      but the implementation fails to do that:

      ==========$ cat -n T.java
           1 import java.util.*;
           2 class T {
           3 public static void main(String[] args) {
           4 System.out.printf("%#s%n", 0);
           5 }
           6 }
      ==========$ /usr/j2sdk1.5.0/bin/javac T.java
      ==========$ /usr/j2sdk1.5.0/bin/java T
      0
      ==========$

            sherman Xueming Shen
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: