surround with try/catch: replace var with explicit type (IDEA-191069)

when declaration has to be split
This commit is contained in:
Anna Kozlova
2018-06-20 14:49:51 +03:00
parent 83d09acf8e
commit 1a5768f1cd
3 changed files with 33 additions and 0 deletions
@@ -0,0 +1,16 @@
// "Surround with try/catch" "true"
public class Test {
public static void main(String[] args) {
Object foo = null;
try {
foo = bar();
} catch (Exception e) {
e.printStackTrace();
}
foo.toString();
}
private static Object bar() throws Exception {
return null;
}
}
@@ -0,0 +1,11 @@
// "Surround with try/catch" "true"
public class Test {
public static void main(String[] args) {
var foo = b<caret>ar();
foo.toString();
}
private static Object bar() throws Exception {
return null;
}
}