nus-yam/ex-repair huggingface dataset:
Program: 14514
Project: 14514
Buggy source:
private void updateUIBelowTheGraph(int itemPosition){
  final VisitModel[] dataToShowOnGraph=getDataToShowOnGraph(mVisitsData);
  String date=mStatsDate[itemPosition];
  if (date == null) {
    AppLog.w(AppLog.T.STATS,"String_Node_Str");
    return;
  }
  mDateTextView.setText(StatsUIHelper.getDateForDisplayInLabels(date,getTimeframe()));
  VisitModel modelTapped=dataToShowOnGraph[itemPosition];
  for (int i=0; i < mRadioGroup.getChildCount(); i++) {
    View o=mRadioGroup.getChildAt(i);
    if (o instanceof RadioButton) {
      RadioButton currentBtm=(RadioButton)o;
      if (i == mSelectedOverviewItemIndex) {
        currentBtm.setChecked(true);
      }
      OverviewLabel overviewItem=(OverviewLabel)currentBtm.getTag();
switch (overviewItem) {
case VIEWS:
        currentBtm.setText(overviewItem.getLabel() + "String_Node_Str" + modelTapped.getViews());
      break;
case VISITORS:
    currentBtm.setText(overviewItem.getLabel() + "String_Node_Str" + modelTapped.getVisitors());
  break;
case LIKES:
currentBtm.setText(overviewItem.getLabel() + "String_Node_Str" + modelTapped.getLikes());
break;
case COMMENTS:
currentBtm.setText(overviewItem.getLabel() + "String_Node_Str" + modelTapped.getComments());
break;
}
}
}
}

Fixed version (ground truth):
private void updateUIBelowTheGraph(int itemPosition){
  final VisitModel[] dataToShowOnGraph=getDataToShowOnGraph(mVisitsData);
  String date=mStatsDate[itemPosition];
  if (date == null) {
    AppLog.w(AppLog.T.STATS,"String_Node_Str");
    return;
  }
  mDateTextView.setText(getDateForDisplayInLabels(date,getTimeframe()));
  VisitModel modelTapped=dataToShowOnGraph[itemPosition];
  for (int i=0; i < mRadioGroup.getChildCount(); i++) {
    View o=mRadioGroup.getChildAt(i);
    if (o instanceof RadioButton) {
      RadioButton currentBtm=(RadioButton)o;
      if (i == mSelectedOverviewItemIndex) {
        currentBtm.setChecked(true);
      }
      OverviewLabel overviewItem=(OverviewLabel)currentBtm.getTag();
switch (overviewItem) {
case VIEWS:
        currentBtm.setText(overviewItem.getLabel() + "String_Node_Str" + modelTapped.getViews());
      break;
case VISITORS:
    currentBtm.setText(overviewItem.getLabel() + "String_Node_Str" + modelTapped.getVisitors());
  break;
case LIKES:
currentBtm.setText(overviewItem.getLabel() + "String_Node_Str" + modelTapped.getLikes());
break;
case COMMENTS:
currentBtm.setText(overviewItem.getLabel() + "String_Node_Str" + modelTapped.getComments());
break;
}
}
}
}
Program: 14515
Project: 14515
Buggy source:
/** 
 * Open a note fragment based on the type of note
 */
private void openNote(final Note note){
  if (note == null || isFinishing() || isActivityDestroyed()) {
    return;
  }
  mSelectedNoteId=note.getId();
  if (note.isUnread()) {
    note.markAsRead();
  }
  mDetailFragment=getDetailFragmentForNote(note);
  FragmentManager fm=getFragmentManager();
  FragmentTransaction ft=fm.beginTransaction();
  ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
  ft.hide(mNotesListFragment);
  ft.add(R.id.layout_fragment_container,mDetailFragment);
  ft.addToBackStack(null);
  ft.commitAllowingStateLoss();
  if (note.getFormattedSubject() != null) {
    setTitle(note.getTitle());
  }
  AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATIONS_OPENED_NOTIFICATION_DETAILS);
}

Fixed version (ground truth):
/** 
 * Open a note fragment based on the type of note
 */
private void openNote(final Note note){
  if (note == null || isFinishing() || isActivityDestroyed()) {
    return;
  }
  mSelectedNoteId=note.getId();
  if (note.isUnread()) {
    note.markAsRead();
  }
  mDetailFragment=getDetailFragmentForNote(note);
  FragmentManager fm=getFragmentManager();
  FragmentTransaction ft=fm.beginTransaction();
  ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
  ft.hide(mNotesListFragment);
  ft.add(R.id.layout_fragment_container,mDetailFragment);
  ft.addToBackStack(null);
  ft.commitAllowingStateLoss();
  if (getSupportActionBar() != null && note.getFormattedSubject() != null) {
    getSupportActionBar().setTitle(note.getTitle());
  }
  AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATIONS_OPENED_NOTIFICATION_DETAILS);
}
Program: 14516
Project: 14516
Buggy source:
public void onBackStackChanged(){
  int backStackEntryCount=getFragmentManager().getBackStackEntryCount();
  if (backStackEntryCount == 0) {
    setTitle(R.string.notifications);
  }
  if (getDrawerToggle() != null) {
    getDrawerToggle().setDrawerIndicatorEnabled(backStackEntryCount == 0);
  }
}

Fixed version (ground truth):
public void onBackStackChanged(){
  int backStackEntryCount=getFragmentManager().getBackStackEntryCount();
  if (getSupportActionBar() != null && backStackEntryCount == 0) {
    getSupportActionBar().setTitle(R.string.notifications);
  }
  if (getDrawerToggle() != null) {
    getDrawerToggle().setDrawerIndicatorEnabled(backStackEntryCount == 0);
  }
}
Program: 14517
Project: 14517
Buggy source:
@Override public void onClick(View view){
  if (mOnPostPopupListener != null) {
    mOnPostPopupListener.onShowPostPopup(view,post);
  }
}

Fixed version (ground truth):
@Override public void onClick(View v){
  mPostSelectedListener.onPostSelected(post.blogId,post.postId);
}
Program: 14518
Project: 14518
Buggy source:
@Override public ReaderPostViewHolder onCreateViewHolder(ViewGroup viewGroup,final int position){
  View view=LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.reader_cardview_post,viewGroup,false);
  view.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      ReaderPost post=getItem(position);
      if (mPostSelectedListener != null && post != null) {
        mPostSelectedListener.onPostSelected(post.blogId,post.postId);
      }
    }
  }
);
  return new ReaderPostViewHolder(view);
}

Fixed version (ground truth):
@Override public ReaderPostViewHolder onCreateViewHolder(ViewGroup viewGroup,int position){
  View view=LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.reader_cardview_post,viewGroup,false);
  return new ReaderPostViewHolder(view);
}
Program: 14521
Project: 14521
Buggy source:
public void setItems(List<MenuDrawerItem> visibleItems){
  if (mItems.size() == visibleItems.size() && mItems.containsAll(visibleItems)) {
    return;
  }
  mItems.clear();
  mItems.addAll(visibleItems);
  notifyDataSetChanged();
}

Fixed version (ground truth):
void setItems(List<MenuDrawerItem> visibleItems){
  mItems.clear();
  mItems.addAll(visibleItems);
  notifyDataSetChanged();
}
Program: 14522
Project: 14522
Buggy source:
private void showReader(){
  Intent intent;
  intent=new Intent(WPDrawerActivity.this,ReaderPostListActivity.class);
  intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
  startActivity(intent);
}

Fixed version (ground truth):
private void showReader(){
  Intent intent=new Intent(WPDrawerActivity.this,ReaderPostListActivity.class);
  intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
  startActivity(intent);
}
Program: 14523
Project: 14523
Buggy source:
/** 
 * called when user selects an item from the drawer to start the associated activity
 */
private void startDrawerIntent(Intent intent){
  intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
  startActivity(intent);
}

Fixed version (ground truth):
/** 
 * called when user selects an item from the drawer - starts the associated activity after a brief delay (to give drawer time to close)
 */
private void startDrawerIntent(final Intent intent){
  intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
  startActivity(intent);
}
Program: 14524
Project: 14524
Buggy source:
public void testRefreshBlogContent() throws InterruptedException {
  XMLRPCFactoryTest.setPrefixAllInstances("String_Node_Str");
  final CountDownLatch countDownLatch=new CountDownLatch(1);
  Blog dummyBlog=new Blog("String_Node_Str","String_Node_Str","String_Node_Str");
  new ApiHelper.RefreshBlogContentTask(mTargetContext,dummyBlog,new GenericCallback(){
    @Override public void onSuccess(){
      assertTrue(true);
      countDownLatch.countDown();
    }
    @Override public void onFailure(    ErrorType errorType,    String errorMessage,    Throwable throwable){
      assertTrue(false);
      countDownLatch.countDown();
    }
  }
).execute(false);
  countDownLatch.await(5000,TimeUnit.SECONDS);
}

Fixed version (ground truth):
public void testRefreshBlogContent() throws InterruptedException {
  XMLRPCFactoryTest.setPrefixAllInstances("String_Node_Str");
  final CountDownLatch countDownLatch=new CountDownLatch(1);
  Blog dummyBlog=new Blog("String_Node_Str","String_Node_Str","String_Node_Str");
  new ApiHelper.RefreshBlogContentTask(dummyBlog,new GenericCallback(){
    @Override public void onSuccess(){
      assertTrue(true);
      countDownLatch.countDown();
    }
    @Override public void onFailure(    ErrorType errorType,    String errorMessage,    Throwable throwable){
      assertTrue(false);
      countDownLatch.countDown();
    }
  }
).execute(false);
  countDownLatch.await(5000,TimeUnit.SECONDS);
}
Program: 14525
Project: 14525
Buggy source:
public void testRefreshBlogContentEmptyResponse() throws InterruptedException {
  XMLRPCFactoryTest.setPrefixAllInstances("String_Node_Str");
  final CountDownLatch countDownLatch=new CountDownLatch(1);
  Blog dummyBlog=new Blog("String_Node_Str","String_Node_Str","String_Node_Str");
  new ApiHelper.RefreshBlogContentTask(mTargetContext,dummyBlog,new GenericCallback(){
    @Override public void onSuccess(){
      assertTrue(false);
      countDownLatch.countDown();
    }
    @Override public void onFailure(    ErrorType errorType,    String errorMessage,    Throwable throwable){
      assertTrue(true);
      countDownLatch.countDown();
    }
  }
).execute(false);
  countDownLatch.await(5000,TimeUnit.SECONDS);
}

Fixed version (ground truth):
public void testRefreshBlogContentEmptyResponse() throws InterruptedException {
  XMLRPCFactoryTest.setPrefixAllInstances("String_Node_Str");
  final CountDownLatch countDownLatch=new CountDownLatch(1);
  Blog dummyBlog=new Blog("String_Node_Str","String_Node_Str","String_Node_Str");
  new ApiHelper.RefreshBlogContentTask(dummyBlog,new GenericCallback(){
    @Override public void onSuccess(){
      assertTrue(false);
      countDownLatch.countDown();
    }
    @Override public void onFailure(    ErrorType errorType,    String errorMessage,    Throwable throwable){
      assertTrue(true);
      countDownLatch.countDown();
    }
  }
).execute(false);
  countDownLatch.await(5000,TimeUnit.SECONDS);
}
Program: 14527
Project: 14527
Buggy source:
public static void displayHtmlComment(TextView textView,String content,int maxImageSize){
  if (textView == null)   return;
  if (content == null) {
    textView.setText(null);
    return;
  }
  if (!content.contains("String_Node_Str") && !content.contains("String_Node_Str")) {
    content=content.trim();
    textView.setText(content);
    if (content.contains("String_Node_Str")) {
      Linkify.addLinks(textView,Linkify.WEB_URLS);
    }
    return;
  }
  content=Emoticons.replaceEmoticonsWithEmoji(content);
  final Spanned html;
  if (maxImageSize > 0 && content.contains("String_Node_Str")) {
    Drawable loading=textView.getContext().getResources().getDrawable(R.drawable.remote_image);
    Drawable failed=textView.getContext().getResources().getDrawable(R.drawable.remote_failed);
    html=HtmlUtils.fromHtml(content,new WPImageGetter(textView,maxImageSize,WordPress.imageLoader,loading,failed));
  }
 else {
    html=HtmlUtils.fromHtml(content);
  }
  CharSequence source=html;
  int start=0;
  int end=source.length();
  while (start < end && Character.isWhitespace(source.charAt(start))) {
    start++;
  }
  while (end > start && Character.isWhitespace(source.charAt(end - 1))) {
    end--;
  }
  textView.setText(source);
}

Fixed version (ground truth):
public static void displayHtmlComment(TextView textView,String content,int maxImageSize){
  if (textView == null) {
    return;
  }
  if (content == null) {
    textView.setText(null);
    return;
  }
  if (!content.contains("String_Node_Str") && !content.contains("String_Node_Str")) {
    content=content.trim();
    textView.setText(content);
    if (content.contains("String_Node_Str")) {
      Linkify.addLinks(textView,Linkify.WEB_URLS);
    }
    return;
  }
  content=Emoticons.replaceEmoticonsWithEmoji(content);
  final Spanned html;
  if (maxImageSize > 0 && content.contains("String_Node_Str")) {
    Drawable loading=textView.getContext().getResources().getDrawable(R.drawable.remote_image);
    Drawable failed=textView.getContext().getResources().getDrawable(R.drawable.remote_failed);
    html=HtmlUtils.fromHtml(content,new WPImageGetter(textView,maxImageSize,WordPress.imageLoader,loading,failed));
  }
 else {
    html=HtmlUtils.fromHtml(content);
  }
  CharSequence source=html;
  int start=0;
  int end=source.length();
  while (start < end && Character.isWhitespace(source.charAt(start))) {
    start++;
  }
  while (end > start && Character.isWhitespace(source.charAt(end - 1))) {
    end--;
  }
  textView.setText(source.subSequence(start,end));
}
Program: 14528
Project: 14528
Buggy source:
public static CharSequence displayHtmlComment(TextView textView,String content,int maxImageSize){
  if (textView == null)   return null;
  if (content == null) {
    textView.setText(null);
    return null;
  }
  if (!content.contains("String_Node_Str") && !content.contains("String_Node_Str")) {
    content=content.trim();
    textView.setText(content);
    if (content.contains("String_Node_Str")) {
      Linkify.addLinks(textView,Linkify.WEB_URLS);
    }
    return content;
  }
  content=Emoticons.replaceEmoticonsWithEmoji(content);
  final Spanned html;
  if (maxImageSize > 0 && content.contains("String_Node_Str")) {
    Drawable loading=textView.getContext().getResources().getDrawable(R.drawable.remote_image);
    Drawable failed=textView.getContext().getResources().getDrawable(R.drawable.remote_failed);
    html=HtmlUtils.fromHtml(content,new WPImageGetter(textView,maxImageSize,WordPress.imageLoader,loading,failed));
  }
 else {
    html=HtmlUtils.fromHtml(content);
  }
  CharSequence source=html;
  int start=0;
  int end=source.length();
  while (start < end && Character.isWhitespace(source.charAt(start))) {
    start++;
  }
  while (end > start && Character.isWhitespace(source.charAt(end - 1))) {
    end--;
  }
  textView.setText(source);
  return source;
}

Fixed version (ground truth):
public static void displayHtmlComment(TextView textView,String content,int maxImageSize){
  if (textView == null) {
    return;
  }
  if (content == null) {
    textView.setText(null);
    return;
  }
  if (!content.contains("String_Node_Str") && !content.contains("String_Node_Str")) {
    content=content.trim();
    textView.setText(content);
    if (content.contains("String_Node_Str")) {
      Linkify.addLinks(textView,Linkify.WEB_URLS);
    }
    return;
  }
  content=Emoticons.replaceEmoticonsWithEmoji(content);
  final Spanned html;
  if (maxImageSize > 0 && content.contains("String_Node_Str")) {
    Drawable loading=textView.getContext().getResources().getDrawable(R.drawable.remote_image);
    Drawable failed=textView.getContext().getResources().getDrawable(R.drawable.remote_failed);
    html=HtmlUtils.fromHtml(content,new WPImageGetter(textView,maxImageSize,WordPress.imageLoader,loading,failed));
  }
 else {
    html=HtmlUtils.fromHtml(content);
  }
  CharSequence source=html;
  int start=0;
  int end=source.length();
  while (start < end && Character.isWhitespace(source.charAt(start))) {
    start++;
  }
  while (end > start && Character.isWhitespace(source.charAt(end - 1))) {
    end--;
  }
  textView.setText(source.subSequence(start,end));
}
Program: 14529
Project: 14529
Buggy source:
private void loadPost(){
  mPost=ReaderPostTable.getPost(mBlogId,mPostId);
  if (mPost == null) {
    ToastUtils.showToast(this,R.string.reader_toast_err_get_post);
    finish();
  }
  final View postHeader=findViewById(R.id.layout_post_header);
  final TextView txtTitle=(TextView)postHeader.findViewById(R.id.text_post_title);
  final WPNetworkImageView imgAvatar=(WPNetworkImageView)postHeader.findViewById(R.id.image_post_avatar);
  final TextView txtCommentsClosed=(TextView)findViewById(R.id.text_comments_closed);
  txtTitle.setText(mPost.getTitle());
  String url=mPost.getPostAvatarForDisplay(getResources().getDimensionPixelSize(R.dimen.avatar_sz_small));
  imgAvatar.setImageUrl(url,WPNetworkImageView.ImageType.AVATAR);
  if (mPost.isCommentsOpen) {
    mCommentBox.setVisibility(View.VISIBLE);
    txtCommentsClosed.setVisibility(View.GONE);
    mEditComment.setOnEditorActionListener(new TextView.OnEditorActionListener(){
      @Override public boolean onEditorAction(      TextView v,      int actionId,      KeyEvent event){
        if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_SEND) {
          submitComment();
        }
        return false;
      }
    }
);
    mImgSubmitComment.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        submitComment();
      }
    }
);
  }
 else {
    mCommentBox.setVisibility(View.GONE);
    txtCommentsClosed.setVisibility(View.VISIBLE);
  }
}

Fixed version (ground truth):
private void loadPost(){
  mPost=ReaderPostTable.getPost(mBlogId,mPostId);
  if (mPost == null) {
    ToastUtils.showToast(this,R.string.reader_toast_err_get_post);
    finish();
  }
  final View postHeader=findViewById(R.id.layout_post_header);
  final TextView txtTitle=(TextView)postHeader.findViewById(R.id.text_post_title);
  final WPNetworkImageView imgAvatar=(WPNetworkImageView)postHeader.findViewById(R.id.image_post_avatar);
  final TextView txtCommentsClosed=(TextView)findViewById(R.id.text_comments_closed);
  txtTitle.setText(mPost.getTitle());
  String url=mPost.getPostAvatarForDisplay(getResources().getDimensionPixelSize(R.dimen.avatar_sz_small));
  imgAvatar.setImageUrl(url,WPNetworkImageView.ImageType.AVATAR);
  if (mPost.isCommentsOpen) {
    mCommentBox.setVisibility(View.VISIBLE);
    txtCommentsClosed.setVisibility(View.GONE);
    mEditComment.setOnEditorActionListener(new TextView.OnEditorActionListener(){
      @Override public boolean onEditorAction(      TextView v,      int actionId,      KeyEvent event){
        if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_SEND) {
          submitComment();
        }
        return false;
      }
    }
);
    mImgSubmitComment.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        submitComment();
      }
    }
);
  }
 else {
    mCommentBox.setVisibility(View.GONE);
    mEditComment.setEnabled(false);
    txtCommentsClosed.setVisibility(View.VISIBLE);
  }
}
Program: 14530
Project: 14530
Buggy source:
public void search(String searchTerm){
  mLastSearch=searchTerm;
  String blogId=getBlogId();
  Cursor cursor=WordPress.wpDB.getThemes(blogId,searchTerm);
  if (mAdapter == null) {
    return;
  }
 else {
    mAdapter.changeCursor(cursor);
    mGridView.invalidateViews();
    if (cursor == null || cursor.getCount() == 0) {
      mNoResultText.setVisibility(View.VISIBLE);
    }
 else {
      mNoResultText.setVisibility(View.GONE);
    }
  }
}

Fixed version (ground truth):
public void search(String searchTerm){
  mLastSearch=searchTerm;
  if (mAdapter == null || WordPress.getCurrentBlog() == null) {
    return;
  }
  String blogId=String.valueOf(WordPress.getCurrentBlog().getRemoteBlogId());
  Cursor cursor=WordPress.wpDB.getThemes(blogId,searchTerm);
  mAdapter.changeCursor(cursor);
  mGridView.invalidateViews();
  if (cursor == null || cursor.getCount() == 0) {
    mNoResultText.setVisibility(View.VISIBLE);
  }
 else {
    mNoResultText.setVisibility(View.GONE);
  }
}
Program: 14531
Project: 14531
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.reader_activity_comments);
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  if (savedInstanceState != null) {
    mBlogId=savedInstanceState.getLong(ReaderConstants.ARG_BLOG_ID);
    mPostId=savedInstanceState.getLong(ReaderConstants.ARG_POST_ID);
  }
 else {
    mBlogId=getIntent().getLongExtra(ReaderConstants.ARG_BLOG_ID,0);
    mPostId=getIntent().getLongExtra(ReaderConstants.ARG_POST_ID,0);
  }
  loadPost();
  mListView=(WPListView)findViewById(android.R.id.list);
  int height=getResources().getDimensionPixelSize(R.dimen.margin_extra_small);
  ReaderUtils.addListViewHeader(mListView,height);
  mListView.setAdapter(getCommentAdapter());
  mLayoutCommentBox=(ViewGroup)findViewById(R.id.layout_comment_box);
  mLayoutCommentBox.setVisibility(View.VISIBLE);
  if (savedInstanceState != null && savedInstanceState.containsKey(KEY_REPLY_TO_COMMENT_ID)) {
    showAddCommentBox(savedInstanceState.getLong(KEY_REPLY_TO_COMMENT_ID));
  }
  refreshComments();
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.reader_activity_comments);
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  if (savedInstanceState != null) {
    mBlogId=savedInstanceState.getLong(ReaderConstants.ARG_BLOG_ID);
    mPostId=savedInstanceState.getLong(ReaderConstants.ARG_POST_ID);
  }
 else {
    mBlogId=getIntent().getLongExtra(ReaderConstants.ARG_BLOG_ID,0);
    mPostId=getIntent().getLongExtra(ReaderConstants.ARG_POST_ID,0);
  }
  loadPost();
  mListView=(WPListView)findViewById(android.R.id.list);
  int height=getResources().getDimensionPixelSize(R.dimen.margin_extra_small);
  ReaderUtils.addListViewHeader(mListView,height);
  mListView.setAdapter(getCommentAdapter());
  mLayoutCommentBox=(ViewGroup)findViewById(R.id.layout_comment_box);
  mLayoutCommentBox.setVisibility(View.VISIBLE);
  final ImageView imgPostComment=(ImageView)mLayoutCommentBox.findViewById(R.id.image_post_comment);
  imgPostComment.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      submitComment(mReplyToCommentId);
    }
  }
);
  if (savedInstanceState != null && savedInstanceState.containsKey(KEY_REPLY_TO_COMMENT_ID)) {
    showAddCommentBox(savedInstanceState.getLong(KEY_REPLY_TO_COMMENT_ID));
  }
  refreshComments();
}
Program: 14532
Project: 14532
Buggy source:
@Override public void onClick(View v){
  submitComment(replyToCommentId);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  submitComment(mReplyToCommentId);
}
Program: 14533
Project: 14533
Buggy source:
private void showAddCommentBox(final long replyToCommentId){
  if (isFinishing() || mIsSubmittingComment) {
    return;
  }
  final EditText editComment=(EditText)mLayoutCommentBox.findViewById(R.id.edit_comment);
  editComment.setHint(replyToCommentId == 0 ? R.string.reader_hint_comment_on_post : R.string.reader_hint_comment_on_comment);
  if (mLayoutCommentBox.getVisibility() != View.VISIBLE) {
    AniUtils.flyIn(mLayoutCommentBox);
  }
  editComment.requestFocus();
  editComment.setOnEditorActionListener(new TextView.OnEditorActionListener(){
    @Override public boolean onEditorAction(    TextView v,    int actionId,    KeyEvent event){
      if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_SEND) {
        submitComment(replyToCommentId);
      }
      return false;
    }
  }
);
  final ImageView imgPostComment=(ImageView)findViewById(R.id.image_post_comment);
  imgPostComment.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      submitComment(replyToCommentId);
    }
  }
);
  EditTextUtils.showSoftInput(editComment);
  if (replyToCommentId != 0) {
    getCommentAdapter().setHighlightCommentId(replyToCommentId,false);
    mListView.postDelayed(new Runnable(){
      @Override public void run(){
        scrollToCommentId(replyToCommentId);
      }
    }
,300);
  }
  mReplyToCommentId=replyToCommentId;
}

Fixed version (ground truth):
private void showAddCommentBox(final long replyToCommentId){
  if (isFinishing() || mIsSubmittingComment) {
    return;
  }
  final EditText editComment=(EditText)mLayoutCommentBox.findViewById(R.id.edit_comment);
  editComment.setHint(replyToCommentId == 0 ? R.string.reader_hint_comment_on_post : R.string.reader_hint_comment_on_comment);
  if (mLayoutCommentBox.getVisibility() != View.VISIBLE) {
    AniUtils.flyIn(mLayoutCommentBox);
  }
  editComment.requestFocus();
  editComment.setOnEditorActionListener(new TextView.OnEditorActionListener(){
    @Override public boolean onEditorAction(    TextView v,    int actionId,    KeyEvent event){
      if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_SEND) {
        submitComment(replyToCommentId);
      }
      return false;
    }
  }
);
  EditTextUtils.showSoftInput(editComment);
  if (replyToCommentId != 0) {
    getCommentAdapter().setHighlightCommentId(replyToCommentId,false);
    mListView.postDelayed(new Runnable(){
      @Override public void run(){
        scrollToCommentId(replyToCommentId);
      }
    }
,300);
  }
  mReplyToCommentId=replyToCommentId;
}
Program: 14534
Project: 14534
Buggy source:
/** 
 * Open a note fragment based on the type of note
 */
private void openNote(final Note note){
  if (note == null || isFinishing() || isActivityDestroyed()) {
    return;
  }
  mSelectedNoteId=note.getId();
  if (note.isUnread()) {
    note.markAsRead();
  }
  mDetailFragment=getDetailFragmentForNote(note);
  if (DisplayUtils.isLandscapeTablet(this)) {
    FragmentManager fm=getFragmentManager();
    FragmentTransaction ft=fm.beginTransaction();
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    ft.replace(R.id.notifications_detail_fragment_container,mDetailFragment);
    ft.commitAllowingStateLoss();
    return;
  }
  FragmentManager fm=getFragmentManager();
  FragmentTransaction ft=fm.beginTransaction();
  ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
  ft.replace(R.id.layout_fragment_container,mDetailFragment);
  mMenuDrawer.setDrawerIndicatorEnabled(false);
  ft.addToBackStack(null);
  ft.commitAllowingStateLoss();
  if (note.getFormattedSubject() != null) {
    setTitle(note.getTitle());
  }
}

Fixed version (ground truth):
/** 
 * Open a note fragment based on the type of note
 */
private void openNote(final Note note){
  if (note == null || isFinishing() || isActivityDestroyed()) {
    return;
  }
  mSelectedNoteId=note.getId();
  if (note.isUnread()) {
    note.markAsRead();
  }
  mDetailFragment=getDetailFragmentForNote(note);
  if (DisplayUtils.isLandscapeTablet(this)) {
    FragmentManager fm=getFragmentManager();
    FragmentTransaction ft=fm.beginTransaction();
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    ft.replace(R.id.notifications_detail_fragment_container,mDetailFragment,TAG_TABLET_DETAIL_VIEW);
    ft.commitAllowingStateLoss();
    return;
  }
  FragmentManager fm=getFragmentManager();
  FragmentTransaction ft=fm.beginTransaction();
  ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
  ft.replace(R.id.layout_fragment_container,mDetailFragment);
  mMenuDrawer.setDrawerIndicatorEnabled(false);
  ft.addToBackStack(null);
  ft.commitAllowingStateLoss();
  if (note.getFormattedSubject() != null) {
    setTitle(note.getTitle());
  }
}
Program: 14535
Project: 14535
Buggy source:
@Override public void onSaveInstanceState(@Nonnull Bundle outState){
  if (outState.isEmpty()) {
    outState.putBoolean("String_Node_Str",true);
  }
  outState.putBoolean(KEY_INITIAL_UPDATE,mHasPerformedInitialUpdate);
  if (DisplayUtils.isLandscapeTablet(this) || getFragmentManager().getBackStackEntryCount() > 0) {
    outState.putString(NOTE_ID_EXTRA,mSelectedNoteId);
  }
  if (!TextUtils.isEmpty(getCommentReplyText())) {
    outState.putString(KEY_REPLY_TEXT,getCommentReplyText());
  }
  super.onSaveInstanceState(outState);
}

Fixed version (ground truth):
@Override public void onSaveInstanceState(@Nonnull Bundle outState){
  if (outState.isEmpty()) {
    outState.putBoolean("String_Node_Str",true);
  }
  outState.putBoolean(KEY_INITIAL_UPDATE,mHasPerformedInitialUpdate);
  if (getFragmentManager().getBackStackEntryCount() > 0 || getFragmentManager().findFragmentByTag(TAG_TABLET_DETAIL_VIEW) != null) {
    outState.putString(NOTE_ID_EXTRA,mSelectedNoteId);
  }
  if (!TextUtils.isEmpty(getCommentReplyText())) {
    outState.putString(KEY_REPLY_TEXT,getCommentReplyText());
  }
  super.onSaveInstanceState(outState);
}
Program: 14536
Project: 14536
Buggy source:
ImageSizeMap(String jsonString){
  if (TextUtils.isEmpty(jsonString)) {
    return;
  }
  try {
    JSONObject json=new JSONObject(jsonString);
    Iterator<String> it=json.keys();
    if (!it.hasNext()) {
      return;
    }
    while (it.hasNext()) {
      JSONObject jsonAttach=json.optJSONObject(it.next());
      String mimeType=JSONUtil.getString(json,"String_Node_Str");
      if (mimeType.startsWith("String_Node_Str")) {
        String normUrl=UrlUtils.normalizeUrl(UrlUtils.removeQuery(JSONUtil.getString(json,"String_Node_Str")));
        int width=jsonAttach.optInt("String_Node_Str");
        int height=jsonAttach.optInt("String_Node_Str");
        this.put(normUrl,new ImageSize(width,height));
      }
    }
  }
 catch (  JSONException e) {
    AppLog.e(AppLog.T.READER,e);
  }
}

Fixed version (ground truth):
ImageSizeMap(String jsonString){
  if (TextUtils.isEmpty(jsonString)) {
    return;
  }
  try {
    JSONObject json=new JSONObject(jsonString);
    Iterator<String> it=json.keys();
    if (!it.hasNext()) {
      return;
    }
    while (it.hasNext()) {
      JSONObject jsonAttach=json.optJSONObject(it.next());
      if (jsonAttach != null && JSONUtil.getString(jsonAttach,"String_Node_Str").startsWith("String_Node_Str")) {
        String normUrl=UrlUtils.normalizeUrl(UrlUtils.removeQuery(JSONUtil.getString(json,"String_Node_Str")));
        int width=jsonAttach.optInt("String_Node_Str");
        int height=jsonAttach.optInt("String_Node_Str");
        this.put(normUrl,new ImageSize(width,height));
      }
    }
  }
 catch (  JSONException e) {
    AppLog.e(AppLog.T.READER,e);
  }
}
Program: 14537
Project: 14537
Buggy source:
/** 
 * returns true if airplane mode has been enabled
 */
