JDK-5038132 : (fmt) missing support for '^' uppercase
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: solaris_2.1
  • CPU: sparc
  • Submitted: 2004-04-27
  • Updated: 2004-04-27
  • Resolved: 2004-04-27
Related Reports
Relates :  
Description
When I use '^' flag, it was throwing exception.
you have moved flags to different file (java.util.FormattableFlags),
which has UPPERCASE (=2) as flag.

When i did a diff between build 48 and build 49 source i could find
the following method has a missed UPPERCASE support.
line 4056 : of Formatter.java file method :
private static Flags parse(char c)  {
 ...
}
has switch statement and there is no
 case for '^' : return UPPERCASE;

And i could see UPPERCASE usage in many places of that java file.

<console>
viswadeep:/home/vv145429/tiger/bugs/formatting 37 % java -version
java version "1.5.0-auto-tiger"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-auto-tiger-112a)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b47, mixed mode)
viswadeep:/home/vv145429/tiger/bugs/formatting 38 % javac Test1_1.java
viswadeep:/home/vv145429/tiger/bugs/formatting 39 % java Test1_1.^R
java Test1_1
Exception in thread "main" java.util.UnknownFormatConversionException: Conversion = '^'
        at java.util.Formatter.checkText(Formatter.java:2485)
        at java.util.Formatter.parse(Formatter.java:2467)
        at java.util.Formatter.format(Formatter.java:2396)
        at java.io.PrintStream.format(PrintStream.java:899)
        at Test1_1.main(Test1_1.java:5)
viswadeep:/home/vv145429/tiger/bugs/formatting 40 % cat Test1_1.java
import java.util.*;
public class Test1_1 {
        public static void main(String[] arg) {

           System.out.format("in uppercase =  %^s","java");
        }
}
viswadeep:/home/vv145429/tiger/bugs/formatting 41 % 

Comments
EVALUATION The '^' flag is no longer supported as result of the work for 4962433. Upper case support is provided via the corresponding uppercase conversions. Use of the UPPERCASE symbol within Formatter.java is an internal implementation detail. -- iag@sfbay 2004-04-27
27-04-2004