diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/dataflow/scope/TooBroadScope.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/dataflow/scope/TooBroadScope.java index 8302df83df11..fcca2f17ce70 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/dataflow/scope/TooBroadScope.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/dataflow/scope/TooBroadScope.java @@ -9,7 +9,7 @@ public class TooBroadScope public void test() { // Example #1 { - Collection list = null; //scope too broad + Collection list = null; //scope too broad { list = new ArrayList(); list.add(new Integer(0)); @@ -19,7 +19,7 @@ public class TooBroadScope // Example #2 { - Collection list; // scope too broad + Collection list; // scope too broad list = new ArrayList(); list.add(new Integer(0)); } @@ -27,14 +27,14 @@ public class TooBroadScope // Example #3 { - Collection list = null; // nope + Collection list = null; // nope list = new ArrayList(); list.add(new Integer(0)); } } public void join() { - String test; + String test; test = "asdf"; } @@ -104,13 +104,13 @@ public class TooBroadScope } void forLoop() { - int i = 0; + int i = 0; for ( ; i < 10; i++) { System.out.println(i); } } - void resourceVariable(boolean b) { + void resourceVariable(boolean b) throws Exception { try (AutoCloseable ac = null) { if (b) { System.out.println(ac); diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/dataflow/scope/expected.xml b/plugins/InspectionGadgets/test/com/siyeh/igtest/dataflow/scope/expected.xml deleted file mode 100644 index 941a71eed17b..000000000000 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/dataflow/scope/expected.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - TooBroadScope.java - 12 - Scope of variable is too broad - Scope of variable <code>list</code> is too broad #loc - - - - TooBroadScope.java - 22 - Scope of variable is too broad - Scope of variable <code>list</code> is too broad #loc - - - - TooBroadScope.java - 30 - Scope of variable is too broad - Scope of variable <code>list</code> is too broad #loc - - - - TooBroadScope.java - 37 - Scope of variable is too broad - Scope of variable <code>test</code> is too broad #loc - - - - TooBroadScope.java - 107 - Scope of variable is too broad - Scope of variable <code>i</code> is too broad #loc - - \ No newline at end of file diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/dataflow/TooBroadScopeInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/dataflow/TooBroadScopeInspectionTest.java index 51b6f9c69372..c575cafcdc36 100644 --- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/dataflow/TooBroadScopeInspectionTest.java +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/dataflow/TooBroadScopeInspectionTest.java @@ -1,10 +1,22 @@ package com.siyeh.ig.dataflow; +import com.intellij.codeInspection.InspectionProfileEntry; import com.siyeh.ig.IGInspectionTestCase; +import com.siyeh.ig.LightInspectionTestCase; -public class TooBroadScopeInspectionTest extends IGInspectionTestCase { +public class TooBroadScopeInspectionTest extends LightInspectionTestCase { - public void test() throws Exception { - doTest("com/siyeh/igtest/dataflow/scope", new TooBroadScopeInspection()); + public void testTooBroadScope() { + doTest(); + } + + @Override + protected InspectionProfileEntry getInspection() { + return new TooBroadScopeInspection(); + } + + @Override + protected String getBasePath() { + return "/plugins/InspectionGadgets/test/com/siyeh/igtest/dataflow/scope"; } } \ No newline at end of file