Hide Forgot
Description of problem: Java applications (For example: Alice) with empty swing popup menus crash because of a null pointer exception in SwingUtilities2. Version-Release number of selected component (if applicable): $ java -version java version "1.6.0_22" OpenJDK Runtime Environment (IcedTea6 1.10.1) (fedora-57.1.10.1.fc15-x86_64) OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode) How reproducible: Use test program: http://hg.openjdk.java.net/jdk7/jdk7/jdk/rev/d353dcff4f14 Actual results: java.lang.NullPointerException at sun.swing.SwingUtilities2.getLeftSideBearing(SwingUtilities2.java:241) at sun.swing.MenuItemLayoutHelper.getLeftExtraWidth(MenuItemLayoutHelper.java:162) at sun.swing.MenuItemLayoutHelper.calcExtraWidths(MenuItemLayoutHelper.java:158) at sun.swing.MenuItemLayoutHelper.reset(MenuItemLayoutHelper.java:148) at javax.swing.plaf.synth.SynthMenuItemLayoutHelper.<init>(SynthMenuItemLayoutHelper.java:119) at javax.swing.plaf.synth.SynthGraphicsUtils.getPreferredMenuItemSize(SynthGraphicsUtils.java:434) at javax.swing.plaf.synth.SynthMenuItemUI.getPreferredMenuItemSize(SynthMenuItemUI.java:195) at javax.swing.plaf.basic.BasicMenuItemUI.getPreferredSize(BasicMenuItemUI.java:363) at javax.swing.JComponent.getPreferredSize(JComponent.java:1634) at javax.swing.BoxLayout.checkRequests(BoxLayout.java:481) at javax.swing.BoxLayout.preferredLayoutSize(BoxLayout.java:298) at javax.swing.plaf.synth.DefaultMenuLayout.preferredLayoutSize(DefaultMenuLayout.java:66) at java.awt.Container.preferredSize(Container.java:1605) at java.awt.Container.getPreferredSize(Container.java:1590) at javax.swing.JComponent.getPreferredSize(JComponent.java:1636) at javax.swing.JPopupMenu.adjustPopupLocationToFitScreen(JPopupMenu.java:358) at javax.swing.JPopupMenu.getPopup(JPopupMenu.java:791) at javax.swing.JPopupMenu.setVisible(JPopupMenu.java:748) at javax.swing.JPopupMenu.show(JPopupMenu.java:921) ... Expected results: No exception. No crash. Additional info: jdk7 bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7037283 jdk7 fix: http://hg.openjdk.java.net/jdk7/jdk7/jdk/rev/d353dcff4f14
Hi Kyle. Thank you very much for finding the changeset that fixes this (in jdk7). I will test it out and backport it.
I reported the wrong bug for openjdk for this: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7036148
That makes sense. The first bug description didn't seem very related. Either way, the changeset link you posted does fix the problem, and I've backported it. The fix should be in the next update of icedtea6-1.10.