This is a classic case of where early-return makes sense....
There are some schools of thought that suggest early return is a bad thing, but consider changing all your if (isWon) {break;} statements to be return winner;.
We can get rid of the iswon and the winner variables entirely, as well as the then unnecessary checks to gate each logic loop. Your method looks like:
public Player getWinner() {
// check columns (same x)
for (int x = 0; x < fields.length; x++) {
Player value = fields[x][0];
if (value == null) {
continue;
}
for (int y = 1; y < fields[x].length; y++) {
Player current = fields[x][y];
if (current == null || !current.equals(value)) {
break;
}
if (y == fields[x].length -1) {
// Early Return.... We have a WINNER!
return value;
}
}
}
// there was no winner in this check
// no need for isWon check or variable... we can't get here unless there is
// no winner yet....
for (int y = 0; y < fields[0].length; y++) {
Player value = fields[0][y];
if (value == null) {
continue;
}
for (int x = 1; x < fields.length; x++) {
Player current = fields[x][y];
if (current == null || !current.equals(value)) {
break;
}
if (x == fields.length -1) {
// We have a winner!
return value;
}
}
}
}
// and so on....
....
// there is no winner.
return null;
}