Bug 21879

Summary: Search could be optimized based on visibility
Product: [Eclipse Project] JDT Reporter: Peter Burka <peter_burka>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: akiezun, n.a.edgar
Version: 2.0   
Target Milestone: 2.1 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Peter Burka CLA 2002-07-24 18:48:20 EDT
When I search for references to a private method or field in the Workspace, 
the search doesn't seem to be any faster than a search for a public method or 
field.

Sometimes I search within the hierarchy instead of the workspace, as this 
operation is 2-3 times faster than a Workspace search. But it's not a useful, 
as it misses references in inner types.

I suspect that this search could be made faster by recognizing that the 
private field can only be referenced by the class itself, and its innner 
classes. Similar optimizations can be made for protected and default members.
Comment 1 Adam Kiezun CLA 2002-07-25 04:34:29 EDT
sounds similar to bug 3447
Comment 2 Philipe Mulet CLA 2002-07-25 05:49:20 EDT
Indeed. Currently, search is able to find appropriate matches in incorrect code 
as well, and this is a nice feature which we want to preserve.

Therefore, private methods may be referenced (incorrectly) from the outside, 
which means we have to look for them. 

If Java tooling only had to deal with correct code, things could be so much 
simpler...
Comment 3 Philipe Mulet CLA 2002-07-25 06:21:21 EDT
Closing.
Comment 4 Philipe Mulet CLA 2002-07-25 07:27:46 EDT
*** Bug 16176 has been marked as a duplicate of this bug. ***
Comment 5 Peter Burka CLA 2002-07-25 09:51:04 EDT
Could we search the current file and files with errors? (And probably files 
which haven't been built, too).

That would still narrow down the search significantly.