Buggy code:
private boolean mirrored = false ; private final Map < Integer , Collection < RobotState > > robots = new HashMap < Integer , Collection < RobotState > > ( ) ; private static final Comparator < RobotState > playerNumberComparator = new Comparator < RobotState > ( ) { @ Override public int compare ( RobotState o1 , RobotState o2 ) { } } ; private final HashMap < String , RobotState > robotsByAddress = new HashMap < String , RobotState > ( ) ; private final EventListenerList listeners = new EventListenerList ( ) ; private final ScheduledExecutorService scheduler = Executors . newScheduledThreadPool ( 1 ) ; private final ScheduledFuture < ? > taskHandle ; public static GameState getInstance ( ) { } private GameState ( ) { } public void shutdown ( ) { } public void reset ( ) { } public void updateGameData ( final GameControlData data ) { int changed = 0 ; if ( data == null ) { if ( ( lastGameControlData ) != null ) { synchronized ( teamNumbers ) { teamNumbers [ GameState . TEAM_LEFT ] = 0 ; teamNumbers [ GameState . TEAM_RIGHT ] = 0 ; int s = 0 ; for ( final Map . Entry < Integer , Collection < RobotState > > entry : robots . entrySet ( ) ) { if ( ! ( entry . getValue ( ) . isEmpty ( ) ) ) { teamNumbers [ ( s ++ ) ] = entry . getKey ( ) ; if ( s == 2 ) { break ; } } } } changed = ( ( GameState . CHANGED_LEFT ) | ( GameState . CHANGED_RIGHT ) ) | ( GameState . CHANGED_OTHER ) ; Logger . getInstance ( ) . createLogfile ( ) ; } } else { if ( ( lastGameControlData ) == null ) { synchronized ( teamNumbers ) { teamNumbers [ GameState . TEAM_LEFT ] = data . team [ 0 ] . teamNumber ; teamNumbers [ GameState . TEAM_RIGHT ] = data . team [ 1 ] . teamNumber ; } changed = ( ( GameState . CHANGED_LEFT ) | ( GameState . CHANGED_RIGHT ) ) | ( GameState . CHANGED_OTHER ) ; } else { synchronized ( teamNumbers ) { if ( ( data . team [ 0 ] . teamNumber ) != ( teamNumbers [ GameState . TEAM_LEFT ] ) ) { teamNumbers [ GameState . TEAM_LEFT ] = data . team [ 0 ] . teamNumber ; changed = ( GameState . CHANGED_LEFT ) | ( GameState . CHANGED_OTHER ) ; } if ( ( data . team [ 1 ] . teamNumber ) != ( teamNumbers [ GameState . TEAM_RIGHT ] ) ) { teamNumbers [ GameState . TEAM_RIGHT ] = data . team [ 1 ] . teamNumber ; changed = ( GameState . CHANGED_RIGHT ) | ( GameState . CHANGED_OTHER ) ; } } } teamColors . put ( ( ( int ) ( data . team [ 0 ] . teamNumber ) ) , ( ( int ) ( data . team [ 0 ] . teamColor ) ) ) ; teamColors . put ( ( ( int ) ( data . team [ 1 ] . teamNumber ) ) , ( ( int ) ( data . team [ 1 ] . teamColor ) ) ) ; for ( final TeamInfo team : data . team ) { final Collection < RobotState > teamRobots = robots . get ( ( ( int ) ( team . teamNumber ) ) ) ; if ( teamRobots != null ) { for ( final RobotState r : teamRobots ) { <START_BUG> if ( ( r . getPlayerNumber ( ) ) <= ( team . player . length ) ) { <END_BUG> r . setPenalty ( team . player [ ( ( r . getPlayerNumber ( ) ) - 1 ) ] . penalty ) ; } } } } final StringBuilder logfileName ; if ( ( ( ( data . team [ 0 ] . teamNumber ) == 98 ) || ( ( data . team [ 0 ] . teamNumber ) == 99 ) ) && ( ( ( data . team [ 1 ] . teamNumber ) == 98 ) || ( ( data . team [ 1 ] . teamNumber ) == 99 ) ) ) { logfileName = new StringBuilder ( "Drop-in_" ) ; if ( ( data . firstHalf ) == ( GameControlData . C_TRUE ) ) { logfileName . append ( "1st" ) ; } else { logfileName . append ( "2nd" ) ; } logfileName . append ( "Half" ) ; } else { if ( ( data . firstHalf ) == ( GameControlData . C_TRUE ) ) { logfileName = new StringBuilder ( getTeamName ( ( ( int ) ( data . team [ 0 ] . teamNumber ) ) , false , false ) ) . append ( "_" ) . append ( getTeamName ( ( ( int ) ( data . team [ 1 ] . teamNumber ) ) , false , false ) ) . append ( "_1st" ) ; } else { logfileName = new StringBuilder ( getTeamName ( ( ( int ) ( data . team [ 1 ] . teamNumber ) ) , false , false ) ) . append ( "_" ) . append ( getTeamName ( ( ( int ) ( data . team [ 0 ] . teamNumber ) ) , false , false ) ) . append ( "_2nd" ) ; } logfileName . append ( "Half" ) ; } if ( ( ( data . gameState ) == ( GameControlData . STATE_READY ) ) && ( ( ( lastGameControlData ) == null ) || ( ( lastGameControlData . gameState ) == ( GameControlData . STATE_INITIAL ) ) ) ) { Logger . getInstance ( ) . createLogfile ( logfileName . toString ( ) ) ; }

Fix:
if ( ( ( r . getPlayerNumber ( ) ) != null ) && ( ( r . getPlayerNumber ( ) ) <= ( team . player . length ) ) ) {