Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8005019

JTable passes row index instead of length when inserts selection interval

    XMLWordPrintable

Details

    • b73
    • x86
    • windows_7

    Backports

      Description

        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.

        Attachments

          Issue Links

            Activity

              People

                alexsch Alexandr Scherbatiy
                ndcosta Nelson Dcosta (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: