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

Bug 532172

Summary: call hierarchy does not finds calls via method references on interface implementations
Product: [Eclipse Project] JDT Reporter: T3rm1 <T3rm1>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: jarthana, stephan.herrmann, t.orf
Version: 4.8   
Target Milestone: ---   
Hardware: PC   
OS: Windows NT   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=484367
https://bugs.eclipse.org/bugs/show_bug.cgi?id=468561
https://bugs.eclipse.org/bugs/show_bug.cgi?id=539602
Whiteboard:

Description T3rm1 CLA 2018-03-08 06:53:03 EST
public class Test2 {

	public void fooImpl(String someString) {

	}

	public void fooImpl2(String someString) {

	}

}

public class Test {

	public Foo fooMethod(Test2 test) {
		return test::fooImpl;
	}

	public Foo fooMethod2(Test2 test) {
		return test::fooImpl2;
	}

}

public interface Foo {

	void bar(String someString);
}

It won't find any references for fooImpl2 and no call hierachy is available.
Comment 1 T3rm1 CLA 2019-03-12 12:09:33 EDT
A possible workaround is to just install IntelliJ for this. I hopen this will be fixed soon so I can uninstall IntelliJ again.
Comment 2 Stephan Herrmann CLA 2019-03-12 14:02:08 EDT
Strictly speaking, there are no calls to fooImpl2 in your example.

What you want is not a call reference but s.t. similar to the Constructor node used in the Call Hierarchy for instantiations of anonymous types.

OTOH, testing with a release candidate towards 2019-03 (4.11), I see plenty of results both in Search and in Call Hierarchy. Which Eclipse version have you been testing with? Please re-test with a recent build.
Comment 3 T3rm1 CLA 2019-03-25 03:54:05 EDT
You are right. I just tested with 4.10 and it looks good.