mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[lombok] IDEA-303185 Fix SneakyThrows, masking exceptions inside sibling constructors
GitOrigin-RevId: 9afd014cce3ea708d7cd88ce7a376a7d11bbab5b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
03da569fcd
commit
c5257f0fea
@@ -0,0 +1,40 @@
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class SneakThrowsDoesntCatchExceptionFromSuperConstructor extends SomeSuperClass {
|
||||
|
||||
<warning descr="Calls to sibling / super constructors are always excluded from @SneakyThrows; @SneakyThrows has been ignored because there is no other code in this constructor.">@SneakyThrows</warning>
|
||||
public SneakThrowsDoesntCatchExceptionFromSuperConstructor() {
|
||||
<error descr="Unhandled exception: java.io.IOException">super</error>("somePath");
|
||||
}
|
||||
|
||||
<warning descr="Calls to sibling / super constructors are always excluded from @SneakyThrows; @SneakyThrows has been ignored because there is no other code in this constructor.">@SneakyThrows</warning>
|
||||
public SneakThrowsDoesntCatchExceptionFromSuperConstructor(int i, float f) {
|
||||
super(<error descr="Unhandled exception: java.io.IOException">throwException</error>());
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public SneakThrowsDoesntCatchExceptionFromSuperConstructor(int i, float f, String s) {
|
||||
super(<error descr="Unhandled exception: java.io.IOException">throwException</error>());
|
||||
if (1 == 1) {
|
||||
throw new Exception("12331323");
|
||||
}
|
||||
}
|
||||
private static int throwException() throws IOException {
|
||||
throw new IOException("Boom");
|
||||
}
|
||||
}
|
||||
|
||||
class SomeSuperClass {
|
||||
private FileInputStream myStream;
|
||||
|
||||
public SomeSuperClass(int i) {
|
||||
|
||||
}
|
||||
|
||||
public SomeSuperClass(String path) throws IOException {
|
||||
myStream = new FileInputStream(path);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class SneakThrowsDoesntCatchExceptionFromThisConstructor {
|
||||
|
||||
private FileInputStream myStream;
|
||||
|
||||
<warning descr="Calls to sibling / super constructors are always excluded from @SneakyThrows; @SneakyThrows has been ignored because there is no other code in this constructor.">@SneakyThrows</warning>
|
||||
public SneakThrowsDoesntCatchExceptionFromThisConstructor() {
|
||||
<error descr="Unhandled exception: java.io.IOException">this</error>("somePath");
|
||||
}
|
||||
|
||||
public SneakThrowsDoesntCatchExceptionFromThisConstructor(String path) throws IOException {
|
||||
myStream = new FileInputStream(path);
|
||||
}
|
||||
|
||||
<warning descr="Calls to sibling / super constructors are always excluded from @SneakyThrows; @SneakyThrows has been ignored because there is no other code in this constructor.">@SneakyThrows</warning>
|
||||
public SneakThrowsDoesntCatchExceptionFromThisConstructor(int i, float f) {
|
||||
this(<error descr="Unhandled exception: java.io.IOException">throwException</error>());
|
||||
}
|
||||
|
||||
public SneakThrowsDoesntCatchExceptionFromThisConstructor(int i) {
|
||||
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public SneakThrowsDoesntCatchExceptionFromThisConstructor(int i, float f, String s) {
|
||||
this(<error descr="Unhandled exception: java.io.IOException">throwException</error>());
|
||||
if (1 == 1) {
|
||||
throw new Exception("12331323");
|
||||
}
|
||||
}
|
||||
|
||||
private static int throwException() throws IOException {
|
||||
throw new IOException("Boom");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user