Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithTry/beforeField.java
Tagir Valeev 6e87cb9bfd RefactoringUtil#ensureCodeBlock enhanced and used in Surround with try-catch
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
2017-09-12 13:34:43 +07:00

11 lines
261 B
Java

// "Surround with try/catch" "true"
import java.io.IOException;
class C {
static final String S = getSt<caret>ring();
static String getString() throws IOException {
if(Math.random() > 0.5) throw new IOException();
return "foo";
}
}