Community
Participate
Working Groups
Created attachment 128680 [details] Test 1 Build ID: HEAD Steps To Reproduce: IResource#setLinkLocation(childLoc, IResource.NONE, getMonitor()); I'm seeing the resources under the linked resource not being automatically refreshed / updated. The API doesn't mention this, in fact there's a BACKROUND_REFRESH flag which can be passed for the refresh not be done in-line (a la Open Project). Having a look at the code Resource#setLinkLocation does: if ((updateFlags & IResource.BACKGROUND_REFRESH) != 0) { workspace.refreshManager.refresh(this); monitor.worked(Policy.opWork * 90 / 100); } else { refreshLocal(DEPTH_INFINITE, Policy.subMonitorFor(monitor, Policy.opWork * 90 / 100)); } which suggests that the IResource should be up to date after the setLinkLocation call. More information: Test attached
Comment: this is not a problem with setLinkLocation(), I suspect this is a problem with the alias manager. doing the following works properly: nonExistingFolderInExistingProject.setLinkLocation(childLoc, IResource.NONE, getMonitor()); assertTrue("2.0", existingFolderInExistingFolder.members().length == 1); assertTrue("3.0", existingFolderInExistingFolder.members()[0].getName().equals("foo")); assertTrue(nonExistingFolderInExistingProject.getLocation().equals(childLoc)); assertTrue("2.0", nonExistingFolderInExistingProject.members().length == 1); assertTrue("3.0", nonExistingFolderInExistingProject.members()[0].getName().equals("foo")); nonExistingFolderInOtherExistingProject.setLinkLocation(parentLoc, IResource.NONE, getMonitor()); but since the unit test calls both setLinkLocation() successively, it fails, as follows: nonExistingFolderInExistingProject.setLinkLocation(childLoc, IResource.NONE, getMonitor()); nonExistingFolderInOtherExistingProject.setLinkLocation(parentLoc, IResource.NONE, getMonitor()); assertTrue("2.0", existingFolderInExistingFolder.members().length == 1); assertTrue("3.0", existingFolderInExistingFolder.members()[0].getName().equals("foo")); assertTrue(nonExistingFolderInExistingProject.getLocation().equals(childLoc)); assertTrue("2.0", nonExistingFolderInExistingProject.members().length == 1); assertTrue("3.0", nonExistingFolderInExistingProject.members()[0].getName().equals("foo")); This is because the second setLinkLocation somehow messes up the alias of the first one.
This is now fixed on the e4 resource CVS HEAD. The included regression test passes successfully.
Thanks Serge!