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

Regression: Hotspot throws bogus NPE instead of AbstractMethodException

    • rc1
    • x86
    • windows_nt

      Install the attached input method CityIM.jar into the lib\ext directory of a Kestrel FCS-R J2RE on Windows. Run the application test/java/awt/im/IMFTest/IMFDemo.java (in the Kestrel workspace) on this J2RE with the Hotspot VM. Click into the text component labeled "Lightweight component, active client" so that it shows an insertion point, indicating it has the focus. Choose the "Select Input Method" item from the window menu (pulled down from the top-left corner of the window). From the pop-up menu, choose "City Input Method"->"German". An exception is thrown repeatedly:

      Exception occurred during event dispatching:
      java.lang.NullPointerException
              at sun.awt.im.InputContext.getInputMethodInstance(InputContext.java:658)
              at sun.awt.im.InputContext.changeInputMethod(InputContext.java:480)
              at sun.awt.im.ExecutableInputMethodManager.changeInputMethod(InputMethodManager.java:525)
              at sun.awt.im.ExecutableInputMethodManager.actionPerformed(InputMethodManager.java:286)
              at java.awt.MenuItem.processActionEvent(MenuItem.java:531)
              at java.awt.MenuItem.processEvent(MenuItem.java:495)
              at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:271)
              at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:261)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:321)
              at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)

      This exception is totally bogus. The line from which it is reportedly thrown contains no code that could lead to an exception - it's a simple assignment to an instance variable. The real problem is encountered 28 lines further down in the source code - it is that the attached version of the input method was built for Kestrel beta interfaces and doesn't have a createInputMethod method. That method was added to the java.awt.im.spi.InputMethodDescriptor interface after beta. The classic VM throws the correct exception:

      java.lang.AbstractMethodError: com/sun/demos/cityim/internal/CityInputMethodDescriptor.createInputMethod
              at sun.awt.im.InputContext.getInputMethodInstance(InputContext.java:686)
              at sun.awt.im.InputContext.changeInputMethod(InputContext.java:480)
              at sun.awt.im.ExecutableInputMethodManager.changeInputMethod(InputMethodManager.java:525)
              at sun.awt.im.ExecutableInputMethodManager.actionPerformed(InputMethodManager.java:286)
              at java.awt.MenuItem.processActionEvent(MenuItem.java:531)
              at java.awt.MenuItem.processEvent(MenuItem.java:495)
              at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:271)
              at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:261)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:321)
              at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)


      Sources for City Input Method are in /export2/local/kestrel/test/java/awt/im/CityInputMethod in the Kestrel workspace. createInputMethod was added in rev. 1.5 of CityInputMethodDescriptor.java.

          Loading...
          Uploaded image for project: 'JDK'
          1. JDK
          2. JDK-4301144

          Regression: Hotspot throws bogus NPE instead of AbstractMethodException

            • rc1
            • x86
            • windows_nt

              Install the attached input method CityIM.jar into the lib\ext directory of a Kestrel FCS-R J2RE on Windows. Run the application test/java/awt/im/IMFTest/IMFDemo.java (in the Kestrel workspace) on this J2RE with the Hotspot VM. Click into the text component labeled "Lightweight component, active client" so that it shows an insertion point, indicating it has the focus. Choose the "Select Input Method" item from the window menu (pulled down from the top-left corner of the window). From the pop-up menu, choose "City Input Method"->"German". An exception is thrown repeatedly:

              Exception occurred during event dispatching:
              java.lang.NullPointerException
                      at sun.awt.im.InputContext.getInputMethodInstance(InputContext.java:658)
                      at sun.awt.im.InputContext.changeInputMethod(InputContext.java:480)
                      at sun.awt.im.ExecutableInputMethodManager.changeInputMethod(InputMethodManager.java:525)
                      at sun.awt.im.ExecutableInputMethodManager.actionPerformed(InputMethodManager.java:286)
                      at java.awt.MenuItem.processActionEvent(MenuItem.java:531)
                      at java.awt.MenuItem.processEvent(MenuItem.java:495)
                      at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:271)
                      at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:261)
                      at java.awt.EventQueue.dispatchEvent(EventQueue.java:321)
                      at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
                      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
                      at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)

              This exception is totally bogus. The line from which it is reportedly thrown contains no code that could lead to an exception - it's a simple assignment to an instance variable. The real problem is encountered 28 lines further down in the source code - it is that the attached version of the input method was built for Kestrel beta interfaces and doesn't have a createInputMethod method. That method was added to the java.awt.im.spi.InputMethodDescriptor interface after beta. The classic VM throws the correct exception:

              java.lang.AbstractMethodError: com/sun/demos/cityim/internal/CityInputMethodDescriptor.createInputMethod
                      at sun.awt.im.InputContext.getInputMethodInstance(InputContext.java:686)
                      at sun.awt.im.InputContext.changeInputMethod(InputContext.java:480)
                      at sun.awt.im.ExecutableInputMethodManager.changeInputMethod(InputMethodManager.java:525)
                      at sun.awt.im.ExecutableInputMethodManager.actionPerformed(InputMethodManager.java:286)
                      at java.awt.MenuItem.processActionEvent(MenuItem.java:531)
                      at java.awt.MenuItem.processEvent(MenuItem.java:495)
                      at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:271)
                      at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:261)
                      at java.awt.EventQueue.dispatchEvent(EventQueue.java:321)
                      at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
                      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
                      at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)


              Sources for City Input Method are in /export2/local/kestrel/test/java/awt/im/CityInputMethod in the Kestrel workspace. createInputMethod was added in rev. 1.5 of CityInputMethodDescriptor.java.

                    rgriesemsunw Robert Griesemer (Inactive)
                    nlindenbsunw Norbert Lindenberg (Inactive)
                    Votes:
                    0 Vote for this issue
                    Watchers:
                    2 Start watching this issue

                      Created:
                      Updated:
                      Resolved:
                      Imported:
                      Indexed:

                        rgriesemsunw Robert Griesemer (Inactive)
                        nlindenbsunw Norbert Lindenberg (Inactive)
                        Votes:
                        0 Vote for this issue
                        Watchers:
                        2 Start watching this issue

                          Created:
                          Updated:
                          Resolved:
                          Imported:
                          Indexed: