Bug 98378

Summary: [search] Can't find declarations in hierarchy of interface.
Product: [Eclipse Project] JDT Reporter: Brian Miller <bmiller>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dirk_baeumer
Version: 3.1   
Target Milestone: 3.1 RC3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 99938    
Attachments:
Description Flags
Patch to fix this issue
none
Test cases added to JavaSearchBugsTests
none
New patch to fix this issue
none
Modified test case in JavaSearchMultipleProjectsTests none

Description Brian Miller CLA 2005-06-03 16:48:24 EDT
Steps:
1) Open type java.lang.CharSequence.
2) Right click on length().
3) Choose Declarations>>Hierarchy.
4) See that wrongly no declarations are found.  Eg, missed is String.length().
Comment 1 Dirk Baeumer CLA 2005-06-04 12:47:46 EDT
Looks like a JDT/Core bug. No references are reported from search.
Comment 2 Frederic Fusier CLA 2005-06-13 08:42:15 EDT
Created attachment 22914 [details]
Patch to fix this issue

External Jar files paths are stored in HierarchyScope with system dependent
path.
This made HierarchyScope.encloses(String) method to return false on system
which does not use '/' as separator due to the fact that documentPath given as
argument is get from an IPath...
Comment 3 Frederic Fusier CLA 2005-06-13 08:44:36 EDT
Created attachment 22916 [details]
Test cases added to JavaSearchBugsTests

Note that these test cases need jclMin1.5.jar and jclMin1.5src.zip files
modification attached with bug 97547
Comment 4 Philipe Mulet CLA 2005-06-13 12:07:26 EDT
+1 for RC3

Dirk - pls vote for this one. See impact on refactoring
Comment 5 Frederic Fusier CLA 2005-06-13 12:12:33 EDT
I've run JDT-UI tests (refactoring & automated) and they all pass...
However, I saw an NPE while searching for declaration of "equals" method in
Object hierarchy...
Double-checking with Jerome, it seems that fix was not done at the right place...
I'll come back with another one soon...
Comment 6 Philipe Mulet CLA 2005-06-14 05:04:33 EDT
Forgot to CC Dirk to obtain vote.
Comment 7 Dirk Baeumer CLA 2005-06-14 05:36:28 EDT
+1.
Comment 8 Frederic Fusier CLA 2005-06-14 06:36:41 EDT
Created attachment 23039 [details]
New patch to fix this issue

As it is specified in IJavaSearchScope#encloses(String), resourcePath must
start with a full OS path in case of JAR file. So, modify IndexManager and
JavaSearchScope to use full OS path instead of path while handling jar file
path (ie. with a device).

Also fix NPE issue which was a side effect discovered while reporting match.
MatchLocator wrongly creates an handle on an initializer although its parent
type was binary...
Comment 9 Frederic Fusier CLA 2005-06-14 06:39:26 EDT
Created attachment 23040 [details]
Modified test case in JavaSearchMultipleProjectsTests

As JavaSearchScope now stores full OS path for external jar files, need to
modify specific test case output...
Comment 10 Frederic Fusier CLA 2005-06-14 12:36:12 EDT
Fixed and released in HEAD.
Comment 11 Maxime Daniel CLA 2005-06-16 12:40:36 EDT
Verified using build N20050616-0010 + JDT Core HEAD.