nus-yam/ex-repair huggingface dataset:
Program: 25871
Project: 25871
Buggy source:
@Override public Bitmap get(String key){
  if (StringHelper.isEmpty(key)) {
    return null;
  }
  Bitmap bitmap=null;
  final SoftReference<Bitmap> reference=memoryCache.get(key);
  if (reference != null) {
    bitmap=reference.get();
  }
  if (bitmap == null) {
    bitmap=loadFromFile(key);
    if (bitmap == null) {
      memoryCache.remove(key);
    }
 else {
      if (App.DEBUG) {
        Log.d(TAG,"String_Node_Str");
      }
      memoryCache.put(key,new SoftReference<Bitmap>(bitmap));
    }
  }
  return bitmap;
}

Fixed version (ground truth):
@Override public Bitmap get(String key){
  if (StringHelper.isEmpty(key)) {
    return null;
  }
  Bitmap bitmap=null;
  final SoftReference<Bitmap> reference=memoryCache.get(key);
  if (reference != null) {
    bitmap=reference.get();
  }
  if (bitmap == null) {
    bitmap=loadFromFile(key);
    if (bitmap == null) {
      memoryCache.remove(key);
    }
 else {
      memoryCache.put(key,new SoftReference<Bitmap>(bitmap));
    }
  }
  return bitmap;
}
Program: 25872
Project: 25872
Buggy source:
@Override public boolean put(String key,Bitmap bitmap){
  if (key == null || bitmap == null) {
    return false;
  }
  memoryCache.put(key,new SoftReference<Bitmap>(bitmap));
  boolean result=writeToFile(key,bitmap);
  if (App.DEBUG) {
    Log.d(TAG,"String_Node_Str" + result);
  }
  return result;
}

Fixed version (ground truth):
@Override public boolean put(String key,Bitmap bitmap){
  if (key == null || bitmap == null) {
    return false;
  }
  memoryCache.put(key,new SoftReference<Bitmap>(bitmap));
  boolean result=writeToFile(key,bitmap);
  return result;
}
Program: 25873
Project: 25873
Buggy source:
public static CursorLoader getConversationLoader(Activity activity,String id){
  String where=DirectMessageColumns.TYPE + "String_Node_Str" + DirectMessageColumns.CONVERSATION_ID+ "String_Node_Str";
  String[] whereArgs=new String[]{String.valueOf(DirectMessageModel.TYPE_CONVERSATION),id};
  String orderBy=DataProvider.ORDERBY_TIME;
  return new CursorLoader(activity,DirectMessageColumns.CONTENT_URI,null,where,whereArgs,orderBy);
}

Fixed version (ground truth):
public static CursorLoader getConversationLoader(Activity activity,String id){
  String where=DirectMessageColumns.TYPE + "String_Node_Str" + DirectMessageColumns.CONVERSATION_ID+ "String_Node_Str";
  String[] whereArgs=new String[]{String.valueOf(DirectMessageModel.TYPE_CONVERSATION_LIST),id};
  String orderBy=DataProvider.ORDERBY_TIME;
  return new CursorLoader(activity,DirectMessageColumns.CONTENT_URI,null,where,whereArgs,orderBy);
}
Program: 25874
Project: 25874
Buggy source:
@Override public ContentValues values(){
  ContentValues cv=convert();
  cv.put(StatusColumns.TEXT,this.text);
  cv.put(StatusColumns.SIMPLE_TEXT,this.simpleText);
  cv.put(StatusColumns.SOURCE,this.source);
  cv.put(StatusColumns.GEO,this.geo);
  cv.put(StatusColumns.MEDIA,this.media);
  cv.put(StatusColumns.USER_ID,this.userId);
  cv.put(StatusColumns.USER_IDSTR,this.userIdstr);
  cv.put(StatusColumns.USER_SCREEN_NAME,this.userScreenName);
  cv.put(StatusColumns.IN_REPLY_TO_STATUS_ID,this.inReplyToStatusId);
  cv.put(StatusColumns.IN_REPLY_TO_USER_ID,this.inReplyToUserId);
  cv.put(StatusColumns.IN_REPLY_TO_SCREEN_NAME,this.inReplyToScreenName);
  cv.put(StatusColumns.RT_STATUS_ID,this.rtStatusId);
  cv.put(StatusColumns.RT_USER_ID,this.rtUserId);
  cv.put(StatusColumns.RT_USER_SCREEN_NAME,this.rtScreenName);
  cv.put(StatusColumns.PHOTO_IMAGE_URL,this.photoImageUrl);
  cv.put(StatusColumns.PHOTO_THUMB_URL,this.photoThumbUrl);
  cv.put(StatusColumns.PHOTO_LARGE_URL,this.photoLargeUrl);
  cv.put(StatusColumns.TRUNCATED,this.truncated);
  cv.put(StatusColumns.FAVORITED,this.favorited);
  cv.put(StatusColumns.RETWEETED,this.retweeted);
  cv.put(StatusColumns.SELF,this.self);
  cv.put(StatusColumns.READ,this.read);
  cv.put(StatusColumns.THREAD,this.thread);
  cv.put(StatusColumns.PHOTO,this.photo);
  cv.put(StatusColumns.SPECIAL,this.special);
  return cv;
}

Fixed version (ground truth):
@Override public ContentValues values(){
  ContentValues cv=convert();
  cv.put(StatusColumns.TEXT,this.text);
  cv.put(StatusColumns.SIMPLE_TEXT,this.simpleText);
  cv.put(StatusColumns.SOURCE,this.source);
  cv.put(StatusColumns.GEO,this.geo);
  cv.put(StatusColumns.MEDIA,this.media);
  cv.put(StatusColumns.USER_RAWID,this.userRawid);
  cv.put(StatusColumns.USER_ID,this.userId);
  cv.put(StatusColumns.USER_SCREEN_NAME,this.userScreenName);
  cv.put(StatusColumns.IN_REPLY_TO_STATUS_ID,this.inReplyToStatusId);
  cv.put(StatusColumns.IN_REPLY_TO_USER_ID,this.inReplyToUserId);
  cv.put(StatusColumns.IN_REPLY_TO_SCREEN_NAME,this.inReplyToScreenName);
  cv.put(StatusColumns.RT_STATUS_ID,this.rtStatusId);
  cv.put(StatusColumns.RT_USER_ID,this.rtUserId);
  cv.put(StatusColumns.RT_USER_SCREEN_NAME,this.rtScreenName);
  cv.put(StatusColumns.PHOTO_IMAGE_URL,this.photoImageUrl);
  cv.put(StatusColumns.PHOTO_THUMB_URL,this.photoThumbUrl);
  cv.put(StatusColumns.PHOTO_LARGE_URL,this.photoLargeUrl);
  cv.put(StatusColumns.TRUNCATED,this.truncated);
  cv.put(StatusColumns.FAVORITED,this.favorited);
  cv.put(StatusColumns.RETWEETED,this.retweeted);
  cv.put(StatusColumns.SELF,this.self);
  cv.put(StatusColumns.READ,this.read);
  cv.put(StatusColumns.THREAD,this.thread);
  cv.put(StatusColumns.PHOTO,this.photo);
  cv.put(StatusColumns.SPECIAL,this.special);
  return cv;
}
Program: 25875
Project: 25875
Buggy source:
public StatusModel(Parcel in){
  readBase(in);
  text=in.readString();
  simpleText=in.readString();
  source=in.readString();
  geo=in.readString();
  media=in.readString();
  userId=in.readLong();
  userIdstr=in.readString();
  userScreenName=in.readString();
  inReplyToStatusId=in.readString();
  inReplyToUserId=in.readString();
  inReplyToScreenName=in.readString();
  rtStatusId=in.readString();
  rtUserId=in.readString();
  rtScreenName=in.readString();
  photoImageUrl=in.readString();
  photoLargeUrl=in.readString();
  photoThumbUrl=in.readString();
  truncated=in.readInt() == 0 ? false : true;
  favorited=in.readInt() == 0 ? false : true;
  retweeted=in.readInt() == 0 ? false : true;
  self=in.readInt() == 0 ? false : true;
  read=in.readInt() == 0 ? false : true;
  thread=in.readInt() == 0 ? false : true;
  photo=in.readInt() == 0 ? false : true;
  special=in.readInt() == 0 ? false : true;
}

