This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 175785 - NullPointerException at java.lang.Class.isAssignableFrom
Summary: NullPointerException at java.lang.Class.isAssignableFrom
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@guibuilder
URL: http://statistics.netbeans.org/except...
Keywords:
: 181190 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-10-30 15:04 UTC by jesterfred
Modified: 2011-10-13 14:58 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 161228


Attachments
stacktrace (2.15 KB, text/plain)
2009-10-30 15:05 UTC, jesterfred
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jesterfred 2009-10-30 15:04:58 UTC
Build: NetBeans IDE 6.7 (Build 200906241340)
VM: Java HotSpot(TM) 64-Bit Server VM, 14.1-b02, Java(TM) SE Runtime Environment, 1.6.0_15-b03
OS: Linux, 2.6.31-14-generic, amd64

User Comments:
jesterfred: Added a Class to the Palette as a component then dragged it onto the app GUI.



Stacktrace: 
java.lang.NullPointerException
        at java.lang.Class.isAssignableFrom(Class.java:0)
        at org.netbeans.modules.form.HandleLayer$NewComponentDrag.end(HandleLayer.java:3112)
        at org.netbeans.modules.form.HandleLayer$NewComponentDropListener.drop(HandleLayer.java:3285)
        at java.awt.dnd.DropTarget.drop(DropTarget.java:434)
        at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:500)
        at sun.awt.X11.XDropTargetContextPeer.processDropMessage(XDropTargetContextPeer.java:165)
Comment 1 jesterfred 2009-10-30 15:05:04 UTC
Created attachment 90306 [details]
stacktrace
Comment 2 Jan Stola 2009-11-20 02:07:02 UTC
The corresponding code is

    Border.class.isAssignableFrom(paletteItem.getComponentClass())

i.e. paletteItem.getComponentClass() is null. In other words, the dragged class cannot be loaded.

It is strange that the NewComponentDrag was not canceled before, see NewComponentDrag.init() line 3053. The only idea I have is that the drop() came immediately after initialization of NewComponentDrag, i.e., before it was canceled through invokeLater() invoked in NewComponentDrag.init().
Comment 3 Jan Stola 2010-02-25 06:34:25 UTC
*** Bug 181190 has been marked as a duplicate of this bug. ***
Comment 4 Jan Stola 2011-10-13 14:58:59 UTC
Fixed.

Modified file: http://hg.netbeans.org/jet-main/rev/16efc53a47b5