Bug 24045

Summary: Error deleting parent folder of source folder
Product: [Eclipse Project] JDT Reporter: John Arthorne <john.arthorne>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 2.0   
Target Milestone: 2.1 RC1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description John Arthorne CLA 2002-09-24 12:30:12 EDT
Build 20020917

1) Create a new java project
2) Create a new source folder "foo/bar".
3) Create a class inside the source folder
4) In the packages view, try to delete the folder "foo".

-> The source folder disappears, but the "foo" folder is still in the packages view

5) Look in the navigator, the "foo" folder is not there
6) Back in the packages view, try to delete the "foo" folder again

-> Error occurs, claiming resource /Project/foo does not exist.
Comment 1 Martin Aeschlimann CLA 2002-09-25 05:17:34 EDT
20020920 (M1)
can't reproduce: step 5), looking in the navigator:
  folder foo exists is navigator (and in the package view).
Comment 2 John Arthorne CLA 2002-09-25 09:39:49 EDT
Are you saying that the folder still exists after attempting to delete it? 
Isn't that a bug?  Do you still get an error if you try to delete a second time?
 I will grab the new build and try again.
Comment 3 John Arthorne CLA 2002-09-25 13:58:41 EDT
I can reproduce the error in build 20020924.  Exact same steps, same results.
Comment 4 Martin Aeschlimann CLA 2002-09-27 05:07:23 EDT
20020924
Tried again, can't reproduce!

1. Open New Java project wizard.
   Enter project name, go to second page, set source folder to foo/bar
   (output folder is bin)
   Create.
2. Select foo/bar in package explorer, add a class A to it.
3. Select foo/bar in package explorer, press delete.
4. Package explorer now shows folders  src and bin
5. Go to navigator: also shows src and bin

I guess you could say that src should be deleted as well. I think by design 
Java Core only deletes the top folder (bar).


Comment 5 John Arthorne CLA 2002-09-27 09:13:10 EDT
Your step 3 is wrong.  After your step 2 the packages view contains source
folder "foo/bar" AND plain folder "foo".  Step 3 should read:

3) Select plain folder "foo" in package explorer, press delete
Note the PR title: "Error deleting PARENT FOLDER of source folder" ;)
Comment 6 John Arthorne CLA 2003-02-06 18:18:58 EST
*** Bug 30008 has been marked as a duplicate of this bug. ***
Comment 7 Erich Gamma CLA 2003-02-11 19:29:05 EST
Other scenarios:
*  delete foo in the navigator
   ->foo folder still shows up
*  close and reopen the package explorer
   ->the foo folder has disappeared
   ->this indicates a JavaElementDelta problem.

The delta sent out when deleting foo in the navigator is:
Java Model[*]: {CHILDREN}
	ZZZTest[*]: {CHILDREN}
		foo/bar[-]: {}

Notice that the foo folder deletion is missing in the delta.

Moving to JDT/Core
Comment 8 Jerome Lanneluc CLA 2003-02-12 12:33:57 EST
DeltaProcessor was wrongly attempting to filter out ResourceDeltas that have a 
child corresponding to a PakcageFragmentRoot delta.

Fixed and added regression test JavaElementDeltaTests.testRemoveNonJavaFolder()
Comment 9 David Audel CLA 2003-02-24 04:51:29 EST
Verified.