Buggy code:
public class StrategyManager extends DefaultBWListener { private Mirror mirror = new Mirror ( ) ; protected Game game ; private Player self ; private int enemyArmyCount ; private Hashtable < UnitType , Double > enemyArmyRatio ; private Hashtable < UnitType , Integer > enemyBuildingInfo ; private HashSet < Position > enemyArmyPosition ; private HashSet < Position > enemyBuildingLocation ; private long startTime ; private long endTime ; private ProductionManager productionManager ; private MilitaryManager militaryManager ; private boolean isScouting = false ; private boolean hasExtendedRange = false ; public void run ( ) { } @ Override public void onUnitCreate ( Unit unit ) { } @ Override public void onEnd ( boolean isWinner ) { } @ Override public void onStart ( ) { } @ Override public void onFrame ( ) { } private void update ( ) { } private void executeStrategy ( ) { int productionBuildings = productionManager . getProdBuildingCount ( ) ; int armyCount = militaryManager . getArmyCount ( ) ; ArrayList < UnitType > productionGoal = new ArrayList < UnitType > ( ) ; int minerals = self . minerals ( ) ; int gas = self . gas ( ) ; if ( ( ( ( ( ( self . supplyTotal ( ) ) - ( self . supplyUsed ( ) ) ) <= 6 ) || ( ( ( self . supplyTotal ( ) ) - ( self . supplyUsed ( ) ) ) <= ( ( productionBuildings * 3 ) + 1 ) ) ) && ( ( self . incompleteUnitCount ( Terran_Supply_Depot ) ) < 1 ) ) && ( minerals >= 100 ) ) { productionGoal . add ( Terran_Supply_Depot ) ; minerals -= 100 ; } if ( ( ( ( minerals >= 150 ) && ( gas >= 150 ) ) && ( ( self . completedUnitCount ( Terran_Academy ) ) >= 1 ) ) && ( ! ( hasExtendedRange ) ) ) { for ( Unit u : self . getUnits ( ) ) { if ( u . getType ( ) . equals ( Terran_Academy ) ) { u . upgrade ( U_238_Shells ) ; hasExtendedRange = true ; } } minerals -= 150 ; gas -= 150 ; } if ( ( ( minerals >= 150 ) && ( ( self . allUnitCount ( Terran_Barracks ) ) > 1 ) ) && ( ( self . allUnitCount ( Terran_Academy ) ) < 1 ) ) { productionGoal . add ( Terran_Academy ) ; minerals -= 150 ; } if ( ( ( ( minerals >= 100 ) && ( ( self . supplyTotal ( ) ) > 12 ) ) && ( ( self . allUnitCount ( Terran_Refinery ) ) < 1 ) ) && ( ( self . allUnitCount ( Terran_Barracks ) ) >= 1 ) ) { productionGoal . add ( Terran_Refinery ) ; minerals -= 100 ; } if ( ( minerals >= 150 ) && ( ( self . allUnitCount ( Terran_Barracks ) ) < 3 ) ) { productionGoal . add ( Terran_Barracks ) ; minerals -= 150 ; } if ( ( minerals >= 100 ) && ( ( self . allUnitCount ( Terran_Barracks ) ) > 0 ) ) { if ( ( ( self . completedUnitCount ( Terran_Academy ) ) >= 1 ) && ( ( militaryManager . getUnitRatio ( Terran_Marine ) ) <= 0.75 ) ) { productionGoal . add ( Terran_Marine ) ; minerals -= 100 ; } else if ( ( self . completedUnitCount ( Terran_Academy ) ) < 1 ) { productionGoal . add ( Terran_Marine ) ; minerals -= 100 ; } } if ( ( ( ( minerals >= 50 ) && ( gas >= 25 ) ) && ( ( self . allUnitCount ( Terran_Barracks ) ) > 0 ) ) && ( ( self . completedUnitCount ( Terran_Academy ) ) >= 1 ) ) { if ( ( ( militaryManager . getUnitRatio ( Terran_Medic ) ) != null ) && ( ( militaryManager . getUnitRatio ( Terran_Medic ) ) <= 0.25 ) ) { productionGoal . add ( Terran_Medic ) ; minerals -= 50 ; gas -= 25 ; } } if ( ( minerals >= 50 ) && ( ( self . allUnitCount ( Terran_SCV ) ) < 28 ) ) { if ( ( ( ( self . supplyTotal ( ) ) - ( self . supplyUsed ( ) ) ) != 6 ) || ( ( ( ( self . supplyTotal ( ) ) - ( self . supplyUsed ( ) ) ) == 6 ) && ( ( self . incompleteUnitCount ( Terran_Supply_Depot ) ) >= 1 ) ) ) { productionGoal . add ( Terran_SCV ) ; minerals -= 50 ; } } if ( minerals >= ( 150 * 3 ) ) { productionGoal . add ( Terran_Barracks ) ; minerals -= 150 ; } productionManager . setGoal ( productionGoal ) ; if ( ( armyCount >= 20 ) && ( armyCount >= ( ( productionBuildings - 1 ) * 3 ) ) ) { for ( Position pos : enemyBuildingLocation ) { militaryManager . command ( Attack , 1.0 , pos ) ; break ; } } <START_BUG> if ( enemyBuildingLocation . isEmpty ( ) ) { <END_BUG> isScouting = false ; } if ( ! ( isScouting ) ) { militaryManager . command ( Scout , 1.0 , null ) ; isScouting = true ; } } private void updateEnemyArmyPos ( ) { } private void updateEnemyBuildingLocations ( ) { } private TilePosition convertPositionToTilePosition ( Position pos ) { } private Position convertTilePositionToPosition ( TilePosition tilePosition ) { } private void displayGameInfo ( ) { } public static void main ( String [ ] args ) { } No newline ; at end ; of file ; }

Fix:
if ( ( enemyBuildingLocation . isEmpty ( ) ) && ( armyCount > 20 ) ) {