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

Summary: Delete operates on lowest rather than highest package component in reduced tree mode
Product: java Reporter: Jan Becicka <jbecicka>
Component: ProjectAssignee: Tomas Zezula <tzezula>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: P4    
Version: 7.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 211060    
Bug Blocks: 53192    

Description Jan Becicka 2012-03-28 19:06:39 UTC
org
  + foo.bar
Select foo.bar and invoke "Delete"

Expected result: "foo.bar" 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 refactoring.java.ui.ContextAnalyzer 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 refactoring.java 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