Buggy code:
public class ClientHandler implements Runnable { Socket clientSocket ; int currentGame = 0 ; int clientID = 0 ; String password ; String user ; String nick ; PrintWriter output ; ClientHandler ( Socket connection ) { } public void run ( ) { } private void handleMessage ( ParsedMessage message ) { } private void ping ( ParsedMessage message ) { } private void pong ( ParsedMessage message ) { } private void register ( ParsedMessage message ) { if ( ( message . args . length ) < 3 ) { sendError ( "not<seq2seq4repair_space>enough<seq2seq4repair_space>parameters<seq2seq4repair_space>recieved,<seq2seq4repair_space>expecting:<seq2seq4repair_space>email,<seq2seq4repair_space>nickname,<seq2seq4repair_space>password" ) ; } else if ( ! ( Common . isValidEmailString ( message . args [ 0 ] ) ) ) { sendError ( ( "invalid<seq2seq4repair_space>email<seq2seq4repair_space>syntax:<seq2seq4repair_space>" + ( message . args [ 0 ] ) ) ) ; } else if ( ! ( Common . isGoodUserName ( message . args [ 1 ] ) ) ) { sendError ( ( "invalid<seq2seq4repair_space>username:<seq2seq4repair_space>" + ( message . args [ 1 ] ) ) ) ; } else if ( ( message . args [ 2 ] . length ( ) ) < 3 ) { sendError ( ( ( "error:<seq2seq4repair_space>password<seq2seq4repair_space>length<seq2seq4repair_space>is<seq2seq4repair_space>too<seq2seq4repair_space>short:<seq2seq4repair_space>" + ( message . args [ 2 ] . length ( ) ) ) + "<seq2seq4repair_space>needs<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>atleast<seq2seq4repair_space>3<seq2seq4repair_space>or<seq2seq4repair_space>greater" ) ) ; } else if ( ( SFAServer . clientDatabasePool ) == null ) { sendError ( "unable<seq2seq4repair_space>to<seq2seq4repair_space>accept<seq2seq4repair_space>registrations<seq2seq4repair_space>at<seq2seq4repair_space>this<seq2seq4repair_space>time" ) ; } else <START_BUG> if ( clientDatabasePool . isConnected ( ) ) { <END_BUG> sendError ( "unable<seq2seq4repair_space>to<seq2seq4repair_space>process<seq2seq4repair_space>registrations<seq2seq4repair_space>at<seq2seq4repair_space>this<seq2seq4repair_space>time" ) ; } else { Connection con = null ; PreparedStatement prep = null ; try { con = clientDatabasePool . getConnection ( ) ; prep = con . prepareStatement ( "insert<seq2seq4repair_space>into<seq2seq4repair_space>SFASchema.UsersTable<seq2seq4repair_space>values<seq2seq4repair_space>(default,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>default,<seq2seq4repair_space>?,<seq2seq4repair_space>default)" ) ; prep . setString ( 1 , message . args [ 0 ] ) ; prep . setString ( 1 , message . args [ 1 ] ) ; prep . setString ( 1 , message . args [ 2 ] ) ; ResultSet rs = prep . executeQuery ( ) ; while ( rs . next ( ) ) { System . out . println ( rs . getInt ( 0 ) ) ; } } catch ( SQLException e ) { sendError ( "an<seq2seq4repair_space>error<seq2seq4repair_space>has<seq2seq4repair_space>occured" ) ; e . printStackTrace ( ) ; } finally { if ( prep != null ) { try { prep . close ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } } if ( con != null ) { clientDatabasePool . returnConnection ( con ) ; } } } } private void user ( ParsedMessage message ) { } private void ready ( ParsedMessage message ) { } private void motd ( ) { } public void quit ( String reason ) { } private void notice ( String notice ) { } private void sendError ( String error ) { } private void sendMessage ( ParsedMessage message ) { } }

Fix:
if ( ! ( clientDatabasePool . isConnected ( ) ) ) {