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

Regression: Hotspot throws NPE instead of AbstractMethodException

XMLWordPrintable

    • kestrel
    • sparc
    • solaris_2.6
    • Verified

      Install the attached input method CityIM.jar into the lib/ext directory of a Kestrel FCS-R J2RE. 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:

      java.lang.NullPointerException
              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)

      This is the wrong exception. The real problem 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.

            jcoomes John Coomes (Inactive)
            nlindenbsunw Norbert Lindenberg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: