#5 NullPointerException in RobustLineIntersector

closed
nobody
None
5
2006-04-20
2006-04-12
No

The following code example results in a
NullPointerException:

Coordinate p1 = new Coordinate(0, 1);
Coordinate p2 = new Coordinate(1, 0);
Coordinate q1 = new Coordinate(1, 1);
Coordinate q2 = new Coordinate(0, 0);
new RobustLineIntersector().computeIntersect(p1, p2,
q1, q2);

Stack Trace:

java.lang.NullPointerException
at com.vividsolutions.jts.geom.Envelope.
init(Envelope.java:233)
at com.vividsolutions.jts.geom.Envelope.
<init>(Envelope.java:166)
at com.vividsolutions.jts.algorithm.
RobustLineIntersector.
isInSegmentEnvelopes(RobustLineIntersector.java:361)
at com.vividsolutions.jts.algorithm.
RobustLineIntersector.
intersection(RobustLineIntersector.java:224)
at com.vividsolutions.jts.algorithm.
RobustLineIntersector.
computeIntersect(RobustLineIntersector.java:132)
at de.disy.gis.gisterm.gfx.common.algorithm.test.

The problem was detected with JTS1.7 and persists in
JTS1.7.1.

Discussion

  • Dr JTS

    Dr JTS - 2006-04-20
    • status: open --> closed
     
  • Dr JTS

    Dr JTS - 2006-04-20

    Logged In: YES
    user_id=1158312

    The computeIntersect method is not intended to be called
    directly. It should be marked protected. This has been
    fixed in CVS.

     

Log in to post a comment.