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 210315 - Delete operates on lowest rather than highest package component in reduced tree mode
Summary: Delete operates on lowest rather than highest package component in reduced tr...
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.2
Hardware: All All
: P4 normal (vote)
Assignee: Tomas Zezula
Depends on: 211060
Blocks: 53192
  Show dependency tree
Reported: 2012-03-28 19:06 UTC by Jan Becicka
Modified: 2016-07-07 07:18 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Jan Becicka 2012-03-28 19:06:39 UTC
Select and invoke "Delete"

Expected result: "" is deleted
Actual result: only bar is deleted
Comment 1 Jesse Glick 2012-04-03 22:43:10 UTC
In fact correct delete handling is implemented in Node.destroy and covered by a unit test, but it seems is intervening at some point and in NodeToFileObjectTask is picking the DataObject for org/foo/bar/ out of the Node.lookup.

I guess this is happening via ExtendedDelete? If so then the only possible fix in java.project alone would be to implement a higher-priority ExtendedDelete that delegates to SafeDeleteAction by passing in a phony Node whose only function is to hold org/foo/ in its lookup. This would work only on DELETE, not Alt-DELETE.

Of course better would be an API change to fix to permit the desired folder to be specified directly. Or do you have any other ideas?

A low priority since in this situation by definition org/foo/ is empty except for bar, so deleting org/foo/bar/ vs. org/foo/ are nearly the same operation - in fact identical for e.g. Mercurial users (after an update etc.), though not for e.g. Subversion users. The workaround is trivial - just select the newly empty org/foo/ and Delete it again.
Comment 2 Jesse Glick 2012-04-25 22:42:55 UTC
No known way of fixing without bug #211060 and a bit of corresponding work in refactoring impl. Can try to propose a patch for that if you like, else deferring.
Comment 3 Martin Balin 2016-07-07 07:18:58 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss