nus-yam/ex-repair huggingface dataset:
Program: 14964
Project: 14964
Buggy source:
@Override public void onActivityCreated(Bundle bundle){
  super.onActivityCreated(bundle);
  ListView list=getListView();
  list.setDivider(getResources().getDrawable(R.drawable.list_divider));
  list.setDividerHeight(1);
  list.setHeaderDividersEnabled(false);
  if (getNote() == null)   return;
  LayoutInflater inflater=getActivity().getLayoutInflater();
  DetailHeader noteHeader=(DetailHeader)inflater.inflate(R.layout.notifications_detail_header,null);
  noteHeader.setText(getHeaderText());
  noteHeader.setBackgroundColor(getResources().getColor(R.color.light_gray));
  noteHeader.getTextView().setGravity(Gravity.CENTER_HORIZONTAL);
  noteHeader.setClickable(false);
  list.addHeaderView(noteHeader);
  DetailHeader noteFooter=(DetailHeader)inflater.inflate(R.layout.notifications_detail_header,null);
  JSONObject bodyObject=getNote().queryJSON("String_Node_Str",new JSONObject());
  String footerText=JSONUtil.getStringDecoded(bodyObject,"String_Node_Str");
  if (!footerText.equals("String_Node_Str")) {
    noteFooter.setText(footerText);
    String footerUrl=JSONUtil.getString(bodyObject,"String_Node_Str");
    if (!footerUrl.equals("String_Node_Str")) {
      noteFooter.setUrl(footerUrl);
    }
    list.addFooterView(noteFooter);
  }
  setListAdapter(new NoteAdapter());
}

Fixed version (ground truth):
@Override public void onActivityCreated(Bundle bundle){
  super.onActivityCreated(bundle);
  ListView list=getListView();
  list.setDivider(getResources().getDrawable(R.drawable.list_divider));
  list.setDividerHeight(1);
  list.setHeaderDividersEnabled(false);
  if (getNote() == null)   return;
  LayoutInflater inflater=getActivity().getLayoutInflater();
  DetailHeader noteHeader=(DetailHeader)inflater.inflate(R.layout.notifications_detail_header,null);
  noteHeader.setText(getHeaderText());
  noteHeader.setBackgroundColor(getResources().getColor(R.color.light_gray));
  noteHeader.getTextView().setGravity(Gravity.CENTER_HORIZONTAL);
  noteHeader.setClickable(false);
  list.addHeaderView(noteHeader);
  DetailHeader noteFooter=(DetailHeader)inflater.inflate(R.layout.notifications_detail_header,null);
  JSONObject bodyObject=getNote().queryJSON("String_Node_Str",new JSONObject());
  String footerText=getFooterText();
  if (!footerText.equals("String_Node_Str")) {
    noteFooter.setText(footerText);
    String footerUrl=JSONUtil.getString(bodyObject,"String_Node_Str");
    if (!footerUrl.equals("String_Node_Str")) {
      noteFooter.setUrl(footerUrl);
    }
    list.addFooterView(noteFooter);
  }
  setListAdapter(new NoteAdapter());
}
Program: 14966
Project: 14966
Buggy source:
@Override public void run(){
  loadPosts(loadMore);
}

Fixed version (ground truth):
@Override public void run(){
  loadPosts(mLoadMore);
}
Program: 14967
Project: 14967
Buggy source:
public void refreshPosts(final boolean loadMore){
  if (!loadMore) {
    mOnRefreshListener.onRefresh(true);
    numRecords=20;
  }
  List<Object> apiArgs=new Vector<Object>();
  apiArgs.add(WordPress.currentBlog);
  apiArgs.add(isPage);
  apiArgs.add(numRecords);
  apiArgs.add(loadMore);
  getPostsTask=new getRecentPostsTask();
  getPostsTask.execute(apiArgs);
}

Fixed version (ground truth):
public void refreshPosts(final boolean loadMore){
  if (!loadMore) {
    mOnRefreshListener.onRefresh(true);
    numRecords=20;
  }
  List<Object> apiArgs=new Vector<Object>();
  apiArgs.add(WordPress.getCurrentBlog());
  apiArgs.add(isPage);
  apiArgs.add(numRecords);
  apiArgs.add(loadMore);
  getPostsTask=new getRecentPostsTask();
  getPostsTask.execute(apiArgs);
}
Program: 14969
Project: 14969
Buggy source:
protected void onPostExecute(Boolean result){
  if (isCancelled() || !result) {
    mOnRefreshListener.onRefresh(false);
    if (getActivity() == null)     return;
    if (errorMsg != "String_Node_Str" && !getActivity().isFinishing()) {
      FragmentTransaction ft=getFragmentManager().beginTransaction();
      WPAlertDialogFragment alert=WPAlertDialogFragment.newInstance(String.format(getResources().getString(R.string.error_refresh),(isPage) ? getResources().getText(R.string.pages) : getResources().getText(R.string.posts)),errorMsg);
      try {
        alert.show(ft,"String_Node_Str");
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
      errorMsg="String_Node_Str";
    }
    return;
  }
  if (loadMore)   switcher.showPrevious();
  mOnRefreshListener.onRefresh(false);
  if (isAdded()) {
    if (getActivity() != null) {
      getActivity().runOnUiThread(new Runnable(){
        @Override public void run(){
          loadPosts(loadMore);
        }
      }
);
    }
  }
}

Fixed version (ground truth):
protected void onPostExecute(Boolean result){
  if (isCancelled() || !result) {
    mOnRefreshListener.onRefresh(false);
    if (getActivity() == null)     return;
    if (errorMsg != "String_Node_Str" && !getActivity().isFinishing()) {
      FragmentTransaction ft=getFragmentManager().beginTransaction();
      WPAlertDialogFragment alert=WPAlertDialogFragment.newInstance(String.format(getResources().getString(R.string.error_refresh),(mIsPage) ? getResources().getText(R.string.pages) : getResources().getText(R.string.posts)),errorMsg);
      try {
        alert.show(ft,"String_Node_Str");
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
      errorMsg="String_Node_Str";
    }
    return;
  }
  if (mLoadMore)   switcher.showPrevious();
  mOnRefreshListener.onRefresh(false);
  if (isAdded()) {
    if (getActivity() != null) {
      getActivity().runOnUiThread(new Runnable(){
        @Override public void run(){
          loadPosts(mLoadMore);
        }
      }
);
    }
  }
}
Program: 14970
Project: 14970
Buggy source:
public String cleanXMLRPCErrorMessage(String message){
  if (message != null) {
    if (message.indexOf("String_Node_Str") > -1)     message=message.substring(message.indexOf("String_Node_Str") + 2,message.length());
    if (message.indexOf("String_Node_Str") > -1)     message=message.substring(0,message.indexOf("String_Node_Str"));
    return message;
  }
 else {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
public String cleanXMLRPCErrorMessage(String message){
  if (message != null) {
    if (message.indexOf("String_Node_Str") > -1)     message=message.substring(message.indexOf("String_Node_Str") + 2,message.length());
    if (message.indexOf("String_Node_Str") > -1)     message=message.substring(0,message.indexOf("String_Node_Str"));
    message=StringUtils.unescapeHTML(message);
    return message;
  }
 else {
    return "String_Node_Str";
  }
}
Program: 14974
Project: 14974
Buggy source:
@Override public void onFailure(int errorCode){
  if (errorCode == ApiHelper.SyncMediaLibraryTask.NO_UPLOAD_FILES_CAP) {
    Toast.makeText(MediaGalleryPickerActivity.this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    MediaGridAdapter adapter=(MediaGridAdapter)mGridView.getAdapter();
    mHasRetrievedAllMedia=true;
    adapter.setHasRetrieviedAll(mHasRetrievedAllMedia);
  }
  if (!isFinishing()) {
    runOnUiThread(new Runnable(){
      @Override public void run(){
        mIsRefreshing=false;
        mGridAdapter.setRefreshing(false);
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public void onFailure(int errorCode){
  if (errorCode == ApiHelper.SyncMediaLibraryTask.NO_UPLOAD_FILES_CAP || errorCode == SyncMediaLibraryTask.UNKNOWN_ERROR) {
    String errorMessage=errorCode == SyncMediaLibraryTask.NO_UPLOAD_FILES_CAP ? "String_Node_Str" : "String_Node_Str";
    Toast.makeText(MediaGalleryPickerActivity.this,errorMessage,Toast.LENGTH_SHORT).show();
    MediaGridAdapter adapter=(MediaGridAdapter)mGridView.getAdapter();
    mHasRetrievedAllMedia=true;
    adapter.setHasRetrieviedAll(mHasRetrievedAllMedia);
  }
  if (!isFinishing()) {
    runOnUiThread(new Runnable(){
      @Override public void run(){
        mIsRefreshing=false;
        mGridAdapter.setRefreshing(false);
      }
    }
);
  }
}
Program: 14976
Project: 14976
Buggy source:
@Override public void onFailure(int errorCode){
  if (errorCode == SyncMediaLibraryTask.NO_UPLOAD_FILES_CAP) {
    Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
    MediaGridAdapter adapter=(MediaGridAdapter)mGridView.getAdapter();
    mHasRetrievedAllMedia=true;
    adapter.setHasRetrieviedAll(mHasRetrievedAllMedia);
  }
  if (getActivity() != null && MediaGridFragment.this.isVisible()) {
    getActivity().runOnUiThread(new Runnable(){
      @Override public void run(){
        mIsRefreshing=false;
        mListener.onMediaItemListDownloaded();
        mGridAdapter.setRefreshing(false);
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public void onFailure(int errorCode){
  if (errorCode == SyncMediaLibraryTask.NO_UPLOAD_FILES_CAP || errorCode == SyncMediaLibraryTask.UNKNOWN_ERROR) {
    String errorMessage=errorCode == SyncMediaLibraryTask.NO_UPLOAD_FILES_CAP ? "String_Node_Str" : "String_Node_Str";
    Toast.makeText(getActivity(),errorMessage,Toast.LENGTH_SHORT).show();
    MediaGridAdapter adapter=(MediaGridAdapter)mGridView.getAdapter();
    mHasRetrievedAllMedia=true;
    adapter.setHasRetrieviedAll(mHasRetrievedAllMedia);
  }
  if (getActivity() != null && MediaGridFragment.this.isVisible()) {
    getActivity().runOnUiThread(new Runnable(){
      @Override public void run(){
        mIsRefreshing=false;
        mListener.onMediaItemListDownloaded();
        mGridAdapter.setRefreshing(false);
      }
    }
);
  }
}
Program: 14977
Project: 14977
Buggy source:
public Theme getTheme(String blogId,String themeId){
  Cursor cursor=db.rawQuery("String_Node_Str" + THEMES_TABLE + "String_Node_Str",new String[]{blogId,themeId});
  if (cursor.moveToFirst()) {
    String name=cursor.getString(0);
    String description=cursor.getString(1);
    String screenshotURL=cursor.getString(2);
    String previewURL=cursor.getString(3);
    boolean isCurrent=cursor.getInt(4) == 1;
    boolean isPremium=cursor.getInt(5) == 1;
    String features=cursor.getString(6);
    Theme theme=new Theme();
    theme.setThemeId(themeId);
    theme.setName(name);
    theme.setDescription(description);
    theme.setScreenshotURL(screenshotURL);
    theme.setPreviewURL(previewURL);
    theme.setCurrent(isCurrent);
    theme.setPremium(isPremium);
    theme.setFeatures(features);
    cursor.close();
    return theme;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public Theme getTheme(String blogId,String themeId){
  Cursor cursor=db.rawQuery("String_Node_Str" + THEMES_TABLE + "String_Node_Str",new String[]{blogId,themeId});
  if (cursor.moveToFirst()) {
    String name=cursor.getString(0);
    String description=cursor.getString(1);
    String screenshotURL=cursor.getString(2);
    String previewURL=cursor.getString(3);
    boolean isCurrent=cursor.getInt(4) == 1;
    boolean isPremium=cursor.getInt(5) == 1;
    String features=cursor.getString(6);
    Theme theme=new Theme();
    theme.setThemeId(themeId);
    theme.setName(name);
    theme.setDescription(description);
    theme.setScreenshotURL(screenshotURL);
    theme.setPreviewURL(previewURL);
    theme.setCurrent(isCurrent);
    theme.setPremium(isPremium);
    theme.setFeatures(features);
    cursor.close();
    return theme;
  }
 else {
    cursor.close();
    return null;
  }
}
Program: 14978
Project: 14978
Buggy source:
public MediaFile getMediaFile(String src,Post post){
  Cursor c=db.query(MEDIA_TABLE,null,"String_Node_Str" + post.getId() + "String_Node_Str"+ src+ "String_Node_Str",null,null,null,null);
  int numRows=c.getCount();
  c.moveToFirst();
  MediaFile mf=new MediaFile();
  if (numRows == 1) {
    mf.setPostID(c.getInt(1));
    mf.setFilePath(c.getString(2));
    mf.setFileName(c.getString(3));
    mf.setTitle(c.getString(4));
    mf.setDescription(c.getString(5));
    mf.setCaption(c.getString(6));
    mf.setHorizontalAlignment(c.getInt(7));
    mf.setWidth(c.getInt(8));
    mf.setHeight(c.getInt(9));
    mf.setMIMEType(c.getString(10));
    mf.setFeatured(c.getInt(11) > 0);
    mf.setVideo(c.getInt(12) > 0);
    mf.setFeaturedInPost(c.getInt(13) > 0);
    mf.setFileURL(c.getString(14));
    mf.setThumbnailURL(c.getString(15));
    mf.setMediaId(c.getString(16));
    mf.setBlogId(c.getString(17));
    mf.setDateCreatedGMT(c.getLong(18));
    mf.setUploadState(c.getString(19));
  }
 else {
    c.close();
    return null;
  }
  c.close();
  return mf;
}

Fixed version (ground truth):
public MediaFile getMediaFile(String src,Post post){
  Cursor c=db.query(MEDIA_TABLE,null,"String_Node_Str" + post.getId() + "String_Node_Str"+ src+ "String_Node_Str",null,null,null,null);
  int numRows=c.getCount();
  c.moveToFirst();
  MediaFile mf=new MediaFile();
  if (numRows >= 1) {
    mf.setPostID(c.getInt(1));
    mf.setFilePath(c.getString(2));
    mf.setFileName(c.getString(3));
    mf.setTitle(c.getString(4));
    mf.setDescription(c.getString(5));
    mf.setCaption(c.getString(6));
    mf.setHorizontalAlignment(c.getInt(7));
    mf.setWidth(c.getInt(8));
    mf.setHeight(c.getInt(9));
    mf.setMIMEType(c.getString(10));
    mf.setFeatured(c.getInt(11) > 0);
    mf.setVideo(c.getInt(12) > 0);
    mf.setFeaturedInPost(c.getInt(13) > 0);
    mf.setFileURL(c.getString(14));
    mf.setThumbnailURL(c.getString(15));
    mf.setMediaId(c.getString(16));
    mf.setBlogId(c.getString(17));
    mf.setDateCreatedGMT(c.getLong(18));
    mf.setUploadState(c.getString(19));
  }
 else {
    c.close();
    return null;
  }
  c.close();
  return mf;
}
Program: 14979
Project: 14979
Buggy source:
private WPImageSpan prepareWPImageSpan(String blogId,final String mediaId){
  Cursor cursor=WordPress.wpDB.getMediaFile(blogId,mediaId);
  if (cursor == null || !cursor.moveToFirst())   return null;
  String url=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  if (url == null)   return null;
  Uri uri=Uri.parse(url);
  WPImageSpan imageSpan=new WPImageSpan(EditPostActivity.this,R.drawable.remote_image,uri);
  imageSpan.setMediaId(mediaId);
  imageSpan.setCaption(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setDescription(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setTitle(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setWidth(cursor.getInt(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setHeight(cursor.getInt(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setMimeType(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setFileName(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setThumbnailURL(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setDateCreatedGMT(cursor.getLong(cursor.getColumnIndex("String_Node_Str")));
  boolean isVideo=false;
  String mimeType=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  if (mimeType != null && mimeType.contains("String_Node_Str"))   isVideo=true;
  imageSpan.setVideo(isVideo);
  cursor.close();
  return imageSpan;
}

Fixed version (ground truth):
private WPImageSpan prepareWPImageSpan(String blogId,final String mediaId){
  Cursor cursor=WordPress.wpDB.getMediaFile(blogId,mediaId);
  if (cursor == null || !cursor.moveToFirst()) {
    if (cursor != null)     cursor.close();
    return null;
  }
  String url=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  if (url == null) {
    cursor.close();
    return null;
  }
  Uri uri=Uri.parse(url);
  WPImageSpan imageSpan=new WPImageSpan(EditPostActivity.this,R.drawable.remote_image,uri);
  imageSpan.setMediaId(mediaId);
  imageSpan.setCaption(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setDescription(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setTitle(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setWidth(cursor.getInt(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setHeight(cursor.getInt(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setMimeType(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setFileName(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setThumbnailURL(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  imageSpan.setDateCreatedGMT(cursor.getLong(cursor.getColumnIndex("String_Node_Str")));
  boolean isVideo=false;
  String mimeType=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  if (mimeType != null && mimeType.contains("String_Node_Str"))   isVideo=true;
  imageSpan.setVideo(isVideo);
  cursor.close();
  return imageSpan;
}
Program: 14981
Project: 14981
Buggy source:
public static int[] getImageSize(Uri uri,Context context){
  String path=null;
  if (uri.toString().contains("String_Node_Str")) {
    String[] projection;
    Uri imgPath;
    projection=new String[]{Images.Media._ID,Images.Media.DATA};
    imgPath=uri;
    Cursor cur=context.getContentResolver().query(imgPath,projection,null,null,null);
    String thumbData="String_Node_Str";
    if (cur.moveToFirst()) {
      int dataColumn;
      dataColumn=cur.getColumnIndex(Images.Media.DATA);
      thumbData=cur.getString(dataColumn);
      path=thumbData;
    }
  }
 else {
    path=uri.toString().replace("String_Node_Str","String_Node_Str");
  }
  BitmapFactory.Options options=new BitmapFactory.Options();
  options.inJustDecodeBounds=true;
  BitmapFactory.decodeFile(path,options);
  int imageHeight=options.outHeight;
  int imageWidth=options.outWidth;
  int[] dimensions={imageWidth,imageHeight};
  return dimensions;
}

Fixed version (ground truth):
public static int[] getImageSize(Uri uri,Context context){
  String path=null;
  if (uri.toString().contains("String_Node_Str")) {
    String[] projection;
    Uri imgPath;
    projection=new String[]{Images.Media._ID,Images.Media.DATA};
    imgPath=uri;
    Cursor cur=context.getContentResolver().query(imgPath,projection,null,null,null);
    String thumbData="String_Node_Str";
    if (cur.moveToFirst()) {
      int dataColumn;
      dataColumn=cur.getColumnIndex(Images.Media.DATA);
      thumbData=cur.getString(dataColumn);
      path=thumbData;
    }
    cur.close();
  }
 else {
    path=uri.toString().replace("String_Node_Str","String_Node_Str");
  }
  BitmapFactory.Options options=new BitmapFactory.Options();
  options.inJustDecodeBounds=true;
  BitmapFactory.decodeFile(path,options);
  int imageHeight=options.outHeight;
  int imageWidth=options.outWidth;
  int[] dimensions={imageWidth,imageHeight};
  return dimensions;
}
Program: 14984
Project: 14984
Buggy source:
public void saveNotes(List<Note> notes){
  db.beginTransaction();
  try {
    for (    Note note : notes) {
      addNote(note,false);
    }
    db.setTransactionSuccessful();
  }
  finally {
    db.endTransaction();
  }
}

Fixed version (ground truth):
public void saveNotes(List<Note> notes){
  db.beginTransaction();
  try {
    for (    Note note : notes)     addNote(note,false);
    db.setTransactionSuccessful();
  }
  finally {
    db.endTransaction();
  }
}
Program: 14985
Project: 14985
Buggy source:
private static ReaderPost getPostFromCursor(Cursor c){
  if (c == null)   throw new IllegalArgumentException("String_Node_Str");
  ReaderPost post=new ReaderPost();
  post.postId=c.getLong(COL_POST_ID);
  post.blogId=c.getLong(COL_BLOG_ID);
  post.setPseudoId(c.getString(COL_PSEUDO_ID));
  post.setAuthorName(c.getString(COL_AUTHOR_NAME));
  post.setBlogName(c.getString(COL_BLOG_NAME));
  post.setBlogUrl(c.getString(COL_BLOG_URL));
  post.setExcerpt(c.getString(COL_EXCERPT));
  post.setFeaturedImage(c.getString(COL_FEATURED_IMAGE));
  post.setFeaturedVideo(c.getString(COL_FEATURED_VIDEO));
  post.setTitle(c.getString(COL_TITLE));
  post.setText(c.getString(COL_TEXT));
  post.setUrl(c.getString(COL_URL));
  post.setPostAvatar(c.getString(COL_POST_AVATAR));
  post.timestamp=c.getLong(COL_TIMESTAMP);
  post.setPublished(c.getString(COL_PUBLISHED));
  post.numReplies=c.getInt(COL_NUM_REPLIES);
  post.numLikes=c.getInt(COL_NUM_LIKES);
  post.isLikedByCurrentUser=SqlUtils.sqlToBool(c.getInt(COL_IS_LIKED));
  post.isFollowedByCurrentUser=SqlUtils.sqlToBool(c.getInt(COL_IS_FOLLOWED));
  post.isCommentsOpen=SqlUtils.sqlToBool(c.getInt(COL_IS_COMMENTS_OPEN));
  post.isRebloggedByCurrentUser=SqlUtils.sqlToBool(c.getInt(COL_IS_REBLOGGED));
  post.isExternal=SqlUtils.sqlToBool(c.getInt(COL_IS_EXTERNAL));
  post.isPrivate=SqlUtils.sqlToBool(c.getInt(COL_IS_PRIVATE));
  return post;
}

Fixed version (ground truth):
private static ReaderPost getPostFromCursor(Cursor c){
  if (c == null)   throw new IllegalArgumentException("String_Node_Str");
  ReaderPost post=new ReaderPost();
  post.postId=c.getLong(COL_POST_ID);
  post.blogId=c.getLong(COL_BLOG_ID);
  post.setPseudoId(c.getString(COL_PSEUDO_ID));
  post.setAuthorName(c.getString(COL_AUTHOR_NAME));
  post.setBlogName(c.getString(COL_BLOG_NAME));
  post.setBlogUrl(c.getString(COL_BLOG_URL));
  post.setExcerpt(c.getString(COL_EXCERPT));
  post.setFeaturedImage(c.getString(COL_FEATURED_IMAGE));
  post.setFeaturedVideo(c.getString(COL_FEATURED_VIDEO));
  post.setTitle(c.getString(COL_TITLE));
  post.setText(c.getString(COL_TEXT));
  post.setUrl(c.getString(COL_URL));
  post.setPostAvatar(c.getString(COL_POST_AVATAR));
  post.timestamp=c.getLong(COL_TIMESTAMP);
  post.setPublished(c.getString(COL_PUBLISHED));
  post.numReplies=c.getInt(COL_NUM_REPLIES);
  post.numLikes=c.getInt(COL_NUM_LIKES);
  post.isLikedByCurrentUser=SqlUtils.sqlToBool(c.getInt(COL_IS_LIKED));
  post.isFollowedByCurrentUser=SqlUtils.sqlToBool(c.getInt(COL_IS_FOLLOWED));
  post.isCommentsOpen=SqlUtils.sqlToBool(c.getInt(COL_IS_COMMENTS_OPEN));
  post.isRebloggedByCurrentUser=SqlUtils.sqlToBool(c.getInt(COL_IS_REBLOGGED));
  post.isExternal=SqlUtils.sqlToBool(c.getInt(COL_IS_EXTERNAL));
  post.isPrivate=SqlUtils.sqlToBool(c.getInt(COL_IS_PRIVATE));
  post.isVideoPress=SqlUtils.sqlToBool(c.getInt(COL_IS_VIDEOPRESS));
  return post;
}
Program: 14987
Project: 14987
Buggy source:
protected static void createTables(SQLiteDatabase db){
  db.execSQL("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  db.execSQL("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
protected static void createTables(SQLiteDatabase db){
  db.execSQL("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  db.execSQL("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}
Program: 14988
Project: 14988
Buggy source:
private static void resetColumnIndexes(Cursor c){
  COL_POST_ID=c.getColumnIndex("String_Node_Str");
  COL_BLOG_ID=c.getColumnIndex("String_Node_Str");
  COL_PSEUDO_ID=c.getColumnIndex("String_Node_Str");
  COL_AUTHOR_NAME=c.getColumnIndex("String_Node_Str");
  COL_BLOG_NAME=c.getColumnIndex("String_Node_Str");
  COL_BLOG_URL=c.getColumnIndex("String_Node_Str");
  COL_EXCERPT=c.getColumnIndex("String_Node_Str");
  COL_FEATURED_IMAGE=c.getColumnIndex("String_Node_Str");
  COL_FEATURED_VIDEO=c.getColumnIndex("String_Node_Str");
  COL_TITLE=c.getColumnIndex("String_Node_Str");
  COL_TEXT=c.getColumnIndex("String_Node_Str");
  COL_URL=c.getColumnIndex("String_Node_Str");
  COL_POST_AVATAR=c.getColumnIndex("String_Node_Str");
  COL_TIMESTAMP=c.getColumnIndex("String_Node_Str");
  COL_PUBLISHED=c.getColumnIndex("String_Node_Str");
  COL_NUM_REPLIES=c.getColumnIndex("String_Node_Str");
  COL_NUM_LIKES=c.getColumnIndex("String_Node_Str");
  COL_IS_LIKED=c.getColumnIndex("String_Node_Str");
  COL_IS_FOLLOWED=c.getColumnIndex("String_Node_Str");
  COL_IS_COMMENTS_OPEN=c.getColumnIndex("String_Node_Str");
  COL_IS_REBLOGGED=c.getColumnIndex("String_Node_Str");
  COL_IS_EXTERNAL=c.getColumnIndex("String_Node_Str");
  COL_IS_PRIVATE=c.getColumnIndex("String_Node_Str");
}

Fixed version (ground truth):
private static void resetColumnIndexes(Cursor c){
  COL_POST_ID=c.getColumnIndex("String_Node_Str");
  COL_BLOG_ID=c.getColumnIndex("String_Node_Str");
  COL_PSEUDO_ID=c.getColumnIndex("String_Node_Str");
  COL_AUTHOR_NAME=c.getColumnIndex("String_Node_Str");
  COL_BLOG_NAME=c.getColumnIndex("String_Node_Str");
  COL_BLOG_URL=c.getColumnIndex("String_Node_Str");
  COL_EXCERPT=c.getColumnIndex("String_Node_Str");
  COL_FEATURED_IMAGE=c.getColumnIndex("String_Node_Str");
  COL_FEATURED_VIDEO=c.getColumnIndex("String_Node_Str");
  COL_TITLE=c.getColumnIndex("String_Node_Str");
  COL_TEXT=c.getColumnIndex("String_Node_Str");
  COL_URL=c.getColumnIndex("String_Node_Str");
  COL_POST_AVATAR=c.getColumnIndex("String_Node_Str");
  COL_TIMESTAMP=c.getColumnIndex("String_Node_Str");
  COL_PUBLISHED=c.getColumnIndex("String_Node_Str");
  COL_NUM_REPLIES=c.getColumnIndex("String_Node_Str");
  COL_NUM_LIKES=c.getColumnIndex("String_Node_Str");
  COL_IS_LIKED=c.getColumnIndex("String_Node_Str");
  COL_IS_FOLLOWED=c.getColumnIndex("String_Node_Str");
  COL_IS_COMMENTS_OPEN=c.getColumnIndex("String_Node_Str");
  COL_IS_REBLOGGED=c.getColumnIndex("String_Node_Str");
  COL_IS_EXTERNAL=c.getColumnIndex("String_Node_Str");
  COL_IS_PRIVATE=c.getColumnIndex("String_Node_Str");
  COL_IS_VIDEOPRESS=c.getColumnIndex("String_Node_Str");
}
Program: 14989
Project: 14989
Buggy source:
/** 
 * pre-loads commonly-accessed fields - avoids performance hit of loading these fields inside an adapter's getView() TODO: Caching comment images
 */
protected void preloadContent(){
  if (isCommentType()) {
    mComment=Note.prepareHtml(getCommentText());
    getCommentPreview();
  }
  getSubject();
  getIconURL();
}

Fixed version (ground truth):
/** 
 * pre-loads commonly-accessed fields - avoids performance hit of loading these fields inside an adapter's getView()
 */
protected void preloadContent(){
  if (isCommentType()) {
    mComment=Note.prepareHtml(getCommentText());
    getCommentPreview();
  }
  getSubject();
  getIconURL();
}
Program: 14991
Project: 14991
Buggy source:
public void addAll(List<Note> notes){
  Collections.sort(notes,new Note.TimeStampComparator());
  if (notes.size() == 0) {
    mAllNotesLoaded=true;
    if (mProgressFooterView != null)     mProgressFooterView.setVisibility(View.GONE);
  }
 else {
    setNotifyOnChange(false);
    try {
      Iterator<Note> noteIterator=notes.iterator();
      while (noteIterator.hasNext())       add(noteIterator.next());
    }
  finally {
      notifyDataSetChanged();
    }
  }
}

Fixed version (ground truth):
public void addAll(List<Note> notes){
  Collections.sort(notes,new Note.TimeStampComparator());
  if (notes.size() == 0) {
    mAllNotesLoaded=true;
    if (mProgressFooterView != null)     mProgressFooterView.setVisibility(View.GONE);
  }
 else {
    setNotifyOnChange(false);
    try {
      Iterator<Note> noteIterator=notes.iterator();
      while (noteIterator.hasNext())       add(noteIterator.next());
    }
  finally {
      setNotifyOnChange(true);
    }
  }
}
Program: 14992
Project: 14992
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  View view=super.getView(position,convertView,parent);
  final Note note=getItem(position);
  final TextView detailText=(TextView)view.findViewById(R.id.note_detail);
  final ProgressBar placeholderLoading=(ProgressBar)view.findViewById(R.id.placeholder_loading);
  final NetworkImageView avatarView=(NetworkImageView)view.findViewById(R.id.note_avatar);
  final ImageView iconView=(ImageView)view.findViewById(R.id.note_icon);
  final TextView unreadIndicator=(TextView)view.findViewById(R.id.unread_indicator);
  if (note.isCommentType()) {
    detailText.setText(note.getCommentPreview());
    detailText.setVisibility(View.VISIBLE);
  }
 else {
    detailText.setVisibility(View.GONE);
  }
  String avatarUrl=note.getIconURL();
  if (avatarUrl != null && avatarUrl.contains("String_Node_Str"))   avatarUrl=avatarUrl.replace("String_Node_Str","String_Node_Str" + mAvatarSz);
  avatarView.setImageUrl(avatarUrl,WordPress.imageLoader);
  avatarView.setDefaultImageResId(R.drawable.placeholder);
  iconView.setImageDrawable(getDrawableForType(note.getType()));
  unreadIndicator.setVisibility(note.isUnread() ? View.VISIBLE : View.GONE);
  placeholderLoading.setVisibility(note.isPlaceholder() ? View.VISIBLE : View.GONE);
  return view;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  View view=super.getView(position,convertView,parent);
  final Note note=getItem(position);
  final TextView detailText=(TextView)view.findViewById(R.id.note_detail);
  final ProgressBar placeholderLoading=(ProgressBar)view.findViewById(R.id.placeholder_loading);
  final NetworkImageView avatarView=(NetworkImageView)view.findViewById(R.id.note_avatar);
  final ImageView iconView=(ImageView)view.findViewById(R.id.note_icon);
  final TextView unreadIndicator=(TextView)view.findViewById(R.id.unread_indicator);
  if (note.isCommentType()) {
    detailText.setText(note.getCommentPreview());
    detailText.setVisibility(View.VISIBLE);
  }
 else {
    detailText.setVisibility(View.GONE);
  }
  String iconUrl=note.getIconURL();
  if (iconUrl != null && iconUrl.contains("String_Node_Str"))   iconUrl=iconUrl.replace("String_Node_Str","String_Node_Str" + mAvatarSz);
  avatarView.setImageUrl(iconUrl,WordPress.imageLoader);
  avatarView.setDefaultImageResId(R.drawable.placeholder);
  iconView.setImageDrawable(getDrawableForType(note.getType()));
  unreadIndicator.setVisibility(note.isUnread() ? View.VISIBLE : View.GONE);
  placeholderLoading.setVisibility(note.isPlaceholder() ? View.VISIBLE : View.GONE);
  return view;
}
Program: 14995
Project: 14995
Buggy source:
private void showFormatBar(){
  mFormatBar.setVisibility(View.VISIBLE);
  AlphaAnimation fadeInAnimation=new AlphaAnimation(0.0f,1.0f);
  fadeInAnimation.setDuration(500);
  mFormatBar.startAnimation(fadeInAnimation);
}

Fixed version (ground truth):
private void showFormatBar(){
  if (mKeyboardShown && mEditContentHasFocus) {
    mFormatBar.setVisibility(View.VISIBLE);
    AlphaAnimation fadeInAnimation=new AlphaAnimation(0.0f,1.0f);
    fadeInAnimation.setDuration(500);
    mFormatBar.startAnimation(fadeInAnimation);
  }
}
Program: 14998
Project: 14998
Buggy source:
@SuppressLint("String_Node_Str") private void selectTopicInActionBar(String topicName){
  if (!SysUtils.isGteAndroid4())   return;
  if (!hasActivity())   return;
  if (topicName == null)   return;
  ActionBar actionBar=getActivity().getActionBar();
  if (actionBar == null)   return;
  int position=getActionBarAdapter().getIndexOfTopicName(topicName);
  if (position == -1)   return;
  if (position == actionBar.getSelectedNavigationIndex())   return;
  actionBar.setSelectedNavigationItem(position);
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") private void selectTopicInActionBar(String topicName){
  if (!hasActivity())   return;
  if (topicName == null)   return;
  ActionBar actionBar=getActionBar();
  if (actionBar == null)   return;
  int position=getActionBarAdapter().getIndexOfTopicName(topicName);
  if (position == -1)   return;
  if (position == actionBar.getSelectedNavigationIndex())   return;
  actionBar.setSelectedNavigationItem(position);
}
Program: 14999
Project: 14999
Buggy source:
@SuppressLint("String_Node_Str") private void setupActionBar(){
  if (!SysUtils.isGteAndroid4())   return;
  ActionBar actionBar=getActivity().getActionBar();
  if (actionBar == null)   return;
  actionBar.setDisplayShowTitleEnabled(false);
  actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
  ActionBar.OnNavigationListener navigationListener=new ActionBar.OnNavigationListener(){
    @Override public boolean onNavigationItemSelected(    int itemPosition,    long itemId){
      ReaderTopic topic=(ReaderTopic)getActionBarAdapter().getItem(itemPosition);
      if (topic != null) {
        setCurrentTopic(topic.getTopicName());
        ReaderLog.d("String_Node_Str" + topic.getTopicName());
      }
      return true;
    }
  }
;
  actionBar.setListNavigationCallbacks(getActionBarAdapter(),navigationListener);
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") private void setupActionBar(){
  ActionBar actionBar=getActionBar();
  if (actionBar == null)   return;
  actionBar.setDisplayShowTitleEnabled(false);
  actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
  ActionBar.OnNavigationListener navigationListener=new ActionBar.OnNavigationListener(){
    @Override public boolean onNavigationItemSelected(    int itemPosition,    long itemId){
      ReaderTopic topic=(ReaderTopic)getActionBarAdapter().getItem(itemPosition);
      if (topic != null) {
        setCurrentTopic(topic.getTopicName());
        ReaderLog.d("String_Node_Str" + topic.getTopicName());
      }
      return true;
    }
  }
;
  actionBar.setListNavigationCallbacks(getActionBarAdapter(),navigationListener);
}
Program: 15000
Project: 15000
Buggy source:
public static int generateIdFor(Note note){
  return StringUtils.getMd5IntHash(note.getSubject() + note.getType()).intValue();
}

Fixed version (ground truth):
public static int generateIdFor(Note note){
  if (note == null) {
    return 0;
  }
  return StringUtils.getMd5IntHash(note.getSubject() + note.getType()).intValue();
}
Program: 15001
Project: 15001
Buggy source:
public Note getNoteById(int id){
  Cursor cursor=db.query(NOTES_TABLE,new String[]{"String_Node_Str"},null,null,null,"String_Node_Str" + id,null,null);
  cursor.moveToFirst();
  try {
    JSONObject jsonNote=new JSONObject(cursor.getString(0));
    return new Note(jsonNote);
  }
 catch (  JSONException e) {
    Log.e(WordPress.TAG,"String_Node_Str" + e);
    return null;
  }
}

Fixed version (ground truth):
public Note getNoteById(int id){
  Cursor cursor=db.query(NOTES_TABLE,new String[]{"String_Node_Str"},"String_Node_Str" + id,null,null,null,null);
  cursor.moveToFirst();
  try {
    JSONObject jsonNote=new JSONObject(cursor.getString(0));
    return new Note(jsonNote);
  }
 catch (  JSONException e) {
    Log.e(WordPress.TAG,"String_Node_Str" + e);
    return null;
  }
catch (  CursorIndexOutOfBoundsException e) {
    Log.v(WordPress.TAG,"String_Node_Str" + e);
    return null;
  }
}
Program: 15003
Project: 15003
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  notes=WordPress.wpDB.loadNotes();
  refreshNotificationsListFragment(notes);
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  notes=WordPress.wpDB.getLatestNotes();
  refreshNotificationsListFragment(notes);
}
Program: 15004
Project: 15004
Buggy source:
private void createBroadcastReceiver(){
  mBroadcastReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      notes=WordPress.wpDB.loadNotes();
      refreshNotificationsListFragment(notes);
    }
  }
;
}

Fixed version (ground truth):
private void createBroadcastReceiver(){
  mBroadcastReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      notes=WordPress.wpDB.getLatestNotes();
      refreshNotificationsListFragment(notes);
    }
  }
;
}
Program: 15005
Project: 15005
Buggy source:
public void testAddNote_issue134(){
  SQLiteDatabase db=TestUtils.loadDBFromDump(targetContext,testContext,"String_Node_Str");
  WordPressDB wpdb=new WordPressDB(targetContext);
  Bundle b=new Bundle();
  b.putString("String_Node_Str","String_Node_Str");
  b.putString("String_Node_Str","String_Node_Str");
  b.putString("String_Node_Str","String_Node_Str");
  b.putString("String_Node_Str","String_Node_Str");
  b.putString("String_Node_Str","String_Node_Str");
  b.putString("String_Node_Str","String_Node_Str");
  b.putString("String_Node_Str","String_Node_Str");
  Note note=new Note(b);
  wpdb.addNote(note,true);
  db.close();
}

Fixed version (ground truth):
public void testAddNote_issue134(){
  SQLiteDatabase db=TestUtils.loadDBFromDump(targetContext,testContext,"String_Node_Str");
  WordPressDB wpdb=new WordPressDB(targetContext);
  Note note=createEmptyNote();
  wpdb.addNote(note,true);
  db.close();
}
Program: 15006
Project: 15006
Buggy source:
@Override protected Bitmap doInBackground(String... params){
  path=params[0];
  BitmapFactory.Options bfo=new BitmapFactory.Options();
  bfo.inJustDecodeBounds=true;
  BitmapFactory.decodeFile(path,bfo);
  bfo.inSampleSize=calculateInSampleSize(bfo,targetWidth,targetHeight);
  bfo.inJustDecodeBounds=false;
  return BitmapFactory.decodeFile(path,bfo);
}

Fixed version (ground truth):
@Override protected Bitmap doInBackground(String... params){
  path=params[0];
  BitmapFactory.Options bfo=new BitmapFactory.Options();
  bfo.inJustDecodeBounds=true;
  BitmapFactory.decodeFile(path,bfo);
  bfo.inSampleSize=calculateInSampleSize(bfo,targetWidth,targetHeight);
  bfo.inJustDecodeBounds=false;
  try {
    File f=new File(path);
    ExifInterface exif=new ExifInterface(f.getPath());
    int orientation=exif.getAttributeInt(ExifInterface.TAG_ORIENTATION,ExifInterface.ORIENTATION_NORMAL);
    int angle=0;
    if (orientation == ExifInterface.ORIENTATION_NORMAL) {
      return BitmapFactory.decodeFile(path,bfo);
    }
 else     if (orientation == ExifInterface.ORIENTATION_ROTATE_90) {
      angle=90;
    }
 else     if (orientation == ExifInterface.ORIENTATION_ROTATE_180) {
      angle=180;
    }
 else     if (orientation == ExifInterface.ORIENTATION_ROTATE_270) {
      angle=270;
    }
    Matrix mat=new Matrix();
    mat.postRotate(angle);
    Bitmap bmp=BitmapFactory.decodeStream(new FileInputStream(f),null,bfo);
    return Bitmap.createBitmap(bmp,0,0,bmp.getWidth(),bmp.getHeight(),mat,true);
  }
 catch (  IOException e) {
    Log.w("String_Node_Str","String_Node_Str");
  }
catch (  OutOfMemoryError oom) {
    Log.w("String_Node_Str","String_Node_Str");
  }
  return null;
}
Program: 15007
Project: 15007
Buggy source:
public boolean saveMediaFile(MediaFile mf){
  boolean returnValue=false;
  ContentValues values=new ContentValues();
  values.put("String_Node_Str",mf.getPostID());
  values.put("String_Node_Str",mf.getFilePath());
  values.put("String_Node_Str",mf.getFileName());
  values.put("String_Node_Str",mf.getTitle());
  values.put("String_Node_Str",mf.getDescription());
  values.put("String_Node_Str",mf.getCaption());
  values.put("String_Node_Str",mf.getHorizontalAlignment());
  values.put("String_Node_Str",mf.getWidth());
  values.put("String_Node_Str",mf.getHeight());
  values.put("String_Node_Str",mf.getMIMEType());
  values.put("String_Node_Str",mf.isFeatured());
  values.put("String_Node_Str",mf.isVideo());
  values.put("String_Node_Str",mf.isFeaturedInPost());
  values.put("String_Node_Str",mf.getFileURL());
  values.put("String_Node_Str",mf.getThumbnailURL());
  values.put("String_Node_Str",mf.getMediaId());
  values.put("String_Node_Str",mf.getBlogId());
  values.put("String_Node_Str",mf.getDateCreatedGMT());
  values.put("String_Node_Str",mf.getUploadState());
synchronized (this) {
    int result=0;
    if (mf.getMediaId() != null) {
      result=db.update(MEDIA_TABLE,values,"String_Node_Str",new String[]{mf.getBlogId(),String.valueOf(mf.getMediaId())});
    }
    if (result == 0)     returnValue=db.insert(MEDIA_TABLE,null,values) > 0;
  }
  return (returnValue);
}

Fixed version (ground truth):
public void saveMediaFile(MediaFile mf){
  ContentValues values=new ContentValues();
  values.put("String_Node_Str",mf.getPostID());
  values.put("String_Node_Str",mf.getFilePath());
  values.put("String_Node_Str",mf.getFileName());
  values.put("String_Node_Str",mf.getTitle());
  values.put("String_Node_Str",mf.getDescription());
  values.put("String_Node_Str",mf.getCaption());
  values.put("String_Node_Str",mf.getHorizontalAlignment());
  values.put("String_Node_Str",mf.getWidth());
  values.put("String_Node_Str",mf.getHeight());
  values.put("String_Node_Str",mf.getMIMEType());
  values.put("String_Node_Str",mf.isFeatured());
  values.put("String_Node_Str",mf.isVideo());
  values.put("String_Node_Str",mf.isFeaturedInPost());
  values.put("String_Node_Str",mf.getFileURL());
  values.put("String_Node_Str",mf.getThumbnailURL());
  values.put("String_Node_Str",mf.getMediaId());
  values.put("String_Node_Str",mf.getBlogId());
  values.put("String_Node_Str",mf.getDateCreatedGMT());
  values.put("String_Node_Str",mf.getUploadState());
synchronized (this) {
    int result=0;
    boolean isMarkedForDelete=false;
    if (mf.getMediaId() != null) {
      Cursor cursor=db.rawQuery("String_Node_Str" + MEDIA_TABLE + "String_Node_Str",new String[]{mf.getMediaId()});
      if (cursor != null && cursor.moveToFirst()) {
        isMarkedForDelete="String_Node_Str".equals(cursor.getString(0));
      }
      if (!isMarkedForDelete)       result=db.update(MEDIA_TABLE,values,"String_Node_Str",new String[]{mf.getBlogId(),mf.getMediaId()});
    }
    if (result == 0 && !isMarkedForDelete)     db.insert(MEDIA_TABLE,null,values);
  }
}
Program: 15008
Project: 15008
Buggy source:
@Override protected void bindChildView(View view,Context context,Cursor cursor,boolean isLastChild){
  String name=cursor.getString(cursor.getColumnIndex(StatsReferrersTable.Columns.NAME));
  int total=cursor.getInt(cursor.getColumnIndex(StatsReferrersTable.Columns.TOTAL));
  TextView entryTextView=(TextView)view.findViewById(R.id.stats_list_cell_entry);
  if (name.startsWith("String_Node_Str")) {
    Spanned link=Html.fromHtml("String_Node_Str" + name + "String_Node_Str"+ name+ "String_Node_Str");
    entryTextView.setText(link);
    entryTextView.setMovementMethod(LinkMovementMethod.getInstance());
  }
 else {
    entryTextView.setText(name);
  }
  DecimalFormat formatter=(DecimalFormat)DecimalFormat.getInstance(Locale.getDefault());
  TextView totalsTextView=(TextView)view.findViewById(R.id.stats_list_cell_total);
  totalsTextView.setText(formatter.format(total));
}

Fixed version (ground truth):
@Override protected void bindChildView(View view,Context context,Cursor cursor,boolean isLastChild){
  String name=cursor.getString(cursor.getColumnIndex(StatsReferrersTable.Columns.NAME));
  int total=cursor.getInt(cursor.getColumnIndex(StatsReferrersTable.Columns.TOTAL));
  TextView entryTextView=(TextView)view.findViewById(R.id.stats_list_cell_entry);
  if (name.startsWith("String_Node_Str")) {
    Spanned link=Html.fromHtml("String_Node_Str" + name + "String_Node_Str"+ name+ "String_Node_Str");
    entryTextView.setText(link);
    entryTextView.setMovementMethod(LinkMovementMethod.getInstance());
  }
 else {
    entryTextView.setText(name);
    entryTextView.setMovementMethod(null);
  }
  DecimalFormat formatter=(DecimalFormat)DecimalFormat.getInstance(Locale.getDefault());
  TextView totalsTextView=(TextView)view.findViewById(R.id.stats_list_cell_total);
  totalsTextView.setText(formatter.format(total));
}
Program: 15009
Project: 15009
Buggy source:
@Override protected void bindChildView(View view,Context context,Cursor cursor,boolean isLastChild){
  String name=cursor.getString(cursor.getColumnIndex(StatsReferrersTable.Columns.NAME));
  int total=cursor.getInt(cursor.getColumnIndex(StatsReferrersTable.Columns.TOTAL));
  TextView entryTextView=(TextView)view.findViewById(R.id.stats_list_cell_entry);
  if (name.startsWith("String_Node_Str")) {
    Spanned link=Html.fromHtml("String_Node_Str" + name + "String_Node_Str"+ name+ "String_Node_Str");
    entryTextView.setText(link);
    entryTextView.setMovementMethod(LinkMovementMethod.getInstance());
  }
 else {
    entryTextView.setText(name);
  }
  DecimalFormat formatter=(DecimalFormat)DecimalFormat.getInstance(Locale.getDefault());
  TextView totalsTextView=(TextView)view.findViewById(R.id.stats_list_cell_total);
  totalsTextView.setText(formatter.format(total));
}

Fixed version (ground truth):
@Override protected void bindChildView(View view,Context context,Cursor cursor,boolean isLastChild){
  String name=cursor.getString(cursor.getColumnIndex(StatsReferrersTable.Columns.NAME));
  int total=cursor.getInt(cursor.getColumnIndex(StatsReferrersTable.Columns.TOTAL));
  TextView entryTextView=(TextView)view.findViewById(R.id.stats_list_cell_entry);
  if (name.startsWith("String_Node_Str")) {
    Spanned link=Html.fromHtml("String_Node_Str" + name + "String_Node_Str"+ name+ "String_Node_Str");
    entryTextView.setText(link);
    entryTextView.setMovementMethod(LinkMovementMethod.getInstance());
  }
 else {
    entryTextView.setText(name);
    entryTextView.setMovementMethod(null);
  }
  DecimalFormat formatter=(DecimalFormat)DecimalFormat.getInstance(Locale.getDefault());
  TextView totalsTextView=(TextView)view.findViewById(R.id.stats_list_cell_total);
  totalsTextView.setText(formatter.format(total));
}
Program: 15011
Project: 15011
Buggy source:
private void loadNetworkImage(Cursor cursor,NetworkImageView imageView){
  String thumbnailURL=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  Uri uri=Uri.parse(thumbnailURL);
  String filepath=uri.getLastPathSegment();
  int placeholderResId=MediaUtils.getPlaceholder(filepath);
  imageView.setErrorImageResId(placeholderResId);
  imageView.setDefaultImageResId(placeholderResId);
  if (thumbnailURL != null && MediaUtils.isValidImage(filepath)) {
    imageView.setTag(thumbnailURL);
    imageView.setImageUrl(thumbnailURL,WordPress.imageLoader);
  }
 else {
    imageView.setImageResource(placeholderResId);
  }
}

Fixed version (ground truth):
private void loadNetworkImage(Cursor cursor,NetworkImageView imageView){
  String thumbnailURL=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  Uri uri=Uri.parse(thumbnailURL);
  String filepath=uri.getLastPathSegment();
  int placeholderResId=MediaUtils.getPlaceholder(filepath);
  imageView.setImageResource(0);
  imageView.setErrorImageResId(placeholderResId);
  imageView.setDefaultImageResId(placeholderResId);
  if (thumbnailURL != null && MediaUtils.isValidImage(filepath)) {
    imageView.setTag(thumbnailURL);
    imageView.setImageUrl(thumbnailURL,WordPress.imageLoader);
  }
 else {
    imageView.setImageResource(placeholderResId);
  }
}
Program: 15012
Project: 15012
Buggy source:
private void loadNetworkImage(Cursor cursor,NetworkImageView imageView){
  String thumbnailURL=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  Uri uri=Uri.parse(thumbnailURL);
  String filepath=uri.getLastPathSegment();
  int placeholderResId=MediaUtils.getPlaceholder(filepath);
  imageView.setErrorImageResId(placeholderResId);
  imageView.setDefaultImageResId(placeholderResId);
  if (thumbnailURL != null && MediaUtils.isValidImage(filepath)) {
    imageView.setTag(thumbnailURL);
    imageView.setImageUrl(thumbnailURL,WordPress.imageLoader);
  }
 else {
    imageView.setImageUrl("String_Node_Str",WordPress.imageLoader);
  }
}

Fixed version (ground truth):
private void loadNetworkImage(Cursor cursor,NetworkImageView imageView){
  String thumbnailURL=cursor.getString(cursor.getColumnIndex("String_Node_Str"));
  Uri uri=Uri.parse(thumbnailURL);
  String filepath=uri.getLastPathSegment();
  int placeholderResId=MediaUtils.getPlaceholder(filepath);
  imageView.setErrorImageResId(placeholderResId);
  imageView.setDefaultImageResId(placeholderResId);
  if (thumbnailURL != null && MediaUtils.isValidImage(filepath)) {
    imageView.setTag(thumbnailURL);
    imageView.setImageUrl(thumbnailURL,WordPress.imageLoader);
  }
 else {
    imageView.setImageResource(placeholderResId);
  }
}