-
Bug
-
Resolution: Fixed
-
P3
-
5.0
FULL PRODUCT VERSION :
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows XP Home, SP1
A DESCRIPTION OF THE PROBLEM :
RoundRectangle2D and Ellipse2D fail to override equals. This behavior is inconsistent with other shapes, such as Rectangle. This can lead to inhomogeneity in client code regarding use of these shapes.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compila and run the test case.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
true
ACTUAL -
false
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.geom.*;
class Test {
public static void main(String args[]) {
RoundRectangle2D.Double a=new RoundRectangle2D.Double(10,10,10,10,2,2);
RoundRectangle2D.Double b=new RoundRectangle2D.Double(10,10,10,10,2,2);
boolean equal=a.equals(b);
System.out.println("equal="+equal);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Provide a deep equals test in client code, or override the shape object.
###@###.### 2004-12-17 23:16:57 GMT
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows XP Home, SP1
A DESCRIPTION OF THE PROBLEM :
RoundRectangle2D and Ellipse2D fail to override equals. This behavior is inconsistent with other shapes, such as Rectangle. This can lead to inhomogeneity in client code regarding use of these shapes.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compila and run the test case.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
true
ACTUAL -
false
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.geom.*;
class Test {
public static void main(String args[]) {
RoundRectangle2D.Double a=new RoundRectangle2D.Double(10,10,10,10,2,2);
RoundRectangle2D.Double b=new RoundRectangle2D.Double(10,10,10,10,2,2);
boolean equal=a.equals(b);
System.out.println("equal="+equal);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Provide a deep equals test in client code, or override the shape object.
###@###.### 2004-12-17 23:16:57 GMT