The AbstractStoreSelectionModel calls the onSelectChange(M model, boolean select) before the classes internal variable selected is updated. The following lines in AbstractStoreSelectionModel.java (lines 309-311):
Code:
onSelectChange(model, true);
selected.add(model);
lastSelected = model;
should be changed to:
Code:
selected.add(model);
lastSelected = model;
onSelectChange(model, true);
With the fix, we can now trust the selected member variable in the concrete implementation of onSelectChange(M, boolean).