mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
[java-intention] IDEA-357879 "Replace catch sections with throw" intention doesn't check ancestors
- fix test's flakiness GitOrigin-RevId: ce2d52a107441215c5c8f953916e2203196fbc25
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9b8735ca88
commit
46c33c46e3
@@ -69,7 +69,7 @@ public final class ConvertCatchToThrowsIntention extends PsiBasedModCommandActio
|
||||
PsiFile containingFile = catchSection.getContainingFile();
|
||||
PsiFile copyCatchSectionContainingFile = copyCatchSection.getContainingFile();
|
||||
for (PsiMethod superMethod : superMethods) {
|
||||
if (!superMethod.isWritable() || !superMethod.isPhysical()) continue;
|
||||
if (!superMethod.isPhysical() || superMethod instanceof PsiCompiledElement) continue;
|
||||
if (superMethod.getContainingFile() == containingFile) {
|
||||
superMethodsToModify.add(
|
||||
PsiTreeUtil.findSameElementInCopy(superMethod, copyCatchSectionContainingFile));
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
*/
|
||||
package com.siyeh.ipp.exceptions;
|
||||
|
||||
import com.intellij.ui.ChooserInterceptor;
|
||||
import com.intellij.ui.UiInterceptors;
|
||||
import com.siyeh.IntentionPowerPackBundle;
|
||||
import com.siyeh.ipp.IPPTestCase;
|
||||
|
||||
@@ -23,6 +25,9 @@ public class ConvertCatchToThrowsTest extends IPPTestCase {
|
||||
public void testInLoopSingleLine() { doTest(); }
|
||||
public void testInLoopSingleLineDeclaration() { doTest(); }
|
||||
public void testWithSuperMethods() {
|
||||
UiInterceptors.register(
|
||||
new ChooserInterceptor(null,
|
||||
IntentionPowerPackBundle.message("convert.catch.to.throws.super.and.current.methods")));
|
||||
doTest();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user