diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/spins/WhileLoopSpinsOnField.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/spins/WhileLoopSpinsOnField.java
deleted file mode 100644
index 2b632dc8f44f..000000000000
--- a/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/spins/WhileLoopSpinsOnField.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.siyeh.igtest.threading.spins;
-
-class WhileLoopSpinsOnField
-{
- private int quantity_;
-
- public static void main(final String[] args)
- {
- final WhileLoopSpinsOnField wlsof = new WhileLoopSpinsOnField();
- wlsof.countdown();
- }
-
- private WhileLoopSpinsOnField()
- {
- quantity_ = 10;
- }
-
- private void countdown()
- {
- while (quantity_ != 0)
- {
- System.out.println(quantity_);
- quantity_--;
- }
- }
-}
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/spins/WhileLoopSpinsOnFieldFalsePositive.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/spins/WhileLoopSpinsOnFieldFalsePositive.java
deleted file mode 100644
index f573febdb0bb..000000000000
--- a/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/spins/WhileLoopSpinsOnFieldFalsePositive.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.siyeh.igtest.threading.spins;
-
-import java.io.InputStream;
-import java.io.IOException;
-
-class WhileLoopSpinsOnFieldFalsePositive {
-
- private InputStream source;
-
- private long remaining;
-
- WhileLoopSpinsOnFieldFalsePositive(InputStream source) {
- if (source == null) {
- throw new NullPointerException("source is null");
- }
- this.source = source;
- remaining = 0L;
- }
-
- public long nextElement() throws IOException {
- while (remaining > 0) {
- remaining -= source.skip(remaining);
- }
- return -1L;
- }
-}
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/spins/WhileLoopSpinsOnFieldInspection.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/spins/WhileLoopSpinsOnFieldInspection.java
deleted file mode 100644
index f6bb1f37e14f..000000000000
--- a/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/spins/WhileLoopSpinsOnFieldInspection.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.siyeh.igtest.threading.spins;
-
-public class WhileLoopSpinsOnFieldInspection
-{
- private Object test = null;
- private int testInt = 3;
- private volatile int testVolatileInt = 3;
-
- public void foo()
- {
- while(test!=null);
- while(test!=null)
- {
- System.out.println("");
- }
- while(testInt!=3)
- {
-
- }
- while(testVolatileInt!=3);
-
- }
-}
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/spins/expected.xml b/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/spins/expected.xml
deleted file mode 100644
index b348e1834b85..000000000000
--- a/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/spins/expected.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
- WhileLoopSpinsOnFieldInspection.java
- 11
- While loop spins on field
- <code>while</code> loop spins on field #loc
-
-
-
- WhileLoopSpinsOnFieldInspection.java
- 12
- While loop spins on field
- <code>while</code> loop spins on field #loc
-
-
-
-
- WhileLoopSpinsOnFieldInspection.java
- 16
- While loop spins on field
- <code>while</code> loop spins on field #loc
-
-
-
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/while_loop_spins_on_field/WhileLoopSpinsOnField.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/while_loop_spins_on_field/WhileLoopSpinsOnField.java
new file mode 100644
index 000000000000..cbf00d8bef9f
--- /dev/null
+++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/threading/while_loop_spins_on_field/WhileLoopSpinsOnField.java
@@ -0,0 +1,72 @@
+package com.siyeh.igtest.threading.while_loop_spins_on_field;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public class WhileLoopSpinsOnField
+{
+ private Object test = null;
+ private int testInt = 3;
+ private volatile int testVolatileInt = 3;
+
+ public void foo()
+ {
+ while(test!=null);
+ while(test!=null)
+ {
+ System.out.println("");
+ }
+ while(testInt!=3)
+ {
+
+ }
+ while(testVolatileInt!=3);
+
+ }
+}
+class WhileLoopSpinsOnFieldFalsePositive {
+
+ private InputStream source;
+
+ private long remaining;
+
+ WhileLoopSpinsOnFieldFalsePositive(InputStream source) {
+ if (source == null) {
+ throw new NullPointerException("source is null");
+ }
+ this.source = source;
+ remaining = 0L;
+ }
+
+ public long nextElement() throws IOException {
+ while (remaining > 0) {
+ remaining -= source.skip(remaining);
+ }
+ return -1L;
+ }
+}
+class WhileLoopSpinsOnField2
+{
+ private int quantity_;
+
+ public static void main(final String[] args)
+ {
+ final WhileLoopSpinsOnField2 wlsof = new WhileLoopSpinsOnField2();
+ wlsof.countdown();
+ }
+
+ private WhileLoopSpinsOnField2()
+ {
+ quantity_ = 10;
+ }
+
+ private void countdown()
+ {
+ while (quantity_ != 0)
+ {
+ System.out.println(quantity_);
+ quantity_--;
+ }
+ }
+}
+
diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/threading/WhileLoopSpinsOnFieldInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/threading/WhileLoopSpinsOnFieldInspectionTest.java
index 58cc66d15529..268e068aa58c 100644
--- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/threading/WhileLoopSpinsOnFieldInspectionTest.java
+++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/threading/WhileLoopSpinsOnFieldInspectionTest.java
@@ -1,11 +1,18 @@
package com.siyeh.ig.threading;
-import com.siyeh.ig.IGInspectionTestCase;
+import com.intellij.codeInspection.InspectionProfileEntry;
+import com.siyeh.ig.LightInspectionTestCase;
+import org.jetbrains.annotations.Nullable;
-public class WhileLoopSpinsOnFieldInspectionTest extends IGInspectionTestCase {
+public class WhileLoopSpinsOnFieldInspectionTest extends LightInspectionTestCase {
- public void test() throws Exception {
- doTest("com/siyeh/igtest/threading/spins",
- new WhileLoopSpinsOnFieldInspection());
+ public void testWhileLoopSpinsOnField() throws Exception {
+ doTest();
+ }
+
+ @Nullable
+ @Override
+ protected InspectionProfileEntry getInspection() {
+ return new WhileLoopSpinsOnFieldInspection();
}
}
\ No newline at end of file