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

IllegalArgumentException in sun.lwawt.macosx.CPlatformWindow

    Details

    • Subcomponent:
    • Introduced In Build:
      b31
    • Introduced In Version:
      10
    • Resolved In Build:
      b03
    • CPU:
      x86
    • OS:
      os_x

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Max OS X/Java 11.0.1

      A DESCRIPTION OF THE PROBLEM :
      The "siblingsComparator" in sun.lwawt.macosx.CPlatformWindow violates the contract if one of the windows is not visible and therefore has no peer:

          private final Comparator<Window> siblingsComparator = (w1, w2) -> {
              if (w1 == w2) {
                  return 0;
              }
              ComponentAccessor componentAccessor = AWTAccessor.getComponentAccessor();
              Object p1 = componentAccessor.getPeer(w1);
              Object p2 = componentAccessor.getPeer(w2);
              if (p1 instanceof LWWindowPeer && p2 instanceof LWWindowPeer) {
                  return Long.compare(
                          ((CPlatformWindow) (((LWWindowPeer) p1).getPlatformWindow())).lastBecomeMainTime,
                          ((CPlatformWindow) (((LWWindowPeer) p2).getPlatformWindow())).lastBecomeMainTime);
              }
              return 0;
          };

      java.lang.IllegalArgumentException: Comparison method violates its general contract!
      at java.base/java.util.TimSort.mergeHi(TimSort.java:903)
      at java.base/java.util.TimSort.mergeAt(TimSort.java:520)
      at java.base/java.util.TimSort.mergeForceCollapse(TimSort.java:461)
      at java.base/java.util.TimSort.sort(TimSort.java:254)
      at java.base/java.util.Arrays.sort(Arrays.java:1441)
      at java.desktop/sun.lwawt.macosx.CPlatformWindow.orderAboveSiblingsImpl(CPlatformWindow.java:1227)
      at java.desktop/sun.lwawt.macosx.CPlatformWindow.orderAboveSiblings(CPlatformWindow.java:1218)
      at java.desktop/sun.lwawt.macosx.CPlatformWindow.checkBlockingAndOrder(CPlatformWindow.java:1168)
      at java.desktop/sun.lwawt.macosx.CPlatformWindow.setModalBlocked(CPlatformWindow.java:973)
      at java.desktop/sun.lwawt.LWWindowPeer.setModalBlocked(LWWindowPeer.java:461)
      at java.desktop/sun.lwawt.LWWindowPeer.blockWindows(LWWindowPeer.java:652)


      FREQUENCY : occasionally


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                serb Sergey Bylokhov
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: