IDEA-181753 Numeric overflow is reported for -Double.POSITIVE_INFINITY

This commit is contained in:
Tagir Valeev
2017-11-07 10:52:38 +07:00
parent b16d922304
commit 121bbbe458
2 changed files with 2 additions and 2 deletions
@@ -448,11 +448,9 @@ class ConstantExpressionVisitor extends JavaElementVisitor implements PsiConstan
if (operandValue instanceof Number) {
if (operandValue instanceof Double) {
value = new Double(-((Number)operandValue).doubleValue());
checkRealNumberOverflow(value, null, null, expression);
}
else if (operandValue instanceof Float) {
value = new Float(-((Number)operandValue).floatValue());
checkRealNumberOverflow(value, null, null, expression);
}
else if (operandValue instanceof Long) {
value = Long.valueOf(-((Number)operandValue).longValue());
@@ -80,4 +80,6 @@ class c {
}
int iii = <warning descr="Numeric overflow in expression">2 % 0</warning>;
double x = -Double.POSITIVE_INFINITY;
}