Open nricci opened 8 years ago
Solved in 1ea35ae
Wrong implementation of method MinesweeperCell.unblock. The condition is too complex
The actual implementation is:
public void unblock() {
if (!this.isBlocked() || this.isOpen())
throw new IllegalStateException("Can't unblock an unblocked or opened cell");
this.isBlockedCell = false;
}
I suggest this one:
public void unblock() {
if (!this.isBlocked() )
throw new IllegalStateException("Can't unblock an unblocked or opened cell");
this.isBlockedCell = false;
}
Modify methods in MinesweeperCell so that they throw a corresponding exception when called in an invalid situation (e.g.: unblock() on a unblocked or opened cell).