This question is not a duplicate of - How do I find the caller of a method using stacktrace or reflection?
I am trying to analyze all possible paths to a particular method for my codebase. I'm envisioning something like this:
Class clazz = MyClass.class;
Method method = clazz.getMethod("myMethod");
Method[] possibleCallers = getMethodsThatInvokeMethod(method); // <-- How do I implement this
Is this possible using reflection? If not, are there any open libraries that can help?
UPDATE: For clarification, I would only like to find the possible static invocations of a given method in the project.