mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
extract method: do not double parameters
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user