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

method MenuSelectionManager.setSelectedPath() throws NPE

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      tiger
    • CPU:
      generic, x86, sparc
    • OS:
      generic, solaris_2.6, windows_2000
    • Verification:
      Verified

      Description



      Name: apR10229 Date: 05/27/2003


      Filed By : SPB JCK team (###@###.###)
      JDK : java full version "1.5.0-beta-b06"
      JCK : 1.5
      Platform[s] : Solaris
      switch/Mode :
      JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
      Failing Test [s] : N/A


      Problem description
      ===================
      There is an unexpected interdependency between
      javax.swing.JComboBox and javax.swing.MenuSelectionManager.
      About 120 jck tests, executed in the single JVM fail due to NPE,
      thrown by the method javax.swing.plaf.basic.BasicPopupMenuUI$MouseGrabber.grabWindow().

          
      Minimized test:
      ===============
      ------- Test.java -------
      import javax.swing.*;
      class Test {
          public static void main(String[] args) {
            JComboBox comboBox = new JComboBox();
            JMenuBar menuBar = new JMenuBar();
            JMenu menu = new JMenu("Menu");
            menuBar.add(menu);
            JMenuItem menuItem = new JMenuItem("Item");
            menu.add(menuItem);
            MenuElement menuPath[] = {menuBar, menu, menuItem };
            MenuSelectionManager.defaultManager().setSelectedPath(menuPath);
          }
      }

      ------- end-of-Test.java -------

      Minimized test output:
      ======================
      <pav@libra(pts/8).291> javac -d . Test.java && java -cp . Test
      Exception in thread "main" java.lang.NullPointerException
              at javax.swing.plaf.basic.BasicPopupMenuUI$MouseGrabber.grabWindow(BasicPopupMenuUI.java:686)
              at javax.swing.plaf.basic.BasicPopupMenuUI$MouseGrabber.stateChanged(BasicPopupMenuUI.java:705)
              at javax.swing.MenuSelectionManager.fireStateChanged(MenuSelectionManager.java:161)
              at javax.swing.MenuSelectionManager.setSelectedPath(MenuSelectionManager.java:87)
              at Test.main(Test.java:11)
      <pav@libra(pts/8).292>


      JCK test source location:
      ==========================
      /java/re/jck/1.5//nightly/binaries/latest/JCK-runtime-15/tests

      Specific Machine Info:
      =====================
      SunOS archer 5.8 Generic_108528-20 sun4u sparc SUNW,Ultra-4

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kizune Alexander Zuev
                Reporter:
                pavsunw Pav Pav (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: