Buggy code:
public class ServerIF { private static final int SOCKET_CREATION_TIMEOUT = 1000 * 3 ; private static final int SOCKET_TRANSMISSION_TIMEOUT = 0 ; private static final int NETWORK_TIME_LIMIT = 1000 * 10 ; private static final int SERVER_LOG_TIME_INTERVAL = ( 1000 * 60 ) * 5 ; private static final int NORMAL_POLLING_RATE = 1000 * 1 ; private static final int ACTIVE_POLLING_RATE = 100 ; private static final int SERVER_LOG_LINE_LENGTH = 96 ; private static final String LOG_FILE_A = "LogFile_A.txt" ; private static final String LOG_FILE_B = "LogFile_B.txt" ; private static ServerIF instance ; private Socket socket ; private BufferedReader in ; private BufferedWriter out ; private boolean bConnected ; private String loginMssg ; private Timer timer ; private long timeCommandSent ; private long timeLastLogWritten ; private int nServerErrorsDetected ; private ArrayList < String > serverLog ; private boolean bLogFileA ; private boolean bDatabaseLoaded ; private ArrayList < ServerListener > listeners ; ServerIF ( String serverAddress , int port ) throws IOException , SocketTimeoutException , UnknownHostException { } public static synchronized ServerIF getInstance ( ) { } void setEnabledServerPolling ( boolean tf ) { } void setDatabaseLoaded ( boolean tf ) { } synchronized String sendRequest ( String request ) { } void serverConnectionIssue ( ) { } String getLoginMssg ( ) { } void close ( ) { } void addServerLogItem ( String item ) { } void writeServerLogFile ( ) { } ArrayList < String > getServerLog ( ) { } boolean isConnected ( ) { } void processChange ( String change ) { String [ ] dbResponses = new String [ ] { "ADDED_USER" , "GLOBAL_MESSAGE" , "UPDATED_GLOBALS" , "USER_ONLINE" , "USER_OFFLINE" , "ADDED_FAMILY" , "UPDATED_FAMILY" , "ADDED_AGENT" , "UPDATED_AGENT" , "DELETED_AGENT" , "ADDED_CHILD" , "UPDATED_CHILD" , "DELETED_CHILD" , "WISH_ADDED" , "ADDED_PARTNER" , "UPDATED_PARTNER" , "DELETED_PARTNER" , "ADDED_CATALOG_WISH" , "UPDATED_CATALOG_WISH" , "DELETED_CATALOG_WISH" , "ADDED_WISH_DETAIL" , "UPDATED_WISH_DETAIL" , "DELETED_WISH_DETAIL" , "ADDED_DELIVERY" , "UPDATED_DELIVERY" , "ADDED_DRIVER" , "UPDATED_DRIVER" , "DELETED_DRIVER" } ; String [ ] chatResponses = new String [ ] { "CHAT_REQUESTED" , "CHAT_ACCEPTED" , "CHAT_MESSAGE" , "CHAT_ENDED" , "ADDED_NEW_YEAR" } ; String [ ] menuBarResponses = new String [ ] { "ADDED_NEW_YEAR" } ; if ( change . startsWith ( "CHAT_" ) ) { int index = 0 ; while ( ( index < ( chatResponses . length ) ) && ( ! ( change . startsWith ( chatResponses [ index ] ) ) ) ) index ++ ; if ( index < ( chatResponses . length ) ) fireDataChanged ( chatResponses [ index ] , change . substring ( chatResponses [ index ] . length ( ) ) ) ; } else if ( change . contains ( "_NEW_YEAR" ) ) { int index = 0 ; while ( ( index < ( menuBarResponses . length ) ) && ( ! ( change . startsWith ( menuBarResponses [ index ] ) ) ) ) index ++ ; if ( index < ( menuBarResponses . length ) ) <START_BUG> fireDataChanged ( menuBarResponses [ index ] , change . substring ( dbResponses [ index ] . length ( ) ) ) ; <END_BUG> } else if ( bDatabaseLoaded ) { int index = 0 ; while ( ( index < ( dbResponses . length ) ) && ( ! ( change . startsWith ( dbResponses [ index ] ) ) ) ) index ++ ; if ( index < ( dbResponses . length ) ) fireDataChanged ( dbResponses [ index ] , change . substring ( dbResponses [ index ] . length ( ) ) ) ; } } public synchronized void addServerListener ( ServerListener l ) { } public synchronized void removeServerListener ( ServerListener l ) { } protected void fireDataChanged ( String event_type , String json ) { } private class TimerListener implements ActionListener { @ Override public void actionPerformed ( ActionEvent e ) { } } }

Fix:
fireDataChanged ( menuBarResponses [ index ] , change . substring ( menuBarResponses [ index ] . length ( ) ) ) ;