-
Bug
-
Resolution: Fixed
-
P4
-
1.2.2
-
beta
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2028964 | 1.4.0 | Jennifer Ball | P4 | Resolved | Fixed | beta2 |
Name: wl91122 Date: 09/08/99
import java.awt.geom.*;
/**
* This program demonstrates an inconsistency between the
* documentation and the implementation of java.awt.geom.Line2D
* in JDK 1.2.2.
*
* Specifically, the relativeCCW() method returns the negative
* value of what it should return.
*
* Bill Farrior
* September 7, 1999
* ###@###.###
*/
public class LineBug {
public static void main(String args[])
{
System.out.println("Consider a line segment from p0 (0,0) to p1 (1,0).\n"+
"A point P lies at (0,2).\n\n" +
"For the line segment to \"point at\" the specified point, it must turn\n"+
"counterclockwise 90 degrees about its first point at the origin.\n"+
"According to the documention on Class java.awt.geom.Line2D, the\n"+
"relativeCCW() method should rightfully return a postive 1 in this\n"+
"situation."
);
System.out.println("\nHowever, the actual value returned is as follows:");
// Define p0
Point2D.Double p0 = new Point2D.Double(0,0);
System.out.println("p0 = " + p0);
// Define p1
Point2D.Double p1 = new Point2D.Double(1,0);
System.out.println("p1 = " + p1);
// Define a line from p0 to p1
Line2D.Double line = new Line2D.Double(p0,p1);
System.out.println("line created from p0 to p1.");
// Define p
Point2D.Double p = new Point2D.Double(0,2);
System.out.println("p = " + p);
// Print the flawed result
System.out.println("line.relativeCCW(p) = " + line.relativeCCW(p) );
}
}
(Review ID: 94985)
======================================================================
- backported by
-
JDK-2028964 Line2D relativeCCW() returns opposite of what documentation says
-
- Resolved
-