Community
Participate
Working Groups
The function org.eclipse.imp.model.internal.CompilationUnitRef.getSource() builds the OS file path for a resource with this piece of code: String absPath= (fPath.getDevice() != null) ? fPath.toOSString() : (fPath.isAbsolute() ? ResourcesPlugin.getWorkspace().getRoot().getLocation().append(fPath).toOSString() : fProject.getRawProject().getLocation().append(fPath).toOSString()); This seems to cause problems when a project is not in the workspace root. In my case I have an absolute fPath = [projectName]/[resourcePathInProject] which leads to [workspaceRoot]/[projectName]/[resourcePathInProject] instead of [projectOSPath]/[resourcePathInProject]
The following code works in my case, but I did not test if I broke something else: String absPath = (fPath.getDevice() != null) ? fPath.toOSString() : (fProject.getRawProject().getLocation().append( fPath.isAbsolute() ? fPath.removeFirstSegments(1) : fPath).toOSString());