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.
Before the DataObject could be got through the cookies: DataObject do = node.getCookies(DataObject.class); But now this method doesn't work. It returns null. Either this approach has to be repaired or a new one has to be provided. The defect can be reproduced in the XSLT project. - Open the attached project - Open the xsl1.xsl file - The XSLT editor appears - DnD any element from the palette (Strndard NetBeans palette) to center region of the XSLT editor. - The NPE happens as described in the issue #97407
The defect is declared as P1 because of the blocked issue 97407 has the same priority. It blocks almost all testing work for the XSLT editor.
Created attachment 39508 [details] The XSLT project to reptoduce the defect
You are right that it is desirable for data object's nodes to return their DataObject as a cookie. However this contract is not enforced in general, only followed by individual implementation. I am not sure what the implementation of your node is, however it is not up to me, it is up to you to find that out. Unless the node is directly org.openide.loaders.DataNode, this issue is invalid for openide/loader. It may be valid for some other module, however from the point of the general infrastructure I close it as invalid. Free free to reassign to other module and reopen.
I suppose the Common Palette is the most suitable module. Because the palette item node used to return the DataObject from the cookies before (5.5.1 branch), I supposed that it was provided by a base class. But now, as Jaroslav sad , it is a decision of the specific node implementation. Actually it doesn't matter for me what way I can get the DataObject. But I'd like to get it someway. :-) Maybe you can put it in cookies directly in the implementation of your PaletteItemNode? Or maybe you can provide another way to get it? I've analysed the code a bit and have found that objects available from cookies are only those which are specified there: org.netbeans.modules.palette.PaletteEnvironmentProvider private PaletteItemNode createPaletteItemNode(PaletteItemHandler handler) { line: 156 Also I have tried to find usage of the method org.netbeans.spi.palette.PaletteFactory public static PaletteController createPalette( String rootFolderName, PaletteActions customActions, PaletteFilter filter, DragAndDropHandler dndHandler ) It seems this method isn't covered by any test. It only is used by my code and also probably by the org.netbeans.modules.vmd.palette.PaletteKit private class DNDHandler extends DragAndDropHandler { line 362
fixed in trunk /cvs/core/palette/src/org/netbeans/modules/palette/PaletteItemNode.java,v <-- PaletteItemNode.java new revision: 1.14; previous revision: 1.13