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

[macos] NPE was thrown at expanding Choice from maximized frame

    Details

    • Subcomponent:
    • Resolved In Build:
      b27
    • CPU:
      x86_64
    • OS:
      os_x

      Backports

        Description

        FULL PRODUCT VERSION :
        openjdk version "14-ea" 2020-03-17
        OpenJDK Runtime Environment (build 14-ea+17-721)
        OpenJDK 64-Bit Server VM (build 14-ea+17-721, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Mac OS X

        A DESCRIPTION OF THE PROBLEM :
        NullPointerException was thrown when maximized Frame and expanded Choice.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. Compile and launch the attached sample
        2. Maximize the frame by double clicking title bar (Not full screen)
        3. Open Choice component
        => NullPointerException was thrown.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        Expected:
        No exception
        Actual:
        Exception was thrown and Choice was not expanded.
        Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at java.desktop/sun.lwawt.macosx.LWCToolkit.getScreenInsets(LWCToolkit.java:482)
        at java.desktop/javax.swing.JPopupMenu.adjustPopupLocationToFitScreen(JPopupMenu.java:348)
        at java.desktop/javax.swing.JPopupMenu.showPopup(JPopupMenu.java:828)
        at java.desktop/javax.swing.JPopupMenu.setVisible(JPopupMenu.java:785)
        at java.desktop/javax.swing.JPopupMenu.show(JPopupMenu.java:959)
        at java.desktop/com.apple.laf.AquaComboBoxPopup.show(AquaComboBoxPopup.java:141)
        at java.desktop/javax.swing.plaf.basic.BasicComboPopup.togglePopup(BasicComboPopup.java:1218)
        at java.desktop/javax.swing.plaf.basic.BasicComboPopup$Handler.mousePressed(BasicComboPopup.java:897)
        at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:288)
        at java.desktop/java.awt.Component.processMouseEvent(Component.java:6634)
        at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
        at java.desktop/java.awt.Component.processEvent(Component.java:6402)
        at java.desktop/java.awt.Container.processEvent(Container.java:2263)
        at java.desktop/java.awt.Component$1.processEvent(Component.java:968)
        at java.desktop/sun.lwawt.LWComponentPeer.sendEventToDelegate(LWComponentPeer.java:1223)
        at java.desktop/sun.lwawt.LWComponentPeer.handleEvent(LWComponentPeer.java:1212)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5074)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4845)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
        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(AccessController.java:391)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
        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)

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import java.awt.*;

        public class ChoiceTest
        {
            static public void main(String args[])
            {
                Frame f = new Frame("ChoiceTest");
                Panel p =new Panel(new BorderLayout());
                Choice choice = new Choice();
                choice.addItem("aaa");
                choice.addItem("bbb");
                p.add("North",choice);
                p.add("Center",new Canvas());

                f.add(p);
                f.setSize(600, 400);
                f.setVisible(true);
            }
        }
        ---------- END SOURCE ---------- 

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  tnakamura Toshio Nakamura
                  Reporter:
                  tnakamura Toshio Nakamura
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: