Bug 178596 - [search] Search for method references does not find references to interface method
Summary: [search] Search for method references does not find references to interface m...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P2 major with 2 votes (vote)
Target Milestone: 3.3.2   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 208756 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-03-21 12:49 EDT by Markus Keller CLA
Modified: 2007-12-12 05:30 EST (History)
4 users (show)

See Also:
philippe_mulet: pmc_approved+


Attachments
Proposed patch (5.95 KB, patch)
2007-11-06 06:02 EST, Frederic Fusier CLA
no flags Details | Diff
Proposed patch for 3.3.2 (289.34 KB, patch)
2007-11-13 07:20 EST, 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 Markus Keller CLA 2007-03-21 12:49:06 EDT
I20070321-0010

- new workspace
- import org.eclipse.debug.core and org.eclipse.jdt.junit as binary plug-ins
- search for references to org.eclipse.debug.internal.core.LaunchConfiguration.launch(String,IProgressMonitor)

Was: 1 match in org.eclipse.jdt.debug.ui_*.jar

Expected: 2 more matches in org.eclipse.jdt.junit_*.jar as when searching for org.eclipse.debug.core.ILaunchConfiguration.launch(String,IProgressMonitor). The additional matches should have MethodReferenceMatch#isSuperInvocation() == true.
Comment 1 Frederic Fusier CLA 2007-11-05 11:16:52 EST
*** Bug 208756 has been marked as a duplicate of this bug. ***
Comment 2 Frederic Fusier CLA 2007-11-05 11:19:48 EST
Looks like a side effect of fix for bug 73401 and must be definitely fixed for 3.4... 
Comment 3 Frederic Fusier CLA 2007-11-05 12:28:57 EST
In fact, this regression has been introduced while fixing bug 156491 and bug 157814...

Bug 156491 comment 6 warned about potential missing matches when the hierarchy includes an interface, but I removed them after remark done in bug 157814 comment 8.

I'll try to figure out how can I solve this bug without introducing regressions on those bugs...
Comment 4 Daniel Schneller CLA 2007-11-06 01:59:12 EST
> Looks like a side effect of fix for bug 73401 
> and must be definitely fixed for 3.4... 

IMHO this is severe and should be fixed with the next 3.3.x release as well! We rely heavily on the call hierachy and getting incomplete results is the worst thing that could happen.
I do not know the internals, but won't refactoring be affected by this?

Comment 5 Frederic Fusier CLA 2007-11-06 03:44:55 EST
(In reply to comment #4)
> IMHO this is severe and should be fixed with the next 3.3.x release as well! We
> rely heavily on the call hierachy and getting incomplete results is the worst
> thing that could happen.
>
I agree it seems a good candidate for 3.3.2. However, I didn't want to promise thing I cannot afford and first wanted to have an idea of what could be the fix for this to know whether it really could go into the maintenance stream or not...

Saying that, I'm currently testing a fix which does not seem to be too aggressive and maybe put in 3.3.2 if all tests pass...

> I do not know the internals, but won't refactoring be affected by this?
> 
No. Refactoring uses specials flags in the search pattern to ignore declaring and return types during the search and so, is not affected by this issue. That's why it's not so critical as you may think initially and explain why I didn't work on this earlier...
Comment 6 Frederic Fusier CLA 2007-11-06 06:02:16 EST
Created attachment 82186 [details]
Proposed patch

All tests pass with this patch which simply extends the verification for super invocation to all super interfaces of the method actual receiver type.
Comment 7 Frederic Fusier CLA 2007-11-06 06:03:51 EST
Jerome, Philippe, OK to backport this safe change to 3.3.2?
Comment 8 Frederic Fusier CLA 2007-11-06 06:11:50 EST
Released for 3.4M4 in HEAD stream.
Comment 9 Frederic Fusier CLA 2007-11-13 07:20:10 EST
Created attachment 82753 [details]
Proposed patch for 3.3.2
Comment 10 Jerome Lanneluc CLA 2007-11-14 04:10:20 EST
+1 for backporting to 3.3.2
Comment 11 Frederic Fusier CLA 2007-11-14 04:26:24 EST
Released for 3.3.2 in R3_3_maintenance stream.
Comment 12 Jerome Lanneluc CLA 2007-11-21 05:35:22 EST
Without this fix, valid matches are missed. As a consequence the user will not find where his/her code is used. Refactoring will be affected as well and risks to produce code that doesn't compile. This fix needs to be included in 3.3.2. Philippe please approve.
Comment 13 Philipe Mulet CLA 2007-11-21 12:30:19 EST
+1 for 3.3.2
Comment 14 Eric Jodet CLA 2007-12-12 05:30:08 EST
Verified for 3.4 M4 using build I20071211-0010