use of org.sonar.java.se.CheckerContext 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.CheckerContext in project sonar-java by SonarSource.
the class NonNullSetToNullCheck method checkEndOfExecutionPath.
@Override
public void checkEndOfExecutionPath(CheckerContext context, ConstraintManager constraintManager) {
if (methodTree.is(Tree.Kind.CONSTRUCTOR) && !isDefaultConstructorForJpa(methodTree) && !callsThisConstructor(methodTree) && !exitingWithException(context)) {
ClassTree classTree = (ClassTree) methodTree.parent();
classTree.members().stream().filter(m -> m.is(Tree.Kind.VARIABLE)).map(m -> (VariableTree) m).filter(v -> v.initializer() == null).forEach(v -> checkVariable(context, methodTree, v.symbol()));
}
}
Aggregations