-
Bug
-
Resolution: Fixed
-
P3
-
1.1.4
-
1.2beta4
-
sparc
-
solaris_2.5
-
Verified
Name: dfC67450 Date: 01/20/98
The java.text.ChoiceFormat.equals(Object) method does not work correctly.
This method should return false if called with null argument
(see general contract for equals(): JLS 1.0 item 20.1.3, page 459).
But it throws NullPointerException.
Here is the test demonstrating the bug:
-----------------Test.java------------------------
import java.text.*;
public class Test {
public static void main (String args[]){
double[] limits = {1, 20};
String[] formats = {"xyz", "abc"};
ChoiceFormat cf = new ChoiceFormat(limits, formats);
System.out.println(cf.equals(null));
}
}
---------Output from the test---------------------
java.lang.NullPointerException
at java.text.ChoiceFormat.equals(ChoiceFormat.java)
at Test.main(Test.java:8)
-------------------------------------------------
======================================================================