Uploaded image for project: 'Jalview'
  1. Jalview
  2. JAL-3388

Sorting Structure Chooser table by Sequence id fails with ClassCastException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.10.0, 2.11.0
    • Fix Version/s: 2.11.1, 2.11.1.0
    • Component/s: jvdesktop
    • Environment:
      Java version: 1.8.0_162
      x86_64 Mac OS X 10.12.6

      Description

      Load uniref50.fa, select all sequences, fetch 3D structure data.
      A panel of PDB entries is displayed.
      All columns appear to be sortable except for the first (Ref Sequence), which throws an error ClassCastException on click to sort by this column.
      Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: jalview.datamodel.Sequence cannot be cast to java.lang.String
      at java.text.Collator.compare(Collator.java:304)
      at javax.swing.DefaultRowSorter.compare(DefaultRowSorter.java:968)
      at javax.swing.DefaultRowSorter.access$100(DefaultRowSorter.java:112)
      at javax.swing.DefaultRowSorter$Row.compareTo(DefaultRowSorter.java:1376)
      at javax.swing.DefaultRowSorter$Row.compareTo(DefaultRowSorter.java:1366)
      at java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:320)
      at java.util.ComparableTimSort.sort(ComparableTimSort.java:188)
      at java.util.Arrays.sort(Arrays.java:1246)
      at javax.swing.DefaultRowSorter.sort(DefaultRowSorter.java:607)
      at javax.swing.DefaultRowSorter.setSortKeys(DefaultRowSorter.java:319)
      at javax.swing.DefaultRowSorter.toggleSortOrder(DefaultRowSorter.java:480)
      at javax.swing.plaf.basic.BasicTableHeaderUI$MouseInputHandler.mouseClicked(BasicTableHeaderUI.java:112)
      at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:270)

      Other columns remain sortable until (it appears) the panel loses and regains focus, and then they fail with the same error.

        Attachments

          Activity

            People

            Assignee:
            gmungoc Mungo Carstairs
            Reporter:
            geoff.barton Geoff Barton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: