-
23 May 2009 1:10 PM #1
[2.0, Trunk] UnsupportedOperationException from ListStore
[2.0, Trunk] UnsupportedOperationException from ListStore
I am seeing an UnsupportedOperationException thrown only in web mode. I have traced it back to the onLoad method of ListStore. The externally supplied List is not copied which is bad if someone is handing you an unmodifiable List. Fix below. The changed lines are commented as "defensive copy"
Code:protected void onLoad(LoadEvent le) { this.config = (ListLoadConfig) le.getConfig(); Object data = le.getData(); removeAll(); if (data instanceof List) { List<M> list = (List) le.getData(); all = new ArrayList<M>(list); // defensive copy } else if (data instanceof ListLoadResult) { all = new ArrayList<M>(((ListLoadResult) data).getData()); // defensive copy } ...
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote