title: How to get the enclosing method node with JDT?
body: <p>When I have a method foo() that calls bar(), how can I get the foo() AST node from MethodInvocation node (or whatever statements/expressions in the method)? For example, I need to know the IMethod foo from b.bar().</p>
  
  <pre><code>public void foo()
  {
      b.bar();
  }
  </code></pre>