Test case is in Mauve. The current Classpath implementation says in a comment: "Here we can use the same code we use for an ordinary rectangle." This is wrong, because RoundRectangle2D is, well, rounded :-) The implementation should cover the case where the intersection is only in the rounded corners, as in: | -------\ | \ \ \ \------- \ | In this case, the method should return false.
Please use a fixed-with font for looking at the ASCII art in my previous comment.
The implementation of the intersects method in java.awt.geom.RoundRectangle2D sometimes returns the wrong values. The attached Mauve test case succeeds on Sun J2SE 1.4.1_01, but fails on Classpath. I've just submitted this test case to <mauve-patches@sources.redhat.com>. The enclosed image (gnu/testlet/java/awt/geom/RoundRectangle2D/doc-files/intersects-1.png) illustrates the expected results. [Testcase and picture are now in mauve] For rectangles #10, 11, 12, 16, 20, 23, 27, 30, 34, 38, 39, and 40, the current classpath implementation returns false. However, true would be the correct result. This bug report comes from GNU Classpath: https://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=6067
This bug is now also tracked in GCC AWT bugzilla: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16823
Fixed.
Fixed on java-gui-branch: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&only_with_tag=java-gui-branch&r1=1.2660.2.321&r2=1.2660.2.322 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/awt/geom/CubicCurve2D.java.diff?cvsroot=gcc&only_with_tag=java-gui-branch&r1=1.4&r2=1.4.8.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/awt/geom/GeneralPath.java.diff?cvsroot=gcc&only_with_tag=java-gui-branch&r1=1.3&r2=1.3.14.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/awt/geom/QuadCurve2D.java.diff?cvsroot=gcc&only_with_tag=java-gui-branch&r1=1.6&r2=1.6.8.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/awt/geom/RoundRectangle2D.java.diff?cvsroot=gcc&only_with_tag=java-gui-branch&r1=1.5&r2=1.5.14.1
All of these are all fixed in 4.0.0 by the merge of the gui branch.