Community
Participate
Working Groups
Created attachment 281524 [details] A project with a failing test case demonstrating the issue According to the spec, "the modification stamp of two distinct resource states should be different if and only if one or more of the attributes listed in the specification as affecting the modification stamp have changed". The current resource implementation can break the contract. Steps to reproduce: 0. Let us have a resource R in state S0. 1. Modify R so that it has a new state, S1. Remember R's modification stamp for S1. 2. Undo the modification so that R is reverted to the original state S0, with the original modification stamp. 3. Modify R in some other way so that it has a state S2 that is different from S1. Observe that R's modification stamp for S2 is the same as R's modification stamp for S1: State ModStamp Orig S0 A Mod1 S1 B Undo S0 A Mod2 S2 B More information: Bug 84350 introduced a new API, IResource#revertModificationStamp(long). But the resource implementation was not updated to keep track of a separate "next modification counter" for a resource. This opened the door to the described issue. A similar issue existed in AbstractDocument and has been fixed in bug 109104. See https://github.com/eclipse/eclipse.platform.text/commit/77d13068054c00d1dfc27f8c47f8af7576a241e7
Can you please provide a reproducer?
(In reply to Andrey Loskutov from comment #1) > Can you please provide a reproducer? Sorry, missed the attachment. Do you want to propose a patch?
(In reply to Andrey Loskutov from comment #2) > Do you want to propose a patch? Hi Andrey, I'm not ready to propose a patch at this time, sorry. I'm not pushing on it. Just thought the issue was worth reporting, so... I should have added that modifications in steps 2 and 3 must be "affecting" ones, i.e., they must affect the modification stamp. Hopefully, this was clear from the "state chart".
(In reply to Vladimir Piskarev from comment #3) > I should have added that modifications in steps 2 and 3 must be "affecting" > ones, i.e., they must affect the modification stamp. Correction: in steps *1* and 3, sorry.