-
Bug
-
Resolution: Fixed
-
P2
-
1.1
-
1.1fcs
-
x86
-
generic
-
Not verified
masayoshi.okutsu@Eng 1997-01-09
java.text.ChoiceFormat.format(long, StringBuffer, FormatStatus) causes
StackOverflowError. To reproduce, exec the following test program.
import java.text.*;
public class bug1{
public static void main(String[] args){
//
double[] limit = {0.0,1.0,2.0};
Object[] format = {"0.0<=Limit<1.0",
"1.0<=Limit<2.0",
"2.0<=Limit"};
ChoiceFormat cf = new ChoiceFormat(limit,format);
FormatStatus status = new FormatStatus();
StringBuffer toappendTo = new StringBuffer("");
//
// main
//
// System.out.println(cf.format((double)1.0,toappendTo,status)); // OK
System.out.println(cf.format((long )1.0,toappendTo,status)); // NG
}
}
Exec result:
[F:\TEMP\text]java bug1
java.lang.StackOverflowError
at java.text.ChoiceFormat.format(ChoiceFormat.java:131)
at java.text.ChoiceFormat.format(ChoiceFormat.java:131)
...
(lots of iteration)
...
at java.text.ChoiceFormat.format(ChoiceFormat.java:131)
at java.text.ChoiceFormat.format(ChoiceFormat.java:131)
at bug1.main(bug1.java:17)