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

Bug 318885

Summary: [search] References of an interface method not found when searching from implementing class
Product: [Eclipse Project] JDT Reporter: maciej <the4yeast>
Component: CoreAssignee: Satyam Kandula <satyam.kandula>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: chris, jarthana, markus.kell.r, Olivier_Thomann, remy.suen
Version: 3.6   
Target Milestone: 3.6.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
projects to reproduce none

Description maciej CLA 2010-07-05 08:13:55 EDT
Build Identifier: 20100617-1415

Right click on a method implemented in a class - find references - workspace. The method is specified in an interface, it is overriden in a class that implements that interface. No references are found - they are found only if searched from the interface itself. It is not the case for every interface/class pair. I see no dependency. Happens every time for a given pair. It DID work in Galileo.

Reproducible: Always

Steps to Reproduce:
1. Make an interface
2. Override a method in a class.
3. Find workspace references from the class.
Comment 1 Remy Suen CLA 2010-07-05 08:39:09 EDT
What is this, Java? C++? Something else?
Comment 2 maciej CLA 2010-07-05 09:08:04 EDT
(In reply to comment #1)
> What is this, Java? C++? Something else?

Java
Comment 3 Remy Suen CLA 2010-07-05 09:10:35 EDT
Java tooling bugs go to JDT.
Comment 4 Markus Keller CLA 2010-07-05 11:33:34 EDT
Works for me. Make sure you didn't enable the "References to Overridden" filter in the Search view (see view Menu, Ctrl+F10).


package p;
public interface Interface {
	void foo();
}

package p;
public class Clazz implements Interface {
	@Override
	public void foo() {
		System.out.println("Hi");
	}
}

package p;
public class CRef {
	public static void main(String[] args) {
		Clazz c= new Clazz();
		c.foo();
	}
}

package p;
public class IRef {
	public static void main(String[] args) {
		Interface i= new Clazz();
		i.foo();
	}
}
Comment 5 maciej CLA 2010-07-05 11:43:40 EDT
I didn't enable that setting.

As I said, 'It is not the case for every interface/class pair'. I don't know why it works for some and does not for others.
I used Galileo and Ganymede for the same projects - always worked there.
Comment 6 Markus Keller CLA 2010-07-05 13:10:16 EDT
Then please provide an example that does not work.
Comment 7 Chris Glencross CLA 2010-07-16 04:30:40 EDT
To reproduce the issue move IRef into a second project which depends on the first project.

Make sure that the second project does not refer to Clazz.

It's appears that Helios assumes that if project2 does not directly use Clazz, then it cannot refer to Clazz.foo(), which isn't true.
Comment 8 Markus Keller CLA 2010-07-19 14:04:33 EDT
Created attachment 174655 [details]
projects to reproduce

To reproduce, import the attached projects and then search for references to Clazz#foo().
Comment 9 Markus Keller CLA 2010-07-19 14:10:52 EDT
(In reply to comment #7)
> Make sure that the second project does not refer to Clazz.

Thanks, that's it. Moving to Core since the bug is in the search engine.
Comment 10 Satyam Kandula CLA 2010-07-20 00:55:32 EDT
This is a duplicate of bug 313668. Please try turning off Build Automatically or try the new builds of 3.6.1

*** This bug has been marked as a duplicate of bug 31368 ***
Comment 11 Jay Arthanareeswaran CLA 2010-08-27 02:15:31 EDT
Verified for 3.6.1 RC2 using build M20100825-0800.
Comment 12 Markus Keller CLA 2010-08-27 04:57:55 EDT

*** This bug has been marked as a duplicate of bug 313668 ***