Commons Math
  1. Commons Math
  2. MATH-1117

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.3
    • Labels:
      None
    • Environment:

      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.

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

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Cyrille Artho
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development