Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330274 - JavaSearchScope#indexOf needs to be updated to deal with package fragment roots enclosed by another package fragment root
Summary: JavaSearchScope#indexOf needs to be updated to deal with package fragment roo...
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.2.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2.3   Edit
Assignee: Ian Tewksbury CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-15 13:56 EST by Ian Tewksbury CLA
Modified: 2010-11-18 08:37 EST (History)
0 users

See Also:
thatnitind: review+


Attachments
Fix Patch (2.74 KB, patch)
2010-11-15 14:00 EST, Ian Tewksbury CLA
thatnitind: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Tewksbury CLA 2010-11-15 13:56:18 EST
The JavaScript tooling allows for a package fragment root to be enclosed by another package fragment root.  The JavaSearchScope#indexOf method simply returns the first package fragment root it finds that ecnloses the given path.  The problem is there maybe another package fragment root contained within the first applicable root that is more specific to the given path and thus should be used.

Fix is to update the method to look through all of the possible container paths to find the most specific root for the given path.
Comment 1 Ian Tewksbury CLA 2010-11-15 14:00:14 EST
Created attachment 183149 [details]
Fix Patch

Patch that updates JavaSearchScope#indexOf to find the most specific container path that encloses the given path.

Passes all existing JUnits.
Comment 2 Nitin Dahyabhai CLA 2010-11-17 17:45:17 EST
Committed to 3.2.3 and HEAD, thanks, Ian.
Comment 3 Ian Tewksbury CLA 2010-11-18 08:37:59 EST
I just noticed my comment in this patch is wrong:
//if have not found answer yet or the new answer is not enclosed by the previous answer and is thus more specific

should read
//if have not found answer yet or the new answer is does not enclose the previous answer and is thus more specific