-
Bug
-
Resolution: Not an Issue
-
P2
-
None
-
1.1.8, 1.2.0
-
sparc
-
solaris_2.6
JDK Version: jdk118
OS: Solaris 2.6
Locale: C, zh
Vector.equals(Object) can not work correctly. If we construct two Vectors,
and assigned them the same value, but the equals() method would return
a "false" boolean value. If we set jdk to 1.2fcs, the return value will
be "true".
Following is a short program to reproduce it:
==========================TestVector.java=================================
import java.util.*;
public class TestVector {
public static void main(String args[]) {
Vector v1 = new Vector();
v1.addElement("White");
v1.addElement("Black");
v1.addElement("Green");
Vector v2 = new Vector();
v2.addElement("White");
v2.addElement("Black");
v2.addElement("Green");
System.out.println("v1 = ");
System.out.println(v1);
System.out.println("v2 = ");
System.out.println(v2);
System.out.println("v1.equals(v2): " + v1.equals(v2));
}
}
===========================================================================
jim.hu@prc 1998-12-11
OS: Solaris 2.6
Locale: C, zh
Vector.equals(Object) can not work correctly. If we construct two Vectors,
and assigned them the same value, but the equals() method would return
a "false" boolean value. If we set jdk to 1.2fcs, the return value will
be "true".
Following is a short program to reproduce it:
==========================TestVector.java=================================
import java.util.*;
public class TestVector {
public static void main(String args[]) {
Vector v1 = new Vector();
v1.addElement("White");
v1.addElement("Black");
v1.addElement("Green");
Vector v2 = new Vector();
v2.addElement("White");
v2.addElement("Black");
v2.addElement("Green");
System.out.println("v1 = ");
System.out.println(v1);
System.out.println("v2 = ");
System.out.println(v2);
System.out.println("v1.equals(v2): " + v1.equals(v2));
}
}
===========================================================================
jim.hu@prc 1998-12-11
- duplicates
-
JDK-4190777 Vector's equals() method can not work correctly.
- Closed