Community
Participate
Working Groups
build 20030730 I have a class (in a source folder) with a private methodA. methodA is called in another method in the same class as follows: protected anotherMethod(ClassA var, ClassB arg1) if (someBoolean) { var.m1(arg1, methodA( arg1, ((ClassB.InnerClass) arg1).m1(), null), false); return arg1.m2(); } When I search for references to methodA I get no hits.
Finding the results is JDT Core.
This works for me using the following cu: public class A { protected Object anotherMethod(ClassA var, ClassB arg1) { if (true) { var.m1( arg1, methodA( arg1, ((ClassB.InnerClass) arg1).m1(), null), false); return arg1.m2(); } return null; } Object methodA(ClassB arg1, Object arg2, Object arg3) { return null; } } class ClassA { void m1(ClassB arg1, Object arg2, boolean arg3) { } } class ClassB { class InnerClass extends ClassB { } Object m1() { return null; } Object m2() { return null; } } Do you have more details?
The key is that the last argument to methodA is of type ClassB.InnerInterface. Where ClassB implements Interface and interface Interface { interface InnnerInterface {}} Here's a simplified snippet that demonstrates the problem: public class A { protected void anotherMethod() { methodA(null); } private Object methodA(ClassB.InnerInterface arg3) { return null; } } class ClassB implements InterfaceB { } interface InterfaceB { interface InnerInterface { } }
Confirmed. Workaround is to define methodA as follows: private Object methodA(InterfaceB.InnerInterface arg3) { return null; }
Fixed and released in HEAD. Search now find method reference in this peculiar case. [jdt-core-internal] Changes done in MethodLocator.matchMethod(MethodBinding) Test case added in JavaSearchTests
Verified in I200409230100.