use of org.sonar.java.se.CheckerDispatcher in project sonar-java by SonarSource.
the class DebugMethodYieldsOnInvocationsCheck method reportAll.
private void reportAll(CheckerContext context) {
CheckerDispatcher checkerDispatcher = (CheckerDispatcher) context;
methodInvocations.pop().stream().filter(mit -> mit.symbol().isMethodSymbol()).forEach(mit -> reportYields(mit, checkerDispatcher));
}
use of org.sonar.java.se.CheckerDispatcher in project sonar-java by SonarSource.
the class DebugMethodYieldsCheck method checkEndOfExecution.
@Override
public void checkEndOfExecution(CheckerContext context) {
MethodBehavior mb = ((CheckerDispatcher) context).methodBehavior();
IdentifierTree methodName = methodNames.pop();
if (mb != null) {
reportIssue(methodName, String.format("Method '%s' has %d method yields.", methodName.name(), mb.yields().size()), flowFromYield(mb, methodName));
}
}
Aggregations