Fixed version (ground truth):
public StatusModel(Parcel in){
  readBase(in);
  text=in.readString();
  simpleText=in.readString();
  source=in.readString();
  geo=in.readString();
  media=in.readString();
  userRawid=in.readLong();
  userId=in.readString();
  userScreenName=in.readString();
  inReplyToStatusId=in.readString();
  inReplyToUserId=in.readString();
  inReplyToScreenName=in.readString();
  rtStatusId=in.readString();
  rtUserId=in.readString();
  rtScreenName=in.readString();
  photoImageUrl=in.readString();
  photoLargeUrl=in.readString();
  photoThumbUrl=in.readString();
  truncated=in.readInt() == 0 ? false : true;
  favorited=in.readInt() == 0 ? false : true;
  retweeted=in.readInt() == 0 ? false : true;
  self=in.readInt() == 0 ? false : true;
  read=in.readInt() == 0 ? false : true;
  thread=in.readInt() == 0 ? false : true;
  photo=in.readInt() == 0 ? false : true;
  special=in.readInt() == 0 ? false : true;
}
Program: 25876
Project: 25876
Buggy source:
@Override public void writeToParcel(Parcel dest,int flags){
  writeBase(dest,flags);
  dest.writeString(text);
  dest.writeString(simpleText);
  dest.writeString(source);
  dest.writeString(geo);
  dest.writeString(media);
  dest.writeLong(userId);
  dest.writeString(userIdstr);
  dest.writeString(userScreenName);
  dest.writeString(inReplyToStatusId);
  dest.writeString(inReplyToUserId);
  dest.writeString(inReplyToScreenName);
  dest.writeString(rtStatusId);
  dest.writeString(rtUserId);
  dest.writeString(rtScreenName);
  dest.writeString(photoImageUrl);
  dest.writeString(photoLargeUrl);
  dest.writeString(photoThumbUrl);
  dest.writeInt(truncated ? 1 : 0);
  dest.writeInt(favorited ? 1 : 0);
  dest.writeInt(retweeted ? 1 : 0);
  dest.writeInt(self ? 1 : 0);
  dest.writeInt(read ? 1 : 0);
  dest.writeInt(thread ? 1 : 0);
  dest.writeInt(photo ? 1 : 0);
  dest.writeInt(special ? 1 : 0);
}

Fixed version (ground truth):
@Override public void writeToParcel(Parcel dest,int flags){
  writeBase(dest,flags);
  dest.writeString(text);
  dest.writeString(simpleText);
  dest.writeString(source);
  dest.writeString(geo);
  dest.writeString(media);
  dest.writeLong(userRawid);
  dest.writeString(userId);
  dest.writeString(userScreenName);
  dest.writeString(inReplyToStatusId);
  dest.writeString(inReplyToUserId);
  dest.writeString(inReplyToScreenName);
  dest.writeString(rtStatusId);
  dest.writeString(rtUserId);
  dest.writeString(rtScreenName);
  dest.writeString(photoImageUrl);
  dest.writeString(photoLargeUrl);
  dest.writeString(photoThumbUrl);
  dest.writeInt(truncated ? 1 : 0);
  dest.writeInt(favorited ? 1 : 0);
  dest.writeInt(retweeted ? 1 : 0);
  dest.writeInt(self ? 1 : 0);
  dest.writeInt(read ? 1 : 0);
  dest.writeInt(thread ? 1 : 0);
  dest.writeInt(photo ? 1 : 0);
  dest.writeInt(special ? 1 : 0);
}
Program: 25877
Project: 25877
Buggy source:
private void configListView(final ListView list){
  list.setHorizontalScrollBarEnabled(false);
  list.setVerticalScrollBarEnabled(false);
  list.setCacheColorHint(0);
  list.setSelector(getResources().getDrawable(R.drawable.list_selector));
  list.setDivider(getResources().getDrawable(R.drawable.separator));
  list.setOnItemClickListener(this);
  list.setOnItemClickListener(this);
}

Fixed version (ground truth):
private void configListView(final ListView list){
  list.setHorizontalScrollBarEnabled(false);
  list.setVerticalScrollBarEnabled(false);
  list.setCacheColorHint(0);
  list.setSelector(getResources().getDrawable(R.drawable.list_selector));
  list.setDivider(getResources().getDrawable(R.drawable.separator));
  list.setOnItemClickListener(this);
  list.setOnItemLongClickListener(this);
}
Program: 25878
Project: 25878
Buggy source:
private void setLayout(){
  setContentView(R.layout.list_pull);
  setActionBar();
  mEmptyView=(ViewGroup)findViewById(R.id.empty);
  mEmptyView.setVisibility(View.GONE);
  mPullToRefreshListView=(PullToRefreshListView)findViewById(R.id.list);
  mPullToRefreshListView.setOnRefreshListener(this);
  mList=mPullToRefreshListView.getRefreshableView();
  mList.setAdapter(mStatusAdapter);
  configListView(mList);
}

Fixed version (ground truth):
private void setLayout(){
  setContentView(R.layout.list_pull);
  setActionBar();
  mPullToRefreshListView=(PullToRefreshListView)findViewById(R.id.list);
  mPullToRefreshListView.setOnRefreshListener(this);
  mList=mPullToRefreshListView.getRefreshableView();
  mList.setAdapter(mStatusAdapter);
  configListView(mList);
}
Program: 25879
Project: 25879
Buggy source:
@Override protected void onPostExecute(List<com.fanfou.app.api.Status> result){
  if (result != null && result.size() > 0) {
    mThread.addAll(result);
  }
  mPullToRefreshListView.onRefreshComplete();
}

Fixed version (ground truth):
@Override protected void onPostExecute(List<com.fanfou.app.api.Status> result){
  if (result != null && result.size() > 0) {
    mThread.addAll(result);
  }
  mPullToRefreshListView.onRefreshComplete();
  mPullToRefreshListView.setPullToRefreshEnabled(false);
}
Program: 25880
Project: 25880
Buggy source:
/** 
 * exec http request
 * @param request
 * @return response object
 * @throws ApiException
 */
