mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-11 11:36:59 +07:00
Fixes IDEA-178781 "Surround with try-catch" QuickFix for "Unhandled exception" in a field initializer Enables stream-to-loop in field initializer Fixes stream-to-loop in for initializer Disables stream-to-loop in for update
19 lines
380 B
Java
19 lines
380 B
Java
// "Surround with try/catch" "true"
|
|
import java.io.IOException;
|
|
|
|
class C {
|
|
static final String S;
|
|
|
|
static {
|
|
try {
|
|
S = getString();
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
static String getString() throws IOException {
|
|
if(Math.random() > 0.5) throw new IOException();
|
|
return "foo";
|
|
}
|
|
} |