unhandledExceptions = new ArrayList<>(ExceptionUtil.getOwnUnhandledExceptions(myErrorElement));
+ return unhandledExceptions.size() == 1;
}
private static boolean notFinishedCatches(PsiCatchSection[] catchSections) {
diff --git a/java/java-impl/src/com/intellij/codeInsight/intention/impl/config/QuickFixFactoryImpl.java b/java/java-impl/src/com/intellij/codeInsight/intention/impl/config/QuickFixFactoryImpl.java
index 8746ebce9a66..bdf8e5b1040d 100644
--- a/java/java-impl/src/com/intellij/codeInsight/intention/impl/config/QuickFixFactoryImpl.java
+++ b/java/java-impl/src/com/intellij/codeInsight/intention/impl/config/QuickFixFactoryImpl.java
@@ -16,6 +16,7 @@ import com.intellij.codeInsight.daemon.quickFix.CreateFieldOrPropertyFix;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.codeInsight.intention.IntentionManager;
import com.intellij.codeInsight.intention.QuickFixFactory;
+import com.intellij.codeInsight.daemon.impl.quickfix.AddExceptionToExistingCatchFix;
import com.intellij.codeInsight.intention.impl.CreateClassInPackageInModuleFix;
import com.intellij.codeInsight.intention.impl.ReplaceAssignmentWithComparisonFix;
import com.intellij.codeInspection.*;
@@ -227,6 +228,12 @@ public class QuickFixFactoryImpl extends QuickFixFactory {
return new SurroundWithTryCatchFix(element);
}
+ @NotNull
+ @Override
+ public IntentionAction createAddExceptionToExistingCatch(@NotNull PsiElement element) {
+ return new AddExceptionToExistingCatchFix(element);
+ }
+
@NotNull
@Override
public IntentionAction createGeneralizeCatchFix(@NotNull PsiElement element, @NotNull PsiClassType type) {
diff --git a/java/java-impl/src/intentionDescriptions/AddExceptionToExistingCatchAction/after.java.template b/java/java-impl/src/intentionDescriptions/AddExceptionToExistingCatchAction/after.java.template
deleted file mode 100644
index 62c5a478d26d..000000000000
--- a/java/java-impl/src/intentionDescriptions/AddExceptionToExistingCatchAction/after.java.template
+++ /dev/null
@@ -1,13 +0,0 @@
-class A extends Exception {}
-class B extends A {}
-class C extends A {}
-
-class Test {
- public static void main(String[] args) {
- try {
- throw new A();
- } catch (A e) {
- } catch (C e) {
- }
- }
-}
\ No newline at end of file
diff --git a/java/java-impl/src/intentionDescriptions/AddExceptionToExistingCatchAction/before.java.template b/java/java-impl/src/intentionDescriptions/AddExceptionToExistingCatchAction/before.java.template
deleted file mode 100644
index 8e6b97c3e4b3..000000000000
--- a/java/java-impl/src/intentionDescriptions/AddExceptionToExistingCatchAction/before.java.template
+++ /dev/null
@@ -1,13 +0,0 @@
-class A extends Exception {}
-class B extends A {}
-class C extends A {}
-
-class Test {
- public static void main(String[] args) {
- try {
- throw new A();
- } catch (B e) {
- } catch (C e) {
- }
- }
-}
\ No newline at end of file
diff --git a/java/java-impl/src/intentionDescriptions/AddExceptionToExistingCatchAction/description.html b/java/java-impl/src/intentionDescriptions/AddExceptionToExistingCatchAction/description.html
deleted file mode 100644
index 39607fce2352..000000000000
--- a/java/java-impl/src/intentionDescriptions/AddExceptionToExistingCatchAction/description.html
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-Intention to add exception to existing catch clause
-
-
-
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/afterSimple.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/afterSingleCatch.java
similarity index 100%
rename from java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/afterSimple.java
rename to java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/afterSingleCatch.java
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/beforeSimple.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/beforeSingleCatch.java
similarity index 100%
rename from java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/beforeSimple.java
rename to java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/beforeSingleCatch.java