title: How to get definition of a SimpleName?
body: <p>Here is my setting code</p>
  
  <pre><code>    ASTParser parser = ASTParser.newParser(AST.JLS8);
      parser.setResolveBindings(true);
      parser.setBindingsRecovery(true);
      parser.setSource(content.toCharArray());
      parser.setKind(ASTParser.K_COMPILATION_UNIT);
      String[] sourcepathEntries = { folderPath };
      String[] encodings = { "UTF-8" };
      parser.setEnvironment(null, sourcepathEntries, encodings, true);
      parser.setUnitName(filePath);
      parser.setStatementsRecovery(true);  
      CompilationUnit cu = (CompilationUnit) parser.createAST(null);
  </code></pre>
  
  <p>The test file is</p>
  
  <pre><code>public class A {
      B b = new B();
      C c = new C();
      int name = 15;
      public void run() {
          int x = 25;
          int d = x + 10;
          if (x != 25) {
              d = 99;
          }
          System.out.println(d);
      }
  
      public B getB() {
          b.run();
          return b;
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/yg3gz.png" rel="nofollow noreferrer">My debug code is here</a></p>
  
  <p>I have already get the <code>Ibinding</code> from <code>SimpleName.resolveBinding()</code> but I can't get any field information from <code>IBinding binding</code>. I am surprised that <code>binding instanceof VaribleBinding</code> return <code>false</code> although debug view shows that.
  I can see the <code>LocalDeclaration</code> but I can not get it. Can anyone help me to solve this? Or provide an alternative solution. </p>