PDA

View Full Version : [FIXED] IndexOutOfBoundsException at ComboBox Store which has setMonitorChanges(true)



drehberger
19 Jun 2009, 7:51 AM
I've hit an IndexOutOfBoundsException with the following stack trace (see end of post).

It happens when a ComboBox loads its store, the store was empty before and gets one or more models through the load, and the store has a listener on DataChange which modifies the entries.
See small test class attached. The Exception occurs when you click on the drop-down-button.
Note that the Exception does not occur when you don't call setMonitorChanges(true) on the store.

Priority of this issue is currently not high because I can get around without setMonitorChanges for the concrete store which was concerned.

Stack trace:


java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at com.extjs.gxt.ui.client.core.CompositeElement.getElement(CompositeElement.java:128)
at com.extjs.gxt.ui.client.widget.ListView.onUpdate(ListView.java:721)
at com.extjs.gxt.ui.client.widget.ListView$3.storeUpdate(ListView.java:602)
at com.extjs.gxt.ui.client.store.StoreListener.handleEvent(StoreListener.java:36)
at com.extjs.gxt.ui.client.store.StoreListener.handleEvent(StoreListener.java:1)
at com.extjs.gxt.ui.client.event.BaseObservable.callListener(BaseObservable.java:176)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:96)
at com.extjs.gxt.ui.client.store.Store.update(Store.java:545)
at com.extjs.gxt.ui.client.store.Store.onModelChange(Store.java:607)
at com.extjs.gxt.ui.client.store.Store$1.modelChanged(Store.java:513)
at com.extjs.gxt.ui.client.data.ChangeEventSupport.notify(ChangeEventSupport.java:33)
at com.extjs.gxt.ui.client.data.BaseModel.notify(BaseModel.java:103)
at com.extjs.gxt.ui.client.data.BaseModel.notifyPropertyChanged(BaseModel.java:152)
at com.extjs.gxt.ui.client.data.BaseModel.set(BaseModel.java:133)
at BugIndexOutOfBoundsExceptionInComboBoxStoreUpdate$1.storeDataChanged(BugIndexOutOfBoundsExceptionInComboBoxStoreUpdate.java:35)
at com.extjs.gxt.ui.client.store.StoreListener.handleEvent(StoreListener.java:28)
at com.extjs.gxt.ui.client.store.StoreListener.handleEvent(StoreListener.java:1)
at com.extjs.gxt.ui.client.event.BaseObservable.callListener(BaseObservable.java:176)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:96)
at com.extjs.gxt.ui.client.store.ListStore.onLoad(ListStore.java:501)
at com.extjs.gxt.ui.client.store.ListStore$1.loaderLoad(ListStore.java:131)
at com.extjs.gxt.ui.client.event.LoadListener.handleEvent(LoadListener.java:23)
at com.extjs.gxt.ui.client.event.LoadListener.handleEvent(LoadListener.java:1)
at com.extjs.gxt.ui.client.event.BaseObservable.callListener(BaseObservable.java:176)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:96)
at com.extjs.gxt.ui.client.data.BasePagingLoader.onLoadSuccess(BasePagingLoader.java:91)
at com.extjs.gxt.ui.client.data.BasePagingLoader.onLoadSuccess(BasePagingLoader.java:1)
at com.extjs.gxt.ui.client.data.BaseLoader$1.onSuccess(BaseLoader.java:127)
at BugIndexOutOfBoundsExceptionInComboBoxStoreUpdate$MyListProxy.load(BugIndexOutOfBoundsExceptionInComboBoxStoreUpdate.java:53)
[...]

drehberger
19 Jun 2009, 7:53 AM
this was about:
GXT version: current trunk (rev. 1546)
Mode: Hosted mode
OS: Windows XP

sven
24 Jun 2009, 5:51 AM
Fixed in SVN.