我正在寻找调用 IMethod 的 IMethod、IType 或 IJavaElement。我探索了 org.eclipse.jdt.internal.corext.callhierarchy.CallHierarchy。我已经编写了这段代码,但它没有在包装器或位置给我任何东西。请指导我。
public void getMethodCallers(IMethod[] methods){
CallHierarchy hierarchy = new CallHierarchy();
IJavaSearchScope searchScope= SearchEngine.createWorkspaceScope();
hierarchy.setSearchScope(searchScope);
CallLocation location = hierarchy.getCallLocation(method[0])
MethodWrapper [] wrapper = hierarchy.getCalleeRoots(methods);
}