summaryrefslogtreecommitdiff
path: root/plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/try_identical_catches/TryIdenticalCatches.java
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/try_identical_catches/TryIdenticalCatches.java')
-rw-r--r--plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/try_identical_catches/TryIdenticalCatches.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/try_identical_catches/TryIdenticalCatches.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/try_identical_catches/TryIdenticalCatches.java
index 5d33c50de89e..09694491d69d 100644
--- a/plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/try_identical_catches/TryIdenticalCatches.java
+++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/try_identical_catches/TryIdenticalCatches.java
@@ -120,4 +120,18 @@ class TryIdenticalCatches {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
+
+ public static void main() {
+ Throwable causeException;
+ try {
+ throw new NullPointerException();
+ } catch (final NullPointerException e) {
+ causeException = e;
+ } <warning descr="catch branch identical to 'NullPointerException' branch">catch (final IllegalArgumentException e)</warning> {
+ causeException = e;
+ } <warning descr="catch branch identical to 'NullPointerException' branch">catch (final IndexOutOfBoundsException e)</warning> {
+ causeException = e;
+ }
+ System.out.println("causeException = " + causeException);
+ }
} \ No newline at end of file