diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/toobroadcatch/TooBroadCatchBlock.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/toobroadcatch/TooBroadCatchBlock.java index c292cbcbc5bc..27f777085f96 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/toobroadcatch/TooBroadCatchBlock.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/toobroadcatch/TooBroadCatchBlock.java @@ -15,7 +15,7 @@ public class TooBroadCatchBlock{ } } catch(FileNotFoundException e){ e.printStackTrace(); - } catch(IOException e){ + } catch(IOException e){ e.printStackTrace(); } } @@ -28,9 +28,9 @@ public class TooBroadCatchBlock{ try { new URL(null); throw new NullPointerException(); - } catch (IOException e) { + } catch (IOException e) { - } catch (RuntimeException e) { + } catch (RuntimeException e) { } } @@ -46,7 +46,7 @@ public class TooBroadCatchBlock{ if (c) { throw new IOException(); } - } catch (ObjectStreamException e) { + } catch (ObjectStreamException e) { // Deal with ObjectStreamException (a subclass of IOException)... } catch (IOException e) { // Deal with IOException... @@ -60,7 +60,7 @@ public class TooBroadCatchBlock{ void test() { try { try (java.io.FileInputStream in = new java.io.FileInputStream("asdf")) {} - } catch (IOException e) {} + } catch (IOException e) {} } boolean m() { @@ -69,7 +69,7 @@ public class TooBroadCatchBlock{ return new java.io.File("can_reset").isFile(); } catch (FileNotFoundException e) { return false; - } catch (Exception e ) { + } catch (Exception e ) { return false; } } @@ -78,7 +78,7 @@ public class TooBroadCatchBlock{ try { new java.io.FileInputStream(""); return new java.io.File("can_reset").isFile(); - } catch (Exception e ) { + } catch (Exception e ) { return false; } } diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/toobroadcatch/expected.xml b/plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/toobroadcatch/expected.xml deleted file mode 100644 index 6c49ec83fc88..000000000000 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/toobroadcatch/expected.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - TooBroadCatchBlock.java - 18 - Overly broad 'catch' block - ''catch'' of <code>IOException</code> is too broad, masking exception 'EOFException' #loc - - - - TooBroadCatchBlock.java - 31 - Overly broad 'catch' block - ''catch'' of <code>IOException</code> is too broad, masking exception 'MalformedURLException' #loc - - - - TooBroadCatchBlock.java - 33 - Overly broad 'catch' block - ''catch'' of <code>RuntimeException</code> is too broad, masking exception 'NullPointerException' #loc - - - - TooBroadCatchBlock.java - 49 - Overly broad 'catch' block - ''catch'' of <code>ObjectStreamException</code> is too broad, masking exceptions 'NotActiveException' and 'StreamCorruptedException' #loc - - - - TooBroadCatchBlock.java - 63 - Overly broad 'catch' block - 'catch' of <code>IOException</code> is too broad, masking exception 'FileNotFoundException' #loc - - - - TooBroadCatchBlock.java - 72 - Overly broad 'catch' block - 'catch' of <code>Exception</code> is too broad, masking exception 'RuntimeException' #loc - - - - TooBroadCatchBlock.java - 81 - Overly broad 'catch' block - 'catch' of <code>Exception</code> is too broad, masking exception 'FileNotFoundException' #loc - - \ No newline at end of file diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/errorhandling/TooBroadCatchInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/errorhandling/TooBroadCatchInspectionTest.java index 997c42bf81c4..901dbb5c8264 100644 --- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/errorhandling/TooBroadCatchInspectionTest.java +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/errorhandling/TooBroadCatchInspectionTest.java @@ -1,10 +1,23 @@ package com.siyeh.ig.errorhandling; -import com.siyeh.ig.IGInspectionTestCase; +import com.intellij.codeInspection.InspectionProfileEntry; +import com.siyeh.ig.LightInspectionTestCase; +import org.jetbrains.annotations.Nullable; -public class TooBroadCatchInspectionTest extends IGInspectionTestCase { +public class TooBroadCatchInspectionTest extends LightInspectionTestCase { - public void test() throws Exception { - doTest("com/siyeh/igtest/errorhandling/toobroadcatch", new TooBroadCatchInspection()); + public void testTooBroadCatchBlock() throws Exception { + doTest(); + } + + @Nullable + @Override + protected InspectionProfileEntry getInspection() { + return new TooBroadCatchInspection(); + } + + @Override + protected String getBasePath() { + return "/plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/toobroadcatch"; } } \ No newline at end of file