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

JInternalFrame : java.lang.AssertionError: cannot find the internal frame

    Details

    • Subcomponent:
    • Resolved In Build:
      b24
    • CPU:
      generic
    • OS:
      linux

      Backports

        Description

        This issue is coming from below code piece (/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java) :

            JInternalFrame findInternalFrame(Component comp) {
                if (comp.getParent() instanceof BasicInternalFrameTitlePane) {
                    comp = comp.getParent();
                }
                if (comp instanceof JInternalFrame) {
                    return (JInternalFrame)comp;
                } else if (comp instanceof JInternalFrame.JDesktopIcon) {
                    return ((JInternalFrame.JDesktopIcon)comp).getInternalFrame();
                }
                assert false : "cannot find the internal frame";
                return null;
            }

        Here it accepting BasicInternalFrameTitlePane in the first if check, but whenever a BasicInternalFrameTitlePane comes in to this method, it always end up with this assertion error.

        How to reproduce:
        Copy the attached test file(InternalFrameDemoTest) under location : /test/jdk/sanity/client/SwingSet/src
        Run using jtreg command : ./jtreg/bin/jtreg -verbose:all -esa -jdk:./testjdk/jdk-12 -dir:./jdklocal/test/jdk sanity/client/SwingSet/src/InternalFrameDemoTest.java

        Here '-esa' is important to include in the command, then only assertion codes will get executed.

        Logs:
        java.lang.AssertionError: cannot find the internal frame
        at java.desktop/com.sun.java.swing.plaf.gtk.Metacity.findInternalFrame(Metacity.java:340)
        at java.desktop/com.sun.java.swing.plaf.gtk.Metacity.updateFrameGeometry(Metacity.java:1474)
        at java.desktop/com.sun.java.swing.plaf.gtk.Metacity.paintButtonBackground(Metacity.java:219)
        at java.desktop/com.sun.java.swing.plaf.gtk.GTKPainter.paintButtonBackground(GTKPainter.java:273)
        at java.desktop/javax.swing.plaf.synth.SynthButtonUI.paintBackground(SynthButtonUI.java:294)
        at java.desktop/javax.swing.plaf.synth.SynthButtonUI.update(SynthButtonUI.java:251)
        at java.desktop/javax.swing.JComponent.paintComponent(JComponent.java:797)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1074)
        at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
        at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
        at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
        at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:590)
        at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
        at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
        at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
        at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:590)
        at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
        at java.desktop/javax.swing.JComponent.paintToOffscreen(JComponent.java:5255)
        at java.desktop/javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:246)
        at java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1323)
        at java.desktop/javax.swing.JComponent._paintImmediately(JComponent.java:5203)
        at java.desktop/javax.swing.JComponent.paintImmediately(JComponent.java:5013)
        at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:888)
        at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:848)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:848)
        at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:823)
        at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:772)
        at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1890)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
        at org.netbeans.jemmy.QueueTool$JemmyQueue.dispatchEvent(QueueTool.java:654)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
        STATUS:Failed.`main' threw exception: java.lang.AssertionError: cannot find the internal frame

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  psadhukhan Prasanta Sadhukhan
                  Reporter:
                  akolarkunnu Abdul Kolarkunnu
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: