IDEA-209947 Make FindDfaCause onTheFly only

GitOrigin-RevId: 52733dbe551b02b96ec2056e4fe7a10bb5d1c9f5
This commit is contained in:
Tagir Valeev
2019-04-29 13:19:16 +07:00
committed by intellij-monorepo-bot
parent fddfc81cc0
commit a19d44c710
2 changed files with 5 additions and 3 deletions

View File

@@ -689,8 +689,10 @@ public class DataFlowInspectionBase extends AbstractBaseJavaLocalInspectionTool
PsiTypeElement castType = typeCast.getCastType();
assert castType != null;
assert operand != null;
reporter.registerProblem(castType, InspectionsBundle.message("dataflow.message.cce", operand.getText()),
createExplainFix(typeCast, new TrackingRunner.CastDfaProblemType()));
if (reporter.isOnTheFly()) {
reporter.registerProblem(castType, InspectionsBundle.message("dataflow.message.cce", operand.getText()),
createExplainFix(typeCast, new TrackingRunner.CastDfaProblemType()));
}
}
}

View File

@@ -167,7 +167,7 @@ public class DataFlowInspection extends DataFlowInspectionBase {
fixes.add(new SurroundWithRequireNonNullFix(qualifier));
}
if (!ExpressionUtils.isNullLiteral(qualifier)) {
if (onTheFly && !ExpressionUtils.isNullLiteral(qualifier)) {
ContainerUtil.addIfNotNull(fixes, createExplainFix(qualifier, new TrackingRunner.NullableDfaProblemType()));
}