mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
extract method: suggest return type by unique variable defined in extracted code (IDEA-108296)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
class X {
|
||||
void foo() {
|
||||
<selection>int x = 0;</selection>
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
class X {
|
||||
void foo() {
|
||||
int x = newMethod();
|
||||
}
|
||||
|
||||
private int newMethod() {
|
||||
int x = 0;
|
||||
return x;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class X {
|
||||
void foo() {
|
||||
<selection>int x = 0;
|
||||
int y = 42;
|
||||
</selection>
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class X {
|
||||
void foo() {
|
||||
newMethod();
|
||||
|
||||
}
|
||||
|
||||
private int newMethod() {
|
||||
int x = 0;
|
||||
int y = 42;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user