use of org.sonar.java.se.ExplodedGraphWalker in project sonar-java by SonarSource.
the class DebugCheckTestUtils method verifyIssuesWithMaxSteps.
static void verifyIssuesWithMaxSteps(String sourcefile, SECheck check, int maxSteps) {
BehaviorCache behaviorCache = new BehaviorCache(new SquidClassLoader(new ArrayList<>()));
SymbolicExecutionVisitor sev = new SymbolicExecutionVisitor(Collections.singletonList(check), behaviorCache) {
@Override
protected ExplodedGraphWalker getWalker() {
return new ExplodedGraphWalker(Collections.singletonList(check), behaviorCache, (SemanticModel) context.getSemanticModel()) {
@Override
protected int maxSteps() {
return maxSteps;
}
};
}
@Override
public void scanFile(JavaFileScannerContext context) {
super.scanFile(context);
// the check has been executed, but we still need to call the scan manually to report the issues
check.scanFile(context);
}
};
JavaCheckVerifier.verify(sourcefile, sev);
}
Aggregations