Skip to content

Default arguments: wrong Call Hiearchy results found for method call in Java class #794

@mauromol

Description

@mauromol

Follow up from #773.

Consider this:

package test42

class GBean {

	GBean() {}
	
	GBean(String foo, String bar = 'hello') {}
	
	void doSomething() {}
	
	void doSomething(String foo, String bar = 'bar') {}
}

And this Java class:

package test42;

public class Test43J {

	public void test() {
		GBean b2 = new GBean("foo");
		
		b2.doSomething();
		b2.doSomething("foo");
		b2.doSomething("foo", "bar");
	}
}

Put the cursor over test42.GBean.doSomething(String, String) and hit Ctrl+Alt+H: it finds only b2.doSomething("foo", "bar") , but not b2.doSomething("foo").
Put the cursor over doSomething in b2.doSomething("foo"): references for a method GBean.doSomething(String) are searched, but this method does not exist in sources (similar to #776, where the call was from Groovy code however).

Similar case is for the GBean constructors: no call is detected for GBean(String, String), and references for a constructor GBean(String) (which does not exist in sources) is performed when invoking from the call site in Test43J.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions