Search in sources :

Example 1 with VariableReadExtractor

use of org.sonar.java.cfg.VariableReadExtractor in project sonar-java by SonarSource.

the class DeadStoreCheck method getUsedLocalVarInSubTree.

private static Set<Symbol> getUsedLocalVarInSubTree(Tree tree, Symbol.MethodSymbol methodSymbol) {
    VariableReadExtractor localVarExtractor = new VariableReadExtractor(methodSymbol, false);
    tree.accept(localVarExtractor);
    return localVarExtractor.usedVariables();
}
Also used : VariableReadExtractor(org.sonar.java.cfg.VariableReadExtractor)

Aggregations

VariableReadExtractor (org.sonar.java.cfg.VariableReadExtractor)1