diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/detail/CaretAtParameter.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/detail/CaretAtParameter.java new file mode 100644 index 000000000000..a21033af4c0f --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/detail/CaretAtParameter.java @@ -0,0 +1,17 @@ +// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +package com.siyeh.ipp.exceptions.detail; + +class Test { + + void foo() { + try{ + if (true) { + throw new IllegalArgumentException(); + } else { + throw new NullPointerException(); + } + } catch (RuntimeException e) { + + } + } +} \ No newline at end of file diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/detail/CaretAtParameter_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/detail/CaretAtParameter_after.java new file mode 100644 index 000000000000..82d68a554f35 --- /dev/null +++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/exceptions/detail/CaretAtParameter_after.java @@ -0,0 +1,19 @@ +// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +package com.siyeh.ipp.exceptions.detail; + +class Test { + + void foo() { + try { + if (true) { + throw new IllegalArgumentException(); + } else { + throw new NullPointerException(); + } + } catch (IllegalArgumentException e) { + + } catch (NullPointerException e) { + + } + } +} \ No newline at end of file diff --git a/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/exceptions/DetailExceptionsIntentionTest.java b/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/exceptions/DetailExceptionsIntentionTest.java index 4aa2832b772f..6270cf47ed18 100644 --- a/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/exceptions/DetailExceptionsIntentionTest.java +++ b/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/exceptions/DetailExceptionsIntentionTest.java @@ -1,3 +1,4 @@ +// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.siyeh.ipp.exceptions; import com.siyeh.IntentionPowerPackBundle; @@ -14,6 +15,7 @@ public class DetailExceptionsIntentionTest extends IPPTestCase { public void testForeach() { doTest(); } public void testTryWithResources() { doTest(); } public void testPolyadicParentheses() { doTest(); } + public void testCaretAtParameter() { doTest(); } @Override protected String getIntentionName() {