mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
extract method: insert cast when duplicate with changed type processed (IDEA-98396)
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
class Test {
|
||||
|
||||
void foo(Object x) {
|
||||
if (x instanceof String) x = ((String)x).substring(1);
|
||||
if (x instanceof String) x = <selection>((String)x).substring(1)</selection>;
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
|
||||
void foo(Object x) {
|
||||
if (x instanceof String) x = newMethod((String) x);
|
||||
if (x instanceof String) x = newMethod((String) x);
|
||||
}
|
||||
|
||||
private String newMethod(String x) {
|
||||
return ((String)x).substring(1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user