nus-yam/ex-repair huggingface dataset:
Program: 14910
Project: 14910
Buggy source:
public void refreshNotes(){
  mFirstLoadComplete=false;
  shouldAnimateRefreshButton=true;
  startAnimatingRefreshButton(mRefreshMenuItem);
  NotesResponseHandler notesHandler=new NotesResponseHandler(){
    @Override public void onNotes(    final List<Note> notes){
      mFirstLoadComplete=true;
      new Thread(){
        @Override public void run(){
          WordPress.wpDB.clearNotes();
          WordPress.wpDB.saveNotes(notes);
          NotificationsActivity.this.runOnUiThread(new Runnable(){
            @Override public void run(){
              refreshNotificationsListFragment(notes);
              stopAnimatingRefreshButton(mRefreshMenuItem);
            }
          }
);
        }
      }
.start();
    }
    @Override public void onErrorResponse(    VolleyError error){
      mFirstLoadComplete=true;
      final NotificationsListFragment.NotesAdapter adapter=mNotesList.getNotesAdapter();
      adapter.clear();
      adapter.addAll(new ArrayList<Note>());
      adapter.notifyDataSetChanged();
      ToastUtils.showToast(getContext(),R.string.error_refresh_notifications,ToastUtils.Duration.LONG);
      stopAnimatingRefreshButton(mRefreshMenuItem);
      shouldAnimateRefreshButton=false;
    }
  }
;
  NotificationUtils.refreshNotifications(notesHandler,notesHandler);
}

