mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
extract method from expression: declare necessary variables inside; reassign result when it was assigned before (IDEA-63593)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
class Foo {
|
||||
void foo() {
|
||||
int x = 0;
|
||||
int y = <selection>x = 1</selection>;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
|
||||
class Foo {
|
||||
void foo() {
|
||||
int x = 0;
|
||||
<selection>x = 1</selection>;
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
|
||||
class Foo {
|
||||
void foo() {
|
||||
int x = 0;
|
||||
newMethod();
|
||||
}
|
||||
|
||||
private void newMethod() {
|
||||
int x;
|
||||
x = 1;
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class Foo {
|
||||
void foo() {
|
||||
int x = 0;
|
||||
int y = x = newMethod();
|
||||
}
|
||||
|
||||
private int newMethod() {
|
||||
int x;
|
||||
return x = 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user