< prev index next >

## src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java

Print this page

    @@ -689,22 +689,18 @@
             for(int i = rmMinIndex; i <= maxIndex; i++) {
                 setState(i, value.get(i + gapLength));
             }

             int leadIndex = this.leadIndex;
    -        if (leadIndex == 0 && rmMinIndex == 0) {
    -            // do nothing
    -        } else if (leadIndex > rmMaxIndex) {
    +        if (leadIndex > rmMaxIndex) {
                 leadIndex = this.leadIndex - gapLength;
             } else if (leadIndex >= rmMinIndex) {
                 leadIndex = rmMinIndex - 1;
             }

             int anchorIndex = this.anchorIndex;
    -        if (anchorIndex == 0 && rmMinIndex == 0) {
    -            // do nothing
    -        } else if (anchorIndex > rmMaxIndex) {
    +        if (anchorIndex > rmMaxIndex) {
                 anchorIndex = this.anchorIndex - gapLength;
             } else if (anchorIndex >= rmMinIndex) {
                 anchorIndex = rmMinIndex - 1;
             }

< prev index next >