localscope.java

来自「检查Java程序漏洞」· Java 代码 · 共 32 行

JAVA
32
字号
/** * BSD-style license; for more info see http://pmd.sourceforge.net/license.html*/package net.sourceforge.pmd.symboltable;import net.sourceforge.pmd.util.Applier;public class LocalScope extends AbstractScope {    public void addDeclaration(VariableNameDeclaration nameDecl) {        if (nameDecl.isExceptionBlockParameter()) {            // this declaration needs to go somewhere... should this be delegated to the next            // highest LocalScope?            return;        }        super.addDeclaration(nameDecl);    }    public NameDeclaration findVariableHere(NameOccurrence occurrence) {        if (occurrence.isThisOrSuper()) {            return null;        }        ImageFinderFunction finder = new ImageFinderFunction(occurrence.getImage());        Applier.apply(finder, variableNames.keySet().iterator());        return finder.getDecl();    }    public String toString() {        return "LocalScope:" + super.glomNames();    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?