From b9b7d146ccae30c1a4c21fe8ab83b64038253664 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Thu, 24 Nov 2011 21:09:12 +0400 Subject: [PATCH] Test, that should fail but it doesn't... --- .../dataFlow/IDEADEV74518/expected.xml | 3 +++ .../dataFlow/IDEADEV74518/src/NoWarnings.java | 16 ++++++++++++++++ .../codeInspection/DataFlowInspectionTest.java | 2 ++ 3 files changed, 21 insertions(+) create mode 100644 java/java-tests/testData/inspection/dataFlow/IDEADEV74518/expected.xml create mode 100644 java/java-tests/testData/inspection/dataFlow/IDEADEV74518/src/NoWarnings.java diff --git a/java/java-tests/testData/inspection/dataFlow/IDEADEV74518/expected.xml b/java/java-tests/testData/inspection/dataFlow/IDEADEV74518/expected.xml new file mode 100644 index 000000000000..9ac879d78616 --- /dev/null +++ b/java/java-tests/testData/inspection/dataFlow/IDEADEV74518/expected.xml @@ -0,0 +1,3 @@ + + + diff --git a/java/java-tests/testData/inspection/dataFlow/IDEADEV74518/src/NoWarnings.java b/java/java-tests/testData/inspection/dataFlow/IDEADEV74518/src/NoWarnings.java new file mode 100644 index 000000000000..59130daee1ea --- /dev/null +++ b/java/java-tests/testData/inspection/dataFlow/IDEADEV74518/src/NoWarnings.java @@ -0,0 +1,16 @@ +import java.util.*; + +public class NoWarnings { + public void f() { + int i = 1; + + boolean b = true; + while (i < 200) { + if (b && i == 1) { // Warning here: i == 1 is always true, but it is not so. + b = false; + } else { + i++; + } + } + } +} diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java index 4fec9c5a40cc..625b51e84f51 100644 --- a/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java @@ -78,6 +78,8 @@ public class DataFlowInspectionTest extends InspectionTestCase { //} public void testconstantExpr() throws Exception { doTest(); } + public void testIDEADEV74518() throws Exception { doTest(); } + public void testNotNullable() throws Exception { doTest15(); } public void testNotNullableParameter() throws Exception { doTest15(); }