JDK-5063507 : (fmt) missing exception for "%#s" format specifier
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 5.0,6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_8,windows_xp
  • CPU: generic
  • Submitted: 2004-06-15
  • Updated: 2017-05-16
  • Resolved: 2009-08-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b70Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
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
==========$

Comments
EVALUATION Not for Tiger. -- iag@sfbay 2004-07-28
28-07-2004