Adam Heath wrote:
> Adam Heath wrote:
>> BJ Freeman wrote:
>>> I check the ofbiz code files for any changes since last week and now. I
>>> did not see any.
>>> I have a trunk version that does not have this error from last week.
>> I've got it isolated, but not fixed.  FastList is not functioning the
>> same as ArrayList, and it's got me purplexed.  Still investigating.
> 
> Wow, what a bug.
> 
> ArrayList.subList().add(Object) works.
> 
> FastList.subList().add(Object) throws UnsupportedOperationException.

I'll file a javolution bug about this.
import java.util.ArrayList;
import java.util.List;
import javolution.util.FastList;

public class Bug {
    public static void doTest(List list) {
        list.add("1");
        list.add("2");
        list.add("3");
        List sub = list.subList(0, 1);
        System.err.println("sub=" + sub);
        sub.add("a");
        System.err.println("sub=" + sub);
        System.err.println("list=" + list);
    }

    public static void main(String[] args) {
        doTest(new ArrayList());
        doTest(FastList.newInstance());
    }
}

Reply via email to