CreateLocalVarFromInstanceofAction: use VariableNameGenerator (produces better results)

GitOrigin-RevId: 10d07e83576c67df180c8652d1003cf3de6810d1
This commit is contained in:
Tagir Valeev
2020-04-10 07:40:25 +00:00
committed by intellij-monorepo-bot
parent 5b813d826b
commit b990c89c65
13 changed files with 39 additions and 27 deletions
@@ -2,7 +2,7 @@
class C {
void f(Object o) {
if (o instanceof String) {
String o1 = (String) o;
String s = (String) o;
<caret>
o = "";
}
@@ -2,7 +2,7 @@
class X {
void foo(Object o) {
if (o instanceof String) {
String o1 = (String) o;
String s = (String) o;
<caret>
String substring = o.();
}
@@ -4,7 +4,7 @@ import java.io.IOException;
class C {
void f(Object o) {
if (o instanceof IOException) {
IOException o1 = (IOException) o;
IOException ioException = (IOException) o;
<caret>
}
}
@@ -2,7 +2,7 @@
public abstract class A {
public void getNodeElements(Object parent) {
if (!(parent instanceof NodeInfo)) return;
NodeInfo parent1 = (NodeInfo) parent;
NodeInfo nodeInfo = (NodeInfo) parent;
<caret>
}
@@ -4,7 +4,7 @@ class X {
if (o instanceof String) {
String a;
String b;
String o1 = (String) o;
String s = (String) o;
<caret>
String c;
@@ -2,7 +2,7 @@
class C {
void f(Object o, Object f) {
if (o instanceof String && f == null) {
String o1 = (String) o;
String s = (String) o;
<caret>
}
}
@@ -2,7 +2,7 @@
class C {
void f(Object o, Object f) {
if (o instanceof String) {//todo comment
String o1 = (String) o;
String s = (String) o;
}
}
@@ -2,7 +2,7 @@
class C {
void f(Object o) {
if (o instanceof Runnable) {
Runnable o1 = (Runnable) o;
Runnable runnable = (Runnable) o;
<caret>
}
}
@@ -1,11 +1,11 @@
// "Insert '(String)x' declaration" "true"
class C {
Object x = new Object();
Object s = new Object();
void x() {
if (x instanceof String) {
String x = (String) this.x;
String s1 = (String) x;
<caret>
}
}
@@ -1,7 +1,7 @@
// "Insert '(String)x' declaration" "true"
class C {
Object x = new Object();
Object s = new Object();
void x() {
if (x insta<caret>nceof String) {