Bug 209054 - [search] for references to method finds wrong interface call
Summary: [search] for references to method finds wrong interface call
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-07 11:58 EST by Markus Keller CLA
Modified: 2007-12-11 09:37 EST (History)
3 users (show)

See Also:


Attachments
Proposed patch (4.26 KB, patch)
2007-11-08 07:54 EST, Frederic Fusier CLA
no flags Details | Diff
Better proposed patch (5.29 KB, patch)
2007-11-08 10:58 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-11-07 11:58:34 EST
I20071106-0816, was OK in 3.4M3, maybe due to fix for bug 178596

Search for references to method Try#canDo() returns a wrong match. IReferenceUpdating does not declare canDo(), so the two methods are not connected:

package xy;

public class Try implements IReferenceUpdating {
	IMovePolicy fInter;
	
	boolean canDo() { // find references
		return fInter.canDo(); // not a reference
	}
}

interface IMovePolicy extends IReferenceUpdating {	
	boolean canDo();
}

interface IReferenceUpdating {}
Comment 1 Frederic Fusier CLA 2007-11-08 06:39:40 EST
Regression introduced by fix for bug 178596...
Comment 2 Frederic Fusier CLA 2007-11-08 07:54:24 EST
Created attachment 82430 [details]
Proposed patch
Comment 3 Markus Keller CLA 2007-11-08 09:15:45 EST
The proposed patch works fine for me. It also does not show the wrong matches in o.e.ant.ui any more for the example from bug 209145.
Comment 4 Frederic Fusier CLA 2007-11-08 10:58:33 EST
Created attachment 82454 [details]
Better proposed patch

Recurse first in super interfaces, then if one matches, verify that it implements the searched method...
Comment 5 Frederic Fusier CLA 2007-11-08 11:05:23 EST
Released for 3.4M4 in HEAD stream.
Comment 6 Frederic Fusier CLA 2007-11-14 04:26:37 EST
Released for 3.3.2 in R3_3_maintenance stream.
Comment 7 Frederic Fusier CLA 2007-11-21 06:20:56 EST
(In reply to comment #6)
> Released for 3.3.2 in R3_3_maintenance stream.
> 
In fact this bug didn't occur in R3_3_maintenance as the patch released in this stream for bug 178596 (https://bugs.eclipse.org/bugs/attachment.cgi?id=82753) does not have this regression => put back the target to 3.4
Comment 8 Jerome Lanneluc CLA 2007-12-11 09:37:04 EST
Verified for 3.4M4 using I20071211-0010