Insert casted declaration in a nice place without exceptions (IDEA-176211)

This commit is contained in:
Bas Leijdekkers
2017-07-20 20:14:11 +02:00
parent 5ff135c8b7
commit f5fdb50da7
9 changed files with 76 additions and 10 deletions
@@ -5,7 +5,6 @@ class C {
if (s instanceof String) {
String s1 = (String) s;
<caret>
}
}
}
@@ -0,0 +1,10 @@
// "Insert '(String)o' declaration" "true"
class X {
void foo(Object o) {
if (o instanceof String) {
String o1 = (String) o;
<caret>
String substring = o.();
}
}
}
@@ -5,8 +5,7 @@ class C {
void f(Object o) {
if (o instanceof IOException) {
IOException o1 = (IOException) o;
<caret>
}
}
}
@@ -0,0 +1,13 @@
// "Insert '(String)o' declaration" "true"
class X {
void foo(Object o) {
if (o instanceof String) {
String a;
String b;
String o1 = (String) o;
<caret>
String c;
}
}
}
@@ -4,7 +4,6 @@ class C {
if (o instanceof String && f == null) {
String o1 = (String) o;
<caret>
}
}
}
@@ -2,7 +2,6 @@
class C {
void f(Object o, Object f) {
if (o instanceof String) {//todo comment
String o1 = (String) o;
}
@@ -0,0 +1,8 @@
// "Insert '(String)o' declaration" "true"
class X {
void foo(Object o) {
if (o insta<caret>nceof String) {
String substring = o.();
}
}
}
@@ -0,0 +1,12 @@
// "Insert '(String)o' declaration" "true"
class X {
void foo(Object o) {
if (o insta<caret>nceof String) {
String a;
String b;
String c;
}
}
}