Avoid NullPointerException in some corner cases.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1554653 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2014-01-01 17:29:18 +00:00
parent 83444ebe71
commit 57eff0d0c3
2 changed files with 10 additions and 2 deletions

View File

@ -45,6 +45,11 @@ public class SubOrientedPoint extends AbstractSubHyperplane<Euclidean1D, Euclide
return 0; return 0;
} }
/** {@inheritDoc} */
public boolean isEmpty() {
return false;
}
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
protected AbstractSubHyperplane<Euclidean1D, Euclidean1D> buildNew(final Hyperplane<Euclidean1D> hyperplane, protected AbstractSubHyperplane<Euclidean1D, Euclidean1D> buildNew(final Hyperplane<Euclidean1D> hyperplane,

View File

@ -128,8 +128,11 @@ public abstract class AbstractRegion<S extends Space, T extends Space> implement
/** {@inheritDoc} */ /** {@inheritDoc} */
public void visitLeafNode(final BSPTree<S> node) { public void visitLeafNode(final BSPTree<S> node) {
node.setAttribute((node == node.getParent().getPlus()) ? if (node.getParent() == null || node == node.getParent().getMinus()) {
Boolean.FALSE : Boolean.TRUE); node.setAttribute(Boolean.TRUE);
} else {
node.setAttribute(Boolean.FALSE);
}
} }
}); });