public static boolean isAirplaneModeOn(Context context){
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
    return Settings.System.getInt(context.getContentResolver(),Settings.System.AIRPLANE_MODE_ON,0) != 0;
  }
 else {
    return Settings.Global.getInt(context.getContentResolver(),Settings.Global.AIRPLANE_MODE_ON,0) != 0;
  }
}

Fixed version (ground truth):
/** 
 * returns true if airplane mode has been enabled
 */
@TargetApi(VERSION_CODES.JELLY_BEAN_MR1) @SuppressWarnings("String_Node_Str") public static boolean isAirplaneModeOn(Context context){
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
    return Settings.System.getInt(context.getContentResolver(),Settings.System.AIRPLANE_MODE_ON,0) != 0;
  }
 else {
    return Settings.Global.getInt(context.getContentResolver(),Settings.Global.AIRPLANE_MODE_ON,0) != 0;
  }
}
Program: 14538
Project: 14538
Buggy source:
/** 
 * returns true if airplane mode has been enabled
 */
public static boolean isAirplaneModeOn(Context context){
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
    return Settings.System.getInt(context.getContentResolver(),Settings.System.AIRPLANE_MODE_ON,0) != 0;
  }
 else {
    return Settings.Global.getInt(context.getContentResolver(),Settings.Global.AIRPLANE_MODE_ON,0) != 0;
  }
}

Fixed version (ground truth):
/** 
 * returns true if airplane mode has been enabled
 */
