use of net.sourceforge.pmd.lang.symboltable.ImageFinderFunction in project pmd by pmd.
the class MethodScope method findVariableHere.
public Set<NameDeclaration> findVariableHere(JavaNameOccurrence occurrence) {
if (occurrence.isThisOrSuper() || occurrence.isMethodOrConstructorInvocation()) {
return Collections.emptySet();
}
ImageFinderFunction finder = new ImageFinderFunction(occurrence.getImage());
Applier.apply(finder, getVariableDeclarations().keySet().iterator());
if (finder.getDecl() != null) {
return Collections.singleton(finder.getDecl());
}
return Collections.emptySet();
}
use of net.sourceforge.pmd.lang.symboltable.ImageFinderFunction in project pmd by pmd.
the class SourceFileScope method findClassNameDeclaration.
public ClassNameDeclaration findClassNameDeclaration(String name) {
ImageFinderFunction finder = new ImageFinderFunction(name);
Applier.apply(finder, getClassDeclarations().keySet().iterator());
return (ClassNameDeclaration) finder.getDecl();
}
use of net.sourceforge.pmd.lang.symboltable.ImageFinderFunction in project pmd by pmd.
the class SourceFileScope method findVariableHere.
protected Set<NameDeclaration> findVariableHere(JavaNameOccurrence occ) {
ImageFinderFunction finder = new ImageFinderFunction(occ.getImage());
Applier.apply(finder, getDeclarations().keySet().iterator());
if (finder.getDecl() != null) {
return Collections.singleton(finder.getDecl());
}
return Collections.emptySet();
}
use of net.sourceforge.pmd.lang.symboltable.ImageFinderFunction in project pmd by pmd.
the class MethodScope method findVariableHere.
public Set<NameDeclaration> findVariableHere(PLSQLNameOccurrence occurrence) {
Set<NameDeclaration> result = new HashSet<>();
if (occurrence.isThisOrSuper() || occurrence.isMethodOrConstructorInvocation()) {
return result;
}
ImageFinderFunction finder = new ImageFinderFunction(occurrence.getImage());
Applier.apply(finder, getVariableDeclarations().keySet().iterator());
if (finder.getDecl() != null) {
result.add(finder.getDecl());
}
return result;
}
use of net.sourceforge.pmd.lang.symboltable.ImageFinderFunction in project pmd by pmd.
the class SourceFileScope method findVariableHere.
protected NameDeclaration findVariableHere(NameOccurrence occ) {
ImageFinderFunction finder = new ImageFinderFunction(occ.getImage());
Applier.apply(finder, getDeclarations().keySet().iterator());
return finder.getDecl();
}
Aggregations