mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-181753 Numeric overflow is reported for -Double.POSITIVE_INFINITY
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user