sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1706793 - /sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java
Date Mon, 05 Oct 2015 10:51:00 GMT
Author: desruisseaux
Date: Mon Oct  5 10:50:59 2015
New Revision: 1706793

URL: http://svn.apache.org/viewvc?rev=1706793&view=rev
Log:
Fix a NullPointerException.

Modified:
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java?rev=1706793&r1=1706792&r2=1706793&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java
[UTF-8] Mon Oct  5 10:50:59 2015
@@ -261,6 +261,7 @@ abstract class TreeNodeList extends Abst
      */
     @Override
     protected void removeRange(final int lower, final int upper) throws IllegalArgumentException
{
+        ArgumentChecks.ensureValidIndexRange(size, lower, upper);
         int i = upper;
         try {
             while (i != lower) {
@@ -269,8 +270,10 @@ abstract class TreeNodeList extends Abst
             }
         } finally {
             modCount++;
-            System.arraycopy(children, upper, children, i, size - upper);
-            Arrays.fill(children, upper, size, null);
+            if (children != null) {
+                System.arraycopy(children, upper, children, i, size - upper);
+                Arrays.fill(children, upper, size, null);
+            }
             size -= (upper - i);
         }
     }



Mime
View raw message