Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7B77C10F0D for ; Mon, 14 Apr 2014 06:13:23 +0000 (UTC) Received: (qmail 91148 invoked by uid 500); 14 Apr 2014 06:13:20 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 90635 invoked by uid 500); 14 Apr 2014 06:13:16 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 90394 invoked by uid 99); 14 Apr 2014 06:13:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Apr 2014 06:13:15 +0000 Date: Mon, 14 Apr 2014 06:13:15 +0000 (UTC) From: "Cyrille Artho (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (MATH-1117) twod.PolygonsSet.getSize produces NullPointerException if BSPTree has no nodes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MATH-1117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Cyrille Artho updated MATH-1117: -------------------------------- Attachment: Report3_1.java Just calling the constructor with the right numbers produces the same effect, for example this one-liner: new org.apache.commons.math3.geometry.euclidean.twod.PolygonsSet(0.0d, 0.0d, 0.0d, 10.3206397147574d); > twod.PolygonsSet.getSize produces NullPointerException if BSPTree has no nodes > ------------------------------------------------------------------------------ > > Key: MATH-1117 > URL: https://issues.apache.org/jira/browse/MATH-1117 > Project: Commons Math > Issue Type: Bug > Affects Versions: 3.2 > Environment: Mac OS 10.9, Java 6, 7 > Reporter: Cyrille Artho > Attachments: Report3.java, Report3_1.java > > > org.apache.commons.math3.geometry.euclidean.twod.PolygonsSet.getSize() uses a tree internally: > final BSPTree 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. -- This message was sent by Atlassian JIRA (v6.2#6252)