You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Either from the Groovy class or from the Java class select the test42.MyService.MyBean.MyBean(boolean, Set<String>, Set<Integer>) constructor and invoke Ctrl+Alt+H (Call Hierarchy) or Ctrl+Shift+G (Find References): in both cases, the call from Test42 is not found, only that from test42.MyService.MyBean.MyBean() is.
The text was updated successfully, but these errors were encountered:
mauromol
changed the title
Constructor call of nested class not found by either call hierarchy or find references
Constructor call of nested class not found by neither call hierarchy nor find references
Nov 20, 2018
This applies to methods with overloads as well. Search is only finding the first method specified in the source. Groovy's named arguments, spread arguments, runtime method resolution, etc. make it more difficult to be sure exactly what method is associated with a given method or constructor call.
If MyBean is not a nested class, the problem is different. The call to the constructor is matched in that case (by both the Call Hierarchy and the Search for References). The problem in that case is that if you invoke Call Hierarchy or the Search for References on the no-arg constructor, the call from Test42 is matched again, while it should match only when searching from the three args overload.
So, when MyBean is top-level you have false positives, while when MyBean is nested you have false negatives. As a first step, I think false negatives are more important to fix.
Constructor calls for inner classes should show up in Call Hierarchy and Search for References now. Not matching in the case of overloads will need to be handled as a separate issue. The constructor reference search component is missing parameter checks that the method reference search component has.
Consider the following Java class:
and the following Groovy class:
Either from the Groovy class or from the Java class select the
test42.MyService.MyBean.MyBean(boolean, Set<String>, Set<Integer>)
constructor and invoke Ctrl+Alt+H (Call Hierarchy) or Ctrl+Shift+G (Find References): in both cases, the call fromTest42
is not found, only that fromtest42.MyService.MyBean.MyBean()
is.The text was updated successfully, but these errors were encountered: