diff --git a/java/java-analysis-impl/src/messages/QuickFixBundle.properties b/java/java-analysis-impl/src/messages/QuickFixBundle.properties index ad18f15eccdc..92d14f891c08 100644 --- a/java/java-analysis-impl/src/messages/QuickFixBundle.properties +++ b/java/java-analysis-impl/src/messages/QuickFixBundle.properties @@ -17,7 +17,7 @@ add.exception.to.throws.family=Add exception to method signature add.exception.to.existing.catch.family=Add exception to existing catch clause add.exception.to.existing.catch.generic=Add exception to existing catch clause add.exception.to.existing.catch.replacement=Replace ''{0}'' with more generic ''{1}'' -add.exception.to.existing.catch.no.replacement=Replace ''{0}'' with ''{1}'' +add.exception.to.existing.catch.no.replacement=Add ''{1}'' to catch with ''{0}'' add.exception.to.existing.catch.chooser.title=Select catch block add.method.body.text=Add method body diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddExceptionToExistingCatchFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddExceptionToExistingCatchFix.java index e04496e66efd..fcddc029b065 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddExceptionToExistingCatchFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddExceptionToExistingCatchFix.java @@ -197,7 +197,7 @@ public class AddExceptionToExistingCatchFix extends PsiElementBaseIntentionActio if (catchType instanceof PsiDisjunctionType) { PsiDisjunctionType disjunction = (PsiDisjunctionType)catchType; for (PsiType type : disjunction.getDisjunctions()) { - if (type.isAssignableFrom(newException)) { + if (newException.isAssignableFrom(type)) { return true; } } diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/afterMultipleExceptionsReplace.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/afterMultipleExceptionsReplace.java index fcff613ad627..a2a683fc23e0 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/afterMultipleExceptionsReplace.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/afterMultipleExceptionsReplace.java @@ -1,4 +1,4 @@ -// "Replace 'C | D | B' with 'A'" "true" +// "Replace 'C | D | B' with more generic 'A'" "true" import java.io.IOException; class A extends Exception {} diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/afterSingleCatch.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/afterSingleCatch.java index 362507a0898d..bc82a53de481 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/afterSingleCatch.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/afterSingleCatch.java @@ -1,4 +1,4 @@ -// "Replace 'IndexOutOfBoundsException' with 'IOException'" "true" +// "Add 'IOException' to catch with 'IndexOutOfBoundsException'" "true" import java.io.File; import java.io.IOException; diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/beforeMultipleExceptionsReplace.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/beforeMultipleExceptionsReplace.java index 2be8c47ad4c6..ba8930dfcf29 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/beforeMultipleExceptionsReplace.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/beforeMultipleExceptionsReplace.java @@ -1,4 +1,4 @@ -// "Replace 'C | D | B' with 'A'" "true" +// "Replace 'C | D | B' with more generic 'A'" "true" import java.io.IOException; class A extends Exception {} diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/beforeSingleCatch.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/beforeSingleCatch.java index c1e87719116a..9bc3ee6d32e3 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/beforeSingleCatch.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/addExceptionToExistingCatch/beforeSingleCatch.java @@ -1,4 +1,4 @@ -// "Replace 'IndexOutOfBoundsException' with 'IOException'" "true" +// "Add 'IOException' to catch with 'IndexOutOfBoundsException'" "true" import java.io.File; class Test {