FULL PRODUCT VERSION :
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
This is a fairly straightforward bug where a row index is passed to a method that is expecting a length instead.
In JTable$SortManager.cacheSelection(RowSorterEvent sortEvent, ModelChange change) method, when:
modelSelection.insertIndexInterval(change.startModelIndex,
change.endModelIndex,
true);
The 2nd arg should be: change.endModelIndex - change.startModelIndex + 1
This can be verified with DefaultListSelectionModel.insertIndexInterval method.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
There's no workaround as the JTable$SortManager class is private final.