Files
openide/java/java-tests/testData/inspection/redundantThrowsGlobalFix/afterRemoveSingleCatch.java
Nikita Eshkeev 8583627c45 [java-analysis-impl] IDEA-248487 Red code after "Remove unnecessary 'throws' declarations"
The algorithm of deducing of how catch type and instructions in a try statement are related didn't use to be robust, this patch introduces a graph based approach to capture the essence of catch types and instructions in a try statement relation.

The graph is a DAG with catch sections on the top level, they are connected to exceptions vertices: since a catch section can have a disjoint set of types in its declaration, each catch section vertex can have a multiple children. At the lowest level there are instructions of a try statement that induce exceptions. Such a structure of a graph makes it possible to implement a robust algorithm to deduce essential types in catch sections.

Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>

GitOrigin-RevId: 8cd2a8223ff0b472d8dfde3e611b4797edb36d5a
2020-09-17 16:27:25 +00:00

14 lines
173 B
Java

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