Files
openide/java/java-tests/testData/inspection/redundantThrowsGlobalFix/afterNestedInCatch.java
Nikita Eshkeev af4bd9a9cd [EA-259285] CharTable not found in: PsiCodeBlock
RedundantThrowsDeclarationInspection used to try to remove or replace try statements regardless if their corresponding PSI elements are still valid. Since PSI nodes were being removed or replace in the loop some of them got to become invalid and when BlockUtils#unwrapTryBlock was invoked on an invalid PSI element it threw the AssertionError. This patch adds checks if the PSI element that is being processed is still valid and if it is not, then stop processing such PSI elements.

GitOrigin-RevId: 6d071ef7888f46bbda10b6d99853ef338055f3a6
2021-03-22 21:37:33 +00:00

10 lines
128 B
Java

// "FileNotFoundException" "true"
import java.io.FileNotFoundException;
class Main {
public void f() {}
{
f();
}
}