platform/shared/rubyJVM/src/javolution/util/FastTable.java in rhodes-2.0.0.beta7 vs platform/shared/rubyJVM/src/javolution/util/FastTable.java in rhodes-2.0.0.beta8

- old
+ new

@@ -532,11 +532,20 @@ */ public final List/*<E>*/subList(int fromIndex, int toIndex) { if ((fromIndex < 0) || (toIndex > _size) || (fromIndex > toIndex)) throw new IndexOutOfBoundsException("fromIndex: " + fromIndex + ", toIndex: " + toIndex + " for list of size: " + _size); - return SubTable.valueOf(this, fromIndex, toIndex - fromIndex); + int size = toIndex - fromIndex; + FastTable table = new FastTable(size); + + for( int i = fromIndex; i < size; i++ ) + table.add(this.get(i)); + + return table; +//RHO + //return SubTable.valueOf(this, fromIndex, toIndex - fromIndex); +//RHO } /** * Reduces the capacity of this table to the current size (minimize * storage space). @@ -712,10 +721,11 @@ } /** * This inner class implements a sub-table. */ +/* private static final class SubTable extends FastCollection implements List, RandomAccess { private static final ObjectFactory FACTORY = new ObjectFactory() { protected Object create() { @@ -828,10 +838,10 @@ + ", toIndex: " + toIndex + " for list of size: " + _size); return SubTable.valueOf(_table, _offset + fromIndex, toIndex - fromIndex); } - } + }*/ /** * This inner class implements a fast table iterator. */ private static final class FastTableIterator implements ListIterator {