Consider the following:
package test15;
public enum MyEnum {
A, B;
}
And:
package test15
class Test15 {
void foo(String s, MyEnum e) {
def d1, d2
switch(e) {
case MyEnum.A:
d1 = new Date()
d2 = new Date()
break
case MyEnum.B:
d1 = null
d2 = null
break
}
foo(s, d1, d2)
}
void foo(String s, Date d1, Date d2) {
}
}
Hit F3 over the call to foo(String, Date, Date) in foo(String, MyEnum) and/or look at the hover: Greclipse thinks that call is for foo(String, MyEnum) itself.
The cause of the problem seems to be d1 and d2 be declared as def together with the presence of the switch.
I think this case is a bit complicated to correctly analyse, but probably something can be done, because if you invoke Call Hierarchy (Ctrl+Alt+H) from foo(String, Date, Date), the call from foo(String, MyEnum) is correctly detected!
Consider the following:
And:
Hit F3 over the call to
foo(String, Date, Date)infoo(String, MyEnum)and/or look at the hover: Greclipse thinks that call is forfoo(String, MyEnum)itself.The cause of the problem seems to be
d1andd2be declared asdeftogether with the presence of the switch.I think this case is a bit complicated to correctly analyse, but probably something can be done, because if you invoke Call Hierarchy (Ctrl+Alt+H) from
foo(String, Date, Date), the call fromfoo(String, MyEnum)is correctly detected!