Buggy code:
public class JoinGameController extends Controller implements IJoinGameController , Observer { private INewGameView newGameView ; private ISelectColorView selectColorView ; private IMessageView messageView ; private IAction joinAction ; private IMasterManager master ; private PlayerInfo localPlayer ; private GameInfo localGame ; private Game gameModel ; private ArrayList < String > takenColors ; private ArrayList < String > newTakenColors ; private final int NUMBER_OF_PLAYERS = 4 ; public JoinGameController ( IJoinGameView view , INewGameView newGameView , ISelectColorView selectColorView , IMessageView messageView ) { } public IJoinGameView getJoinGameView ( ) { } public IAction getJoinAction ( ) { } public void setJoinAction ( IAction value ) { } public INewGameView getNewGameView ( ) { } public void setNewGameView ( INewGameView newGameView ) { } public ISelectColorView getSelectColorView ( ) { } public void setSelectColorView ( ISelectColorView selectColorView ) { } public IMessageView getMessageView ( ) { } public void setMessageView ( IMessageView messageView ) { } @ Override public void start ( ) { } @ Override public void startCreateNewGame ( ) { } @ Override public void cancelCreateNewGame ( ) { } @ Override public void createNewGame ( ) { } @ Override public void startJoinGame ( GameInfo game ) { } @ Override public void cancelJoinGame ( ) { } @ Override public void joinGame ( CatanColor color ) { } public void generateGameList ( ) { } public void enableAllColors ( ) { } @ Override public void update ( Observable o , Object arg ) { System . out . println ( "UPDATING<seq2seq4repair_space>joinGameController." ) ; ModelManager manager = ( ( ModelManager ) ( o ) ) ; gameModel = manager . getCurrentModel ( ) ; int i = 0 ; for ( Player p : gameModel . players ( ) ) { if ( ( ! ( takenColors . contains ( p . color ( ) . name ( ) ) ) ) && ( ( takenColors . size ( ) ) < ( NUMBER_OF_PLAYERS ) ) ) takenColors . add ( p . color ( ) . name ( ) ) ; for ( int k = 0 ; k < ( takenColors . size ( ) ) ; ++ k ) { System . out . print ( ( ( takenColors . get ( k ) ) + "<seq2seq4repair_space>" ) ) ; } <START_BUG> if ( ( takenColors . size ( ) ) != 0 ) { <END_BUG> if ( ! ( takenColors . get ( i ) . equals ( p . color ( ) . name ( ) ) ) ) { System . out . println ( ( "$$$$$$$$$$$<seq2seq4repair_space>enabling<seq2seq4repair_space>" + ( takenColors . get ( i ) ) ) ) ; getSelectColorView ( ) . setColorEnabled ( CatanColor . valueOf ( takenColors . get ( i ) ) , true ) ; takenColors . set ( i , p . color ( ) . name ( ) ) ; } } i ++ ; } for ( int j = 0 ; j < ( takenColors . size ( ) ) ; j ++ ) { getSelectColorView ( ) . setColorEnabled ( CatanColor . valueOf ( takenColors . get ( j ) ) , false ) ; if ( ( master . getPlayer ( ) ) != null ) { if ( takenColors . get ( j ) . equalsIgnoreCase ( master . getPlayer ( ) . color ( ) . toString ( ) ) ) { getSelectColorView ( ) . setColorEnabled ( master . getPlayer ( ) . color ( ) , true ) ; } } else { System . out . println ( "NULLLLLLLLLLLL<seq2seq4repair_space>PLAYERRRRRRRRRRRR<seq2seq4repair_space>(joinGameController)" ) ; } } } }

Fix:
if ( ( ( takenColors . size ( ) ) != 0 ) && ( i < ( takenColors . size ( ) ) ) ) {