mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 08:06:56 +07:00
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
31 lines
430 B
Java
31 lines
430 B
Java
// "Ex4" "true"
|
|
|
|
class Hello {
|
|
public void g() { }
|
|
{
|
|
g();
|
|
g();
|
|
try {
|
|
g();
|
|
g();
|
|
} catch (Exception ex2) {
|
|
ex2.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
|
|
class B {
|
|
{
|
|
new Hello().g();
|
|
new Hello().g();
|
|
try {
|
|
new Hello().g();
|
|
new Hello().g();
|
|
} catch (Exception ex2) {
|
|
ex2.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
|
|
class Ex1 extends Exception {}
|
|
class Ex2 extends Ex1 {} |