mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
DataFlowInspectionBase internationalization
GitOrigin-RevId: 08434323329b331b72ffd07ed80fe8fe865c6ab7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
251f34e91f
commit
1ecf89dcbf
@@ -153,7 +153,8 @@ public abstract class DataFlowInspectionBase extends AbstractBaseJavaLocalInspec
|
||||
PsiExpression condition = PsiUtil.skipParenthesizedExprDown(statement.getCondition());
|
||||
if (BoolUtils.isBooleanLiteral(condition)) {
|
||||
LocalQuickFix fix = createSimplifyBooleanExpressionFix(condition, condition.textMatches(PsiKeyword.TRUE));
|
||||
holder.registerProblem(condition, "Condition is always " + condition.getText(), fix);
|
||||
holder.registerProblem(condition, InspectionsBundle
|
||||
.message("dataflow.message.constant.no.ref", condition.textMatches(PsiKeyword.TRUE) ? 1 : 0), fix);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +176,7 @@ public abstract class DataFlowInspectionBase extends AbstractBaseJavaLocalInspec
|
||||
private void checkLoopCondition(PsiExpression condition) {
|
||||
condition = PsiUtil.skipParenthesizedExprDown(condition);
|
||||
if (condition != null && condition.textMatches(PsiKeyword.FALSE)) {
|
||||
holder.registerProblem(condition, "Condition is always false", createSimplifyBooleanExpressionFix(condition, false));
|
||||
holder.registerProblem(condition, InspectionsBundle.message("dataflow.message.constant.no.ref", 0), createSimplifyBooleanExpressionFix(condition, false));
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -374,7 +375,8 @@ public abstract class DataFlowInspectionBase extends AbstractBaseJavaLocalInspec
|
||||
if (chunk.myRange != null) {
|
||||
if (result.value() instanceof Boolean) {
|
||||
// report rare cases like a == b == c where "a == b" part is constant
|
||||
String message = InspectionsBundle.message("dataflow.message.constant.condition", result.toString());
|
||||
String message = InspectionsBundle.message("dataflow.message.constant.condition",
|
||||
((Boolean)result.value()).booleanValue() ? 1 : 0);
|
||||
reporter.registerProblem(expression, chunk.myRange, message);
|
||||
// do not add to reported anchors if only part of expression was reported
|
||||
}
|
||||
@@ -776,7 +778,7 @@ public abstract class DataFlowInspectionBase extends AbstractBaseJavaLocalInspec
|
||||
}
|
||||
String message = InspectionsBundle.message(isAtRHSOfBooleanAnd(psiAnchor) ?
|
||||
"dataflow.message.constant.condition.when.reached" :
|
||||
"dataflow.message.constant.condition", Boolean.toString(evaluatesToTrue));
|
||||
"dataflow.message.constant.condition", evaluatesToTrue ? 1 : 0);
|
||||
reporter.registerProblem(psiAnchor, message, fixes.toArray(LocalQuickFix.EMPTY_ARRAY));
|
||||
}
|
||||
|
||||
|
||||
@@ -70,8 +70,9 @@ dataflow.message.arraystore=Storing element of type <code>{0}</code> to array of
|
||||
dataflow.message.redundant.instanceof=Condition <code>#ref</code> #loc is redundant and can be replaced with a null check
|
||||
dataflow.message.contract.fail=The call to '#ref' always fails, according to its method contracts
|
||||
dataflow.message.contract.fail.index=The call to '#ref' always fails as index is out of bounds
|
||||
dataflow.message.constant.condition=Condition <code>#ref</code> #loc is always <code>{0}</code>
|
||||
dataflow.message.constant.condition.when.reached=Condition <code>#ref</code> #loc is always <code>{0}</code> when reached
|
||||
dataflow.message.constant.condition=Condition <code>#ref</code> #loc is always <code>{0, choice, 0#false|1#true}</code>
|
||||
dataflow.message.constant.condition.when.reached=Condition <code>#ref</code> #loc is always <code>{0, choice, 0#false|1#true}</code> when reached
|
||||
dataflow.message.constant.no.ref=Condition is always {0, choice, 0#false|1#true}
|
||||
dataflow.message.unreachable.switch.label=Switch label <code>#ref</code> #loc is unreachable
|
||||
dataflow.message.only.switch.label=Switch label <code>#ref</code> #loc is the only reachable in the whole switch
|
||||
dataflow.message.pointless.assignment.expression=Condition <code>#ref</code> #loc at the left side of assignment expression is always <code>{0}</code>. Can be simplified
|
||||
|
||||
Reference in New Issue
Block a user