Author: manik.surtani(a)jboss.com
Date: 2008-07-24 05:43:46 -0400 (Thu, 24 Jul 2008)
New Revision: 6395
Modified:
core/trunk/src/main/java/org/jboss/cache/util/ImmutableListCopy.java
Log:
Fixed sublist boundary chk
Modified: core/trunk/src/main/java/org/jboss/cache/util/ImmutableListCopy.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/ImmutableListCopy.java 2008-07-24
09:43:30 UTC (rev 6394)
+++ core/trunk/src/main/java/org/jboss/cache/util/ImmutableListCopy.java 2008-07-24
09:43:46 UTC (rev 6395)
@@ -305,10 +305,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 > size || fromIndex > toIndex)
+ throw new IllegalArgumentException("fromIndex(" + fromIndex +
"), toIndex(" + toIndex + "), size (" + size + ")");
offset = fromIndex;
size = toIndex - fromIndex;
}
Show replies by date