mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 14:25:04 +07:00
unhandled exceptions: fix retained
This commit is contained in:
+55
@@ -20,3 +20,58 @@ class Main {
|
||||
throwsNothing.f();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface A {
|
||||
void close() throws Exception;
|
||||
}
|
||||
|
||||
interface B {
|
||||
void close() throws IOException;
|
||||
}
|
||||
|
||||
abstract class AB implements A, B {}
|
||||
abstract class BA implements B, A {}
|
||||
|
||||
class ABUsage {
|
||||
void foo(AB ab) {
|
||||
try {
|
||||
ab.close();
|
||||
}
|
||||
catch (IOException ignored) {}
|
||||
}
|
||||
|
||||
void foo(BA ba) {
|
||||
try {
|
||||
ba.close();
|
||||
}
|
||||
catch (IOException ignored) {}
|
||||
}
|
||||
}
|
||||
|
||||
interface C {
|
||||
void close();
|
||||
}
|
||||
|
||||
interface D {
|
||||
void close() throws IOException;
|
||||
}
|
||||
|
||||
abstract class CD implements C, D {}
|
||||
abstract class DC implements D, C {}
|
||||
|
||||
class CDUsage {
|
||||
void foo(CD cd) {
|
||||
try {
|
||||
cd.close();
|
||||
}
|
||||
catch (<error descr="Exception 'java.io.IOException' is never thrown in the corresponding try block">IOException ignored</error>) {}
|
||||
}
|
||||
|
||||
void foo(DC dc) {
|
||||
try {
|
||||
dc.close();
|
||||
}
|
||||
catch (<error descr="Exception 'java.io.IOException' is never thrown in the corresponding try block">IOException ignored</error>) {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user