Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361876

Summary: Search for reference on Injected method with parameter
Product: [Tools] AJDT Reporter: CHENG Yuk Pong <eclipse>
Component: CoreAssignee: AJDT-inbox <AJDT-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aclement, andrew.eisenberg
Version: 2.1.3   
Target Milestone: 2.2.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description CHENG Yuk Pong CLA 2011-10-24 22:07:56 EDT
Build Identifier: 20110916-0149

Search for reference (Ctrl-Shift-G) does not work on injected method with parameter. (It is okay if I remove all parameters)

Reproducible: Always

Steps to Reproduce:
1. Create a project with following files:


public class Test {
}

public aspect TestAspect {
	public void Test.caller(Test t) {
		t.method(null);
	}
	public void Test.method(String arg1) {
	}
}

2. Select "Test.method(String arg1)", right-click -> "Reference" -> "Workspace"

3. Expected: found the reference in Test.caller,  Actual Result: nothing found;


P.S.
 If you change "Test.method(String arg1)" to "Test.method()", everything works.
Comment 1 Andrew Eisenberg CLA 2011-10-25 08:36:02 EDT
I have been able to reproduce.
Comment 2 Andrew Eisenberg CLA 2011-11-07 19:40:50 EST
Turns out there were two problems here and neither having to do with searching exactly.  Rather, the problem is that in the case you show, an incorrect element was chosen for searching.  And because the correct element was not selected for a search, the search failed to find any references.

I have a fix in my workspace, but it needs some unit tests before I can commit.
Comment 3 Andrew Eisenberg CLA 2011-11-08 13:00:38 EST
Committed the fix with regression tests.  Resolving.
Comment 4 Andrew Eisenberg CLA 2011-12-12 19:43:22 EST
*** Bug 366470 has been marked as a duplicate of this bug. ***