| Summary: | [Preferences] WorkingCopyPreferences attempts to set value of removed node | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Walter Harley <eclipse> | ||||||||||
| Component: | Resources | Assignee: | Szymon Brandys <Szymon.Brandys> | ||||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||||
| Severity: | major | ||||||||||||
| Priority: | P3 | CC: | agrealis, benno.baumgartner, daniel_megert, dj.houghton, drews, jackie, martinae, Michael_Rennie, sieg, Szymon.Brandys, Tod_Creasey | ||||||||||
| Version: | 3.2 | Keywords: | helpwanted | ||||||||||
| Target Milestone: | 3.4 M7 | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Windows XP | ||||||||||||
| Whiteboard: | hasPatch | ||||||||||||
| Bug Depends on: | |||||||||||||
| Bug Blocks: | 139284 | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Walter Harley
*** Bug 139284 has been marked as a duplicate of this bug. *** *** Bug 155413 has been marked as a duplicate of this bug. *** *** Bug 162924 has been marked as a duplicate of this bug. *** *** Bug 186389 has been marked as a duplicate of this bug. *** *** Bug 197599 has been marked as a duplicate of this bug. *** *** Bug 208231 has been marked as a duplicate of this bug. *** *** Bug 208368 has been marked as a duplicate of this bug. *** Created attachment 82171 [details] suggested fix Fix suggestion for core.resources: When the project preferences files in .settings is deleted, don't remove the node, just clear its settings as the nodes might still be referenced. As Walter explains in comment 0, the preference framework internally deletes the .settings file when the last project specific setting has been cleared. By doing that it also removes the nodes by calling removeNode, making the preferences unusable for any clients still holding references on it. Clients like the preference pages should still be able to read, modify and flush that preference. The fact that the .settings file has been removed as it isn't necessary anymore, is just an implementation detail to them. DJ, it would be great if you could have a look at my suggested fix. We really need fix this problem. It's too easy to reproduce the failure. Note that the proposed fix is in Platform Resources. The patch looks fine and it works well. One thing to note is that with the patch applied there are 2 JUnit test failures in the resources.tests. In both cases it looks like we are checking for the existence of a node after a deletion but with this patch the behavior has changed so the node still exists, but is empty. Thanks Dani. Created attachment 88401 [details]
Tests update
I am not sure if I had make it right but I am attaching tests fix that reflects (in my opinion) changes introduces by the patch.
Thanks Krzysztof. However I see more test that fails. Other failures are in CharsetTest#testMovingProject and ProjectPreferencesTest#testProjectMove. Actually the issue is CharsetTest#testMovingProject and one of ProjectPreferenceSessionTest test is broken too. I'm investigating... I think that this should be solved on the UI level. WorkingCopyPreferences should be aware of the state of underlying ProjectPreferences. I asked Tod to look at the issue and we will try to work out the solution. Can you explain why you think the patch from comment 8 is not correct? As explain in comment 8, the fact that the .settings file has been removed is just an implementation detail. You can't expect the UI to know about this and follow this. >I think that this should be solved on the UI level.
-1 for that.
What's the state here? Any answers to the questions in comment 17. I'd like to understand what's the problem with patch proposed in comment 8. Created attachment 97949 [details]
Martin's patch with fixed tests
There is one more issue to handle when the patch is introduced. The scenario is: 1) create "Project1" and "Project2" and set some project preferences on both, e.g. encoding 2) delete "Project2" 3) rename "Project1" to "Project2" 4) notice, that "Project2" uses now the OLD preferences of the removed project, it means "no preferences" 5) restart, fixes it Created attachment 97991 [details]
The patch is smaller now, but better
The latest patch with a minor modification released to HEAD. Verified in I20080502-0100. |