lombok-intellij-plugin
lombok-intellij-plugin copied to clipboard
SneakyThrows permits missing 'catch' blocks in checked-exception-throwing try-with-resource blocks within lambdas
Short description
If 'try-with-resources' block throws checked exception from within a lambda, the lambda must catch or rethrow. The SneakyThrows annotation neuters this requirement. IDEA reports code as valid while compiler rejects.
Expected behavior
Compile error should be visible from IDE.
Version information
- IDEA Version: IU-213.6461.79
- **JDK Version:**11.0.16
- OS Type & Version: Windows 10
- Lombok Plugin Version: 213.6461.79
- Lombok Dependency Version: 1.18.24
Steps to reproduce
@SneakyThrows
void foo() {
Runnable r = () -> {
try (Reader reader = new FileReader("")) {}
}
}
@mplushnikov https://github.com/JetBrains/intellij-community/pull/2629