Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong navigation for constructor call #1103

Closed
mauromol opened this issue Apr 27, 2020 · 5 comments
Closed

Wrong navigation for constructor call #1103

mauromol opened this issue Apr 27, 2020 · 5 comments
Assignees
Labels
Milestone

Comments

@mauromol
Copy link

Consider the project attached to #1090 and its MyBean class, but use this test class instead:

package test61

import java.util.function.BiConsumer

import org.hibernate.Session
import org.hibernate.SessionFactory
import org.hibernate.criterion.DetachedCriteria
import org.hibernate.criterion.Order

class Test66 {

	SessionFactory shopSessionFactory
	
	void foo() {
		def b = new MyBean(shopSessionFactory, bar('a', 'b', 'c'), [Order.asc('foo'), Order.asc('bar')], ['a', 'b'], 
			{} as BiConsumer<Session, ? super List>)
	}

	DetachedCriteria bar(String a, String b, String d) {
		
	}
}

If you click on MyBean word inside the foo() method and hit F3, you're brought to test61.MyBean.MyBean(SessionFactory, DetachedCriteria, Order...) constructor, while you should be brought to test61.MyBean.MyBean(SessionFactory, DetachedCriteria, List<Order>, Map<String, ? extends Iterable<String>>, BiConsumer<Session, ? super T>).

Call Hierarchy and Search for References for the latter constructor, though, are correct, so it seems to be just an issue with navigation.

@mauromol mauromol changed the title Wrong navigation in constructor call Wrong navigation for constructor call Apr 27, 2020
@eric-milles
Copy link
Member

['a', 'b'] is not a Map literal. This call is not an exact match for a declared constructor.

@mauromol
Copy link
Author

Right, sorry, when I extracted the use case from the real case I wrote the constructor call wrong. You should change it like this:

package test61

import java.util.function.BiConsumer

import org.hibernate.Session
import org.hibernate.SessionFactory
import org.hibernate.criterion.DetachedCriteria
import org.hibernate.criterion.Order

class Test66 {

	SessionFactory shopSessionFactory
	
	void foo() {
		def b = new MyBean(shopSessionFactory, bar('a', 'b', 'c'), [Order.asc('foo'), Order.asc('bar')], [a: ['a'], b: ['b']], {} as BiConsumer<Session, ? super List>)
	}

	DetachedCriteria bar(String a, String b, String d) {
		
	}
}

The same problem with navigation occurs.

@eric-milles eric-milles self-assigned this Apr 27, 2020
@eric-milles eric-milles added this to the v3.8.0 milestone Apr 27, 2020
@eric-milles
Copy link
Member

Getting tripped up on Map<String, ? extends Iterable<String>>. Testing fix now.

@eric-milles
Copy link
Member

ready to test

@mauromol
Copy link
Author

Sorry, I missed this. Works fine in 3.8.0.v202004282258-e1912.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants