Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-1117

twod.PolygonsSet.getSize produces NullPointerException if BSPTree has no nodes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2
    • 3.3
    • None
    • None
    • Mac OS 10.9, Java 6, 7

    Description

      org.apache.commons.math3.geometry.euclidean.twod.PolygonsSet.getSize() uses a tree internally:

      final BSPTree<Euclidean2D> tree = getTree(false);

      However, if that tree contains no data, it seems that the reference returned is null, which causes a subsequent NullPointerException.

      Probably an exception with a message ("tree has no data") would clarify that this is an API usage error.

      Attachments

        1. Report3.java
          0.5 kB
          Cyrille Artho
        2. Report3_1.java
          0.3 kB
          Cyrille Artho

        Activity

          People

            Unassigned Unassigned
            Telcontar Cyrille Artho
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: