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

Bug 500786

Summary: Unable to find method reference having an enum parameter which is defined within a class in Mars
Product: [Eclipse Project] JDT Reporter: Natasha DSouza <dsouza.natasha303>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: blocker    
Priority: P3 CC: dsouza.natasha303
Version: 4.5.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Natasha DSouza CLA 2016-09-03 03:49:32 EDT
Pleae note that this issue happen for an enum defined within a class.

Please use the exact test case

package ind.pakistan.life.search
public class TestCompareAtrributeFilte {
	public enum CompareType {
			EQUAL,NOT}
}

Next the enum defined above is used in static method defined in another class:
package ind.pakistan.life.search;

import  ind.pakistan.life.search.TestCompareAtrributeFilte.CompareType;

public class SampleUse {
  public static void compareTest(CompareType compare,String...criteria){
     // do nothing
  }
}

the compareTest method defined above is usen in test class below

package ind.pakistan.life.search;
import ind.pakistan.life.search;.TestCompareAtrributeFilte.CompareType;
public class SampleToolTest {
public void test(){
  SampleUse.compareTest(CompareType.EQUAL, "Natasha");
  SampleUse.compareTest(CompareType.EQUAL, "Natasha","Ashiwin");
 }
}

I have implemented an tool that generates the references for methods needed  and below is the search pattern used.

IJavaSearchScope scope = createJavaSearchScope(packages.toArray(new IPackageFragment[packages.size()]));
			
MethodPattern pattern = (MethodPattern)  SearchPattern.createPattern(method, IJavaSearchConstants.METHOD,IJavaSearchConstants.REFERENCES, R_EXACT_MATCH);
pattern.varargs = true;
new SearchEngine().search(pattern, new SearchParticipant[] { getDefaultSearchParticipant() }, scope, requestor, null);

Using the above pattern and passing the method argument string as "ind.pakistan.life.search.SampleUse.compareTest(ind.pakistan.life.search.TestCompareAtrributeFilte.CompareType, java.lang.String[])" yields the below result in 

1) eclipse Kepler working fine and gives 2 matches as expected
Version: Kepler Service Release 1
Build id: 20130911-2042

2) eclipse Mars its not working fine and yields 0 matches
Version: Mars.1 Release (4.5.1)
Build id: 20150924-1200

Please can you have look into this issue?
Comment 1 Eclipse Genie CLA 2019-04-17 05:26:59 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.