mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-22 06:20:54 +07:00
19 lines
398 B
Java
19 lines
398 B
Java
// "Surround with try/catch" "true-preview"
|
|
import java.io.IOException;
|
|
|
|
class C {
|
|
static final String S;
|
|
|
|
static {
|
|
try {
|
|
S = getString();
|
|
} catch (IOException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
|
|
static String getString() throws IOException {
|
|
if(Math.random() > 0.5) throw new IOException();
|
|
return "foo";
|
|
}
|
|
} |