Buggy code:
public class CTP { static final String KEY_REQ_TYPE = "req_type" ; static final String KEY_USER = "user" ; static final String KEY_IP = "ip" ; static final String KEY_FILENAME = "file_name" ; static final String KEY_FILETYPE = "file_type" ; static final String KEY_MSG_LENGTH = "length" ; static final String KEY_USERLIST = "user_list" ; static final String KEY_REQ_MSG = "req_message" ; static final String KEY_RES_MSG = "res_message" ; static final String REQ_USERLIST = "user_list" ; static final String REQ_JOINUSER = "join_user" ; static final String REQ_PROBE = "probe_req" ; static final String REQ_FILE_PROBE = "file_probe_req" ; static final String REQ_LEAVEUSER = "leave_user" ; static final String REQ_FILELIST = "file_list" ; static final String REQ_FILE = "file" ; static final String KEY_RES_TYPE = "res_type" ; static final String RES_USERLIST = "user_list" ; static final String RES_FILELIST = "file_list" ; static final String RES_FILE_PROBE = "file_probe_res" ; static final String RES_PROBE = "probe_res" ; static final String RES_ERROR = "error" ; static final String RES_OK = "ok" ; static final int CTP_TYPE_REQ = 0 ; static final int CTP_TYPE_RES = 1 ; private int ctpType ; private String dataType ; private JSONObject payload ; private int msgLength ; private Logger logger ; public CTP ( String rawMsg ) throws JSONException { } public int getType ( ) { } public String getDataType ( ) { } public static String buildReq_PeerList ( ) { } public static String buildReq_JoinUser ( String userName , String ipAddress ) { } public static String buildReq_Probe ( String userName , String ipAddress ) { } public static String build_FileList ( String userName , List < FileInfo > fileInfoes ) { } public String buildRes_JoinUser ( Map < String , String > userList ) { } public String buildRes_Probe ( Map < String , String > userList ) { } public static String buildRes_PeerList ( Map < String , String > userList ) { } public static String buildRes_Err ( String msg ) { } public static String buildErr_Unrecognized ( ) { } public static String buildRes_Ok ( String msg ) { } public String getMessage ( ) { } public String putPeerList ( Map < String , String > userList ) { if ( ( msgLength ) == ( payload . toString ( ) . length ( ) ) ) { try { JSONArray jArr = payload . getJSONArray ( CTP . KEY_USERLIST ) ; for ( int i = 0 ; i < ( jArr . length ( ) ) ; i ++ ) { JSONObject obj = jArr . getJSONObject ( i ) ; <START_BUG> if ( ( obj . getString ( CTP . KEY_IP ) . split ( "." ) . length ) == 4 ) { <END_BUG> userList . put ( obj . getString ( CTP . KEY_USER ) , obj . getString ( CTP . KEY_IP ) ) ; } else { logger . d ( this , ( "IP<seq2seq4repair_space>Parsing<seq2seq4repair_space>error:<seq2seq4repair_space>" + ( obj . getString ( CTP . KEY_IP ) ) ) ) ; } } return CTP . buildRes_Ok ( "Successfully<seq2seq4repair_space>added." ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } } logger . d ( this , "Parsing<seq2seq4repair_space>error" ) ; return null ; } public static String buildReq_File_Probe ( String fileName ) { } private static String build_req ( String reqType , Map < String , String > params ) { } private static String build_res ( String resType , Map < String , String > params ) { } public String buildRes_File_Probe ( String homeDirectory , String userName , String ipAddress ) { } No newline ; at end ; of file ; }

Fix:
if ( ( obj . getString ( CTP . KEY_IP ) . split ( "\\." ) . length ) == 4 ) {