Fixed version (ground truth):
public void refreshNotes(){
  mFirstLoadComplete=false;
  mShouldAnimateRefreshButton=true;
  startAnimatingRefreshButton(mRefreshMenuItem);
  NotesResponseHandler notesHandler=new NotesResponseHandler(){
    @Override public void onNotes(    final List<Note> notes){
      mFirstLoadComplete=true;
      new Thread(){
        @Override public void run(){
          WordPress.wpDB.clearNotes();
          WordPress.wpDB.saveNotes(notes);
          NotificationsActivity.this.runOnUiThread(new Runnable(){
            @Override public void run(){
              refreshNotificationsListFragment(notes);
              stopAnimatingRefreshButton(mRefreshMenuItem);
            }
          }
);
        }
      }
.start();
    }
    @Override public void onErrorResponse(    VolleyError error){
      mFirstLoadComplete=true;
      final NotificationsListFragment.NotesAdapter adapter=mNotesList.getNotesAdapter();
      adapter.clear();
      adapter.addAll(new ArrayList<Note>());
      adapter.notifyDataSetChanged();
      ToastUtils.showToast(getContext(),R.string.error_refresh_notifications,ToastUtils.Duration.LONG);
      stopAnimatingRefreshButton(mRefreshMenuItem);
      mShouldAnimateRefreshButton=false;
    }
  }
;
  NotificationUtils.refreshNotifications(notesHandler,notesHandler);
}
Program: 14911
Project: 14911
Buggy source:
@Override public boolean onCreateOptionsMenu(Menu menu){
  super.onCreateOptionsMenu(menu);
  MenuInflater inflater=getSupportMenuInflater();
  inflater.inflate(R.menu.notifications,menu);
  mRefreshMenuItem=menu.findItem(R.id.menu_refresh);
  if (shouldAnimateRefreshButton) {
    shouldAnimateRefreshButton=false;
    startAnimatingRefreshButton(mRefreshMenuItem);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onCreateOptionsMenu(Menu menu){
  super.onCreateOptionsMenu(menu);
  MenuInflater inflater=getSupportMenuInflater();
  inflater.inflate(R.menu.notifications,menu);
  mRefreshMenuItem=menu.findItem(R.id.menu_refresh);
  if (mShouldAnimateRefreshButton) {
    mShouldAnimateRefreshButton=false;
    startAnimatingRefreshButton(mRefreshMenuItem);
  }
  return true;
}
Program: 14912
Project: 14912
Buggy source:
private void signin(){
  if (!wpcomFieldsFilled()) {
    FragmentTransaction ft=getFragmentManager().beginTransaction();
    WPAlertDialogFragment alert=WPAlertDialogFragment.newInstance(getString(R.string.required_fields));
    alert.show(ft,"String_Node_Str");
    return;
  }
  new SetupBlogTask().execute();
}

Fixed version (ground truth):
private void signin(){
  if (!wpcomFieldsFilled()) {
    FragmentTransaction ft=getFragmentManager().beginTransaction();
    WPAlertDialogFragment alert=WPAlertDialogFragment.newInstance(getString(R.string.required_fields));
    ft.add(alert,"String_Node_Str");
    ft.commitAllowingStateLoss();
    return;
  }
  new SetupBlogTask().execute();
}
Program: 14915
Project: 14915
Buggy source:
public void run(){
  if (TextUtils.isEmpty(moderateErrorMsg)) {
    final String msg;
    if (checkedCommentTotal > 1) {
      msg=getResources().getText(R.string.comments_moderated).toString();
    }
 else {
      msg=getResources().getText(R.string.comment_moderated).toString();
    }
    Toast.makeText(getActivity().getApplicationContext(),msg,Toast.LENGTH_SHORT).show();
    checkedCommentTotal=0;
    hideModerationBar();
    selectedCommentPositions.clear();
    mOnCommentChangeListener.onCommentDeleted();
  }
 else {
    if (!getActivity().isFinishing()) {
      FragmentTransaction ft=getFragmentManager().beginTransaction();
      WPAlertDialogFragment alert=WPAlertDialogFragment.newInstance(moderateErrorMsg);
      try {
        alert.show(ft,"String_Node_Str");
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
public void run(){
  if (TextUtils.isEmpty(moderateErrorMsg)) {
    final String msg;
    if (checkedCommentTotal > 1) {
      msg=getResources().getText(R.string.comments_moderated).toString();
    }
 else {
      msg=getResources().getText(R.string.comment_moderated).toString();
    }
    Toast.makeText(getActivity().getApplicationContext(),msg,Toast.LENGTH_SHORT).show();
    checkedCommentTotal=0;
    hideModerationBar();
    selectedCommentPositions.clear();
    mOnCommentChangeListener.onCommentDeleted();
  }
 else {
    if (!getActivity().isFinishing()) {
      FragmentTransaction ft=getFragmentManager().beginTransaction();
      WPAlertDialogFragment alert=WPAlertDialogFragment.newInstance(moderateErrorMsg);
      ft.add(alert,"String_Node_Str");
      ft.commitAllowingStateLoss();
    }
  }
}
Program: 14917
Project: 14917
Buggy source:
private void showVideoPressUpgradeDialog(){
  FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
  String title=getString(R.string.media_no_video_title);
  String message=getString(R.string.media_no_video_message);
  String infoTitle=getString(R.string.learn_more);
  String infoURL=Constants.videoPressURL;
  WPAlertDialogFragment.newInstance(message,title,false,infoTitle,infoURL).show(ft,"String_Node_Str");
}

Fixed version (ground truth):
private void showVideoPressUpgradeDialog(){
  FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
  String title=getString(R.string.media_no_video_title);
  String message=getString(R.string.media_no_video_message);
  String infoTitle=getString(R.string.learn_more);
  String infoURL=Constants.videoPressURL;
  WPAlertDialogFragment alert=WPAlertDialogFragment.newInstance(message,title,false,infoTitle,infoURL);
  ft.add(alert,"String_Node_Str");
  ft.commitAllowingStateLoss();
}
Program: 14918
Project: 14918
Buggy source:
public void onClick(View v){
  if (!WordPress.wpDB.findLocalChanges(WordPress.getCurrentBlog().getLocalTableBlogId(),isPage)) {
    switcher.showNext();
    numRecords+=20;
    refreshPosts(true);
  }
 else {
    if (!getActivity().isFinishing()) {
      FragmentTransaction ft=getFragmentManager().beginTransaction();
      WPAlertDialogFragment alert=WPAlertDialogFragment.newInstance(getString(R.string.remote_changes),getString(R.string.local_changes),true);
      alert.show(ft,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void onClick(View v){
  if (!WordPress.wpDB.findLocalChanges(WordPress.getCurrentBlog().getLocalTableBlogId(),isPage)) {
    switcher.showNext();
    numRecords+=20;
    refreshPosts(true);
  }
 else {
    if (!getActivity().isFinishing()) {
      FragmentTransaction ft=getFragmentManager().beginTransaction();
      WPAlertDialogFragment alert=WPAlertDialogFragment.newInstance(getString(R.string.remote_changes),getString(R.string.local_changes),true);
      ft.add(alert,"String_Node_Str");
      ft.commitAllowingStateLoss();
    }
  }
}
Program: 14920
Project: 14920
Buggy source:
public void createSwitcher(){
  switcher=new ViewSwitcher(getActivity().getApplicationContext());
  Button footer=(Button)View.inflate(getActivity().getApplicationContext(),R.layout.list_footer_btn,null);
  footer.setText(getResources().getText(R.string.load_more) + "String_Node_Str" + getResources().getText((isPage) ? R.string.tab_pages : R.string.tab_posts));
  footer.setOnClickListener(new Button.OnClickListener(){
    public void onClick(    View v){
      if (!WordPress.wpDB.findLocalChanges(WordPress.getCurrentBlog().getLocalTableBlogId(),isPage)) {
        switcher.showNext();
        numRecords+=20;
        refreshPosts(true);
      }
 else {
        if (!getActivity().isFinishing()) {
          FragmentTransaction ft=getFragmentManager().beginTransaction();
          WPAlertDialogFragment alert=WPAlertDialogFragment.newInstance(getString(R.string.remote_changes),getString(R.string.local_changes),true);
          alert.show(ft,"String_Node_Str");
        }
      }
    }
  }
);
  View progress=View.inflate(getActivity().getApplicationContext(),R.layout.list_footer_progress,null);
  switcher.addView(footer);
  switcher.addView(progress);
}

Fixed version (ground truth):
public void createSwitcher(){
  switcher=new ViewSwitcher(getActivity().getApplicationContext());
  Button footer=(Button)View.inflate(getActivity().getApplicationContext(),R.layout.list_footer_btn,null);
  footer.setText(getResources().getText(R.string.load_more) + "String_Node_Str" + getResources().getText((isPage) ? R.string.tab_pages : R.string.tab_posts));
  footer.setOnClickListener(new Button.OnClickListener(){
    public void onClick(    View v){
      if (!WordPress.wpDB.findLocalChanges(WordPress.getCurrentBlog().getLocalTableBlogId(),isPage)) {
        switcher.showNext();
        numRecords+=20;
        refreshPosts(true);
      }
 else {
        if (!getActivity().isFinishing()) {
          FragmentTransaction ft=getFragmentManager().beginTransaction();
          WPAlertDialogFragment alert=WPAlertDialogFragment.newInstance(getString(R.string.remote_changes),getString(R.string.local_changes),true);
          ft.add(alert,"String_Node_Str");
          ft.commitAllowingStateLoss();
        }
      }
    }
  }
);
  View progress=View.inflate(getActivity().getApplicationContext(),R.layout.list_footer_progress,null);
  switcher.addView(footer);
  switcher.addView(progress);
}
Program: 14921
Project: 14921
Buggy source:
private void selectAndShowFirstPost(){
  Post post=new Post(WordPress.currentBlog.getLocalTableBlogId(),Integer.valueOf(mPostIDs[0]),isPage);
  if (post.getId() >= 0) {
    WordPress.currentPost=post;
    mOnPostSelectedListener.onPostSelected(post);
    FragmentManager fm=getActivity().getSupportFragmentManager();
    ViewPostFragment f=(ViewPostFragment)fm.findFragmentById(R.id.postDetail);
    if (f != null && f.isInLayout())     getListView().setItemChecked(0,true);
  }
}

Fixed version (ground truth):
private void selectAndShowFirstPost(){
  Post post=new Post(WordPress.currentBlog.getLocalTableBlogId(),Integer.valueOf(mPostIDs[0]),isPage);
  if (post.getId() >= 0) {
    WordPress.currentPost=post;
    mOnPostSelectedListener.onPostSelected(post);
    FragmentManager fm=getActivity().getSupportFragmentManager();
    ViewPostFragment f=(ViewPostFragment)fm.findFragmentById(R.id.postDetail);
    if (f != null && f.isInLayout()) {
      getListView().setItemChecked(0,true);
    }
  }
}
Program: 14922
Project: 14922
Buggy source:
private void showPost(long selectedID){
  Post post=new Post(WordPress.currentBlog.getLocalTableBlogId(),selectedID,isPage);
  if (post.getId() >= 0) {
    WordPress.currentPost=post;
    mOnPostSelectedListener.onPostSelected(post);
    mPostListAdapter.notifyDataSetChanged();
  }
 else {
    if (!getActivity().isFinishing()) {
      FragmentTransaction ft=getFragmentManager().beginTransaction();
      WPAlertDialogFragment alert=WPAlertDialogFragment.newInstance(getString(R.string.post_not_found));
      alert.show(ft,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void showPost(long selectedID){
  Post post=new Post(WordPress.currentBlog.getLocalTableBlogId(),selectedID,isPage);
  if (post.getId() >= 0) {
    WordPress.currentPost=post;
    mOnPostSelectedListener.onPostSelected(post);
    mPostListAdapter.notifyDataSetChanged();
  }
 else {
    if (!getActivity().isFinishing()) {
      FragmentTransaction ft=getFragmentManager().beginTransaction();
      WPAlertDialogFragment alert=WPAlertDialogFragment.newInstance(getString(R.string.post_not_found));
      ft.add(alert,"String_Node_Str");
      ft.commitAllowingStateLoss();
    }
  }
}
Program: 14924
Project: 14924
Buggy source:
private static void getStatsClicks(final String blogId,final String date){
  WordPress.restClient.getStatsClicks(blogId,date,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseClicksTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      Log.e(TAG,"String_Node_Str");
      updateRefreshMap(StatsViewType.CLICKS,-1);
    }
  }
);
}

Fixed version (ground truth):
private static void getStatsClicks(final String blogId,final String date){
  WordPress.restClient.getStatsClicks(blogId,date,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseClicksTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      AppLog.e(T.STATS,"String_Node_Str");
      updateRefreshMap(StatsViewType.CLICKS,-1);
    }
  }
);
}
Program: 14925
Project: 14925
Buggy source:
public static void getStatsSummary(final String blogId,final StatsSummaryInterface callback){
  WordPress.restClient.getStatsSummary(blogId,new Listener(){
    @Override public void onResponse(    final JSONObject response){
      new AsyncTask<Void,Void,StatsSummary>(){
        @Override protected StatsSummary doInBackground(        Void... params){
          StatUtils.saveSummary(blogId,response);
          return StatUtils.getSummary(blogId);
        }
        protected void onPostExecute(        StatsSummary result){
          if (callback != null)           callback.onSuccess();
          StatUtils.broadcastSummaryUpdated(result);
        }
      }
.execute();
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      if (callback != null)       callback.onFailure(error);
      Log.e(TAG,"String_Node_Str",error);
    }
  }
);
}

Fixed version (ground truth):
public static void getStatsSummary(final String blogId,final StatsSummaryInterface callback){
  WordPress.restClient.getStatsSummary(blogId,new Listener(){
    @Override public void onResponse(    final JSONObject response){
      new AsyncTask<Void,Void,StatsSummary>(){
        @Override protected StatsSummary doInBackground(        Void... params){
          StatUtils.saveSummary(blogId,response);
          return StatUtils.getSummary(blogId);
        }
        protected void onPostExecute(        StatsSummary result){
          if (callback != null)           callback.onSuccess();
          StatUtils.broadcastSummaryUpdated(result);
        }
      }
.execute();
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      if (callback != null)       callback.onFailure(error);
      AppLog.e(T.STATS,"String_Node_Str",error);
    }
  }
);
}
Program: 14926
Project: 14926
Buggy source:
private static void getStatsTagsAndCategories(final String blogId){
  WordPress.restClient.getStatsTagsAndCategories(blogId,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseTagsAndCategoriesTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.TAGS_AND_CATEGORIES,-1);
      Log.e(TAG,"String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
private static void getStatsTagsAndCategories(final String blogId){
  WordPress.restClient.getStatsTagsAndCategories(blogId,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseTagsAndCategoriesTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.TAGS_AND_CATEGORIES,-1);
      AppLog.e(T.STATS,"String_Node_Str");
    }
  }
);
}
Program: 14927
Project: 14927
Buggy source:
private static void getStatsComments(final String blogId){
  WordPress.restClient.getStatsMostCommented(blogId,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseMostCommentedTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.COMMENTS,-1);
      Log.e(TAG,"String_Node_Str");
    }
  }
);
  WordPress.restClient.getStatsTopCommenters(blogId,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseTopCommentersTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.COMMENTS,-1);
      Log.e(TAG,"String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
private static void getStatsComments(final String blogId){
  WordPress.restClient.getStatsMostCommented(blogId,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseMostCommentedTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.COMMENTS,-1);
      AppLog.e(T.STATS,"String_Node_Str");
    }
  }
);
  WordPress.restClient.getStatsTopCommenters(blogId,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseTopCommentersTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.COMMENTS,-1);
      AppLog.e(T.STATS,"String_Node_Str");
    }
  }
);
}
Program: 14928
Project: 14928
Buggy source:
private static void getStatsViewsByCountry(final String blogId,String date){
  WordPress.restClient.getStatsGeoviews(blogId,date,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseGeoViewsTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.VIEWS_BY_COUNTRY,-1);
      Log.e("String_Node_Str",StatsGeoviewsFragment.class.getSimpleName() + "String_Node_Str" + error.toString());
    }
  }
);
}

Fixed version (ground truth):
private static void getStatsViewsByCountry(final String blogId,String date){
  WordPress.restClient.getStatsGeoviews(blogId,date,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseGeoViewsTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.VIEWS_BY_COUNTRY,-1);
      AppLog.e(T.STATS,error);
    }
  }
);
}
Program: 14929
Project: 14929
Buggy source:
public static void getStatsBarChart(final String blogId,final StatsBarChartUnit barChartUnit){
  Listener listener=new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseBarChartTask().execute(blogId,response,barChartUnit.ordinal());
    }
  }
;
  ErrorListener errorListener=new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.VISITORS_AND_VIEWS,-1);
      Log.e(TAG,"String_Node_Str");
    }
  }
;
  WordPress.restClient.getStatsBarChartData(blogId,barChartUnit,30,listener,errorListener);
}

Fixed version (ground truth):
public static void getStatsBarChart(final String blogId,final StatsBarChartUnit barChartUnit){
  Listener listener=new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseBarChartTask().execute(blogId,response,barChartUnit.ordinal());
    }
  }
;
  ErrorListener errorListener=new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.VISITORS_AND_VIEWS,-1);
      AppLog.e(T.STATS,"String_Node_Str");
    }
  }
;
  WordPress.restClient.getStatsBarChartData(blogId,barChartUnit,30,listener,errorListener);
}
Program: 14930
Project: 14930
Buggy source:
private static void getStatsTopPostsAndPages(final String blogId,final String date){
  WordPress.restClient.getStatsTopPosts(blogId,date,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseTopPostsAndPagesTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.TOP_POSTS_AND_PAGES,-1);
      Log.e(TAG,"String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
private static void getStatsTopPostsAndPages(final String blogId,final String date){
  WordPress.restClient.getStatsTopPosts(blogId,date,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseTopPostsAndPagesTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.TOP_POSTS_AND_PAGES,-1);
      AppLog.e(T.STATS,"String_Node_Str");
    }
  }
);
}
Program: 14931
Project: 14931
Buggy source:
private static void getStatsReferrers(final String blogId,final String date){
  WordPress.restClient.getStatsReferrers(blogId,date,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseReferrersTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.REFERRERS,-1);
      Log.e(TAG,"String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
private static void getStatsReferrers(final String blogId,final String date){
  WordPress.restClient.getStatsReferrers(blogId,date,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseReferrersTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.REFERRERS,-1);
      AppLog.e(T.STATS,"String_Node_Str");
    }
  }
);
}
Program: 14932
Project: 14932
Buggy source:
private static void getStatsVideoPlays(final String blogId,String date){
  WordPress.restClient.getStatsVideoPlays(blogId,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseVideoPlaysTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.VIDEO_PLAYS,-1);
      Log.e(TAG,"String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
private static void getStatsVideoPlays(final String blogId,String date){
  WordPress.restClient.getStatsVideoPlays(blogId,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseVideoPlaysTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.VIDEO_PLAYS,-1);
      AppLog.e(T.STATS,"String_Node_Str");
    }
  }
);
}
Program: 14933
Project: 14933
Buggy source:
private static void getStatsTopAuthors(final String blogId){
  WordPress.restClient.getStatsTopAuthors(blogId,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseTopAuthorsTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.TOP_AUTHORS,-1);
      Log.e(TAG,"String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
private static void getStatsTopAuthors(final String blogId){
  WordPress.restClient.getStatsTopAuthors(blogId,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseTopAuthorsTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.TOP_AUTHORS,-1);
      AppLog.e(T.STATS,"String_Node_Str");
    }
  }
);
}
Program: 14934
Project: 14934
Buggy source:
@Override public void onErrorResponse(VolleyError error){
  updateRefreshMap(StatsViewType.VISITORS_AND_VIEWS,-1);
  Log.e(TAG,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void onErrorResponse(VolleyError error){
  updateRefreshMap(StatsViewType.VISITORS_AND_VIEWS,-1);
  AppLog.e(T.STATS,"String_Node_Str");
}
Program: 14935
Project: 14935
Buggy source:
private static void getStatsSearchEngineTerms(final String blogId,final String date){
  WordPress.restClient.getStatsSearchEngineTerms(blogId,date,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseSearchEngineTermsTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.SEARCH_ENGINE_TERMS,-1);
      Log.e(TAG,"String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
private static void getStatsSearchEngineTerms(final String blogId,final String date){
  WordPress.restClient.getStatsSearchEngineTerms(blogId,date,new Listener(){
    @Override public void onResponse(    JSONObject response){
      new ParseSearchEngineTermsTask().execute(blogId,response);
    }
  }
,new ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      updateRefreshMap(StatsViewType.SEARCH_ENGINE_TERMS,-1);
      AppLog.e(T.STATS,"String_Node_Str");
    }
  }
);
}
Program: 14937
Project: 14937
Buggy source:
@Override public void onFailure(ApiHelper.ErrorType errorType,String errorMessage,Throwable throwable){
  if (errorType == ApiHelper.ErrorType.NO_ERROR) {
    String message=errorType == ApiHelper.ErrorType.NO_UPLOAD_FILES_CAP ? getString(R.string.media_error_no_permission) : getString(R.string.error_refresh_media);
    Toast.makeText(MediaGalleryPickerActivity.this,message,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(ApiHelper.ErrorType errorType,String errorMessage,Throwable throwable){
  if (errorType != ApiHelper.ErrorType.NO_ERROR) {
    String message=errorType == ApiHelper.ErrorType.NO_UPLOAD_FILES_CAP ? getString(R.string.media_error_no_permission) : getString(R.string.error_refresh_media);
    Toast.makeText(MediaGalleryPickerActivity.this,message,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: 14939
Project: 14939
Buggy source:
@Override public void onFailure(ApiHelper.ErrorType errorType,String errorMessage,Throwable throwable){
  if (errorType == ApiHelper.ErrorType.NO_ERROR) {
    String message=errorType == ApiHelper.ErrorType.NO_UPLOAD_FILES_CAP ? getString(R.string.media_error_no_permission) : getString(R.string.error_refresh_media);
    Toast.makeText(MediaGalleryPickerActivity.this,message,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(ApiHelper.ErrorType errorType,String errorMessage,Throwable throwable){
  if (errorType != ApiHelper.ErrorType.NO_ERROR) {
    String message=errorType == ApiHelper.ErrorType.NO_UPLOAD_FILES_CAP ? getString(R.string.media_error_no_permission) : getString(R.string.error_refresh_media);
    Toast.makeText(MediaGalleryPickerActivity.this,message,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: 14943
Project: 14943
Buggy source:
/** 
 * Sign out from all accounts by clearing out the password, which will require user to sign in again
 */
public static void signOut(Context context){
  NotificationUtils.unregisterPushNotificationsToken(context,GCMRegistrar.getRegistrationId(context));
  try {
    GCMRegistrar.checkDevice(context);
    GCMRegistrar.unregister(context);
  }
 catch (  Exception e) {
    Log.v("String_Node_Str","String_Node_Str" + e.getMessage());
  }
  SharedPreferences.Editor editor=PreferenceManager.getDefaultSharedPreferences(context).edit();
  editor.remove(WordPress.WPCOM_USERNAME_PREFERENCE);
  editor.remove(WordPress.WPCOM_PASSWORD_PREFERENCE);
  editor.remove(WordPress.ACCESS_TOKEN_PREFERENCE);
  editor.commit();
  wpDB.deactivateAccounts();
  wpDB.updateLastBlogId(-1);
  currentBlog=null;
  ReaderPrefs.reset();
  ReaderDatabase.reset();
  WordPress.wpDB.clearNotes();
  Intent broadcastIntent=new Intent();
  broadcastIntent.setAction(BROADCAST_ACTION_SIGNOUT);
  context.sendBroadcast(broadcastIntent);
}

Fixed version (ground truth):
/** 
 * Sign out from all accounts by clearing out the password, which will require user to sign in again
 */
public static void signOut(Context context){
  NotificationUtils.unregisterPushNotificationsToken(context,GCMRegistrar.getRegistrationId(context));
  try {
    GCMRegistrar.checkDevice(context);
    GCMRegistrar.unregister(context);
  }
 catch (  Exception e) {
    Log.v("String_Node_Str","String_Node_Str" + e.getMessage());
  }
  SharedPreferences.Editor editor=PreferenceManager.getDefaultSharedPreferences(context).edit();
  editor.remove(WordPress.WPCOM_USERNAME_PREFERENCE);
  editor.remove(WordPress.WPCOM_PASSWORD_PREFERENCE);
  editor.remove(WordPress.ACCESS_TOKEN_PREFERENCE);
  editor.commit();
  wpDB.deactivateAccounts();
  wpDB.updateLastBlogId(-1);
  currentBlog=null;
  UserPrefs.reset();
  ReaderDatabase.reset();
  WordPress.wpDB.clearNotes();
  Intent broadcastIntent=new Intent();
  broadcastIntent.setAction(BROADCAST_ACTION_SIGNOUT);
  context.sendBroadcast(broadcastIntent);
}
Program: 14944
Project: 14944
Buggy source:
@Override public void onResponse(JSONObject jsonObject){
  WPComLoginActivity.this.setResult(RESULT_OK);
  finish();
}

Fixed version (ground truth):
@Override public void onResponse(JSONObject jsonObject){
  WPComLoginActivity.this.setResult(RESULT_OK);
  ReaderUserActions.updateCurrentUser(jsonObject);
  finish();
}
Program: 14945
Project: 14945
Buggy source:
@Override protected void onPostExecute(Boolean isSignedIn){
  if (isSignedIn && !isFinishing()) {
    if (!mIsJetpackAuthRequest) {
      WordPress.restClient.get("String_Node_Str",new RestRequest.Listener(){
        @Override public void onResponse(        JSONObject jsonObject){
          WPComLoginActivity.this.setResult(RESULT_OK);
          finish();
        }
      }
,null);
    }
 else {
      WPComLoginActivity.this.setResult(RESULT_OK);
      finish();
    }
  }
 else {
    Toast.makeText(getBaseContext(),getString(R.string.invalid_login),Toast.LENGTH_SHORT).show();
    mSignInButon.setEnabled(true);
    mSignInButon.setText(R.string.sign_in);
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(Boolean isSignedIn){
  if (isSignedIn && !isFinishing()) {
    if (!mIsJetpackAuthRequest) {
      WordPress.restClient.get("String_Node_Str",new RestRequest.Listener(){
        @Override public void onResponse(        JSONObject jsonObject){
          WPComLoginActivity.this.setResult(RESULT_OK);
          ReaderUserActions.updateCurrentUser(jsonObject);
          finish();
        }
      }
,null);
    }
 else {
      WPComLoginActivity.this.setResult(RESULT_OK);
      finish();
    }
  }
 else {
    Toast.makeText(getBaseContext(),getString(R.string.invalid_login),Toast.LENGTH_SHORT).show();
    mSignInButon.setEnabled(true);
    mSignInButon.setText(R.string.sign_in);
  }
}
Program: 14947
Project: 14947
Buggy source:
public void setMimeType(String type){
  mimeType=type;
}

Fixed version (ground truth):
public void setMimeType(String type){
  mimeType=StringUtils.notNullStr(type);
}
Program: 14948
Project: 14948
Buggy source:
public String getMimeType(){
  return mimeType;
}

Fixed version (ground truth):
public String getMimeType(){
  return StringUtils.notNullStr(mimeType);
}
Program: 14949
Project: 14949
Buggy source:
public static WPImageSpan prepareWPImageSpan(Context context,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(context,R.drawable.remote_image,uri);
  MediaFile mediaFile=imageSpan.getMediaFile();
  mediaFile.setMediaId(mediaId);
  mediaFile.setCaption(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setDescription(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setTitle(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setWidth(cursor.getInt(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setHeight(cursor.getInt(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setMimeType(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setFileName(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setThumbnailURL(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.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;
  mediaFile.setVideo(isVideo);
  cursor.close();
  return imageSpan;
}

Fixed version (ground truth):
public static WPImageSpan prepareWPImageSpan(Context context,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(context,R.drawable.remote_image,uri);
  MediaFile mediaFile=imageSpan.getMediaFile();
  mediaFile.setMediaId(mediaId);
  mediaFile.setCaption(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setDescription(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setTitle(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setWidth(cursor.getInt(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setHeight(cursor.getInt(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setMimeType(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setFileName(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setThumbnailURL(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setDateCreatedGMT(cursor.getLong(cursor.getColumnIndex("String_Node_Str")));
  mediaFile.setVideo(mediaFile.getMimeType().contains("String_Node_Str"));
  mediaFile.save();
  cursor.close();
  return imageSpan;
}
Program: 14950
Project: 14950
Buggy source:
public static void setWPImageSpanWidth(Context context,Uri curStream,WPImageSpan is){
  MediaFile mediaFile=is.getMediaFile();
  if (mediaFile != null)   mediaFile.setWidth(getMinimumImageWitdh(context,curStream));
}

Fixed version (ground truth):
public static void setWPImageSpanWidth(Context context,Uri curStream,WPImageSpan is){
  MediaFile mediaFile=is.getMediaFile();
  if (mediaFile != null)   mediaFile.setWidth(getMinimumImageWidth(context,curStream));
}
Program: 14953
Project: 14953
Buggy source:
private boolean mustPingPushNotificationsBackend(){
  if (WordPress.hasValidWPComCredentials(mContext) == false)   return false;
  if (background == false)   return false;
  if (lastPingDate == null)   return false;
  Date now=new Date();
  long nowInMilliseconds=now.getTime();
  long lastPingDateInMilliseconds=lastPingDate.getTime();
  int secondsPassed=(int)(nowInMilliseconds - lastPingDateInMilliseconds) / (1000);
  if (secondsPassed >= DEFAULT_TIMEOUT) {
    lastPingDate=now;
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean mustPingPushNotificationsBackend(){
  if (WordPress.hasValidWPComCredentials(mContext) == false)   return false;
  if (background == false)   return false;
  background=false;
  if (lastPingDate == null)   return false;
  Date now=new Date();
  long nowInMilliseconds=now.getTime();
  long lastPingDateInMilliseconds=lastPingDate.getTime();
  int secondsPassed=(int)(nowInMilliseconds - lastPingDateInMilliseconds) / (1000);
  if (secondsPassed >= DEFAULT_TIMEOUT) {
    lastPingDate=now;
    return true;
  }
  return false;
}
Program: 14955
Project: 14955
Buggy source:
@Override public void run(){
  showReplyBox();
}

Fixed version (ground truth):
@Override public void run(){
  ReaderAniUtils.flyIn(txtBtnApprove);
}
Program: 14956
Project: 14956
Buggy source:
private void approveComment(){
  if (!hasActivity() || !hasComment() || mIsApprovingComment)   return;
  final TextView txtBtnApprove=(TextView)getActivity().findViewById(R.id.text_approve);
  ReaderAniUtils.flyOut(txtBtnApprove);
  Runnable runnable=new Runnable(){
    @Override public void run(){
      showReplyBox();
    }
  }
;
  MessageBarUtils.showMessageBar(getActivity(),getString(R.string.comment_approved),MessageBarUtils.MessageBarType.INFO,runnable);
  mIsApprovingComment=true;
  CommentActions.CommentActionListener actionListener=new CommentActions.CommentActionListener(){
    @Override public void onActionResult(    boolean succeeded){
      mIsApprovingComment=false;
      if (hasActivity()) {
        if (succeeded) {
          mComment.setStatus(CommentStatus.toString(CommentStatus.APPROVED));
          if (mChangeListener != null)           mChangeListener.onCommentModerated();
        }
 else {
          hideReplyBox(true);
          txtBtnApprove.setVisibility(View.VISIBLE);
          ToastUtils.showToast(getActivity(),R.string.error_moderate_comment,ToastUtils.Duration.LONG);
        }
      }
    }
  }
;
  CommentActions.moderateComment(mAccountId,mComment,CommentStatus.APPROVED,actionListener);
}

Fixed version (ground truth):
private void approveComment(){
  if (!hasActivity() || !hasComment() || mIsApprovingComment)   return;
  if (!checkConnection(getActivity()))   return;
  final TextView txtBtnApprove=(TextView)getActivity().findViewById(R.id.text_approve);
  ReaderAniUtils.flyOut(txtBtnApprove);
  MessageBarUtils.showMessageBar(getActivity(),getString(R.string.comment_approved));
  CommentActions.CommentActionListener actionListener=new CommentActions.CommentActionListener(){
    @Override public void onActionResult(    boolean succeeded){
      mIsApprovingComment=false;
      if (hasActivity()) {
        if (succeeded) {
          showReplyBox();
          mComment.setStatus(CommentStatus.toString(CommentStatus.APPROVED));
          if (mChangeListener != null)           mChangeListener.onCommentModerated();
        }
 else {
          ToastUtils.showToast(getActivity(),R.string.error_moderate_comment,ToastUtils.Duration.LONG);
          new Handler().postDelayed(new Runnable(){
            @Override public void run(){
              ReaderAniUtils.flyIn(txtBtnApprove);
            }
          }
,500);
        }
      }
    }
  }
;
  mIsApprovingComment=true;
  CommentActions.moderateComment(mAccountId,mComment,CommentStatus.APPROVED,actionListener);
}
Program: 14958
Project: 14958
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mWebView.getSettings().setJavaScriptEnabled(true);
  mWebView.getSettings().setUserAgentString(Constants.USER_AGENT);
  mWebView.getSettings().setDisplayZoomControls(false);
  mWebView.setWebChromeClient(new WordPressWebChromeClient(this));
  ActionBar actionBar=getSupportActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
  String url=getIntent().getStringExtra(URL_TO_LOAD);
  if (url != null) {
    loadUrl(url);
  }
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") @Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mWebView.getSettings().setJavaScriptEnabled(true);
  mWebView.getSettings().setUserAgentString(Constants.USER_AGENT);
  if (android.os.Build.VERSION.SDK_INT >= 11) {
    mWebView.getSettings().setDisplayZoomControls(false);
  }
  mWebView.setWebChromeClient(new WordPressWebChromeClient(this));
  ActionBar actionBar=getSupportActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
  String url=getIntent().getStringExtra(URL_TO_LOAD);
  if (url != null) {
    loadUrl(url);
  }
}
Program: 14959
Project: 14959
Buggy source:
public static void initialize(){
  mixpanel=MixpanelAPI.getInstance(WordPress.getContext(),Config.MIXPANEL_TOKEN);
  SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(WordPress.getContext());
  int sessionCount=preferences.getInt("String_Node_Str",0);
  sessionCount++;
  SharedPreferences.Editor editor=preferences.edit();
  editor.putInt("String_Node_Str",sessionCount);
  editor.commit();
  boolean connected=WordPress.hasValidWPComCredentials(WordPress.getContext());
  int numBlogs=WordPress.wpDB.getAccounts().size();
  try {
    JSONObject properties=new JSONObject();
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str",sessionCount);
    properties.put("String_Node_Str",connected);
    properties.put("String_Node_Str",numBlogs);
    mixpanel.registerSuperProperties(properties);
  }
 catch (  JSONException e) {
    e.printStackTrace();
  }
  if (connected) {
    String username=preferences.getString(WordPress.WPCOM_USERNAME_PREFERENCE,null);
    mixpanel.identify(username);
    mixpanel.getPeople().increment("String_Node_Str",1);
    try {
      JSONObject jsonObj=new JSONObject();
      jsonObj.put("String_Node_Str",username);
      jsonObj.put("String_Node_Str",username);
      mixpanel.getPeople().set(jsonObj);
    }
 catch (    JSONException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public static void initialize(){
  mixpanel=MixpanelAPI.getInstance(WordPress.getContext(),Config.MIXPANEL_TOKEN);
  SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(WordPress.getContext());
  int sessionCount=preferences.getInt("String_Node_Str",0);
  sessionCount++;
  SharedPreferences.Editor editor=preferences.edit();
  editor.putInt("String_Node_Str",sessionCount);
  editor.commit();
  boolean connected=WordPress.hasValidWPComCredentials(WordPress.getContext());
  int numBlogs=WordPress.wpDB.getShownAccounts().size();
  try {
    JSONObject properties=new JSONObject();
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str",sessionCount);
    properties.put("String_Node_Str",connected);
    properties.put("String_Node_Str",numBlogs);
    mixpanel.registerSuperProperties(properties);
  }
 catch (  JSONException e) {
    e.printStackTrace();
  }
  if (connected) {
    String username=preferences.getString(WordPress.WPCOM_USERNAME_PREFERENCE,null);
    mixpanel.identify(username);
    mixpanel.getPeople().increment("String_Node_Str",1);
    try {
      JSONObject jsonObj=new JSONObject();
      jsonObj.put("String_Node_Str",username);
      jsonObj.put("String_Node_Str",username);
      mixpanel.getPeople().set(jsonObj);
    }
 catch (    JSONException e) {
      e.printStackTrace();
    }
  }
}
Program: 14960
Project: 14960
Buggy source:
@Override public void onImeBack(WPEditText ctrl,String text){
  if (!mActivity.getSupportActionBar().isShowing())   setContentEditingModeVisible(false);
}

Fixed version (ground truth):
@Override public void onImeBack(WPEditText ctrl,String text){
  if (mRootView.getBottom() < mOriginalViewBottom && !mActivity.getSupportActionBar().isShowing())   setContentEditingModeVisible(false);
}
Program: 14963
Project: 14963
Buggy source:
@Override public boolean onKeyPreIme(int keyCode,KeyEvent event){
  if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) {
    clearFocus();
    if (mOnImeBack != null)     mOnImeBack.onImeBack(this,this.getText().toString());
  }
  return super.onKeyPreIme(keyCode,event);
}

Fixed version (ground truth):
@Override public boolean onKeyPreIme(int keyCode,KeyEvent event){
  if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) {
    if (mOnImeBack != null)     mOnImeBack.onImeBack(this,this.getText().toString());
  }
  return super.onKeyPreIme(keyCode,event);
}