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

problem with LayoutComparator / SortingFocusTraversalPolicy

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • 9
    • 7, 8, 9
    • client-libs

      FULL PRODUCT VERSION :
      java version "1.7.0_04"
      Java(TM) SE Runtime Environment (build 1.7.0_04-b22)
      Java HotSpot(TM) Client VM (build 23.0-b21, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Happens in standalone as well as when invoking java program in JNLP mode.


      A DESCRIPTION OF THE PROBLEM :
      This issue is same as described in bug 6923200 which seems to be closed but I am seeing this consistently using latest JRE 7

      1. while disabling a button on a panel which is inside JTabbed pane. It seems to cause this following exception consistently while using JRE 7 1.7.0_04-b22

      java.lang.IllegalArgumentException: Comparison method violates its general contract!
              at java.util.TimSort.mergeHi(TimSort.java:868)
              at java.util.TimSort.mergeAt(TimSort.java:485)
              at java.util.TimSort.mergeForceCollapse(TimSort.java:426)
              at java.util.TimSort.sort(TimSort.java:223)
              at java.util.TimSort.sort(TimSort.java:173)
              at java.util.Arrays.sort(Arrays.java:659)
              at java.util.Collections.sort(Collections.java:217)
              at javax.swing.SortingFocusTraversalPolicy.enumerateAndSortCycle(SortingFocusTraversalPolicy.java:136)
              at javax.swing.SortingFocusTraversalPolicy.getFocusTraversalCycle(SortingFocusTraversalPolicy.java:110)
              at javax.swing.SortingFocusTraversalPolicy.getComponentAfter(SortingFocusTraversalPolicy.java:280)
              at javax.swing.LayoutFocusTraversalPolicy.getComponentAfter(LayoutFocusTraversalPolicy.java:106)
              at java.awt.Component.getNextFocusCandidate(Component.java:7860)
              at java.awt.Component.transferFocus(Component.java:7828)
              at java.awt.Component.disable(Component.java:1517)
              at javax.swing.JComponent.disable(JComponent.java:3635)
              at java.awt.Component.enable(Component.java:1495)
              at java.awt.Component.setEnabled(Component.java:1458)
              at javax.swing.JComponent.setEnabled(JComponent.java:2677)
              at javax.swing.AbstractButton.setEnabled(AbstractButton.java:2087)


      ============================================================




      2. while removing all and adding new components:


      ============================================================
      Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException:
      Comparison method violates its general contract!
      at java.util.TimSort.mergeHi(Unknown Source)
      at java.util.TimSort.mergeAt(Unknown Source)
      at java.util.TimSort.mergeForceCollapse(Unknown Source)
      at java.util.TimSort.sort(Unknown Source)
      at java.util.TimSort.sort(Unknown Source)
      at java.util.Arrays.sort(Unknown Source)
      at java.util.Collections.sort(Unknown Source)
      at javax.swing.SortingFocusTraversalPolicy.enumerateAndSortCycle(Unknown
      Source)
      at
      javax.swing.SortingFocusTraversalPolicy.getFocusTraversalCycle(Unknown Source)
      at javax.swing.SortingFocusTraversalPolicy.getComponentAfter(Unknown
      Source)
      at javax.swing.LayoutFocusTraversalPolicy.getComponentAfter(Unknown
      Source)
      at java.awt.Component.getNextFocusCandidate(Unknown Source)
      at java.awt.Component.transferFocus(Unknown Source)
      at java.awt.Container.removeNotify(Unknown Source)
      at javax.swing.JComponent.removeNotify(Unknown Source)
      at java.awt.Container.removeAll(Unknown Source)
      =======================================================


      These errors are happening randomly making it hard to use this app with JRE 7.

      REGRESSION. Last worked in version 7

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      I have a java swing app with JFrame, which has a tabbed pane .
      each pane has JSplitPane , with right side of split pane child has several panels inside.
      Each panel has several buttons and JTable inside jscrollpane

      button actions usually disables itself takes some action and then it is enabled again. When enabling button exceptions mentioned in description happens.

      Also some button actions result in panel be cleared of existing panels inside it and new panels being displayed. In this case second exception mentioned in description item 2 happens sometimes.



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      expected result:
       code should proceed without any of exceptions mentioned.
      ACTUAL -
      Exception happens at random place of enable/disable.
      It is not possible to even have try catch and ignore this. Button actions don't happen properly.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.IllegalArgumentException: Comparison method violates its general contract!

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      None.

            ssadetsky Semyon Sadetsky (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: