Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
P4
-
Resolution: Won't Fix
-
Affects Version/s: 1.2.2
-
Fix Version/s: None
-
Component/s: core-libs
-
Labels:
-
Subcomponent:
-
CPU:sparc
-
OS:solaris_2.5
Description
Name: saC57035 Date: 07/08/99
Javadoc says:
----------------------
pattern := subpattern{;subpattern}
subpattern := {prefix}integer{.fraction}{suffix}
prefix := '\\u0000'..'\\uFFFD' - specialCharacters
suffix := '\\u0000'..'\\uFFFD' - specialCharacters
integer := '#'* '0'* '0'
...
Illegal patterns, such as "#.#.#" or mixing '_' and '*' in the same pattern,
will cause an IllegalArgumentException to be thrown. From the message of
IllegalArgumentException
----------------------
So integer part of pattern have to contain at least one '0' special
character and trying to apply pattern "##.##" should throw
IllegalArgumentException
jdk1.2.2 allow to apply pattern "##.##"
If this behavour is correct it should be reflected in specification
------------ Test,java
import java.text.DecimalFormat;
class Test {
public static void main(String [] args) {
new DecimalFormat().applyPattern("##.##");
System.out.println("No Exception");
}
}
------------ Output
No exception
-------------
======================================================================