Buggy code:
public class GarenaTCP extends Thread { boolean terminated ; int conn_id ; long last_time ; long last_received ; Map < Integer , String > local_ports ; int remote_id ; String remote_username ; InetAddress remote_address ; int remote_port ; List < GarenaTCPPacket > packets ; PriorityQueue < GarenaTCPPacket > packetRetransmitQueue ; HashMap < Integer , GarenaTCPPacket > out_packets ; ByteBuffer out_buffer ; String [ ] reservedNames ; GarenaInterface garena ; TCPWorker worker ; Socket socket ; DataOutputStream out ; DataInputStream in ; ByteBuffer buf ; boolean localBuffered ; Integer seq ; Integer ack ; boolean rttMade ; double smoothedRTT ; double rttVariation ; int retransmissionTimeout ; int maximumBufferedPackets ; int standardDelay ; int soTimeout ; double srttAlpha ; double srttBeta ; double srttLower ; double srttUpper ; double srttClockGranularity ; int srttK ; int maxUDPSize ; int maxTCPSize ; public GarenaTCP ( GarenaInterface garena , TCPWorker worker ) { } public void setWorker ( TCPWorker worker ) { } public String getPortHost ( int port ) { } public boolean init ( InetAddress remote_address , int remote_port , int remote_id , int conn_id , int destination_port , MemberInfo member ) { this . remote_address = remote_address ; this . remote_port = remote_port ; this . remote_id = remote_id ; this . conn_id = conn_id ; if ( member != null ) { this . remote_username = member . username ; } else { this . remote_username = remote_id + "" ; } Main . println ( 5 , ( ( ( ( ( ( ( ( ( "[GarenaTCP<seq2seq4repair_space>" + conn_id ) + "]<seq2seq4repair_space>Starting<seq2seq4repair_space>new<seq2seq4repair_space>virtual<seq2seq4repair_space>TCP<seq2seq4repair_space>connection<seq2seq4repair_space>" ) + conn_id ) + "<seq2seq4repair_space>with<seq2seq4repair_space>user<seq2seq4repair_space>" ) + ( remote_username ) ) + "<seq2seq4repair_space>at<seq2seq4repair_space>" ) + remote_address ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + destination_port ) ) ; if ( isReservedName ( remote_username ) ) { Main . println ( 6 , ( ( ( ( ( ( ( ( "[GarenaTCP<seq2seq4repair_space>" + conn_id ) + "]<seq2seq4repair_space>User<seq2seq4repair_space>" ) + ( remote_username ) ) + "<seq2seq4repair_space>at<seq2seq4repair_space>" ) + remote_address ) + "<seq2seq4repair_space>in<seq2seq4repair_space>connection<seq2seq4repair_space>" ) + conn_id ) + "<seq2seq4repair_space>tried<seq2seq4repair_space>to<seq2seq4repair_space>use<seq2seq4repair_space>a<seq2seq4repair_space>reserved<seq2seq4repair_space>name" ) ) ; end ( true ) ; return false ; } String hostname = getPortHost ( destination_port ) ; if ( hostname == null ) { Main . println ( 6 , ( ( ( ( ( ( "[GarenaTCP<seq2seq4repair_space>" + conn_id ) + "]<seq2seq4repair_space>User<seq2seq4repair_space>" ) + ( remote_username ) ) + "<seq2seq4repair_space>tried<seq2seq4repair_space>to<seq2seq4repair_space>connect<seq2seq4repair_space>on<seq2seq4repair_space>port<seq2seq4repair_space>" ) + destination_port ) + ";<seq2seq4repair_space>terminating" ) ) ; end ( true ) ; return false ; } else { Main . println ( 7 , ( ( ( ( ( ( ( "[GarenaTCP<seq2seq4repair_space>" + conn_id ) + "]<seq2seq4repair_space>Connecting<seq2seq4repair_space>to<seq2seq4repair_space>GAMEHOST<seq2seq4repair_space>at<seq2seq4repair_space>" ) + hostname ) + "<seq2seq4repair_space>on<seq2seq4repair_space>port<seq2seq4repair_space>" ) + destination_port ) + "<seq2seq4repair_space>for<seq2seq4repair_space>connection<seq2seq4repair_space>" ) + conn_id ) ) ; try { InetAddress local_address = InetAddress . getByName ( hostname ) ; socket = new Socket ( local_address , destination_port ) ; out = new DataOutputStream ( socket . getOutputStream ( ) ) ; in = new DataInputStream ( socket . getInputStream ( ) ) ; } catch ( IOException ioe ) { end ( true ) ; if ( Main . DEBUG ) { ioe . printStackTrace ( ) ; } return false ; } if ( configuration . getBoolean ( "gcb_enablegcbi" , false ) ) { buf . clear ( ) ; buf . order ( ByteOrder . LITTLE_ENDIAN ) ; buf . put ( ( ( byte ) ( GCBI_HEADER_CONSTANT ) ) ) ; buf . put ( ( ( byte ) ( GCBI_INIT ) ) ) ; buf . putShort ( ( ( short ) ( 22 ) ) ) ; buf . order ( ByteOrder . BIG_ENDIAN ) ; buf . put ( remote_address . getAddress ( ) ) ; buf . putInt ( remote_id ) ; buf . putInt ( garena . room_id ) ; <START_BUG> if ( member != null ) { <END_BUG> buf . putInt ( member . experience ) ; buf . put ( member . country . substring ( 0 , 2 ) . getBytes ( ) ) ; } else { buf . putInt ( ( - 1 ) ) ; buf . put ( "??" . getBytes ( ) ) ; } writeOutData ( buf . array ( ) , 0 , buf . position ( ) , true ) ; } start ( ) ; return true ; } } public void initReverse ( InetAddress remote_address , int remote_port , int remote_id , int conn_id , Socket socket ) { } public void connAck ( int seq , int ack ) { } public void data ( int seq , int ack , byte [ ] data , int offset , int length ) { } public void processOutData ( ByteBuffer buf ) { } public void processOutDataSingle ( ByteBuffer buf , int length ) { } public void writeOutData ( byte [ ] data , boolean force ) { } public void writeOutData ( byte [ ] data , int offset , int length , boolean force ) { } public void standardRetransmission ( ) { } public void acknowledgePacket ( int x ) { } public void run ( ) { } private void handleLocalPacket ( byte [ ] data , ByteBuffer lbuf ) { } private synchronized long lastTime ( ) { } public void end ( boolean removeWorker ) { } public boolean isReservedName ( String test ) { } public boolean isTimeout ( ) { } }

Fix:
if ( ( member != null ) && ( ( member . country . length ( ) ) >= 2 ) ) {