private NetResponse fetch(final NetRequest request) throws ApiException {
  final FanFouOAuthProvider provider=new FanFouOAuthProvider();
  final OAuthToken token=App.getOAuthToken();
  final OAuthService service=new OAuthService(provider,token);
  final OAuthClient client=new OAuthClient(service,request);
  try {
    HttpResponse response=client.exec();
    NetResponse res=new NetResponse(response);
    int statusCode=response.getStatusLine().getStatusCode();
    if (App.DEBUG) {
      log("String_Node_Str" + request.url + "String_Node_Str"+ request.post+ "String_Node_Str"+ statusCode);
    }
    if (statusCode == HTTP_OK) {
      return res;
    }
 else     if (statusCode == HTTP_UNAUTHORIZED) {
      throw new ApiException(statusCode,"String_Node_Str");
    }
 else {
      throw new ApiException(statusCode,Parser.error(res.getContent()));
    }
  }
 catch (  Exception e) {
    if (App.DEBUG) {
      Log.e(TAG,e.toString());
    }
    throw new ApiException(ERROR_IO_EXCEPTION,e.getMessage(),e.getCause());
  }
}

Fixed version (ground truth):
/** 
 * exec http request
 * @param request
 * @return response object
 * @throws ApiException
 */
private NetResponse fetch(final NetRequest request) throws ApiException {
  final FanFouOAuthProvider provider=new FanFouOAuthProvider();
  final OAuthToken token=App.getOAuthToken();
  final OAuthService service=new OAuthService(provider,token);
  final OAuthClient client=new OAuthClient(service,request);
  try {
    HttpResponse response=client.exec();
    NetResponse res=new NetResponse(response);
    int statusCode=response.getStatusLine().getStatusCode();
    if (App.DEBUG) {
      log("String_Node_Str" + request.url + "String_Node_Str"+ request.post+ "String_Node_Str"+ statusCode);
    }
    if (statusCode == HTTP_OK) {
      return res;
    }
 else     if (statusCode == HTTP_UNAUTHORIZED) {
      throw new ApiException(statusCode,"String_Node_Str");
    }
 else {
      throw new ApiException(statusCode,Parser.error(res.getContent()));
    }
  }
 catch (  IOException e) {
    if (App.DEBUG) {
      Log.e(TAG,e.toString());
    }
    throw new ApiException(ERROR_IO_EXCEPTION,e.getMessage(),e.getCause());
  }
}
Program: 25881
Project: 25881
Buggy source:
private void handleDm(int count){
  Cursor mc=initCursor(Constants.TYPE_DIRECT_MESSAGES_INBOX);
  List<DirectMessage> dms=null;
  try {
    dms=mApi.directMessagesInbox(count,DEFAULT_PAGE,Utils.getDmSinceId(mc),null,Constants.MODE);
  }
 catch (  ApiException e) {
    if (App.DEBUG) {
      Log.e(TAG,"String_Node_Str" + e.statusCode + "String_Node_Str"+ e.getMessage());
    }
  }
  mc.close();
  if (dms != null) {
    int size=dms.size();
    if (size > 0) {
      if (App.DEBUG) {
        Log.d(TAG,"String_Node_Str" + size);
      }
      if (size == 1) {
        DirectMessage dm=dms.get(0);
        getContentResolver().insert(DirectMessageInfo.CONTENT_URI,dm.toContentValues());
        notifyDmOne(NOTIFICATION_TYPE_DM,dms.get(0));
      }
 else {
        getContentResolver().bulkInsert(DirectMessageInfo.CONTENT_URI,Parser.toContentValuesArray(dms));
        notifyDmList(NOTIFICATION_TYPE_DM,size);
      }
      getContentResolver().notifyChange(DirectMessageInfo.CONTENT_URI,null,false);
    }
  }
}

Fixed version (ground truth):
private void handleDm(int count){
  Cursor mc=initCursor(Constants.TYPE_DIRECT_MESSAGES_INBOX);
  List<DirectMessage> dms=null;
  try {
    dms=mApi.directMessagesInbox(count,DEFAULT_PAGE,Utils.getDmSinceId(mc),null,Constants.MODE);
  }
 catch (  ApiException e) {
    if (App.DEBUG) {
      Log.e(TAG,"String_Node_Str" + e.statusCode + "String_Node_Str"+ e.getMessage());
    }
  }
catch (  Exception e) {
    if (App.DEBUG) {
      Log.e(TAG,e.getMessage());
    }
  }
  mc.close();
  if (dms != null) {
    int size=dms.size();
    if (size > 0) {
      if (App.DEBUG) {
        Log.d(TAG,"String_Node_Str" + size);
      }
      if (size == 1) {
        DirectMessage dm=dms.get(0);
        getContentResolver().insert(DirectMessageInfo.CONTENT_URI,dm.toContentValues());
        notifyDmOne(NOTIFICATION_TYPE_DM,dms.get(0));
      }
 else {
        getContentResolver().bulkInsert(DirectMessageInfo.CONTENT_URI,Parser.toContentValuesArray(dms));
        notifyDmList(NOTIFICATION_TYPE_DM,size);
      }
      getContentResolver().notifyChange(DirectMessageInfo.CONTENT_URI,null,false);
    }
  }
}
Program: 25882
Project: 25882
Buggy source:
private void handleMention(int count){
  Cursor mc=initCursor(Constants.TYPE_STATUSES_MENTIONS);
  List<Status> ss=null;
  try {
    ss=mApi.mentions(count,DEFAULT_PAGE,Utils.getSinceId(mc),null,Constants.FORMAT,Constants.MODE);
  }
 catch (  ApiException e) {
    if (App.DEBUG) {
      Log.e(TAG,"String_Node_Str" + e.statusCode + "String_Node_Str"+ e.getMessage());
    }
  }
  mc.close();
  if (ss != null) {
    int size=ss.size();
    if (size > 0) {
      if (App.DEBUG) {
        Log.d(TAG,"String_Node_Str" + size);
      }
      if (size == 1) {
        Status s=ss.get(0);
        getContentResolver().insert(StatusInfo.CONTENT_URI,s.toContentValues());
        notifyStatusOne(NOTIFICATION_TYPE_MENTION,s);
      }
 else {
        getContentResolver().bulkInsert(StatusInfo.CONTENT_URI,Parser.toContentValuesArray(ss));
        notifyStatusList(NOTIFICATION_TYPE_MENTION,size);
      }
      getContentResolver().notifyChange(StatusInfo.CONTENT_URI,null,false);
    }
  }
}

