DivideByZeroInspection: add fix for 0.0/0.0 (replace with NaN)

Fixes IDEA-117884 Inspection "Divide by zero": Recognize 0.0/0.0
This commit is contained in:
Tagir Valeev
2018-06-18 16:36:10 +07:00
parent e03e71ce9f
commit 048abf37d7
5 changed files with 89 additions and 9 deletions
@@ -0,0 +1,6 @@
// "Replace with 'NaN'" "true"
class Test {
public void test() {
double nan = Double.NaN;
}
}
@@ -0,0 +1,6 @@
// "Replace with 'NaN'" "false"
class Test {
public void test() {
double nan = 0/<caret>0;
}
}
@@ -0,0 +1,6 @@
// "Replace with 'NaN'" "true"
class Test {
public void test() {
double nan = 0.0/<caret>0.0;
}
}