use of com.intellij.codeInspection.dataFlow.value.DfaConstValue in project intellij-community by JetBrains.
the class DataFlowInspectionBase method reportConstantPushes.
private void reportConstantPushes(StandardDataFlowRunner runner, ProblemsHolder holder, DataFlowInstructionVisitor visitor, Set<PsiElement> reportedAnchors) {
for (Instruction instruction : runner.getInstructions()) {
if (instruction instanceof PushInstruction) {
PsiExpression place = ((PushInstruction) instruction).getPlace();
DfaValue value = ((PushInstruction) instruction).getValue();
Object constant = value instanceof DfaConstValue ? ((DfaConstValue) value).getValue() : null;
if (place instanceof PsiPolyadicExpression && constant instanceof Boolean && !isFlagCheck(place) && reportedAnchors.add(place)) {
reportConstantCondition(holder, visitor, place, (Boolean) constant);
}
}
}
}
Aggregations