mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
surround with try/catch: replace var with explicit type (IDEA-191069)
when declaration has to be split
This commit is contained in:
+16
@@ -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;
|
||||
}
|
||||
}
|
||||
+11
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user