extract method: do not double parameters

This commit is contained in:
anna
2010-07-09 17:38:13 +04:00
parent 616023e610
commit c899f8f467
4 changed files with 46 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
class Test {
void f() {
new Runnable() {
public void run() {
int j = 0;
if (j == 0 && <selection>j < 0 && j > 0</selection>) {
assert false;
}
}
};
}
}

View File

@@ -0,0 +1,16 @@
class Test {
void f() {
new Runnable() {
public void run() {
int j = 0;
if (j == 0 && newMethod(j)) {
assert false;
}
}
};
}
private boolean newMethod(int j) {
return j < 0 && j > 0;
}
}