Fixed version (ground truth):
private void handleMention(int count){
  Cursor mc=initCursor(Constants.TYPE_STATUSES_MENTIONS);
  List<Status> ss=null;
  try {
    ss=mApi.mentions(count,DEFAULT_PAGE,Utils.getSinceId(mc),null,Constants.FORMAT,Constants.MODE);
  }
 catch (  ApiException e) {
    if (App.DEBUG) {
      Log.e(TAG,"String_Node_Str" + e.statusCode + "String_Node_Str"+ e.getMessage());
    }
  }
catch (  Exception e) {
    if (App.DEBUG) {
      Log.e(TAG,e.getMessage());
    }
  }
  mc.close();
  if (ss != null) {
    int size=ss.size();
    if (size > 0) {
      if (App.DEBUG) {
        Log.d(TAG,"String_Node_Str" + size);
      }
      if (size == 1) {
        Status s=ss.get(0);
        getContentResolver().insert(StatusInfo.CONTENT_URI,s.toContentValues());
        notifyStatusOne(NOTIFICATION_TYPE_MENTION,s);
      }
 else {
        getContentResolver().bulkInsert(StatusInfo.CONTENT_URI,Parser.toContentValuesArray(ss));
        notifyStatusList(NOTIFICATION_TYPE_MENTION,size);
      }
      getContentResolver().notifyChange(StatusInfo.CONTENT_URI,null,false);
    }
  }
}
Program: 25883
Project: 25883
Buggy source:
private void handleHome(int count){
  Cursor mc=initCursor(Constants.TYPE_STATUSES_HOME_TIMELINE);
  List<Status> ss=null;
  try {
    ss=mApi.homeTimeline(count,DEFAULT_PAGE,Utils.getSinceId(mc),null,Constants.FORMAT,Constants.MODE);
  }
 catch (  ApiException e) {
    if (App.DEBUG) {
      Log.e(TAG,"String_Node_Str" + e.statusCode + "String_Node_Str"+ e.getMessage());
    }
  }
  mc.close();
  if (ss != null) {
    int size=ss.size();
    if (size > 0) {
      if (App.DEBUG) {
        Log.d(TAG,"String_Node_Str" + size);
      }
      if (size == 1) {
        Status s=ss.get(0);
        getContentResolver().insert(StatusInfo.CONTENT_URI,s.toContentValues());
        notifyStatusOne(NOTIFICATION_TYPE_HOME,ss.get(0));
      }
 else {
        getContentResolver().bulkInsert(StatusInfo.CONTENT_URI,Parser.toContentValuesArray(ss));
        notifyStatusList(NOTIFICATION_TYPE_HOME,size);
      }
      getContentResolver().notifyChange(StatusInfo.CONTENT_URI,null,false);
    }
  }
}

Fixed version (ground truth):
private void handleHome(int count){
  Cursor mc=initCursor(Constants.TYPE_STATUSES_HOME_TIMELINE);
  List<Status> ss=null;
  try {
    ss=mApi.homeTimeline(count,DEFAULT_PAGE,Utils.getSinceId(mc),null,Constants.FORMAT,Constants.MODE);
  }
 catch (  ApiException e) {
    if (App.DEBUG) {
      Log.e(TAG,"String_Node_Str" + e.statusCode + "String_Node_Str"+ e.getMessage());
    }
  }
catch (  Exception e) {
    if (App.DEBUG) {
      Log.e(TAG,e.getMessage());
    }
  }
  mc.close();
  if (ss != null) {
    int size=ss.size();
    if (size > 0) {
      if (App.DEBUG) {
        Log.d(TAG,"String_Node_Str" + size);
      }
      if (size == 1) {
        Status s=ss.get(0);
        getContentResolver().insert(StatusInfo.CONTENT_URI,s.toContentValues());
        notifyStatusOne(NOTIFICATION_TYPE_HOME,ss.get(0));
      }
 else {
        getContentResolver().bulkInsert(StatusInfo.CONTENT_URI,Parser.toContentValuesArray(ss));
        notifyStatusList(NOTIFICATION_TYPE_HOME,size);
      }
      getContentResolver().notifyChange(StatusInfo.CONTENT_URI,null,false);
    }
  }
}
Program: 25884
Project: 25884
Buggy source:
public static void setStatus(final TextView textView,final String text){
  String processedText=preprocessText(text);
  textView.setText(Html.fromHtml(processedText),BufferType.SPANNABLE);
  Linkify.addLinks(textView,Linkify.WEB_URLS);
  linkifyUsers(textView);
  linkifyTags(textView);
  userNameIdMap.clear();
}

Fixed version (ground truth):
public static void setStatus(final TextView textView,final String text){
  String processedText=preprocessText(text);
  textView.setText(processedText,BufferType.SPANNABLE);
  Linkify.addLinks(textView,Linkify.WEB_URLS);
  linkifyUsers(textView);
  linkifyTags(textView);
  if (App.DEBUG) {
    Log.e(TAG,"String_Node_Str" + text);
    Log.e(TAG,"String_Node_Str" + processedText);
    Log.e(TAG,"String_Node_Str" + textView.getText().toString());
  }
  userNameIdMap.clear();
}
Program: 25886
Project: 25886
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (resultCode == RESULT_OK) {
switch (requestCode) {
case REQUEST_LOCATION_ADD:
      break;
case REQUEST_PHOTO_LIBRARY:
    if (App.DEBUG) {
      log("String_Node_Str");
    }
  if (data != null) {
    parsePhoto(data.getData());
  }
break;
case REQUEST_PHOTO_CAPTURE:
if (App.DEBUG) {
log("String_Node_Str");
}
if (data != null) {
doCameraShot(data);
}
break;
case REQUEST_USERNAME_ADD:
if (App.DEBUG) {
log("String_Node_Str");
}
if (data != null) {
insertNames(data);
}
break;
default :
break;
}
}
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (resultCode == RESULT_OK) {
switch (requestCode) {
case REQUEST_LOCATION_ADD:
      break;
case REQUEST_PHOTO_LIBRARY:
    if (App.DEBUG) {
      log("String_Node_Str" + data);
    }
  if (data != null) {
    parsePhoto(data.getData());
  }
break;
case REQUEST_PHOTO_CAPTURE:
if (App.DEBUG) {
log("String_Node_Str");
}
doCameraShot();
break;
case REQUEST_USERNAME_ADD:
if (App.DEBUG) {
log("String_Node_Str" + data);
}
if (data != null) {
insertNames(data);
}
break;
default :
break;
}
}
}
Program: 25887
Project: 25887
Buggy source:
private void startCameraShot(){
  photo=IOHelper.getPhotoFilePath(this);
  photoUri=Uri.fromFile(photo);
  Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  intent.putExtra(MediaStore.EXTRA_OUTPUT,photoUri);
  startActivityForResult(Intent.createChooser(intent,"String_Node_Str"),REQUEST_PHOTO_CAPTURE);
}

Fixed version (ground truth):
private void startCameraShot(){
  photo=IOHelper.getPhotoFilePath(this);
  photoUri=Uri.fromFile(photo);
  if (App.DEBUG) {
    log("String_Node_Str" + photo.getAbsolutePath());
    log("String_Node_Str" + photoUri);
  }
  Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  intent.putExtra(MediaStore.EXTRA_OUTPUT,photoUri);
  startActivityForResult(Intent.createChooser(intent,"String_Node_Str"),REQUEST_PHOTO_CAPTURE);
}
Program: 25888
Project: 25888
Buggy source:
private void doCameraShot(Intent data){
  try {
    if (App.DEBUG) {
      log("String_Node_Str" + photoUri);
      log("String_Node_Str" + photo.getCanonicalPath());
      log("String_Node_Str" + photo.length());
    }
    showPreview();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void doCameraShot(){
  if (App.DEBUG) {
    log("String_Node_Str" + photoUri);
    log("String_Node_Str" + photo.getAbsolutePath());
    log("String_Node_Str" + photo.length());
  }
  showPreview();
}
Program: 25889
Project: 25889
Buggy source:
public static File getPhotoFilePath(Context context){
  File baseDir=getPhotoDir(context);
  if (!baseDir.exists()) {
    baseDir.mkdirs();
  }
  Date date=new Date();
  String filename=FILENAME_FORMAT.format(date);
  return new File(baseDir,filename);
}

Fixed version (ground truth):
public static File getPhotoFilePath(Context context){
  File baseDir=getPhotoDir(context);
  Date date=new Date();
  String filename=FILENAME_FORMAT.format(date);
  return new File(baseDir,filename);
}
Program: 25890
Project: 25890
Buggy source:
private void setLayout(){
  setContentView(R.layout.list_pull);
  setActionBar();
  mEmptyView=(ViewGroup)findViewById(R.id.empty);
  mPullToRefreshListView=(PullToRefreshListView)findViewById(R.id.list);
  mList=mPullToRefreshListView.getRefreshableView();
  configListView(mList);
}

Fixed version (ground truth):
private void setLayout(){
  setContentView(R.layout.list_pull);
  setActionBar();
  mPullToRefreshListView=(PullToRefreshListView)findViewById(R.id.list);
  mPullToRefreshListView.setOnRefreshListener(this);
  mList=mPullToRefreshListView.getRefreshableView();
  mList.setOnItemClickListener(this);
  mList.setOnItemLongClickListener(this);
  mStatusAdapter=new SearchResultsAdapter(this,mStatuses);
  mList.setAdapter(mStatusAdapter);
}
Program: 25891
Project: 25891
Buggy source:
protected void search(){
  parseIntent();
  mStatuses.clear();
  doSearch(true);
  showProgress();
}

Fixed version (ground truth):
protected void search(){
  parseIntent();
  mStatuses.clear();
  doSearch(true);
  mPullToRefreshListView.setRefreshing();
}
Program: 25892
Project: 25892
Buggy source:
@Override protected void onPostExecute(List<com.fanfou.app.api.Status> result){
  if (!showListView) {
    showContent();
  }
  if (result != null && result.size() > 0) {
    int size=result.size();
    log("String_Node_Str" + size);
    maxId=result.get(size - 1).id;
    log("String_Node_Str" + maxId);
    mStatuses.addAll(result);
    updateUI(size < 20);
  }
  mPullToRefreshListView.onRefreshComplete();
}

Fixed version (ground truth):
@Override protected void onPostExecute(List<com.fanfou.app.api.Status> result){
  mPullToRefreshListView.onRefreshComplete();
  if (result != null && result.size() > 0) {
    int size=result.size();
    log("String_Node_Str" + size);
    maxId=result.get(size - 1).id;
    log("String_Node_Str" + maxId);
    mStatuses.addAll(result);
    updateUI(size < 20);
  }
  mPullToRefreshListView.onRefreshComplete();
}
Program: 25893
Project: 25893
Buggy source:
@Override protected void onPreExecute(){
}

Fixed version (ground truth):
@Override protected void onPreExecute(){
  if (maxId == null) {
    mStatuses.clear();
    mStatusAdapter.notifyDataSetChanged();
  }
}
Program: 25894
Project: 25894
Buggy source:
private void doSearch(boolean reset){
  if (keyword != null) {
    if (App.DEBUG) {
      log("String_Node_Str" + keyword);
    }
    mActionBar.setTitle(keyword);
    if (reset) {
      mStatuses.clear();
      mStatusAdapter.notifyDataSetChanged();
    }
    new SearchTask().execute();
    mPullToRefreshListView.setRefreshing();
  }
}

Fixed version (ground truth):
private void doSearch(boolean reset){
  if (keyword != null) {
    if (App.DEBUG) {
      log("String_Node_Str" + keyword);
    }
    mActionBar.setTitle(keyword);
    if (reset) {
      maxId=null;
    }
    new SearchTask().execute();
    mPullToRefreshListView.setRefreshing();
  }
}
Program: 25895
Project: 25895
Buggy source:
private void switchLocation(){
  enableLocation=!enableLocation;
  OptionHelper.saveBoolean(mContext,R.string.option_location_enable,enableLocation);
  if (App.DEBUG)   log("String_Node_Str" + enableLocation);
  if (enableLocation) {
    iLocationIcon.setImageResource(R.drawable.ic_bar_geoon);
    mLocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,0,0,mLocationMonitor);
  }
 else {
    iLocationIcon.setImageResource(R.drawable.ic_bar_geooff);
    mLocationManager.removeUpdates(mLocationMonitor);
  }
}

Fixed version (ground truth):
private void switchLocation(){
  enableLocation=!enableLocation;
  OptionHelper.saveBoolean(mContext,R.string.option_location_enable,enableLocation);
  if (App.DEBUG)   log("String_Node_Str" + enableLocation);
  if (enableLocation) {
    iLocationIcon.setImageResource(R.drawable.ic_bar_geoon);
    if (mLocationProvider != null) {
      mLocationManager.requestLocationUpdates(mLocationProvider,0,0,mLocationMonitor);
    }
  }
 else {
    iLocationIcon.setImageResource(R.drawable.ic_bar_geooff);
    mLocationManager.removeUpdates(mLocationMonitor);
  }
}
Program: 25896
Project: 25896
Buggy source:
/** 
 * Deallocates the resources and Instance of SoundManager
 */
public static void cleanup(){
  mSoundPool.release();
  mSoundPool=null;
  mSoundPoolMap.clear();
  mAudioManager.unloadSoundEffects();
  _instance=null;
}

Fixed version (ground truth):
/** 
 * Deallocates the resources and Instance of SoundManager
 */
public static void cleanup(){
  mSoundPool.release();
  mSoundPool=null;
  mSoundPoolMap.clear();
  _instance=null;
}
Program: 25897
Project: 25897
Buggy source:
@Override protected void onPostExecute(ResultInfo result){
  try {
    if (progressDialog != null && progressDialog.isShowing()) {
      progressDialog.dismiss();
    }
  }
 catch (  Exception e) {
  }
switch (result.code) {
case LOGIN_IO_ERROR:
    Utils.notify(mContext,result.message);
  break;
case LOGIN_AUTH_FAILED:
Utils.notify(mContext,result.message);
break;
case LOGIN_CANCELLED_BY_USER:
break;
case LOGIN_AUTH_SUCCESS:
g.setCustomVar(2,"String_Node_Str",username);
g.setCustomVar(2,"String_Node_Str",String.valueOf(Build.VERSION.SDK_INT));
g.setCustomVar(2,"String_Node_Str",Build.MODEL);
g.setCustomVar(2,"String_Node_Str",DeviceHelper.uuid(mContext));
if (g != null) {
g.dispatch();
}
AlarmHelper.setScheduledTasks(mContext);
IntentHelper.goHomePage(mContext,page);
finish();
break;
default :
break;
}
}

Fixed version (ground truth):
@Override protected void onPostExecute(ResultInfo result){
  progressDialog.dismiss();
switch (result.code) {
case LOGIN_IO_ERROR:
case LOGIN_AUTH_FAILED:
    Utils.notify(mContext,result.message);
  break;
case LOGIN_CANCELLED_BY_USER:
break;
case LOGIN_AUTH_SUCCESS:
if (g != null) {
g.setCustomVar(2,"String_Node_Str",username);
g.setCustomVar(2,"String_Node_Str",Build.VERSION.SDK);
g.setCustomVar(2,"String_Node_Str",Build.MODEL);
g.setCustomVar(2,"String_Node_Str",DeviceHelper.uuid(mContext));
g.dispatch();
}
AlarmHelper.setScheduledTasks(mContext);
IntentHelper.goHomePage(mContext,page);
finish();
break;
default :
break;
}
}
Program: 25898
Project: 25898
Buggy source:
/** 
 * exec http request
 * @param request
 * @return response object
 * @throws ApiException
 */
private NetResponse fetch(final NetRequest request) throws ApiException {
  OAuthNetClient client=new OAuthNetClient(oauth);
  try {
    HttpResponse response=client.open(request);
    int statusCode=response.getStatusLine().getStatusCode();
    if (App.DEBUG) {
      log("String_Node_Str" + request.url + "String_Node_Str"+ request.post+ "String_Node_Str"+ statusCode);
    }
    if (statusCode == HTTP_OK) {
      return new NetResponse(response);
    }
    throw new ApiException(statusCode,Parser.error(response));
  }
 catch (  IOException e) {
    if (App.DEBUG) {
      Log.e(TAG,e.toString());
    }
    throw new ApiException(ERROR_IO_EXCEPTION,e.toString(),e.getCause());
  }
}

Fixed version (ground truth):
/** 
 * exec http request
 * @param request
 * @return response object
 * @throws ApiException
 */
private NetResponse fetch(final NetRequest request) throws ApiException {
  OAuthNetClient client=new OAuthNetClient(oauth);
  try {
    HttpResponse response=client.open(request);
    NetResponse res=new NetResponse(response);
    int statusCode=response.getStatusLine().getStatusCode();
    if (App.DEBUG) {
      log("String_Node_Str" + request.url + "String_Node_Str"+ request.post+ "String_Node_Str"+ statusCode);
    }
    if (statusCode == HTTP_OK) {
      return res;
    }
 else     if (statusCode == HTTP_UNAUTHORIZED) {
      throw new ApiException(statusCode,"String_Node_Str");
    }
 else {
      throw new ApiException(statusCode,Parser.error(res.getContent()));
    }
  }
 catch (  IOException e) {
    if (App.DEBUG) {
      Log.e(TAG,e.toString());
    }
    throw new ApiException(ERROR_IO_EXCEPTION,e.toString(),e.getCause());
  }
}
Program: 25899
Project: 25899
Buggy source:
public OAuthToken requestOAuthAccessToken(String username,String password) throws OAuthTokenException, IOException {
  String authorization=OAuthHelper.buildXAuthHeader(username,password,HttpGet.METHOD_NAME,mOAuthProvider.getAccessTokenURL(),mOAuthProvider);
  NetRequest nr=NetRequest.newBuilder().url(mOAuthProvider.getAccessTokenURL()).header("String_Node_Str",authorization).build();
  NetClient client=new NetClient();
  HttpResponse response=client.exec(nr);
  int statusCode=response.getStatusLine().getStatusCode();
  String content=EntityUtils.toString(response.getEntity(),HTTP.UTF_8);
  if (App.DEBUG) {
    log("String_Node_Str" + statusCode + "String_Node_Str"+ content);
  }
  if (statusCode == 200) {
    return OAuthToken.from(content);
  }
  throw new OAuthTokenException(Parser.error(content));
}

Fixed version (ground truth):
public OAuthToken requestOAuthAccessToken(String username,String password) throws OAuthTokenException, IOException {
  String authorization=OAuthHelper.buildXAuthHeader(username,password,HttpGet.METHOD_NAME,mOAuthProvider.getAccessTokenURL(),mOAuthProvider);
  NetRequest nr=NetRequest.newBuilder().url(mOAuthProvider.getAccessTokenURL()).header("String_Node_Str",authorization).build();
  NetClient client=new NetClient();
  HttpResponse response=client.exec(nr);
  int statusCode=response.getStatusLine().getStatusCode();
  String content=EntityUtils.toString(response.getEntity(),HTTP.UTF_8);
  if (App.DEBUG) {
    log("String_Node_Str" + statusCode + "String_Node_Str"+ content);
  }
  if (statusCode == 200) {
    return OAuthToken.from(content);
  }
  throw new OAuthTokenException("String_Node_Str");
}
Program: 25901
Project: 25901
Buggy source:
public static VersionInfo fetchVersionInfo(){
  NetClient client=new NetClient();
  try {
    HttpResponse response=client.get(APP_UPDATE_SITE);
    int statusCode=response.getStatusLine().getStatusCode();
    if (App.DEBUG) {
      Log.d(TAG,"String_Node_Str" + statusCode);
    }
    if (statusCode == 200) {
      String content=EntityUtils.toString(response.getEntity(),HTTP.UTF_8);
      if (App.DEBUG) {
        Log.d(TAG,"String_Node_Str" + content);
      }
      return VersionInfo.parse(content);
    }
  }
 catch (  IOException e) {
    if (App.DEBUG) {
      e.printStackTrace();
    }
  }
catch (  Exception e) {
    if (App.DEBUG) {
      e.printStackTrace();
    }
  }
 finally {
    client.close();
  }
  return null;
}

Fixed version (ground truth):
public static VersionInfo fetchVersionInfo(){
  NetClient client=new NetClient();
  try {
    HttpResponse response=client.get(UPDATE_VERSION_FILE);
    int statusCode=response.getStatusLine().getStatusCode();
    if (App.DEBUG) {
      Log.d(TAG,"String_Node_Str" + statusCode);
    }
    if (statusCode == 200) {
      String content=EntityUtils.toString(response.getEntity(),HTTP.UTF_8);
      if (App.DEBUG) {
        Log.d(TAG,"String_Node_Str" + content);
      }
      return VersionInfo.parse(content);
    }
  }
 catch (  IOException e) {
    if (App.DEBUG) {
      e.printStackTrace();
    }
  }
catch (  Exception e) {
    if (App.DEBUG) {
      e.printStackTrace();
    }
  }
 finally {
    client.close();
  }
  return null;
}
Program: 25902
Project: 25902
Buggy source:
public static void doReply(Context context,Status status){
  if (status != null) {
    if (App.DEBUG) {
      Log.d(TAG,"String_Node_Str");
    }
    StringBuilder sb=new StringBuilder();
    boolean replyToAll=OptionHelper.readBoolean(R.string.option_reply_to_all_default,true);
    if (replyToAll) {
      ArrayList<String> names=StatusHelper.getMentions(status);
      for (      String name : names) {
        sb.append("String_Node_Str").append(name).append("String_Node_Str");
      }
    }
    Intent intent=new Intent(context,WritePage.class);
    intent.putExtra(Commons.EXTRA_IN_REPLY_TO_ID,status.id);
    intent.putExtra(Commons.EXTRA_TEXT,sb.toString());
    intent.putExtra(Commons.EXTRA_TYPE,WritePage.TYPE_REPLY);
    context.startActivity(intent);
  }
 else {
    doWrite(context,null);
  }
}

Fixed version (ground truth):
public static void doReply(Context context,Status status){
  if (status != null) {
    if (App.DEBUG) {
      Log.d(TAG,"String_Node_Str");
    }
    StringBuilder sb=new StringBuilder();
    boolean replyToAll=OptionHelper.readBoolean(R.string.option_reply_to_all_default,true);
    if (replyToAll) {
      ArrayList<String> names=StatusHelper.getMentions(status);
      for (      String name : names) {
        sb.append("String_Node_Str").append(name).append("String_Node_Str");
      }
    }
 else {
      sb.append("String_Node_Str").append(status.userScreenName).append("String_Node_Str");
    }
    Intent intent=new Intent(context,WritePage.class);
    intent.putExtra(Commons.EXTRA_IN_REPLY_TO_ID,status.id);
    intent.putExtra(Commons.EXTRA_TEXT,sb.toString());
    intent.putExtra(Commons.EXTRA_TYPE,WritePage.TYPE_REPLY);
    context.startActivity(intent);
  }
 else {
    doWrite(context,null);
  }
}
Program: 25903
Project: 25903
Buggy source:
public static HashSet<String> getMentionedNames(String text){
  HashSet<String> names=new HashSet<String>();
  Matcher m=namePattern.matcher(text);
  while (m.find()) {
    String name=m.group(1);
    if (name.length() <= MAX_NAME_LENGTH + 1) {
      names.add(m.group(1));
    }
  }
  String name=App.getUserName();
  names.remove(name);
  return names;
}

Fixed version (ground truth):
private static HashSet<String> getMentionedNames(String text){
  HashSet<String> names=new HashSet<String>();
  Matcher m=namePattern.matcher(text);
  while (m.find()) {
    String name=m.group(1);
    if (name.length() <= MAX_NAME_LENGTH + 1) {
      names.add(m.group(1));
    }
  }
  String name=App.getUserName();
  names.remove(name);
  return names;
}
Program: 25904
Project: 25904
Buggy source:
public Task(String url,final Handler handler){
  this.url=url;
  this.handler=handler;
  this.timestamp=System.currentTimeMillis();
}

Fixed version (ground truth):
public Task(String url,final Handler handler){
  this.url=url;
  this.handler=handler;
  this.timestamp=System.nanoTime();
}
Program: 25905
Project: 25905
Buggy source:
private ImageLoader(){
  if (App.DEBUG) {
    Log.d(TAG,"String_Node_Str");
  }
  this.mExecutorService=Executors.newSingleThreadExecutor(new NameCountThreadFactory());
  this.mCache=ImageCache.getInstance();
  this.mViewsMap=new HashMap<String,ImageView>();
  this.mClient=new NetClient();
  this.mHandler=new InnerHandler();
  new Thread(this).start();
}

Fixed version (ground truth):
private ImageLoader(){
  if (App.DEBUG) {
    Log.d(TAG,"String_Node_Str");
  }
  this.mCache=ImageCache.getInstance();
  this.mViewsMap=new HashMap<String,ImageView>();
  this.mClient=new NetClient();
  this.mHandler=new InnerHandler();
  new Thread(this).start();
}
Program: 25906
Project: 25906
Buggy source:
public static List<DirectMessage> parseMessges(JSONArray a,int type) throws ApiException {
  if (a == null) {
    return null;
  }
  List<DirectMessage> dms=new ArrayList<DirectMessage>();
  try {
    for (int i=0; i < a.length(); i++) {
      JSONObject o=a.getJSONObject(i);
      DirectMessage dm=parse(o,type);
      dms.add(dm);
    }
  }
 catch (  JSONException e) {
    throw new ApiException(ResponseCode.ERROR_PARSE_FAILED,e.getMessage(),e);
  }
  return dms;
}

Fixed version (ground truth):
public static List<DirectMessage> parseMessges(JSONArray a,int type) throws ApiException {
  if (a == null) {
    return null;
  }
  List<DirectMessage> dms=new ArrayList<DirectMessage>();
  try {
    for (int i=0; i < a.length(); i++) {
      JSONObject o=a.getJSONObject(i);
      DirectMessage dm=parse(o,type);
      dms.add(dm);
    }
  }
 catch (  JSONException e) {
    throw new ApiException(ResponseCode.ERROR_JSON_EXCEPTION,e.getMessage(),e);
  }
  return dms;
}
Program: 25907
Project: 25907
Buggy source:
public static DirectMessage parse(JSONObject o,int type) throws ApiException {
  if (o == null) {
    return null;
  }
  DirectMessage dm=null;
  try {
    dm=new DirectMessage();
    dm.id=o.getString(BasicColumns.ID);
    dm.realId=Parser.decodeMessageRealId(dm.id);
    dm.text=o.getString(DirectMessageInfo.TEXT);
    dm.createdAt=Parser.date(o.getString(BasicColumns.CREATED_AT));
    dm.senderId=o.getString(DirectMessageInfo.SENDER_ID);
    dm.senderScreenName=o.getString(DirectMessageInfo.SENDER_SCREEN_NAME);
    dm.recipientId=o.getString(DirectMessageInfo.RECIPIENT_ID);
    dm.recipientScreenName=o.getString(DirectMessageInfo.RECIPIENT_SCREEN_NAME);
    if (o.has("String_Node_Str")) {
      JSONObject so=o.getJSONObject("String_Node_Str");
      dm.sender=User.parse(so);
      dm.senderProfileImageUrl=dm.sender.profileImageUrl;
    }
    if (o.has("String_Node_Str")) {
      JSONObject so=o.getJSONObject("String_Node_Str");
      dm.recipient=User.parse(so);
      dm.recipientProfileImageUrl=dm.recipient.profileImageUrl;
    }
    dm.isRead=false;
    dm.type=type;
    dm.ownerId=App.me.userId;
  }
 catch (  JSONException e) {
    throw new ApiException(ResponseCode.ERROR_PARSE_FAILED,e.getMessage(),e);
  }
  if (App.DEBUG)   log("String_Node_Str" + dm.id);
  return dm;
}

Fixed version (ground truth):
public static DirectMessage parse(JSONObject o,int type) throws ApiException {
  if (o == null) {
    return null;
  }
  DirectMessage dm=null;
  try {
    dm=new DirectMessage();
    dm.id=o.getString(BasicColumns.ID);
    dm.realId=Parser.decodeMessageRealId(dm.id);
    dm.text=o.getString(DirectMessageInfo.TEXT);
    dm.createdAt=Parser.date(o.getString(BasicColumns.CREATED_AT));
    dm.senderId=o.getString(DirectMessageInfo.SENDER_ID);
    dm.senderScreenName=o.getString(DirectMessageInfo.SENDER_SCREEN_NAME);
    dm.recipientId=o.getString(DirectMessageInfo.RECIPIENT_ID);
    dm.recipientScreenName=o.getString(DirectMessageInfo.RECIPIENT_SCREEN_NAME);
    if (o.has("String_Node_Str")) {
      JSONObject so=o.getJSONObject("String_Node_Str");
      dm.sender=User.parse(so);
      dm.senderProfileImageUrl=dm.sender.profileImageUrl;
    }
    if (o.has("String_Node_Str")) {
      JSONObject so=o.getJSONObject("String_Node_Str");
      dm.recipient=User.parse(so);
      dm.recipientProfileImageUrl=dm.recipient.profileImageUrl;
    }
    dm.isRead=false;
    dm.type=type;
    dm.ownerId=App.me.userId;
  }
 catch (  JSONException e) {
    throw new ApiException(ResponseCode.ERROR_JSON_EXCEPTION,e.getMessage(),e);
  }
  if (App.DEBUG)   log("String_Node_Str" + dm.id);
  return dm;
}
Program: 25908
Project: 25908
Buggy source:
public static List<DirectMessage> parseConversationList(JSONArray a) throws ApiException {
  if (a == null) {
    return null;
  }
  List<DirectMessage> dms=new ArrayList<DirectMessage>();
  try {
    for (int i=0; i < a.length(); i++) {
      JSONObject io=a.getJSONObject(i);
      JSONObject dmo=io.getJSONObject("String_Node_Str");
      DirectMessage dm=parse(dmo,TYPE_LIST);
      dms.add(dm);
    }
  }
 catch (  JSONException e) {
    throw new ApiException(ResponseCode.ERROR_PARSE_FAILED,e.getMessage(),e);
  }
  return dms;
}

Fixed version (ground truth):
public static List<DirectMessage> parseConversationList(JSONArray a) throws ApiException {
  if (a == null) {
    return null;
  }
  List<DirectMessage> dms=new ArrayList<DirectMessage>();
  try {
    for (int i=0; i < a.length(); i++) {
      JSONObject io=a.getJSONObject(i);
      JSONObject dmo=io.getJSONObject("String_Node_Str");
      DirectMessage dm=parse(dmo,TYPE_LIST);
      dms.add(dm);
    }
  }
 catch (  JSONException e) {
    throw new ApiException(ResponseCode.ERROR_JSON_EXCEPTION,e.getMessage(),e);
  }
  return dms;
}
Program: 25909
Project: 25909
Buggy source:
/** 
 * exec http request
 * @param request
 * @return response object
 * @throws ApiException
 */
private NetResponse fetch(final NetRequest request) throws ApiException {
  try {
    HttpResponse response=request.send(conn);
    int statusCode=response.getStatusLine().getStatusCode();
    if (App.DEBUG) {
      log("String_Node_Str" + request.url + "String_Node_Str"+ request.post+ "String_Node_Str"+ statusCode);
    }
    if (statusCode == HTTP_OK) {
      return new NetResponse(response);
    }
 else {
      throw new ApiException(statusCode,Parser.error(response));
    }
  }
 catch (  IOException e) {
    if (App.DEBUG) {
      Log.e(TAG,e.getMessage() + "String_Node_Str" + e.toString());
    }
    throw new ApiException(ERROR_NOT_CONNECTED,e.toString(),e.getCause());
  }
}

Fixed version (ground truth):
/** 
 * exec http request
 * @param request
 * @return response object
 * @throws ApiException
 */
private NetResponse fetch(final NetRequest request) throws ApiException {
  try {
    HttpResponse response=conn.exec(request);
    int statusCode=response.getStatusLine().getStatusCode();
    if (App.DEBUG) {
      log("String_Node_Str" + request.url + "String_Node_Str"+ request.post+ "String_Node_Str"+ statusCode);
    }
    if (statusCode == HTTP_OK) {
      return new NetResponse(response);
    }
    throw new ApiException(statusCode,Parser.error(response));
  }
 catch (  IOException e) {
    if (App.DEBUG) {
      Log.e(TAG,e.getMessage() + "String_Node_Str" + e.toString());
    }
    throw new ApiException(ERROR_IO_EXCEPTION,e.toString(),e.getCause());
  }
}
Program: 25910
Project: 25910
Buggy source:
public static List<Search> savedSearches(JSONArray a) throws ApiException {
  try {
    List<Search> ss=new ArrayList<Search>();
    for (int i=0; i < a.length(); i++) {
      JSONObject o=a.getJSONObject(i);
      Search s=savedSearch(o);
      ss.add(s);
    }
    return ss;
  }
 catch (  JSONException e) {
    if (App.DEBUG) {
      Log.e(TAG,e.getMessage());
    }
    throw new ApiException(ERROR_PARSE_FAILED,e.getMessage(),e.getCause());
  }
}

Fixed version (ground truth):
public static List<Search> savedSearches(JSONArray a) throws ApiException {
  try {
    List<Search> ss=new ArrayList<Search>();
    for (int i=0; i < a.length(); i++) {
      JSONObject o=a.getJSONObject(i);
      Search s=savedSearch(o);
      ss.add(s);
    }
    return ss;
  }
 catch (  JSONException e) {
    if (App.DEBUG) {
      Log.e(TAG,e.getMessage());
    }
    throw new ApiException(ERROR_JSON_EXCEPTION,e.getMessage(),e.getCause());
  }
}
Program: 25911
Project: 25911
Buggy source:
public static Search trend(JSONObject o) throws ApiException {
  try {
    Search t=new Search();
    t.name=Html.fromHtml(o.getString(NAME)).toString();
    t.query=Html.fromHtml(o.getString(QUERY)).toString();
    return t;
  }
 catch (  JSONException e) {
    if (App.DEBUG)     e.printStackTrace();
    throw new ApiException(ERROR_PARSE_FAILED,e.getMessage(),e.getCause());
  }
}

Fixed version (ground truth):
public static Search trend(JSONObject o) throws ApiException {
  try {
    Search t=new Search();
    t.name=Html.fromHtml(o.getString(NAME)).toString();
    t.query=Html.fromHtml(o.getString(QUERY)).toString();
    return t;
  }
 catch (  JSONException e) {
    if (App.DEBUG)     e.printStackTrace();
    throw new ApiException(ERROR_JSON_EXCEPTION,e.getMessage(),e.getCause());
  }
}
Program: 25912
Project: 25912
Buggy source:
public static void handleJSONException(JSONException e) throws ApiException {
  if (App.DEBUG) {
    Log.e(TAG,e.getMessage());
  }
  throw new ApiException(ERROR_PARSE_FAILED,e.getMessage(),e.getCause());
}

Fixed version (ground truth):
public static void handleJSONException(JSONException e) throws ApiException {
  if (App.DEBUG) {
    Log.e(TAG,e.getMessage());
  }
  throw new ApiException(ERROR_JSON_EXCEPTION,e.getMessage(),e.getCause());
}
Program: 25913
Project: 25913
Buggy source:
public static Search savedSearch(JSONObject o) throws ApiException {
  try {
    Search s=new Search();
    s.name=o.getString(NAME);
    s.query=o.getString(QUERY);
    return s;
  }
 catch (  JSONException e) {
    if (App.DEBUG) {
      Log.e(TAG,e.getMessage());
    }
    throw new ApiException(ERROR_PARSE_FAILED,e.getMessage(),e.getCause());
  }
}

Fixed version (ground truth):
public static Search savedSearch(JSONObject o) throws ApiException {
  try {
    Search s=new Search();
    s.name=o.getString(NAME);
    s.query=o.getString(QUERY);
    return s;
  }
 catch (  JSONException e) {
    if (App.DEBUG) {
      Log.e(TAG,e.getMessage());
    }
    throw new ApiException(ERROR_JSON_EXCEPTION,e.getMessage(),e.getCause());
  }
}