Bug 98378 - [search] Can't find declarations in hierarchy of interface.
Summary: [search] Can't find declarations in hierarchy of interface.
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC3   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 99938
  Show dependency tree
 
Reported: 2005-06-03 16:48 EDT by Brian Miller CLA
Modified: 2005-06-16 12:46 EDT (History)
1 user (show)

See Also:


Attachments
Patch to fix this issue (1.90 KB, patch)
2005-06-13 08:42 EDT, Frederic Fusier CLA
no flags Details | Diff
Test cases added to JavaSearchBugsTests (2.95 KB, patch)
2005-06-13 08:44 EDT, Frederic Fusier CLA
no flags Details | Diff
New patch to fix this issue (11.04 KB, patch)
2005-06-14 06:36 EDT, Frederic Fusier CLA
no flags Details | Diff
Modified test case in JavaSearchMultipleProjectsTests (925 bytes, patch)
2005-06-14 06:39 EDT, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.