extract method: suggest return type by unique variable defined in extracted code (IDEA-108296)

This commit is contained in:
Anna Kozlova
2014-12-04 10:57:19 +01:00
parent cab9d9a5e3
commit e13047d703
9 changed files with 103 additions and 6 deletions
@@ -0,0 +1,5 @@
class X {
void foo() {
<selection>int x = 0;</selection>
}
}
@@ -0,0 +1,10 @@
class X {
void foo() {
int x = newMethod();
}
private int newMethod() {
int x = 0;
return x;
}
}
@@ -0,0 +1,7 @@
class X {
void foo() {
<selection>int x = 0;
int y = 42;
</selection>
}
}
@@ -0,0 +1,11 @@
class X {
void foo() {
newMethod();
}
private int newMethod() {
int x = 0;
int y = 42;
}
}