@TargetApi(VERSION_CODES.JELLY_BEAN_MR1) @SuppressWarnings("String_Node_Str") public static boolean isAirplaneModeOn(Context context){
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
    return Settings.System.getInt(context.getContentResolver(),Settings.System.AIRPLANE_MODE_ON,0) != 0;
  }
 else {
    return Settings.Global.getInt(context.getContentResolver(),Settings.Global.AIRPLANE_MODE_ON,0) != 0;
  }
}
Program: 14540
Project: 14540
Buggy source:
public static String getSrcAttrValue(final String tag){
  if (tag == null) {
    return null;
  }
  Matcher matcher=SRC_ATTR_PATTERN.matcher(tag);
  if (matcher.find()) {
    return tag.substring(matcher.start() + 5,matcher.end() - 1);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
private static String getSrcAttrValue(final String tag){
  if (tag == null) {
    return null;
  }
  Matcher matcher=SRC_ATTR_PATTERN.matcher(tag);
  if (matcher.find()) {
    return tag.substring(matcher.start() + 5,matcher.end() - 1);
  }
 else {
    return null;
  }
}
Program: 14541
Project: 14541
Buggy source:
private void replaceImageTag(final String imageTag,final String imageUrl){
  if (imageUrl.contains("String_Node_Str")) {
    return;
  }
  int origWidth;
  int origHeight;
  ReaderAttachment attach=(mAttachments != null ? mAttachments.get(imageUrl) : null);
  if (attach != null && attach.isImage()) {
    origWidth=attach.width;
    origHeight=attach.height;
  }
 else   if (imageUrl.contains("String_Node_Str")) {
    Uri uri=Uri.parse(imageUrl.replace("String_Node_Str","String_Node_Str"));
    origWidth=StringUtils.stringToInt(uri.getQueryParameter("String_Node_Str"));
    origHeight=StringUtils.stringToInt(uri.getQueryParameter("String_Node_Str"));
  }
 else {
    return;
  }
  int newWidth;
  int newHeight;
  if (origWidth > 0 && origHeight > 0) {
    float ratio=((float)origHeight / (float)origWidth);
    newWidth=mResourceVars.fullSizeImageWidth;
    newHeight=(int)(newWidth * ratio);
  }
 else   if (origWidth > 0) {
    newWidth=mResourceVars.fullSizeImageWidth;
    newHeight=0;
  }
 else {
    return;
  }
  String newImageUrl=ReaderUtils.getResizedImageUrl(imageUrl,newWidth,newHeight,mPost.isPrivate);
  String newImageTag=String.format("String_Node_Str",newImageUrl,newWidth,newHeight);
  int start=mRenderBuilder.indexOf(imageTag);
  if (start == -1) {
    AppLog.w(AppLog.T.READER,"String_Node_Str");
    return;
  }
  mRenderBuilder.replace(start,start + imageTag.length(),newImageTag);
}

Fixed version (ground truth):
private void replaceImageTag(final String imageTag,final String imageUrl){
  if (imageTag.contains("String_Node_Str")) {
    return;
  }
  int origWidth;
  int origHeight;
  ReaderAttachment attach=(mAttachments != null ? mAttachments.get(imageUrl) : null);
  if (attach != null && attach.isImage()) {
    origWidth=attach.width;
    origHeight=attach.height;
  }
 else   if (imageUrl.contains("String_Node_Str")) {
    Uri uri=Uri.parse(imageUrl.replace("String_Node_Str","String_Node_Str"));
    origWidth=StringUtils.stringToInt(uri.getQueryParameter("String_Node_Str"));
    origHeight=StringUtils.stringToInt(uri.getQueryParameter("String_Node_Str"));
  }
 else {
    origWidth=0;
    origHeight=0;
  }
  int newWidth;
  int newHeight;
  if (origWidth > 0 && origHeight > 0) {
    float ratio=((float)origHeight / (float)origWidth);
    newWidth=mResourceVars.fullSizeImageWidth;
    newHeight=(int)(newWidth * ratio);
  }
 else   if (origWidth > 0) {
    newWidth=mResourceVars.fullSizeImageWidth;
    newHeight=0;
  }
 else {
    AppLog.d(AppLog.T.READER,"String_Node_Str" + imageUrl);
    return;
  }
  String newImageUrl=ReaderUtils.getResizedImageUrl(imageUrl,newWidth,newHeight,mPost.isPrivate);
  String newImageTag=String.format("String_Node_Str",newImageUrl,newWidth,newHeight);
  int start=mRenderBuilder.indexOf(imageTag);
  if (start == -1) {
    AppLog.w(AppLog.T.READER,"String_Node_Str");
    return;
  }
  mRenderBuilder.replace(start,start + imageTag.length(),newImageTag);
}
Program: 14544
Project: 14544
Buggy source:
@Override public void onPostsLoaded(int postCount){
  if (postCount == 0 && mCanLoadMorePosts) {
    requestPosts(false);
    setRefreshing(true);
  }
 else   if (mShouldSelectFirstPost) {
    mShouldSelectFirstPost=false;
    if (mPostsListAdapter.getCount() > 0) {
      PostsListPost postsListPost=(PostsListPost)mPostsListAdapter.getItem(0);
      if (postsListPost != null) {
        showPost(postsListPost.getPostId());
        getListView().setItemChecked(0,true);
      }
    }
  }
 else   if (DisplayUtils.isTablet(getActivity())) {
    int selectedPosition=getListView().getCheckedItemPosition();
    if (selectedPosition != ListView.INVALID_POSITION && selectedPosition < mPostsListAdapter.getCount()) {
      PostsListPost postsListPost=(PostsListPost)mPostsListAdapter.getItem(selectedPosition);
      if (postsListPost != null) {
        showPost(postsListPost.getPostId());
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onPostsLoaded(int postCount){
  if (postCount == 0 && mCanLoadMorePosts) {
    setRefreshing(true);
    requestPosts(false);
  }
 else   if (mShouldSelectFirstPost) {
    mShouldSelectFirstPost=false;
    if (mPostsListAdapter.getCount() > 0) {
      PostsListPost postsListPost=(PostsListPost)mPostsListAdapter.getItem(0);
      if (postsListPost != null) {
        showPost(postsListPost.getPostId());
        getListView().setItemChecked(0,true);
      }
    }
  }
 else   if (DisplayUtils.isTablet(getActivity())) {
    int selectedPosition=getListView().getCheckedItemPosition();
    if (selectedPosition != ListView.INVALID_POSITION && selectedPosition < mPostsListAdapter.getCount()) {
      PostsListPost postsListPost=(PostsListPost)mPostsListAdapter.getItem(selectedPosition);
      if (postsListPost != null) {
        showPost(postsListPost.getPostId());
      }
    }
  }
}
Program: 14548
Project: 14548
Buggy source:
@Override public void onListItemClick(ListView l,View v,int position,long id){
  if (!isAdded())   return;
  if (!DisplayUtils.isLandscapeTablet(getActivity())) {
    v.setBackgroundColor(getActivity().getResources().getColor(R.color.white));
    float yOffset=-v.getY();
    v.animate().translationY(yOffset).alpha(0.0f).setDuration(NotificationsActivity.NOTIFICATION_TRANSITION_DURATION);
  }
  Note note=mNotesAdapter.getNote(position);
  if (note != null && mNoteClickListener != null) {
    mNoteClickListener.onClickNote(note,v.getY());
    mNotesAdapter.setSelectedPosition(position);
  }
}

Fixed version (ground truth):
@Override public void onListItemClick(ListView l,View v,int position,long id){
  if (!isAdded())   return;
  Note note=mNotesAdapter.getNote(position);
  if (note != null && mNoteClickListener != null) {
    mNoteClickListener.onClickNote(note,v.getY());
    mNotesAdapter.setSelectedPosition(position);
  }
}
Program: 14549
Project: 14549
Buggy source:
@Override public View configureView(View view){
  final CommentUserNoteBlockHolder noteBlockHolder=(CommentUserNoteBlockHolder)view.getTag();
  noteBlockHolder.nameTextView.setText(getNoteText().toString());
  if (hasImageMediaItem()) {
    noteBlockHolder.avatarImageView.setImageUrl(getNoteMediaItem().optString("String_Node_Str","String_Node_Str"),WordPress.imageLoader);
    if (!TextUtils.isEmpty(getUserUrl())) {
      noteBlockHolder.avatarImageView.setOnTouchListener(mOnGravatarTouchListener);
    }
 else {
      noteBlockHolder.avatarImageView.setOnTouchListener(null);
    }
  }
 else {
    noteBlockHolder.avatarImageView.setImageResource(R.drawable.placeholder);
    noteBlockHolder.avatarImageView.setOnTouchListener(null);
  }
  if (mTextViewIndent == 0) {
    Context context=view.getContext();
    if (context != null) {
      mTextViewIndent=context.getResources().getDimensionPixelSize(R.dimen.avatar_sz_small) + context.getResources().getDimensionPixelSize(R.dimen.margin_medium);
    }
  }
  CommentUtils.indentTextViewFirstLine(noteBlockHolder.commentTextView,NotificationUtils.getSpannableTextFromIndices(getNoteData().optJSONObject("String_Node_Str"),getOnNoteBlockTextClickListener()),mTextViewIndent);
  return view;
}

Fixed version (ground truth):
@Override public View configureView(View view){
  final CommentUserNoteBlockHolder noteBlockHolder=(CommentUserNoteBlockHolder)view.getTag();
  noteBlockHolder.nameTextView.setText(getNoteText().toString());
  if (hasImageMediaItem()) {
    noteBlockHolder.avatarImageView.setImageUrl(getNoteMediaItem().optString("String_Node_Str","String_Node_Str"),WordPress.imageLoader);
    if (!TextUtils.isEmpty(getUserUrl())) {
      noteBlockHolder.avatarImageView.setOnTouchListener(mOnGravatarTouchListener);
    }
 else {
      noteBlockHolder.avatarImageView.setOnTouchListener(null);
    }
  }
 else {
    noteBlockHolder.avatarImageView.setImageResource(R.drawable.placeholder);
    noteBlockHolder.avatarImageView.setOnTouchListener(null);
  }
  if (mTextViewIndent == 0) {
    Context context=view.getContext();
    if (context != null) {
      mTextViewIndent=context.getResources().getDimensionPixelSize(R.dimen.comment_avatar_size) + DisplayUtils.dpToPx(context,6);
    }
  }
  CommentUtils.indentTextViewFirstLine(noteBlockHolder.commentTextView,NotificationUtils.getSpannableTextFromIndices(getNoteData().optJSONObject("String_Node_Str"),getOnNoteBlockTextClickListener()),mTextViewIndent);
  return view;
}
Program: 14550
Project: 14550
Buggy source:
public static void saveAttachmentsForPosts(ReaderPostList posts){
  if (posts == null || posts.size() == 0) {
    return;
  }
  SQLiteDatabase db=ReaderDatabase.getWritableDb();
  db.beginTransaction();
  SQLiteStatement stmt=db.compileStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  try {
    for (    ReaderPost post : posts) {
      if (post.hasAttachments()) {
        String[] args={Long.toString(post.blogId),Long.toString(post.postId)};
        db.delete("String_Node_Str","String_Node_Str",args);
        stmt.bindLong(1,post.blogId);
        stmt.bindLong(2,post.postId);
        for (        ReaderAttachment attach : post.getAttachments()) {
          stmt.bindLong(3,attach.attachmentId);
          stmt.bindString(4,attach.getUrl());
          stmt.bindString(5,attach.getMimeType());
          stmt.bindLong(6,attach.width);
          stmt.bindLong(7,attach.height);
          stmt.execute();
        }
      }
    }
  }
  finally {
    db.endTransaction();
    SqlUtils.closeStatement(stmt);
  }
}

Fixed version (ground truth):
public static void saveAttachmentsForPosts(ReaderPostList posts){
  if (posts == null || posts.size() == 0) {
    return;
  }
  SQLiteDatabase db=ReaderDatabase.getWritableDb();
  SQLiteStatement stmt=db.compileStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  try {
    for (    ReaderPost post : posts) {
      if (post.hasAttachments()) {
        String[] args={Long.toString(post.blogId),Long.toString(post.postId)};
        db.delete("String_Node_Str","String_Node_Str",args);
        stmt.bindLong(1,post.blogId);
        stmt.bindLong(2,post.postId);
        for (        ReaderAttachment attach : post.getAttachments()) {
          stmt.bindLong(3,attach.attachmentId);
          stmt.bindString(4,attach.getUrl());
          stmt.bindString(5,attach.getMimeType());
          stmt.bindLong(6,attach.width);
          stmt.bindLong(7,attach.height);
          stmt.execute();
        }
      }
    }
  }
  finally {
    SqlUtils.closeStatement(stmt);
  }
}
Program: 14551
Project: 14551
Buggy source:
private void deleteQuickPressShortcutsForAccount(Context ctx,int accountId){
  List<Map<String,Object>> shortcuts=getQuickPressShortcuts(accountId);
  if (shortcuts.size() == 0)   return;
  String packageName=EditPostActivity.class.getPackage().getName();
  String className=EditPostActivity.class.getName();
  for (int i=0; i < shortcuts.size(); i++) {
    Map<String,Object> shortcutHash=shortcuts.get(i);
    Intent shortcutIntent=new Intent();
    shortcutIntent.setClassName(packageName,className);
    shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    shortcutIntent.setAction(Intent.ACTION_VIEW);
    Intent broadcastShortcutIntent=new Intent();
    broadcastShortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT,shortcutIntent);
    broadcastShortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME,shortcutHash.get("String_Node_Str").toString());
    broadcastShortcutIntent.putExtra("String_Node_Str",false);
    broadcastShortcutIntent.setAction("String_Node_Str");
    ctx.sendBroadcast(broadcastShortcutIntent);
    String shortcutId=shortcutHash.get("String_Node_Str").toString();
    db.delete(QUICKPRESS_SHORTCUTS_TABLE,"String_Node_Str",new String[]{shortcutId});
  }
}

Fixed version (ground truth):
private void deleteQuickPressShortcutsForAccount(Context ctx,int accountId){
  List<Map<String,Object>> shortcuts=getQuickPressShortcuts(accountId);
  if (shortcuts.size() == 0)   return;
  for (int i=0; i < shortcuts.size(); i++) {
    Map<String,Object> shortcutHash=shortcuts.get(i);
    Intent shortcutIntent=new Intent(WordPress.getContext(),EditPostActivity.class);
    shortcutIntent.setAction(Intent.ACTION_MAIN);
    shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    Intent broadcastShortcutIntent=new Intent();
    broadcastShortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT,shortcutIntent);
    broadcastShortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME,shortcutHash.get("String_Node_Str").toString());
    broadcastShortcutIntent.putExtra("String_Node_Str",false);
    broadcastShortcutIntent.setAction("String_Node_Str");
    ctx.sendBroadcast(broadcastShortcutIntent);
    String shortcutId=shortcutHash.get("String_Node_Str").toString();
    db.delete(QUICKPRESS_SHORTCUTS_TABLE,"String_Node_Str",new String[]{shortcutId});
  }
}
Program: 14553
Project: 14553
Buggy source:
/** 
 * @param imageUrl the url of the image to load
 * @param hiResWidth maximum width of the full-size image
 * @param isPrivate whether this is an image from a private blog
 * @param position the position of the image in ReaderPhotoViewerActivity
 * @param photoListener optional listener
 */
public void setImageUrl(String imageUrl,int hiResWidth,boolean isPrivate,int position,ReaderPhotoListener photoListener){
  int loResWidth=(int)(hiResWidth * 0.15f);
  if (isPrivate) {
    mLoResImageUrl=ReaderUtils.getPrivateImageForDisplay(imageUrl,loResWidth,0);
    mHiResImageUrl=ReaderUtils.getPrivateImageForDisplay(imageUrl,hiResWidth,0);
  }
 else {
    mLoResImageUrl=PhotonUtils.getPhotonImageUrl(imageUrl,loResWidth,0);
    mHiResImageUrl=PhotonUtils.getPhotonImageUrl(imageUrl,hiResWidth,0);
  }
  mPosition=position;
  mPhotoListener=photoListener;
  loadImageIfNecessary(false);
}

Fixed version (ground truth):
/** 
 * @param imageUrl the url of the image to load
 * @param hiResWidth maximum width of the full-size image
 * @param isPrivate whether this is an image from a private blog
 * @param position the position of the image in ReaderPhotoViewerActivity
 * @param photoListener optional listener
 */
public void setImageUrl(String imageUrl,int hiResWidth,boolean isPrivate,int position,ReaderPhotoListener photoListener){
  int loResWidth=(int)(hiResWidth * 0.15f);
  if (isPrivate) {
    mLoResImageUrl=ReaderUtils.getPrivateImageForDisplay(imageUrl,loResWidth,0);
    mHiResImageUrl=ReaderUtils.getPrivateImageForDisplay(imageUrl,hiResWidth,0);
  }
 else {
    mLoResImageUrl=PhotonUtils.getPhotonImageUrl(imageUrl,loResWidth,0);
    mHiResImageUrl=PhotonUtils.getPhotonImageUrl(imageUrl,hiResWidth,0);
  }
  mPosition=position;
  mPhotoListener=photoListener;
  loadLoResImage(false);
}
Program: 14554
Project: 14554
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  if (!isInEditMode()) {
    loadImageIfNecessary(true);
  }
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  if (!isInEditMode()) {
    loadLoResImage(true);
  }
}
Program: 14555
Project: 14555
Buggy source:
@Override public void onResponse(final ImageLoader.ImageContainer response,boolean isImmediate){
  post(new Runnable(){
    @Override public void run(){
      handleResponse(response,false);
    }
  }
);
}

Fixed version (ground truth):
@Override public void onResponse(final ImageContainer response,boolean isImmediate){
  post(new Runnable(){
    @Override public void run(){
      handleResponse(response,false);
    }
  }
);
}