?
-
Is it possible to refactor the while loop into one method? The only way
I can think of is to use if ... else when deciding the setSize but
that would be inefficient.
if (....) {
while (thread == Thread.currentThread()) {
setSize(x, getHeight());
x--;
if (x == SOME_VALUE) {
thread = null;
}
}
} else {
while (thread == Thread.currentThread()) {
setSize(getWidth(), y);
y--;
if (y == SOME_VALUE) {
thread = null;
}
}
}
I can think of is to use if ... else when deciding the setSize but
that would be inefficient.
if (....) {
while (thread == Thread.currentThread()) {
setSize(x, getHeight());
x--;
if (x == SOME_VALUE) {
thread = null;
}
}
} else {
while (thread == Thread.currentThread()) {
setSize(getWidth(), y);
y--;
if (y == SOME_VALUE) {
thread = null;
}
}
}