Community
Participate
Working Groups
When I upgrade to a new build, I keep my old workspace. When I re-import all my binary plugins, I will often get an error that one or more fragments (*.win32) cannot be deleted. This leads to several problems: 1. If I go to the navigator and try to delete the fragment (and remove its contents from disk), I get an error that the fragment cannot be deleted because the .project file is missing (I think it would be OK to delete the project in this case anyway). 2. I trigger the creation of the .project file by adding a project reference and try to delete the fragment again. I get another error saying the project cannot be deleted but there are no further details and nothing in the log. Furthermore, the .project was removed from the file system but not from the navigator (i.e. the project is out-of-sync). 3. I suspect that the deletion cannot occur becuase the import of the fragment which failed either left the jar file for the plugin open or locked in the OS. I verified this by shutting down Eclipse and restarting. I could then delete the fragment. I will enter a separate report againsts PDE for this as well. It would be nice if the delete failure indicated why the delete failed and didn't leave the project in an inconsistent state.
Bug 26296 has been logged against PDE for the jar file being locked or open after the import.
*** Bug 26465 has been marked as a duplicate of this bug. ***
Old summary: [resources] Cannot delete project after failed binary project import we should investigate making the delete operation best-case so we try and delete as much as we can. Also, when there are resources which we cannot delete, we should leave the parent container in a consistent state and not out of sync with the file system.
It looks like the old best effort deletion code still exists. This is currently dead code, so it should either be revived or removed. The unreferenced delete methods are: FileSystemResourceManager.delete DeleteVisitor class three delete methods on FileSystemStore.
Created attachment 2881 [details] patches for core.resources and core.tests.resources Deletes open projects by best-effort using the (revived) DeleteVisitor. Please verify and release.
Released code for best-case deletion for projects. Need to add code for folders as well.
Created attachment 2995 [details] patches for core.resources and core.tests.resources Same fix applied for when deleting folders. Additional test case for folder deletion. Test cases are platform-specific: Windows and Linux (w/natives). I ran all tests in both platforms, with no errors.
Reviewed and released into HEAD.