[jbosscache-commits] JBoss Cache SVN: r6394 - core/branches/2.2.X/src/main/java/org/jboss/cache/util.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Thu Jul 24 05:43:30 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-07-24 05:43:30 -0400 (Thu, 24 Jul 2008)
New Revision: 6394

Modified:
   core/branches/2.2.X/src/main/java/org/jboss/cache/util/ImmutableListCopy.java
Log:
Fixed sublist boundary chk

Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/util/ImmutableListCopy.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/util/ImmutableListCopy.java	2008-07-24 09:41:42 UTC (rev 6393)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/util/ImmutableListCopy.java	2008-07-24 09:43:30 UTC (rev 6394)
@@ -304,10 +304,8 @@
 
       ImmutableSubList(int fromIndex, int toIndex)
       {
-         assertIndexInRange(fromIndex);
-         assertIndexInRange(toIndex - 1);
-         if (fromIndex > toIndex)
-            throw new IllegalArgumentException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")");
+         if (fromIndex < 0 || toIndex > ImmutableListCopy.this.size || fromIndex > toIndex)
+            throw new IllegalArgumentException("fromIndex(" + fromIndex + "), toIndex(" + toIndex + "), size (" + ImmutableListCopy.this.size + ")");
          offset = fromIndex;
          size = toIndex - fromIndex;
       }




More information about the jbosscache-commits mailing list