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

NPE at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection

    Details

    • Subcomponent:
    • Resolved In Build:
      b01
    • CPU:
      x86
    • OS:
      linux, windows_7, windows_8
    • Verification:
      Not verified

      Backports

        Description

        NPE in BasicTreeUI:

        java.lang.NullPointerException
                at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(BasicTreeUI.java:3501)
                at javax.swing.plaf.basic.BasicTreeUI$Handler.mouseReleasedDND(BasicTreeUI.java:3571)
                at javax.swing.plaf.basic.BasicTreeUI$Handler.mouseReleased(BasicTreeUI.java:3559)
                at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
                at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
                at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
                at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
                at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
                at java.awt.Component.processMouseEvent(Component.java:6041)
                at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
                at java.awt.Component.processEvent(Component.java:5806)
                at java.awt.Container.processEvent(Container.java:2058)
                at java.awt.Component.dispatchEventImpl(Component.java:4413)
                at java.awt.Container.dispatchEventImpl(Container.java:2116)
                at java.awt.Component.dispatchEvent(Component.java:4243)
                at java.awt.LightweightDispatcher.retargetMouseEvent(LightweightDispatcher.java:4322)
                at java.awt.LightweightDispatcher.processMouseEvent(LightweightDispatcher.java:3986)
                at java.awt.LightweightDispatcher.dispatchEvent(LightweightDispatcher.java:3916)
                at java.awt.Container.dispatchEventImpl(Container.java:2102)
                at java.awt.Window.dispatchEventImpl(Window.java:2440)
                at java.awt.Component.dispatchEvent(Component.java:4243)
                at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
                at org.netbeans.core.TimeableEventQueue.dispatchEvent(TimeableEventQueue.java:104)
                at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
                at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
                at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
                at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
                at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
                at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

        I examined the code and it looks like getPathBounds(tree, pressedPath) returns null (don't know why and how) and then NPE arises:

                        Rectangle bounds = getPathBounds(tree, pressedPath);

        line 3501: NPE: if(e.getY() >= (bounds.y + bounds.height)) {
                            return;
                        }


        Happens in NetBeans IDE, original issue is here:
        http://www.netbeans.org/issues/show_bug.cgi?id=126170

        Nice summarization of when error appeared to users can be seen here:
        http://statistics.netbeans.org/analytics/detail.do?id=2534

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  alitvinov Anton Litvinov
                  Reporter:
                  dsimoneksunw David Simonek (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: