Community
Participate
Working Groups
Build id: I20090217-2200 Steps: 1) Create a project and linked resources inside, e.g. a.txt, b.txt, c.txt 2) Delete c.txt, you'll get an event with such a delta /[*]: {} /testProject1[*]: {DESCRIPTION} /testProject1/.project[*]: {CONTENT} /testProject1/c.txt[-]: {} 3) Recreate c.txt 4) Open .project and remove c.txt by editing it, you'll get another delta /[*]: {} /testProject1[*]: {DESCRIPTION} /testProject1/.project[*]: {CONTENT} /testProject1/a.txt[*]: {CONTENT | REPLACED} /testProject1/b.txt[*]: {CONTENT | REPLACED} /testProject1/c.txt[-]: {} Actually any change to .project will trigger an event with CONTENT | REPLACED for all linked resources.
Created attachment 127246 [details] Fix v01
Released to HEAD.
-toLink.createLink(newLink.getLocationURI(), IResource.REPLACE | IResource.ALLOW_MISSING_LOCAL, null); +if (!toLink.exists()) +toLink.createLink(newLink.getLocationURI(), IResource.REPLACE | IResource.ALLOW_MISSING_LOCAL, null); Doesn't this introduce a bug when an oldLink is being replaced with a newLink (different location) and the link is actually masking a real resource in the filesystem? In the first part of the reconcileLinks, the old link will be removed, as it's being replaced. Then the creation of the new link will never occur because toLink.exists() will return true as there's an IResource there already. Should the check be something like: if (!toLink.exists() || toLink.isLinked())
(In reply to comment #3) > ... || !toLink.isLinked() ...
(In reply to comment #3) > In the first part of the reconcileLinks, the old link will be removed, as it's > being replaced. Then the creation of the new link will never occur because > toLink.exists() will return true as there's an IResource there already. Should > the check be something like: if (!toLink.exists() || toLink.isLinked()) > True. I'll fix it and add yet another test.
Created attachment 127322 [details] Additional fix & improved test