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.
Try the following test: 1. create java class 2. go to property sheet 3. change name notice that the property sheet will disappear. JavaNode.createSheet invokes super.createSheet() which adds a read/write property that invoked obj.rename when the setValue method is invoked, this invocation causes the property sheet to disappear.
It looks like the problem is that the selection is not retained after the node rename. It applyies to all nodes not only to JavaNodes. I'm going to investigate it more.
It seems that this bug only affects DataNodes. (Renaming another nodes e.g. JavaMethods is OK). It looks like the problem is that the DataNode first fires PropertyChange of it's parent from the parent to null. After this the PropertyChange of the name is fired. This probably causes the selection loss. The parent property change seems to be result of the run of FolderChilderen$Addition
I am taking this issue.
This is a regression and as such I think this should be included in NB 3.3.2.
Fixed in trunk: org.openide.loaders.DataObject revision 1.71 Diff: http://www.netbeans.org/source/browse/openide/src/org/openide/loaders/DataObject.java.diff?r1=1.70&r2=1.71&f=H
FWIW (1) the regression was caused by my fix of issue #20699; (2) I approve of the fix - it would have been desirable anyway, as the #20699 patch just exposed an existing bug. The #20699 patch caused the data node to be recreated whenever the primary file of a data object changed or the data object was recreated (even if the type of data object did not change) - however until the patch for #22258, the primary file was signalled as having changed after a simple (in-folder) rename, when in fact the primary file does not change identity in this situation. Petr I suggest a unit test: rename a simple DataObject and confirm that PROP_PRIMARY_FILE is *not* fired.
verified in [orion CE](020416_1) & [nb_dev](20020417)
Resolved for 3.4.x or earlier, no new info since then -> closing.