Index: src/main/java/common/javax/swing/tree/DefaultTreeSelectionModel.java =================================================================== --- src/main/java/common/javax/swing/tree/DefaultTreeSelectionModel.java (revision 495289) +++ src/main/java/common/javax/swing/tree/DefaultTreeSelectionModel.java (working copy) @@ -146,7 +146,7 @@ } public TreePath[] getSelectionPaths() { - return selection; + return (((selection != null) && (selection.length > 0)) ? selection : null) ; } public void removeSelectionPaths(final TreePath[] paths) { @@ -202,10 +202,10 @@ public int[] getSelectionRows() { if (rowMapper == null || isSelectionEmpty()) { - return new int[0]; + return null; } - - return getCleanedSortedRowsArray(rowMapper.getRowsForPaths(getSelectionPaths())); + int[] ret = getCleanedSortedRowsArray(rowMapper.getRowsForPaths(getSelectionPaths())); + return (ret.length == 0 ? null : ret); } public boolean isRowSelected(final int i) {