mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
extract method: inline output variable if it is returned right after creation ( IDEA-54490 )
This commit is contained in:
@@ -12,8 +12,7 @@ class C {
|
||||
}
|
||||
|
||||
private List newMethod(Object[] array) {
|
||||
List l1 = new ArrayList(Arrays.asList(array));
|
||||
return l1;
|
||||
return new ArrayList(Arrays.asList(array));
|
||||
}
|
||||
|
||||
String[] getObjects() {
|
||||
|
||||
@@ -7,7 +7,6 @@ class C {
|
||||
}
|
||||
|
||||
private int newMethod() {
|
||||
final int i = 128;
|
||||
return i;
|
||||
return 128;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
<selection>int j = 0;
|
||||
int i = 0;
|
||||
j = 9;</selection>
|
||||
System.out.println(i);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
void foo() {
|
||||
int i = newMethod();
|
||||
System.out.println(i);
|
||||
}
|
||||
|
||||
private int newMethod() {
|
||||
int j = 0;
|
||||
int i = 0;
|
||||
j = 9;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user