Buggy code:
public class MapScene extends Scene { public static final int RETURNTOBASE = 2 ; public static final int VICTORY = 3 ; private Map map ; private MapCursor cursor ; private Camera camera ; private ArrayList < Actor > actorList ; private ArrayList < Unit > unitList ; private ArrayList < Unit > dieingUnits ; private int numFactions ; private int turn ; private Unit selectedUnit ; private int lastUnitIndexSearched ; private ArrayList < Unit > attackableUnits ; private int attackableUnitsIndex ; private AI ai ; boolean fightGraphicsMode ; private int animationFrames ; private PlayerData playerArmy ; private MovementArrow mvArrow ; private int movingIndex ; private ArrayList < Point > movingLine ; private UnitActionMenu unitActionMenu ; private WeaponSelectionMenu weaponSelect ; private FightUI fightUI ; private SystemActionMenu systemAction ; private Grid grid ; private UnitCircles unitCircles ; private XPBarUI xp ; private PreBattleScene preBattleScene ; private TerrainUI terrainUI ; private UnitHoverUI unitHoverUI ; private boolean drawAllyMoveRange ; private ArrayList < Point > allyRangeMap ; private ArrayList < Unit > enemyRangeList ; private ArrayList < Point > selectedEnemyRangeMap ; private boolean drawAllEnemyRanges ; private ArrayList < Point > allEnemyRangeMap ; private ArrayList < Point > playerStartingLocations ; public MapScene ( Scene parent ) { } public void respondControls ( InputManager im ) { } public int runFrame ( ) { if ( active ) { <START_BUG> switch ( getControlState ( ) ) { <END_BUG> case 1 : cursor . runFrame ( ) ; camera . moveToRenderable ( cursor , map ) ; if ( checkWinCondition ( ) ) return MapScene . VICTORY ; break ; case 2 : mvArrow . runFrame ( ) ; cursor . runFrame ( ) ; camera . moveToRenderable ( cursor , map ) ; break ; case 3 : cursor . moveToDest ( ) ; camera . moveToRenderable ( cursor , map ) ; switch ( unitActionMenu . runFrame ( ) ) { case UnitActionMenu . BACK : cst3to2 ( ) ; break ; case UnitActionMenu . ATTACK : cst3to6 ( ) ; break ; case UnitActionMenu . WAIT : cst3to1 ( ) ; break ; } break ; case 4 : cursor . moveToDest ( ) ; camera . moveToRenderable ( cursor , map ) ; switch ( systemAction . runFrame ( ) ) { case SystemActionMenu . BACK : cst4to1 ( ) ; break ; case SystemActionMenu . ENDTURN : cst4to9 ( ) ; break ; } break ; case 5 : cursor . moveToDest ( ) ; if ( ! ( selectedUnit . isMoving ( ) ) ) { if ( ( movingIndex ) < ( movingLine . size ( ) ) ) { selectedUnit . setDest ( movingLine . get ( movingIndex ) ) ; ( movingIndex ) ++ ; } else cst5toX ( ) ; } selectedUnit . moveToDest ( ) ; camera . moveToRenderable ( selectedUnit , map ) ; break ; case 6 : cursor . moveInstantly ( attackableUnits . get ( attackableUnitsIndex ) . getCoord ( ) ) ; camera . moveToRenderable ( cursor , map ) ; break ; case 7 : camera . moveToRenderable ( selectedUnit , map ) ; switch ( weaponSelect . runFrame ( ) ) { case WeaponSelectionMenu . BACK : cst7to6 ( ) ; break ; case 1 : cst7to8 ( ) ; break ; } break ; case 8 : int result = fightUI . runFrame ( ) ; switch ( result ) { case 0 : cst8toX ( ) ; break ; case 1 : case 2 : case 3 : resolveBattle ( result ) ; cst8to12 ( ) ; break ; } break ; case 9 : cst9toX ( ) ; break ; case 10 : camera . moveToRenderable ( cursor , map ) ; switch ( ai . runFrame ( ) ) { case 0 : cst10to9 ( ) ; break ; } break ; case 11 : cst11to1 ( ) ; break ; case 12 : if ( ( animationFrames ) != 0 ) ( animationFrames ) -- ; else cst12toX ( ) ; break ; case 13 : switch ( xp . runFrame ( ) ) { case 1 : cst13to1 ( ) ; break ; } break ; case 14 : camera . moveToRenderable ( cursor , map ) ; switch ( preBattleScene . runFrame ( ) ) { case PreBattleScene . VIEWMAP : cst14to15 ( ) ; break ; case PreBattleScene . START : cst14to1 ( ) ; break ; case PreBattleScene . UPDATEUNITS : setStartingUnits ( ) ; break ; case PreBattleScene . RETURNTOBASE : return MapScene . RETURNTOBASE ; } break ; case 15 : cursor . runFrame ( ) ; camera . moveToRenderable ( cursor , map ) ; break ; } terrainUI . runFrame ( ) ; unitHoverUI . runFrame ( ) ; } return NOTHING ; } public void animate ( ) { } public void draw ( Graphics2D g2 ) { } public void resize ( ) { } public void start ( PlayerData pd ) { } public void getAllyMoveRange ( Unit u ) { } public void getAllyRange ( Unit u ) { } public void addEnemyRange ( Unit u ) { } public void removeEnemyRange ( Unit u ) { } public void getAllEnemyRanges ( ) { } public void toggleEnemyRanges ( ) { } public void clearRanges ( ) { } public void drawRanges ( Graphics2D g ) { } public void drawRangeSquare ( Graphics2D g , Point p ) { } public Unit getUnitAtPoint ( int x , int y ) { } public Unit getUnitAtPoint ( Point p ) { } public Actor getActorAtPoint ( int x , int y ) { } public Actor getActorAtPoint ( Point p ) { } public void moveToNextUnmovedUnit ( ) { } public void startTurn ( ) { } public void endTurn ( ) { } public void resolveBattle ( int whoDied ) { } public void setStartingUnits ( ) { }

Fix:
switch ( controlState ) {