Adam Heath wrote:
> However, javolution doesn't allow one to do structural changes to the
> sublist; that's why there's an exception during the add() call.
Attached you will find an example that showcases the problem. I'll file
a bug with javolution.
import java.util.ArrayList;
import java.util.List;
import javolution.util.FastList;
public class JavolutionBug {
public static void doListTest(String label, List data) {
System.err.println("label[" + label + "]");
try {
for (int i = 0; i < 20; i++) {
data.add(Integer.valueOf(i));
}
List sub = data.subList(5, 10);
System.err.println("data=" + data);
System.err.println("sub=" + sub);
sub.add("abc");
System.err.println("data=" + data);
System.err.println("sub=" + sub);
} catch (Throwable t) {
t.printStackTrace();
}
}
public static void main(String[] args) throws Exception {
doListTest("ArrayList", new ArrayList());
doListTest("FastList", FastList.newInstance());
}
}