| Summary: | Creating a file in place of a linked resources, then deleting that linked resource from the .project file leaves the workspace in an inconsistent state. | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Serge Beauchamp <serge> | ||||||||
| Component: | Resources | Assignee: | Serge Beauchamp <serge> | ||||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | sptaszkiewicz, Szymon.Brandys | ||||||||
| Version: | 3.7 | Flags: | serge:
review?
(Szymon.Brandys) |
||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Whiteboard: | stalebug | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Serge Beauchamp
Created attachment 204577 [details]
Fix
Fix for this issue. The approach is to have this bug resolved when the user refreshes the workspace.
Szymon, can you review this patch for me please? Thanks. I think we may reproduce using easier steps: 1) Create a project 'p1' 2) Create a linke file under 'p1' and link it to anything 3) Close the project and remove <linkedResources> section from .project 4) Open the project and refresh The linked file is still there. If just do: 1) Create a project 'p1' 2) Create a linke file under 'p1' and link it to anything 3) Remove <linkedResources> section from .project 4) Refresh .project The linked resource will be removed. I think that the problem is Project#reconcileLinksAndGroups? I'll check if I am right. Serge, could you attach a test? These steps fail too: 1) Create a project 'p1' 2) Create a linked file under 'p1' and link it to anything 3) Close Eclipse and remove <linkedResources> section from .project 4) Restart Eclipse and refresh 'p1' Looking closer at #reconcileLinksAndGroups, it indeed does not do a good job for failing cases described in this bug. If linked resources were removed from .project while the project was closed, #reconcileLinksAndGroups will not remove them from the workspace. setting target to 3.8M5 (In reply to comment #4) > These steps fail too: > 1) Create a project 'p1' > 2) Create a linked file under 'p1' and link it to anything > 3) Close Eclipse and remove <linkedResources> section from .project > 4) Restart Eclipse and refresh 'p1' > > Looking closer at #reconcileLinksAndGroups, it indeed does not do a good job > for failing cases described in this bug. If linked resources were removed from > .project while the project was closed, #reconcileLinksAndGroups will not remove > them from the workspace. How can #reconcileLinksAndGroups get the list of linked resources in the workspace, and validate them against the description.getLinks() list without a visitor? It seems like adding a visitor in #reconcileLinksAndGroups would be more of a performance issue than the current fix in the RefreshLocalVisitor, what do you think? Sege, still in the plan for M6? We do not have much time. your suggestion looks good Szymon, I'll get back to you tomorrow with a fix. Created attachment 215072 [details]
Fix and JUnit test
Here's a new fix moving the resolution to the reconcile() code instead of in the RefreshVisitor code.
Created attachment 215073 [details]
Fix and JUnit test
Again, but with less spurious changes.
(In reply to comment #10) > Created attachment 215073 [details] > Fix and JUnit test > > Again, but with less spurious changes. I'm not sure where the line changes are comming from, since I verified twice I only changed the reconcileLinksAndGroups() method in Project.java. The diff is misleading in terms of how much change there is. To summarize it, this was the old implementation: reconcileLinksAndGroups() { // old code } The new implementation looks like that: reconcileLinksAndGroups() { try { // old code } finally { // new code } } Szymon, can you review the changes please? thanks. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |