Java: even more precise rethrow types (IJ-CR-13170)

GitOrigin-RevId: 34d767e800b3dc24d11fa05e6d237b88b630cb0c
This commit is contained in:
Bas Leijdekkers
2021-08-23 13:50:58 +00:00
committed by intellij-monorepo-bot
parent 6f7d008170
commit 333c564c62
2 changed files with 23 additions and 3 deletions
@@ -277,4 +277,22 @@ class C {
}
catch (E ignored) {}
}
private void m17() throws InterruptedException, java.io.FileNotFoundException {
try {
Thread.sleep(1);
throw new java.io.FileNotFoundException();
} catch (InterruptedException | java.io.IOException ex) {
throw ex;
}
}
private void m18() throws InterruptedException {
try {
Thread.sleep(1L);
// no IOException thrown
} catch (<error descr="Exception 'java.io.IOException' is never thrown in the corresponding try block">java.io.IOException ex</error>) {
throw ex;
}
}
}