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

1.4 REGRESSION: JEditor pane throws NullPointerException on mouse movement

XMLWordPrintable

    • mantis
    • x86
    • windows_nt, windows_2000



      Name: gm110360 Date: 05/30/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      FULL OPERATING SYSTEM VERSION :
      Windows NT Version 4.0

      A DESCRIPTION OF THE PROBLEM :
      A JEditorPane which is displaying an HTML page with
      frames will sometimes throw a NullPointerException
      when the mouse is moved in the bottom border.

      You can also see another bug - script code is
      displayed.


      REGRESSION. Last worked in version 1.3.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Change the url in my source to a local copy of the JDK
      1.4 docs "api/index.html" file.
      2. Run the code.
      3. Move the mouse in the bottom border of the page.
      Sometimes nothing happens on a particular run.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Expect no stack dump. Get stack dump.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.NullPointerException
      at
      javax.swing.text.html.HTMLEditorKit$LinkController.doesElementContainLocation(HT
      MLEditorKit.java:733)
      at
      javax.swing.text.html.HTMLEditorKit$LinkController.mouseMoved(HTMLEditorKit.java
      :631)
      at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:268)
      at java.awt.Component.processMouseMotionEvent(Component.java:5066)
      at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:2763)
      at java.awt.Component.processEvent(Component.java:4822)
      at java.awt.Container.processEvent(Container.java:1380)
      at java.awt.Component.dispatchEventImpl(Component.java:3526)
      at java.awt.Container.dispatchEventImpl(Container.java:1437)
      at java.awt.Component.dispatchEvent(Component.java:3367)
      at
      java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3214)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2942)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2859)
      at java.awt.Container.dispatchEventImpl(Container.java:1423)
      at java.awt.Window.dispatchEventImpl(Window.java:1566)
      at java.awt.Component.dispatchEvent(Component.java:3367)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
      at
      java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:1
      90)
      at
      java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144
      )
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)


      This bug can be reproduced often.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;

          public class JEditorPaneBug {
             public static void main(String args[]) {
               JFrame frame = new JFrame();
               JEditorPane jep = new JEditorPane();
               jep.setEditable(false);
               frame.getContentPane().add(jep);
               frame.setSize(400, 400);
               frame.setVisible(true);
            
               try {
                  // Change page to local copy of JDK 1.4
                  // docs "api/index.html" file.
                  jep.setPage("file:D:/docs/api/index.html"); }
                   catch(java.io.IOException e) {
                     System.out.println("Page not found."); }
            }
         }


      ---------- END SOURCE ----------

      Release Regression From : 1.3.1_03
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      (Review ID: 139872)
      ======================================================================

            idk Igor Kushnirskiy (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: