Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 128460

Summary: IWorkspaceRoot.findFilesForLocation fails with linked folders
Product: [Eclipse Project] Platform Reporter: Jan Ploski <jpljpl>
Component: ResourcesAssignee: John Arthorne <john.arthorne>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2 M6   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Jan Ploski CLA 2006-02-17 14:27:42 EST
I am reporting this bug against the Eclipse 3.2M4 build,
as a regression from the 3.1.1 build:

IWorkspaceRoot.findFilesForLocation(...) returns an empty array instead of
the file that is contained in a linked folder in the workspace. For example,
I have a folder linked to /usr/share/perl/5.8 and I invoke findFilesForLocation
with /usr/share/perl/5.8/Carp.pm as an argument. The file is there and I can
see it in the workspace by browsing the linked folder.

The cause of this problem seems to be in
o.e.c.i.localstore.FileSystemResourceManager.java:74

That line reads:

relative = location.relativize(testLocation);

While I think it should read:

relative = testLocation.relativize(location);

This breaks a source code lookup in the debugger of the EPIC plug-in.
The corrected version produces the expected result.
Comment 1 John Arthorne CLA 2006-02-17 14:38:15 EST
I suspect this is a duplicate of bug 122825.  It's fixed for M5 (avail later today).
Comment 2 Jan Ploski CLA 2006-02-17 14:47:17 EST
I will run my test case with 3.2M5 over the weekend.
Comment 3 Jan Ploski CLA 2006-02-18 08:12:08 EST
I just tried with M5. The bug still exists, but the offending line in
FileSystemResourceManager.java has number 75 now.
Comment 4 John Arthorne CLA 2006-02-21 14:11:29 EST
Confirmed.
Comment 5 John Arthorne CLA 2006-02-21 14:23:01 EST
Fix released