Skip to content

Missing Groovy references in Call Hierarchy and Search for References when method invoked through an interface #329

@mauromol

Description

@mauromol

This was the old GRECLIPSE-1786.

Consider the following code. An interface:

package f;

public interface IFJ {

	void doSomething(int a, boolean b);

	void doSomething(int a);
}

A Java class implementing that interface:

package f;

public class FJ implements IFJ {

	@Override
	public void doSomething(int a) {
		doSomething(a, false);
	}

	@Override
	public void doSomething(int a, boolean b) {
	}
}

A Java class using an instance of the aforementioned class, through the interface:

package f;

public class FGJava {

	public void foo() {
		IFJ fj = new FJ();
		fj.doSomething(1);
	}
}

The same class, written in Groovy:

package f 

class FG {
	void foo() {
		IFJ fj = new FJ() 
                fj.doSomething(1)
	}
}

Now, select the following methods:

  1. f.IFJ.doSomething(int)
  2. f.FJ.doSomething(int)

Invoke Call Hierarchy (Ctrl+Alt+H) and Search for References (Ctrl+Shift+G). In the first case, both f.FGJava.foo() and f.FG.foo() are shown, in the second case only f.FGJava.foo() is shown.

Now, select f.FJ.doSomething(int, boolean) and invoke Call Hierarchy. Expand f.FJ.doSomething(int). Coherently with the second case above, only f.FGJava.foo() is shown.

In other words, references from Groovy code are not found when the invocation is made through an interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions