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.
The NullPointerExcetion or StackOverflowError is thrown from ImageUtilities.ToolTipImage.getProperty for key "url" when no URL is known. The NPE is thrown when icon is not yet initialised. The SOE is thrown when it's already initialised.
The proposed workaround with: EXPECTED_ICON == icon does not work as the DataNode (JavaNode superclass) annotates the icon by fs annotations, so the super call does not return the EXPECTED_ICON. As the setIconBase() is final the "url" property is only way how to find out that the icon was changed. Another (last resort) solution is to extend the JavaNode API with a boolean specifying if the icons should be computed or not. But this will require to find JN subclasses which set own icon base.
Created attachment 148185 [details] Possible patch Possible patch
I can simulate NPE. I don't know how to simulate StackOverflow. What is the order of calls?
First you need to call getIcon() to initialise the icon and after then call getProperty("url").
changeset: 1fd35694ee30 user: Jaroslav Tulach <jtulach@netbeans.org> date: Tue Jul 22 11:08:18 2014 +0200 summary: #245854: More sticky 'url' property when composing and altering images Pull the changeset to have it immediately in your repository.
Thanks a lot!
Nearly perfect. But does not work for merged images which is a common case for the DataNode. The images are merged by the FS.annotateIcon().
Improved fix per Tomáš's request: changeset: ca6f15ae45ee tag: tip parent: 1fd35694ee30 user: Jaroslav Tulach <jtulach@netbeans.org> date: Tue Jul 22 13:47:14 2014 +0200 summary: In case of merging of images, keep the URL from the master image
Works fine. Thanks!
Integrated into 'main-silver', will be available in build *201407250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/1fd35694ee30 User: Jaroslav Tulach <jtulach@netbeans.org> Log: #245854: More sticky 'url' property when composing and altering images
*** Bug 246153 has been marked as a duplicate of this bug. ***
*** Bug 248349 has been marked as a duplicate of this bug. ***
*** Bug 252903 has been marked as a duplicate of this bug. ***