Community
Participate
Working Groups
This bug was introduced by fix for bug 202384. If we are creating a project that already has some preferences then those preferences are loaded when refreshing inside project.open() but before initialized(). Nodes are loaded properly but then they got replaced inside initialized() as the parent node was not initialized yet. Those nodes are still in loadedNodes but they do not reflect the real content of prefs files any more. We get the state were loadedNodes claim that our preferences are correctly loaded but those nodes are empty. For now, I can see two possible solutions: call removeNodes(this) inside initialize() or call ((ProjectPreferences) parent).initialize() inside load() so that even if we are refreshing, parent preferences will get initialized properly.
Created attachment 187749 [details] Patch v.0.1
Can you provide steps that show the problem? We also need additional tests.
Created attachment 187837 [details] Patch v.0.2 Patch and test showing the problem. Before bug 202384 got fixed the test would have passed. I've changed also the test for 202384 in case the test would be run on platform with default UTF-8 encoding.
Szymon, please review.
We will release the fix at the beginning of M6.
SzymonP, can you verify that the fix also fixes PDE's broken test. Thanks.
(In reply to comment #6) > SzymonP, can you verify that the fix also fixes PDE's broken test. Thanks. Yes, it does. I have tested the patch on the PDE's broken test without temporary fix that was committed there (using version 1.5).
The most severe part of the bug is that preferences are lost permanently if we call flush on the broken preferences node. This is what happens in PDE's test. It is not visible unless you compare the content of preference file on disk after the test failed to the version from their zip (or to the version after the test passed).
Created attachment 187941 [details] Patch with lazy initialization Szymon P., I remember I suggested this patch some time ago. It does not fail your tests. Could you verify that it fixes PDE problem too? If yes, we could consider fixing the issue my way.
Created attachment 187956 [details] More detailed test
Created attachment 188053 [details] Patch v.0.2 + more detailed test
Thanks Szymon. The fix is in HEAD.