Buggy code:
public class GameView { private GameModel game ; private GameControl gameControl ; public GameView ( GameModel game ) { } public void gameLoop ( ) { while ( ( game . getStatus ( ) ) != ( GameModel . GAME_OVER ) ) { if ( game . getStatus ( ) . equals ( PRE_GAME ) ) { game . getPlayer1 ( ) . setName ( "Player<seq2seq4repair_space>1" ) ; game . getPlayer2 ( ) . setName ( "Player<seq2seq4repair_space>2" ) ; game . getPlayer1 ( ) . setPlayerShips ( game . getPlayer1 ( ) . setShips ( ) ) ; game . getPlayer2 ( ) . setPlayerShips ( game . getPlayer2 ( ) . setShips ( ) ) ; game . getPlayer1 ( ) . getBoard ( ) . getNewBoard ( ) ; game . getPlayer2 ( ) . getBoard ( ) . getNewBoard ( ) ; game . setStatus ( NEW_GAME ) ; } if ( game . getStatus ( ) . equals ( NEW_GAME ) ) { game . getPlayer1 ( ) . getBoardView ( ) . displayBoard ( game . getPlayer1 ( ) . getBoard ( ) . getBoard ( ) , game . getStatus ( ) ) ; System . out . println ( ) ; System . out . println ( ( ( game . getPlayer1 ( ) . getName ( ) ) + ",<seq2seq4repair_space>Please<seq2seq4repair_space>set<seq2seq4repair_space>your<seq2seq4repair_space>ships<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>board." ) ) ; for ( Ship ship : game . getPlayer1 ( ) . getPlayerShips ( ) ) { LocationInfo location = game . getPlayer1 ( ) . getBoardView ( ) . getShipPlacement ( ship , game . getPlayer1 ( ) . getBoard ( ) . getBoard ( ) ) ; game . getPlayer1 ( ) . getBoard ( ) . setShip ( location , ship ) ; game . getPlayer1 ( ) . getBoardView ( ) . displayBoard ( game . getPlayer1 ( ) . getBoard ( ) . getBoard ( ) , game . getStatus ( ) ) ; } game . getPlayer2 ( ) . getBoardView ( ) . displayBoard ( game . getPlayer2 ( ) . getBoard ( ) . getBoard ( ) , game . getStatus ( ) ) ; System . out . println ( ) ; System . out . println ( ( ( game . getPlayer2 ( ) . getName ( ) ) + ",<seq2seq4repair_space>Please<seq2seq4repair_space>set<seq2seq4repair_space>your<seq2seq4repair_space>ships<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>board." ) ) ; for ( Ship ship : game . getPlayer2 ( ) . getPlayerShips ( ) ) { LocationInfo location = game . getPlayer2 ( ) . getBoardView ( ) . getShipPlacement ( ship , game . getPlayer2 ( ) . getBoard ( ) . getBoard ( ) ) ; game . getPlayer2 ( ) . getBoard ( ) . setShip ( location , ship ) ; game . getPlayer2 ( ) . getBoardView ( ) . displayBoard ( game . getPlayer2 ( ) . getBoard ( ) . getBoard ( ) , game . getStatus ( ) ) ; } new BattleshipArt ( ) . displayBattle ( ) ; game . setAttacker ( game . getPlayer1 ( ) ) ; game . setDefender ( game . getPlayer2 ( ) ) ; game . setStatus ( PLAYING ) ; } if ( game . getStatus ( ) . equals ( PLAYING ) ) { game . getDefender ( ) . getBoardView ( ) . displayBoard ( game . getDefender ( ) . getBoard ( ) . getBoard ( ) , game . getStatus ( ) ) ; System . out . println ( ( ( game . getAttacker ( ) . getName ( ) ) + ",<seq2seq4repair_space>It<seq2seq4repair_space>is<seq2seq4repair_space>your<seq2seq4repair_space>turn,<seq2seq4repair_space>attack<seq2seq4repair_space>your<seq2seq4repair_space>opponent." ) ) ; Point attack = getAttack ( game . getDefender ( ) ) ; <START_BUG> int result = game . getDefender ( ) . getBoard ( ) . testAttack ( attack , game . getDefender ( ) . getBoard ( ) . grid ) ; <END_BUG> switch ( result ) { case - 1 : continue ; case 0 : new BattleshipArt ( ) . displayMiss ( ) ; this . gameControl . alternateturn ( ) ; break ; case 1 : new BattleshipArt ( ) . displayHit ( ) ; this . gameControl . alternateturn ( ) ; break ; } System . out . println ( game . toString ( ) ) ; } } } public Point getAttack ( Player player ) { } }

Fix:
int result = game . getDefender ( ) . getBoard ( ) . testAttack ( attack , game . getDefender ( ) . getBoard ( ) . getGrid ( ) ) ;