Bug 12551 - Search finds some but not all method refs
Summary: Search finds some but not all method refs
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 F2   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-01 12:09 EST by Nick Edgar CLA
Modified: 2002-06-03 12:21 EDT (History)
0 users

See Also:


Attachments
Export.zip containing the relevant sources (14.68 KB, application/zip)
2002-04-01 12:12 EST, Nick Edgar CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2002-04-01 12:09:05 EST
Build 20020328

I have the following code pattern (non-essential aspects snipped out).
When I do a search for references to ActionGroup.updateActionBars(), it finds 
them all.
However, if I select the updateActionBars() reference in 
ResourceNavigator.updateActionBars(IStructuredSelection) and search for 
references, it matches the reference just selected (correct) and 2 of the 5 
refs in ResourceNavigatorActionGroup.updateActionBars().
Either it should match none of these (if the search means all refs to 
ResourceNavigatorActionGroup.updateActionBars()) or all of them (if the search 
includes all refs to ActionGroup.updateActionBars()).

public class ActionGroup {
    public void updateActionBars();
}

public class ResourceNavigator {
	protected ResourceNavigatorActionGroup actionGroup;
	protected void updateActionBars(IStructuredSelection selection) {
		actionGroup.setContext(new ActionContext(selection));
		actionGroup.updateActionBars();
	}
}

public class ResourceNavigatorActionGroup extends ActionGroup {
        // these all directly subclass ActionGroup
	private GotoActionGroup gotoGroup;
	private OpenActionGroup openGroup;
	private RefactorActionGroup refactorGroup;
	private SortAndFilterActionGroup sortAndFilterGroup;
	private WorkspaceActionGroup workspaceGroup;

	/**
	 * Overrides the super implementation to delegate to the subgroups.
	 */
	public void updateActionBars() {
		gotoGroup.updateActionBars();
		openGroup.updateActionBars();
		refactorGroup.updateActionBars();
		sortAndFilterGroup.updateActionBars();
		workspaceGroup.updateActionBars();
	} 
}
Comment 1 Nick Edgar CLA 2002-04-01 12:10:18 EST
The 2 refs matched above in ResourceNavigatorActionGroup.updateActionBars() 
were:
openGroup.updateActionBars();
workspaceGroup.updateActionBars();
The other 3 were not matched.

Comment 2 Nick Edgar CLA 2002-04-01 12:12:54 EST
Created attachment 533 [details]
Export.zip containing the relevant sources
Comment 3 Jerome Lanneluc CLA 2002-05-27 08:49:23 EDT
The search means all refs to ResourceNavigationActionGroup.updateActionBars() 
or one of its superclasses (in this case ActionGroup.updateActionBars()) 

The 3 method references gotoGroup.updateActionBars(), 
refactorGroup.updateActionBars() and sortAndFilterGroup.updateActionBars() are 
not references to ActionGroup.updateActionBars() since the respective receiver 
types overrides updateActionBars().

So matching one of this 3 references would be incorrect since the receiver 
types are not a ResourceNavigationActionGroup or an ActionGroup.
Comment 4 Kent Johnson CLA 2002-06-03 12:21:22 EDT
Closed again... incorrectly marked for verification.