View Javadoc

1   /***
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3   */
4   package net.sourceforge.pmd.symboltable;
5   
6   import net.sourceforge.pmd.util.Applier;
7   
8   public class MethodScope extends AbstractScope {
9   
10      public NameDeclaration findVariableHere(NameOccurrence occurrence) {
11          if (occurrence.isThisOrSuper()) {
12              return null;
13          }
14          ImageFinderFunction finder = new ImageFinderFunction(occurrence.getImage());
15          Applier.apply(finder, variableNames.keySet().iterator());
16          return finder.getDecl();
17      }
18  
19      public String toString() {
20          return "MethodScope:" + super.glomNames();
21      }
22  }