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

NullPointerException thrown by AccessBridge when assistive technology started be

XMLWordPrintable



      Name: dk106046 Date: 12/10/2001


      The problem is independent of the JDK.
      Versions of Access Bridge with problem: 1.0.1, 1.0.1b07 and 1.0.2beta.

      - Steps to reproduce:
      Having installed the Access Bridge modify the ccessibility.properties file to switch on the Access Bridge.
      Start an assistive technology, e.g., JAWS or JavaFerret.
      After this start a java application, e.g., the HTMLConverter gui. Every now and then (30% of the time) a NullPointerException will be thrown and the assistive technology will not be able to get information about swing components.

      - Text of error messages:
      Exception in thread "Thread-1" java.lang.NullPointerException
              at com.sun.java.accessibility.AccessBridge.addJavaEventNotification(Acce
      ssBridge.java:2137)
              at com.sun.java.accessibility.AccessBridge.run(Native Method)
              at java.lang.Thread.run(Thread.java:512)
      Exception in thread "Thread-1" java.lang.NullPointerException
              at com.sun.java.accessibility.AccessBridge.addAccessibilityEventNotifica
      tion(AccessBridge.java:2152)
              at com.sun.java.accessibility.AccessBridge.run(Native Method)
              at java.lang.Thread.run(Thread.java:512)

      - Problem Analysis:
      The problem is to do with the fact that in AccessBridge's constructor eventHandler, on which EventHandler.addJavaEventNotification() is called in AccessBridge.addJavaEventNotification(), is instantiated AFTER the AccessBridge thread is started. If an assistive technology (AT) is already running when the AccessBridge thread is started then the AT's dll sends out a message which initiates a call to AccessBridge.addJavaEventNotification(). If this happens quickly enough then a call to eventHandler.addJavaEventNotification() can be made BEFORE eventHandler has been instantiated in AccessBridge's constructor causing a NullPointerException.

      - Problem Solution:
      In the AccessBridge constructor instantiate eventHandler before starting the AccessBridge thread.
      (Review ID: 136553)
      ======================================================================

            lmonsantsunw Lynn Monsanto (Inactive)
            dkorbel David Korbel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: