nus-yam/ex-repair huggingface dataset:
Program: 14101
Project: 14101
Buggy source:
public static void deleteEmailFollowersForLocalBlogId(int localTableBlogId){
  String[] args=new String[]{Integer.toString(localTableBlogId),Integer.toString(1)};
  getWritableDb().delete(PEOPLE_TABLE,"String_Node_Str",args);
}

Fixed version (ground truth):
public static void deleteEmailFollowersForLocalBlogId(int localTableBlogId){
  String[] args=new String[]{Integer.toString(localTableBlogId),Integer.toString(0),Integer.toString(1)};
  getWritableDb().delete(PEOPLE_TABLE,"String_Node_Str",args);
}
Program: 14102
Project: 14102
Buggy source:
public static void deleteFollowersForLocalBlogId(int localTableBlogId){
  String[] args=new String[]{Integer.toString(localTableBlogId),Integer.toString(1)};
  getWritableDb().delete(PEOPLE_TABLE,"String_Node_Str",args);
}

Fixed version (ground truth):
public static void deleteFollowersForLocalBlogId(int localTableBlogId){
  String[] args=new String[]{Integer.toString(localTableBlogId),Integer.toString(1),Integer.toString(0)};
  getWritableDb().delete(PEOPLE_TABLE,"String_Node_Str",args);
}
Program: 14103
Project: 14103
Buggy source:
public static List<Person> getEmailFollowers(int localTableBlogId){
  String[] args={Integer.toString(localTableBlogId),Integer.toString(1)};
  String where="String_Node_Str";
  return PeopleTable.getPeople(localTableBlogId,where,args);
}

Fixed version (ground truth):
public static List<Person> getEmailFollowers(int localTableBlogId){
  String[] args={Integer.toString(localTableBlogId),Integer.toString(0),Integer.toString(1)};
  String where="String_Node_Str";
  return PeopleTable.getPeople(localTableBlogId,where,args);
}
Program: 14104
Project: 14104
Buggy source:
private static void deletePeopleForLocalBlogIdExceptForFirstPage(int localTableBlogId,boolean isFollower){
  int size=getPeopleCountForLocalBlogId(localTableBlogId,isFollower);
  int fetchLimit=PeopleUtils.FETCH_USERS_LIMIT;
  if (size > fetchLimit) {
    int deleteCount=size - fetchLimit;
    String[] args=new String[]{Integer.toString(localTableBlogId),Integer.toString(isFollower ? 1 : 0),Integer.toString(deleteCount)};
    getWritableDb().delete(PEOPLE_TABLE,"String_Node_Str" + "String_Node_Str" + PEOPLE_TABLE + "String_Node_Str"+ "String_Node_Str",args);
  }
}

Fixed version (ground truth):
public static void deletePeopleForLocalBlogIdExceptForFirstPage(int localTableBlogId){
  int size=getPeopleCountForLocalBlogId(localTableBlogId);
  int fetchLimit=PeopleUtils.FETCH_LIMIT;
  if (size > fetchLimit) {
    int deleteCount=size - fetchLimit;
    String[] args=new String[]{Integer.toString(localTableBlogId),Integer.toString(deleteCount)};
    getWritableDb().delete(PEOPLE_TABLE,"String_Node_Str" + PEOPLE_TABLE + "String_Node_Str"+ "String_Node_Str",args);
  }
}
Program: 14105
Project: 14105
Buggy source:
public static int getUsersCountForLocalBlogId(int localTableBlogId){
  return PeopleTable.getPeopleCountForLocalBlogId(localTableBlogId,false);
}

Fixed version (ground truth):
public static int getUsersCountForLocalBlogId(int localTableBlogId){
  String[] args=new String[]{Integer.toString(localTableBlogId),Integer.toString(0)};
  String sql="String_Node_Str" + PEOPLE_TABLE + "String_Node_Str";
  return SqlUtils.intForQuery(getReadableDb(),sql,args);
}
Program: 14106
Project: 14106
Buggy source:
private static int getPeopleCountForLocalBlogId(int localTableBlogId,boolean isFollower){
  String[] args=new String[]{Integer.toString(localTableBlogId),Integer.toString(isFollower ? 1 : 0)};
  String sql="String_Node_Str" + PEOPLE_TABLE + "String_Node_Str";
  return SqlUtils.intForQuery(getReadableDb(),sql,args);
}

Fixed version (ground truth):
private static int getPeopleCountForLocalBlogId(int localTableBlogId){
  String[] args=new String[]{Integer.toString(localTableBlogId)};
  String sql="String_Node_Str" + PEOPLE_TABLE + "String_Node_Str";
  return SqlUtils.intForQuery(getReadableDb(),sql,args);
}
Program: 14108
Project: 14108
Buggy source:
public static void fetchUsers(final String blogId,final int localTableBlogId,final int offset,final FetchUsersCallback callback){
  com.wordpress.rest.RestRequest.Listener listener=new RestRequest.Listener(){
    @Override public void onResponse(    JSONObject jsonObject){
      if (jsonObject != null && callback != null) {
        try {
          JSONArray jsonArray=jsonObject.getJSONArray("String_Node_Str");
          List<Person> people=peopleListFromJSON(jsonArray,blogId,localTableBlogId,false,false);
          int numberOfUsers=jsonObject.optInt("String_Node_Str");
          boolean isEndOfList=(people.size() + offset) >= numberOfUsers;
          callback.onSuccess(people,isEndOfList);
        }
 catch (        JSONException e) {
          AppLog.e(T.API,"String_Node_Str" + e);
          callback.onError();
        }
      }
    }
  }
;
  RestRequest.ErrorListener errorListener=new RestRequest.ErrorListener(){
    @Override public void onErrorResponse(    VolleyError volleyError){
      AppLog.e(T.API,volleyError);
      if (callback != null) {
        callback.onError();
      }
    }
  }
;
  Map<String,String> params=new HashMap<>();
  params.put("String_Node_Str",Integer.toString(PeopleUtils.FETCH_USERS_LIMIT));
  params.put("String_Node_Str",Integer.toString(offset));
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  String path=String.format("String_Node_Str",blogId);
  WordPress.getRestClientUtilsV1_1().get(path,params,null,listener,errorListener);
}

Fixed version (ground truth):
public static void fetchUsers(final String blogId,final int localTableBlogId,final int offset,final FetchUsersCallback callback){
  com.wordpress.rest.RestRequest.Listener listener=new RestRequest.Listener(){
    @Override public void onResponse(    JSONObject jsonObject){
      if (jsonObject != null && callback != null) {
        try {
          JSONArray jsonArray=jsonObject.getJSONArray("String_Node_Str");
          List<Person> people=peopleListFromJSON(jsonArray,blogId,localTableBlogId,false,false);
          int numberOfUsers=jsonObject.optInt("String_Node_Str");
          boolean isEndOfList=(people.size() + offset) >= numberOfUsers;
          callback.onSuccess(people,isEndOfList);
        }
 catch (        JSONException e) {
          AppLog.e(T.API,"String_Node_Str" + e);
          callback.onError();
        }
      }
    }
  }
;
  RestRequest.ErrorListener errorListener=new RestRequest.ErrorListener(){
    @Override public void onErrorResponse(    VolleyError volleyError){
      AppLog.e(T.API,volleyError);
      if (callback != null) {
        callback.onError();
      }
    }
  }
;
  Map<String,String> params=new HashMap<>();
  params.put("String_Node_Str",Integer.toString(PeopleUtils.FETCH_LIMIT));
  params.put("String_Node_Str",Integer.toString(offset));
  params.put("String_Node_Str","String_Node_Str");
  params.put("String_Node_Str","String_Node_Str");
  String path=String.format("String_Node_Str",blogId);
  WordPress.getRestClientUtilsV1_1().get(path,params,null,listener,errorListener);
}
Program: 14110
Project: 14110
Buggy source:
@Override public boolean onFetchFirstPage(PeopleListFilter filter){
  Blog blog=WordPress.getCurrentBlog();
  if (filter == PeopleListFilter.TEAM && mCanRefreshUsers) {
    fetchUsersList(blog.getDotComBlogId(),blog.getLocalTableBlogId(),0);
    return true;
  }
 else   if (filter == PeopleListFilter.FOLLOWERS && mCanRefreshFollowers) {
    fetchFollowersList(blog.getDotComBlogId(),blog.getLocalTableBlogId(),1);
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onFetchFirstPage(PeopleListFilter filter){
  Blog blog=WordPress.getCurrentBlog();
  if (filter == PeopleListFilter.TEAM && mCanRefreshUsers) {
    return fetchUsersList(blog.getDotComBlogId(),blog.getLocalTableBlogId(),0);
  }
 else   if (filter == PeopleListFilter.FOLLOWERS && mCanRefreshFollowers) {
    return fetchFollowersList(blog.getDotComBlogId(),blog.getLocalTableBlogId(),1);
  }
  return false;
}
Program: 14111
Project: 14111
Buggy source:
private void fetchFollowersList(String dotComBlogId,final int localTableBlogId,final int page){
  if (mFollowersEndOfListReached || mFollowersFetchRequestInProgress || !NetworkUtils.checkConnection(this)) {
    return;
  }
  mFollowersFetchRequestInProgress=true;
  PeopleUtils.fetchFollowers(dotComBlogId,localTableBlogId,page,new PeopleUtils.FetchFollowersCallback(){
    @Override public void onSuccess(    List<Person> peopleList,    boolean isEndOfList){
      boolean isFreshList=(page == 1);
      mFollowersEndOfListReached=isEndOfList;
      PeopleTable.saveFollowers(peopleList,localTableBlogId,isFreshList);
      PeopleListFragment peopleListFragment=getListFragment();
      if (peopleListFragment != null) {
        boolean isFirstPage=page == 1;
        peopleListFragment.fetchingRequestFinished(PeopleListFilter.FOLLOWERS,isFirstPage);
      }
      refreshOnScreenFragmentDetails();
      mFollowersFetchRequestInProgress=false;
    }
    @Override public void onError(){
      PeopleListFragment peopleListFragment=getListFragment();
      if (peopleListFragment != null) {
        boolean isFirstPage=page == 1;
        peopleListFragment.fetchingRequestFinished(PeopleListFilter.FOLLOWERS,isFirstPage);
      }
      mFollowersFetchRequestInProgress=false;
      ToastUtils.showToast(PeopleManagementActivity.this,R.string.error_fetch_people_list,ToastUtils.Duration.LONG);
    }
  }
);
}

Fixed version (ground truth):
private boolean fetchFollowersList(String dotComBlogId,final int localTableBlogId,final int page){
  if (mFollowersEndOfListReached || mFollowersFetchRequestInProgress || !NetworkUtils.checkConnection(this)) {
    return false;
  }
  mFollowersFetchRequestInProgress=true;
  PeopleUtils.fetchFollowers(dotComBlogId,localTableBlogId,page,new PeopleUtils.FetchFollowersCallback(){
    @Override public void onSuccess(    List<Person> peopleList,    boolean isEndOfList){
      boolean isFreshList=(page == 1);
      mFollowersEndOfListReached=isEndOfList;
      PeopleTable.saveFollowers(peopleList,localTableBlogId,isFreshList);
      PeopleListFragment peopleListFragment=getListFragment();
      if (peopleListFragment != null) {
        boolean isFirstPage=page == 1;
        peopleListFragment.fetchingRequestFinished(PeopleListFilter.FOLLOWERS,isFirstPage);
      }
      refreshOnScreenFragmentDetails();
      mFollowersFetchRequestInProgress=false;
    }
    @Override public void onError(){
      PeopleListFragment peopleListFragment=getListFragment();
      if (peopleListFragment != null) {
        boolean isFirstPage=page == 1;
        peopleListFragment.fetchingRequestFinished(PeopleListFilter.FOLLOWERS,isFirstPage);
      }
      mFollowersFetchRequestInProgress=false;
      ToastUtils.showToast(PeopleManagementActivity.this,R.string.error_fetch_people_list,ToastUtils.Duration.LONG);
    }
  }
);
  return true;
}
Program: 14112
Project: 14112
Buggy source:
private void fetchUsersList(String dotComBlogId,final int localTableBlogId,final int offset){
  if (mUsersEndOfListReached || mUsersFetchRequestInProgress || !NetworkUtils.checkConnection(this)) {
    return;
  }
  mUsersFetchRequestInProgress=true;
  PeopleUtils.fetchUsers(dotComBlogId,localTableBlogId,offset,new PeopleUtils.FetchUsersCallback(){
    @Override public void onSuccess(    List<Person> peopleList,    boolean isEndOfList){
      boolean isFreshList=(offset == 0);
      mUsersEndOfListReached=isEndOfList;
      PeopleTable.saveUsers(peopleList,localTableBlogId,isFreshList);
      PeopleListFragment peopleListFragment=getListFragment();
      if (peopleListFragment != null) {
        boolean isFirstPage=offset == 0;
        peopleListFragment.fetchingRequestFinished(PeopleListFilter.TEAM,isFirstPage);
      }
      refreshOnScreenFragmentDetails();
      mUsersFetchRequestInProgress=false;
    }
    @Override public void onError(){
      PeopleListFragment peopleListFragment=getListFragment();
      if (peopleListFragment != null) {
        boolean isFirstPage=offset == 0;
        peopleListFragment.fetchingRequestFinished(PeopleListFilter.TEAM,isFirstPage);
      }
      mUsersFetchRequestInProgress=false;
      ToastUtils.showToast(PeopleManagementActivity.this,R.string.error_fetch_people_list,ToastUtils.Duration.LONG);
    }
  }
);
}

Fixed version (ground truth):
private boolean fetchUsersList(String dotComBlogId,final int localTableBlogId,final int offset){
  if (mUsersEndOfListReached || mUsersFetchRequestInProgress || !NetworkUtils.checkConnection(this)) {
    return false;
  }
  mUsersFetchRequestInProgress=true;
  PeopleUtils.fetchUsers(dotComBlogId,localTableBlogId,offset,new PeopleUtils.FetchUsersCallback(){
    @Override public void onSuccess(    List<Person> peopleList,    boolean isEndOfList){
      boolean isFreshList=(offset == 0);
      mUsersEndOfListReached=isEndOfList;
      PeopleTable.saveUsers(peopleList,localTableBlogId,isFreshList);
      PeopleListFragment peopleListFragment=getListFragment();
      if (peopleListFragment != null) {
        boolean isFirstPage=offset == 0;
        peopleListFragment.fetchingRequestFinished(PeopleListFilter.TEAM,isFirstPage);
      }
      refreshOnScreenFragmentDetails();
      mUsersFetchRequestInProgress=false;
    }
    @Override public void onError(){
      PeopleListFragment peopleListFragment=getListFragment();
      if (peopleListFragment != null) {
        boolean isFirstPage=offset == 0;
        peopleListFragment.fetchingRequestFinished(PeopleListFilter.TEAM,isFirstPage);
      }
      mUsersFetchRequestInProgress=false;
      ToastUtils.showToast(PeopleManagementActivity.this,R.string.error_fetch_people_list,ToastUtils.Duration.LONG);
    }
  }
);
  return true;
}
Program: 14113
Project: 14113
Buggy source:
public static void addToolbarToDialog(final Fragment context,final Dialog dialog,String title){
  if (!context.isAdded() || dialog == null) {
    return;
  }
  Toolbar toolbar;
  if (dialog.findViewById(android.R.id.list) == null) {
    return;
  }
  LinearLayout root=(LinearLayout)dialog.findViewById(android.R.id.list).getParent();
  toolbar=(Toolbar)LayoutInflater.from(context.getActivity()).inflate(org.wordpress.android.R.layout.toolbar,root,false);
  root.addView(toolbar,0);
  dialog.getWindow().setWindowAnimations(R.style.DialogAnimations);
  TextView titleView=(TextView)toolbar.findViewById(R.id.toolbar_title);
  titleView.setVisibility(View.VISIBLE);
  titleView.setText(title);
  toolbar.setTitle("String_Node_Str");
  toolbar.setContentInsetsAbsolute(0,0);
  toolbar.setNavigationIcon(org.wordpress.android.R.drawable.ic_arrow_back_white_24dp);
  toolbar.setNavigationOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      dialog.dismiss();
    }
  }
);
}

Fixed version (ground truth):
public static void addToolbarToDialog(final Fragment context,final Dialog dialog,String title){
  if (!context.isAdded() || dialog == null) {
    return;
  }
  Toolbar toolbar;
  if (dialog.findViewById(android.R.id.list) == null) {
    return;
  }
  ViewGroup root=(ViewGroup)dialog.findViewById(android.R.id.list).getParent();
  toolbar=(Toolbar)LayoutInflater.from(context.getActivity()).inflate(org.wordpress.android.R.layout.toolbar,root,false);
  root.addView(toolbar,0);
  dialog.getWindow().setWindowAnimations(R.style.DialogAnimations);
  TextView titleView=(TextView)toolbar.findViewById(R.id.toolbar_title);
  titleView.setVisibility(View.VISIBLE);
  titleView.setText(title);
  toolbar.setTitle("String_Node_Str");
  toolbar.setNavigationIcon(org.wordpress.android.R.drawable.ic_arrow_back_white_24dp);
  toolbar.setNavigationOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      dialog.dismiss();
    }
  }
);
}
Program: 14114
Project: 14114
Buggy source:
@Override public void onFeaturedImageChanged(int mediaId){
}

Fixed version (ground truth):
@Override public void onFeaturedImageChanged(long mediaId){
}
Program: 14115
Project: 14115
Buggy source:
@Override public void onFeaturedImageChanged(int mediaId){
}

Fixed version (ground truth):
@Override public void onFeaturedImageChanged(long mediaId){
}
Program: 14116
Project: 14116
Buggy source:
@Override public void onRefreshStarted(){
  reloadPostAndComments();
}

Fixed version (ground truth):
@Override public void onRefreshStarted(){
  updatePostAndComments();
}
Program: 14118
Project: 14118
Buggy source:
@Override public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  if (progress == 0) {
    progress=1;
  }
  imageWidthText.setText(progress * 10 + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  if (progress == 0) {
    progress=1;
  }
  imageWidthText.setText(String.format(Locale.US,"String_Node_Str",progress * 10));
}
Program: 14120
Project: 14120
Buggy source:
private WPEditImageSpan createWPEditImageSpanLocal(Context context,MediaFile mediaFile){
  if (context == null || mediaFile == null || mediaFile.getFilePath() == null) {
    return null;
  }
  Uri imageUri=Uri.parse(mediaFile.getFilePath());
  Bitmap thumbnailBitmap;
  if (MediaUtils.isVideo(imageUri.toString())) {
    thumbnailBitmap=BitmapFactory.decodeResource(context.getResources(),R.drawable.media_movieclip);
  }
 else {
    thumbnailBitmap=ImageUtils.getWPImageSpanThumbnailFromFilePath(context,imageUri.getEncodedPath(),ImageUtils.getMaximumThumbnailWidthForEditor(context));
    if (thumbnailBitmap == null) {
      thumbnailBitmap=BitmapFactory.decodeResource(context.getResources(),R.drawable.legacy_dashicon_format_image_big_grey);
    }
  }
  WPEditImageSpan imageSpan=new WPEditImageSpan(context,thumbnailBitmap,imageUri);
  mediaFile.setWidth(MediaUtils.getMinimumImageWidth(context,imageUri,mBlogSettingMaxImageWidth));
  return imageSpan;
}

Fixed version (ground truth):
private WPEditImageSpan createWPEditImageSpanLocal(Context context,MediaFile mediaFile){
  if (context == null || mediaFile == null || mediaFile.getFilePath() == null) {
    return null;
  }
  Uri imageUri=Uri.parse(mediaFile.getFilePath());
  Bitmap thumbnailBitmap;
  if (MediaUtils.isVideo(imageUri.toString())) {
    thumbnailBitmap=BitmapFactory.decodeResource(context.getResources(),R.drawable.media_movieclip);
  }
 else {
    thumbnailBitmap=ImageUtils.getWPImageSpanThumbnailFromFilePath(context,imageUri.getEncodedPath(),ImageUtils.getMaximumThumbnailWidthForEditor(context));
    if (thumbnailBitmap == null) {
      thumbnailBitmap=BitmapFactory.decodeResource(context.getResources(),R.drawable.legacy_dashicon_format_image_big_grey);
    }
  }
  WPEditImageSpan imageSpan=new WPEditImageSpan(context,thumbnailBitmap,imageUri);
  mediaFile.setWidth(MediaUtils.getMinimumImageWidth(context,imageUri,mBlogSettingMaxImageWidth));
  imageSpan.setMediaFile(mediaFile);
  return imageSpan;
}
Program: 14121
Project: 14121
Buggy source:
private WPEditImageSpan createWPEditImageSpanLocal(Context context,MediaFile mediaFile){
  if (context == null || mediaFile == null || mediaFile.getFilePath() == null) {
    return null;
  }
  Uri imageUri=Uri.parse(mediaFile.getFilePath());
  Bitmap thumbnailBitmap;
  if (MediaUtils.isVideo(imageUri.toString())) {
    thumbnailBitmap=BitmapFactory.decodeResource(context.getResources(),R.drawable.media_movieclip);
  }
 else {
    thumbnailBitmap=ImageUtils.getWPImageSpanThumbnailFromFilePath(context,imageUri.getEncodedPath(),ImageUtils.getMaximumThumbnailWidthForEditor(context));
    if (thumbnailBitmap == null) {
      thumbnailBitmap=BitmapFactory.decodeResource(context.getResources(),R.drawable.legacy_dashicon_format_image_big_grey);
    }
  }
  WPEditImageSpan imageSpan=new WPEditImageSpan(context,thumbnailBitmap,imageUri);
  mediaFile.setWidth(MediaUtils.getMaximumImageWidth(context,imageUri,mBlogSettingMaxImageWidth));
  return imageSpan;
}

Fixed version (ground truth):
private WPEditImageSpan createWPEditImageSpanLocal(Context context,MediaFile mediaFile){
  if (context == null || mediaFile == null || mediaFile.getFilePath() == null) {
    return null;
  }
  Uri imageUri=Uri.parse(mediaFile.getFilePath());
  Bitmap thumbnailBitmap;
  if (MediaUtils.isVideo(imageUri.toString())) {
    thumbnailBitmap=BitmapFactory.decodeResource(context.getResources(),R.drawable.media_movieclip);
  }
 else {
    thumbnailBitmap=ImageUtils.getWPImageSpanThumbnailFromFilePath(context,imageUri.getEncodedPath(),ImageUtils.getMaximumThumbnailWidthForEditor(context));
    if (thumbnailBitmap == null) {
      thumbnailBitmap=BitmapFactory.decodeResource(context.getResources(),R.drawable.legacy_dashicon_format_image_big_grey);
    }
  }
  WPEditImageSpan imageSpan=new WPEditImageSpan(context,thumbnailBitmap,imageUri);
  mediaFile.setWidth(MediaUtils.getMaximumImageWidth(context,imageUri,mBlogSettingMaxImageWidth));
  imageSpan.setMediaFile(mediaFile);
  return imageSpan;
}
Program: 14123
Project: 14123
Buggy source:
private boolean navigateBackToPeopleListFragment(){
  FragmentManager fragmentManager=getFragmentManager();
  if (fragmentManager.getBackStackEntryCount() > 0) {
    PersonDetailFragment personDetailFragment=getDetailFragment();
    boolean shouldResetToolbarElevation=(personDetailFragment != null);
    ActionBar actionBar=getSupportActionBar();
    if (shouldResetToolbarElevation && actionBar != null) {
      actionBar.setElevation(getResources().getDimension(R.dimen.appbar_elevation));
    }
    fragmentManager.popBackStack();
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean navigateBackToPeopleListFragment(){
  FragmentManager fragmentManager=getFragmentManager();
  if (fragmentManager.getBackStackEntryCount() > 0) {
    fragmentManager.popBackStack();
    PersonDetailFragment personDetailFragment=getDetailFragment();
    if (personDetailFragment != null && personDetailFragment.isAdded()) {
      resetToolbarElevation();
    }
    return true;
  }
  return false;
}
Program: 14124
Project: 14124
Buggy source:
@Override public void onPersonSelected(Person person){
  PersonDetailFragment personDetailFragment=getDetailFragment();
  long personID=person.getPersonID();
  int localTableBlogID=person.getLocalTableBlogId();
  if (personDetailFragment == null) {
    personDetailFragment=PersonDetailFragment.newInstance(personID,localTableBlogID);
  }
 else {
    personDetailFragment.setPersonDetails(personID,localTableBlogID);
  }
  if (!personDetailFragment.isAdded()) {
    AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.OPENED_PERSON);
    FragmentTransaction fragmentTransaction=getFragmentManager().beginTransaction();
    fragmentTransaction.add(R.id.fragment_container,personDetailFragment,KEY_PERSON_DETAIL_FRAGMENT);
    fragmentTransaction.addToBackStack(null);
    ActionBar actionBar=getSupportActionBar();
    if (actionBar != null) {
      actionBar.setElevation(0);
    }
    fragmentTransaction.commit();
  }
}

Fixed version (ground truth):
@Override public void onPersonSelected(Person person){
  PersonDetailFragment personDetailFragment=getDetailFragment();
  long personID=person.getPersonID();
  int localTableBlogID=person.getLocalTableBlogId();
  if (personDetailFragment == null) {
    personDetailFragment=PersonDetailFragment.newInstance(personID,localTableBlogID);
  }
 else {
    personDetailFragment.setPersonDetails(personID,localTableBlogID);
  }
  if (!personDetailFragment.isAdded()) {
    AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.OPENED_PERSON);
    FragmentTransaction fragmentTransaction=getFragmentManager().beginTransaction();
    fragmentTransaction.add(R.id.fragment_container,personDetailFragment,KEY_PERSON_DETAIL_FRAGMENT);
    fragmentTransaction.addToBackStack(null);
    removeToolbarElevation();
    fragmentTransaction.commit();
  }
}
Program: 14125
Project: 14125
Buggy source:
private void runUrlCanonicalization(String testCaseComment,JSONObject testSetup) throws JSONException {
  final JSONObject input=testSetup.getJSONObject("String_Node_Str");
  final String inputUrl=input.isNull("String_Node_Str") ? null : input.getString("String_Node_Str");
  final JSONObject output=testSetup.getJSONObject("String_Node_Str");
  final String outputUrl=output.optString("String_Node_Str",null);
  final JSONObject error=output.optJSONObject("String_Node_Str");
  String canonicalizedUrl=null;
  try {
    canonicalizedUrl=XMLRPCUtils.sanitizeSiteUrl(inputUrl);
    assertNull(testCaseMessage("String_Node_Str",testCaseComment),error);
  }
 catch (  XMLRPCUtils.XMLRPCUtilsException hce) {
    assertNotNull(testCaseMessage("String_Node_Str",testCaseComment),error);
    assertEquals(testCaseMessage("String_Node_Str",testCaseComment),error.getString("String_Node_Str"),getInstrumentation().getTargetContext().getString(hce.errorMsgId));
  }
  assertEquals(testCaseMessage("String_Node_Str",testCaseComment),outputUrl,canonicalizedUrl);
}

Fixed version (ground truth):
private void runUrlCanonicalization(String testCaseComment,JSONObject testSetup) throws JSONException {
  final JSONObject input=testSetup.getJSONObject("String_Node_Str");
  final String inputUrl=input.isNull("String_Node_Str") ? null : input.getString("String_Node_Str");
  final JSONObject output=testSetup.getJSONObject("String_Node_Str");
  final String outputUrl=output.optString("String_Node_Str",null);
  final JSONObject error=output.optJSONObject("String_Node_Str");
  String canonicalizedUrl=null;
  try {
    canonicalizedUrl=XMLRPCUtils.sanitizeSiteUrl(inputUrl,true);
    assertNull(testCaseMessage("String_Node_Str",testCaseComment),error);
  }
 catch (  XMLRPCUtils.XMLRPCUtilsException hce) {
    assertNotNull(testCaseMessage("String_Node_Str",testCaseComment),error);
    assertEquals(testCaseMessage("String_Node_Str",testCaseComment),error.getString("String_Node_Str"),getInstrumentation().getTargetContext().getString(hce.errorMsgId));
  }
  assertEquals(testCaseMessage("String_Node_Str",testCaseComment),outputUrl,canonicalizedUrl);
}
Program: 14126
Project: 14126
Buggy source:
private static boolean isFollowActionSuccessful(JSONObject json,boolean isAskingToFollow){
  if (json == null) {
    return false;
  }
  final boolean isSubscribed;
  if (json.has("String_Node_Str")) {
    isSubscribed=json.optBoolean("String_Node_Str",false);
  }
 else   if (json.has("String_Node_Str")) {
    isSubscribed=json.optBoolean("String_Node_Str",false);
  }
 else {
    isSubscribed=false;
  }
  return (isSubscribed == isAskingToFollow);
}

Fixed version (ground truth):
private static boolean isFollowActionSuccessful(JSONObject json,boolean isAskingToFollow){
  if (json == null) {
    return false;
  }
  boolean isSubscribed;
  if (json.has("String_Node_Str")) {
    isSubscribed=json.optBoolean("String_Node_Str",false);
  }
 else {
    isSubscribed=json.has("String_Node_Str") && json.optBoolean("String_Node_Str",false);
  }
  return (isSubscribed == isAskingToFollow);
}
Program: 14127
Project: 14127
Buggy source:
@Override public boolean shouldOverrideUrlLoading(WebView view,String url){
  if (view.getVisibility() == View.VISIBLE && mReaderWebView.hasUrlClickListener() && isValidClickedUrl(url)) {
    return mReaderWebView.getUrlClickListener().onUrlClick(url);
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean shouldOverrideUrlLoading(WebView view,String url){
  return view.getVisibility() == View.VISIBLE && mReaderWebView.hasUrlClickListener() && isValidClickedUrl(url) && mReaderWebView.getUrlClickListener().onUrlClick(url);
}
Program: 14128
Project: 14128
Buggy source:
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity(),R.style.Calypso_AlertDialog);
  builder.setTitle(R.string.role);
  builder.setNegativeButton(R.string.cancel,null);
  builder.setPositiveButton(R.string.ok,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      if (mListener != null) {
        String role=mRoleListAdapter.getSelectedRole();
        Bundle args=getArguments();
        if (args != null) {
          long personID=args.getLong(PERSON_ID_TAG);
          int localTableBlogId=args.getInt(PERSON_LOCAL_TABLE_BLOG_ID_TAG);
          mListener.onRoleChanged(personID,localTableBlogId,role);
        }
      }
    }
  }
);
  if (mRoleListAdapter == null) {
    final String[] roles=getResources().getStringArray(R.array.roles);
    mRoleListAdapter=new RoleListAdapter(getActivity(),R.layout.role_list_row,roles);
  }
  Bundle args=getArguments();
  if (args != null) {
    String role=args.getString(ROLE_TAG);
    mRoleListAdapter.setSelectedRole(role);
  }
  builder.setAdapter(mRoleListAdapter,null);
  return builder.create();
}

Fixed version (ground truth):
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity(),R.style.Calypso_AlertDialog);
  builder.setTitle(R.string.role);
  builder.setNegativeButton(R.string.cancel,null);
  builder.setPositiveButton(R.string.ok,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      if (mListener != null) {
        String role=mRoleListAdapter.getSelectedRole();
        Bundle args=getArguments();
        if (args != null) {
          long personID=args.getLong(PERSON_ID_TAG);
          int localTableBlogId=args.getInt(PERSON_LOCAL_TABLE_BLOG_ID_TAG);
          mListener.onRoleChanged(personID,localTableBlogId,role);
        }
      }
    }
  }
);
  if (mRoleListAdapter == null) {
    final String[] roles=getResources().getStringArray(R.array.roles);
    mRoleListAdapter=new RoleListAdapter(getActivity(),R.layout.role_list_row,roles);
  }
  if (savedInstanceState != null) {
    String savedRole=savedInstanceState.getString(ROLE_TAG);
    mRoleListAdapter.setSelectedRole(savedRole);
  }
 else {
    Bundle args=getArguments();
    if (args != null) {
      String role=args.getString(ROLE_TAG);
      mRoleListAdapter.setSelectedRole(role);
    }
  }
  builder.setAdapter(mRoleListAdapter,null);
  return builder.create();
}
Program: 14129
Project: 14129
Buggy source:
@Override public void onClick(View v){
  changeSelection(position);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  showRoleChangeDialog();
}
Program: 14130
Project: 14130
Buggy source:
private void showRoleChangeDialog(){
  Context context=getActivity();
  AlertDialog.Builder builder=new AlertDialog.Builder(context,R.style.Calypso_AlertDialog);
  builder.setTitle(R.string.role);
  builder.setNegativeButton(R.string.cancel,null);
  builder.setPositiveButton(R.string.ok,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      if (mListener != null) {
        String role=mRoleListAdapter.getSelectedRole();
        mListener.onRoleChanged(mPersonID,mLocalTableBlogID,role);
      }
    }
  }
);
  if (mRoleListAdapter == null) {
    final String[] roles=getResources().getStringArray(R.array.roles);
    mRoleListAdapter=new RoleListAdapter(context,R.layout.role_list_row,roles);
  }
  Person person=loadPerson();
  if (person != null) {
    mRoleListAdapter.setSelectedRole(person.getRole());
  }
  builder.setAdapter(mRoleListAdapter,null);
  builder.show();
}

Fixed version (ground truth):
private void showRoleChangeDialog(){
  Person person=loadPerson();
  if (person == null) {
    return;
  }
  RoleChangeDialogFragment.newInstance(person.getPersonID(),person.getLocalTableBlogId(),person.getRole()).show(getFragmentManager(),null);
}
Program: 14131
Project: 14131
Buggy source:
private void hideSearchMessage(){
  if (!isAdded())   return;
  TextView txtSearchMsg=(TextView)getView().findViewById(R.id.text_search_message);
  if (txtSearchMsg.getVisibility() == View.VISIBLE) {
    AniUtils.fadeOut(txtSearchMsg,AniUtils.Duration.MEDIUM);
  }
  RecyclerView recycler=mRecyclerView.getInternalRecyclerView();
  if (recycler != null && recycler.getVisibility() != View.VISIBLE) {
    AniUtils.fadeIn(recycler,AniUtils.Duration.MEDIUM);
  }
}

Fixed version (ground truth):
private void hideSearchMessage(){
  if (!isAdded())   return;
  mEmptyView.setVisibility(View.GONE);
}
Program: 14132
Project: 14132
Buggy source:
private void showSearchMessage(){
  if (!isAdded())   return;
  boolean isLandscape=DisplayUtils.isLandscape(getActivity());
  boolean isTablet=DisplayUtils.isXLarge(getActivity());
  if (!isLandscape || isTablet) {
    TextView txtSearchMsg=(TextView)getView().findViewById(R.id.text_search_message);
    if (txtSearchMsg.getVisibility() != View.VISIBLE) {
      AniUtils.fadeIn(txtSearchMsg,AniUtils.Duration.MEDIUM);
    }
  }
  RecyclerView recycler=mRecyclerView.getInternalRecyclerView();
  if (recycler != null && recycler.getVisibility() == View.VISIBLE) {
    AniUtils.fadeOut(recycler,AniUtils.Duration.MEDIUM);
  }
  mEmptyView.setVisibility(View.GONE);
}

Fixed version (ground truth):
private void showSearchMessage(){
  if (!isAdded())   return;
  getPostAdapter().clear();
  boolean isLandscape=DisplayUtils.isLandscape(getActivity());
  boolean isTablet=DisplayUtils.isXLarge(getActivity());
  if (!isLandscape || isTablet) {
    setEmptyTitleAndDescription(getString(R.string.reader_label_post_search_explainer),null);
    mEmptyView.setVisibility(View.VISIBLE);
  }
}
Program: 14133
Project: 14133
Buggy source:
private void resetPostAdapter(ReaderPostListType postListType){
  mPostListType=postListType;
  mPostAdapter=null;
  mRecyclerView.setAdapter(null);
  mHasUpdatedPosts=false;
  checkPostAdapter();
}

Fixed version (ground truth):
private void resetPostAdapter(ReaderPostListType postListType){
  mPostListType=postListType;
  mPostAdapter=null;
  mRecyclerView.setAdapter(null);
  mRecyclerView.setAdapter(getPostAdapter());
}
Program: 14134
Project: 14134
Buggy source:
private void checkPostAdapter(){
  if (isAdded() && mRecyclerView.getAdapter() == null) {
    mRecyclerView.setAdapter(getPostAdapter());
    if (!mHasUpdatedPosts && NetworkUtils.isNetworkAvailable(getActivity())) {
      mHasUpdatedPosts=true;
      if (getPostListType().isTagType()) {
        updateCurrentTagIfTime();
      }
 else       if (getPostListType() == ReaderPostListType.BLOG_PREVIEW) {
        updatePostsInCurrentBlogOrFeed(UpdateAction.REQUEST_NEWER);
      }
 else       if (getPostListType() == ReaderPostListType.SEARCH_RESULTS) {
        updatePostsInCurrentSearch(0);
      }
    }
  }
}

Fixed version (ground truth):
private void checkPostAdapter(){
  if (isAdded() && mRecyclerView.getAdapter() == null) {
    mRecyclerView.setAdapter(getPostAdapter());
    if (!mHasUpdatedPosts && NetworkUtils.isNetworkAvailable(getActivity())) {
      mHasUpdatedPosts=true;
      if (getPostListType().isTagType()) {
        updateCurrentTagIfTime();
      }
 else       if (getPostListType() == ReaderPostListType.BLOG_PREVIEW) {
        updatePostsInCurrentBlogOrFeed(UpdateAction.REQUEST_NEWER);
      }
    }
  }
}
Program: 14135
Project: 14135
Buggy source:
private void submitSearchQuery(@NonNull String query){
  if (!isAdded())   return;
  ReaderSearchTable.addOrUpdateQueryString(query);
  mSearchView.clearFocus();
  hideSearchMessage();
  mCurrentSearchQuery=query;
  resetPostAdapter(ReaderPostListType.SEARCH_RESULTS);
}

Fixed version (ground truth):
private void submitSearchQuery(@NonNull String query){
  if (!isAdded())   return;
  ReaderSearchTable.addOrUpdateQueryString(query);
  mSearchView.clearFocus();
  hideSearchMessage();
  mCurrentSearchQuery=query;
  resetPostAdapter(ReaderPostListType.SEARCH_RESULTS);
  updatePostsInCurrentSearch(0);
}
Program: 14136
Project: 14136
Buggy source:
private boolean shouldShowBoxAndPagesAnimation(){
  return getPostListType().isTagType() || getPostListType() == ReaderPostListType.SEARCH_RESULTS;
}

Fixed version (ground truth):
private boolean shouldShowBoxAndPagesAnimation(){
  return getPostListType().isTagType();
}
Program: 14137
Project: 14137
Buggy source:
public void setCurrentSearchQuery(@NonNull String query){
  mCurrentSearchQuery=query;
}

Fixed version (ground truth):
public void setCurrentSearchQuery(@NonNull String query){
  if (!query.equals(mCurrentSearchQuery)) {
    mCurrentSearchQuery=query;
    reload();
  }
}
Program: 14138
Project: 14138
Buggy source:
private static boolean isTagAlphaNumeric(String tagString){
  if (tagString == null)   return false;
  for (int i=0; i < tagString.length(); i++) {
    char c=tagString.charAt(i);
    if (!Character.isLetterOrDigit(c) && c != '-') {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private static boolean isTagAlphaNumeric(String tagString){
  if (TextUtils.isEmpty(tagString)) {
    return false;
  }
  for (int i=0; i < tagString.length(); i++) {
    char c=tagString.charAt(i);
    if (!Character.isLetterOrDigit(c) && c != '-') {
      return false;
    }
  }
  return true;
}
Program: 14139
Project: 14139
Buggy source:
private void deleteCredentialsInSmartLock(){
  if (isSmartLockAvailable()) {
    return;
  }
  Credential credential=new Credential.Builder(mUsername).setPassword(mPassword).build();
  Auth.CredentialsApi.delete(mCredentialsClient,credential).setResultCallback(new ResultCallback<Status>(){
    @Override public void onResult(    Status status){
      AppLog.i(T.NUX,status.isSuccess() ? "String_Node_Str" + mUsername : "String_Node_Str" + mUsername);
    }
  }
);
}

Fixed version (ground truth):
private void deleteCredentialsInSmartLock(){
  if (!isSmartLockAvailable()) {
    return;
  }
  Credential credential=new Credential.Builder(mUsername).setPassword(mPassword).build();
  Auth.CredentialsApi.delete(mCredentialsClient,credential).setResultCallback(new ResultCallback<Status>(){
    @Override public void onResult(    Status status){
      AppLog.i(T.NUX,status.isSuccess() ? "String_Node_Str" + mUsername : "String_Node_Str" + mUsername);
    }
  }
);
}
Program: 14140
Project: 14140
Buggy source:
private void updatePostObject(boolean isAutosave){
  if (mPost == null) {
    AppLog.e(AppLog.T.POSTS,"String_Node_Str");
    return;
  }
  if (mEditorFragment != null) {
    if (mShowNewEditor) {
      updatePostContentNewEditor(isAutosave,(String)mEditorFragment.getTitle(),(String)mEditorFragment.getContent());
    }
 else {
      updatePostContent(isAutosave);
    }
  }
  if (mEditPostSettingsFragment != null) {
    mEditPostSettingsFragment.updatePostSettings();
  }
}

Fixed version (ground truth):
private synchronized void updatePostObject(boolean isAutosave){
  if (mPost == null) {
    AppLog.e(AppLog.T.POSTS,"String_Node_Str");
    return;
  }
  if (mEditorFragment != null) {
    if (mShowNewEditor) {
      updatePostContentNewEditor(isAutosave,(String)mEditorFragment.getTitle(),(String)mEditorFragment.getContent());
    }
 else {
      updatePostContent(isAutosave);
    }
  }
  if (mEditPostSettingsFragment != null) {
    mEditPostSettingsFragment.updatePostSettings();
  }
}
Program: 14142
Project: 14142
Buggy source:
@Override protected void onResume(){
  super.onResume();
  mAutoSaveTimer=new Timer();
  mAutoSaveTimer.scheduleAtFixedRate(new AutoSaveTask(),AUTOSAVE_INTERVAL_MILLIS,AUTOSAVE_INTERVAL_MILLIS);
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  mHandler=new Handler();
  mHandler.postDelayed(mAutoSave,AUTOSAVE_INTERVAL_MILLIS);
}
Program: 14143
Project: 14143
Buggy source:
private void saveAndFinish(){
  savePost(true);
  if (mEditorFragment != null && mPost.hasEmptyContentFields()) {
    if (mIsNewPost) {
      WordPress.wpDB.deletePost(mPost);
      finish();
      return;
    }
  }
 else   if (mOriginalPost != null && !mPost.hasChanges(mOriginalPost)) {
    WordPress.wpDB.updatePost(mOriginalPost);
    finish();
    return;
  }
 else {
    if (mShowNewEditor) {
      updatePostContentNewEditor(false,mPost.getTitle(),mPost.getContent());
      savePostToDb();
    }
 else {
      savePost(false);
    }
  }
  Intent i=new Intent();
  i.putExtra(EXTRA_SAVED_AS_LOCAL_DRAFT,true);
  i.putExtra(EXTRA_IS_PAGE,mIsPage);
  setResult(RESULT_OK,i);
  ToastUtils.showToast(this,R.string.editor_toast_changes_saved);
  finish();
}

Fixed version (ground truth):
private void saveAndFinish(){
  new SaveAndFinishTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Program: 14144
Project: 14144
Buggy source:
@Override public void onPageSelected(int position){
  invalidateOptionsMenu();
  if (position == PAGE_CONTENT) {
    setTitle(StringUtils.unescapeHTML(WordPress.getCurrentBlog().getBlogName()));
  }
 else   if (position == PAGE_SETTINGS) {
    setTitle(mPost.isPage() ? R.string.page_settings : R.string.post_settings);
  }
 else   if (position == PAGE_PREVIEW) {
    setTitle(mPost.isPage() ? R.string.preview_page : R.string.preview_post);
    savePost(true);
    if (mEditPostPreviewFragment != null) {
      mEditPostPreviewFragment.loadPost();
    }
  }
}

Fixed version (ground truth):
@Override public void onPageSelected(int position){
  invalidateOptionsMenu();
  if (position == PAGE_CONTENT) {
    setTitle(StringUtils.unescapeHTML(WordPress.getCurrentBlog().getBlogName()));
  }
 else   if (position == PAGE_SETTINGS) {
    setTitle(mPost.isPage() ? R.string.page_settings : R.string.post_settings);
  }
 else   if (position == PAGE_PREVIEW) {
    setTitle(mPost.isPage() ? R.string.preview_page : R.string.preview_post);
    savePostAsync();
    if (mEditPostPreviewFragment != null) {
      mEditPostPreviewFragment.loadPost();
    }
  }
}
Program: 14145
Project: 14145
Buggy source:
@Override protected void onPause(){
  super.onPause();
  try {
    unregisterReceiver(mGalleryReceiver);
  }
 catch (  IllegalArgumentException e) {
    AppLog.d(T.EDITOR,"String_Node_Str");
  }
  stopMediaUploadService();
  mAutoSaveTimer.cancel();
}

Fixed version (ground truth):
@Override protected void onPause(){
  super.onPause();
  try {
    unregisterReceiver(mGalleryReceiver);
  }
 catch (  IllegalArgumentException e) {
    AppLog.d(T.EDITOR,"String_Node_Str");
  }
  stopMediaUploadService();
  mHandler.removeCallbacks(mAutoSave);
  mHandler=null;
}
Program: 14147
Project: 14147
Buggy source:
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  savePost(true);
  outState.putSerializable(STATE_KEY_CURRENT_POST,mPost);
  outState.putSerializable(STATE_KEY_ORIGINAL_POST,mOriginalPost);
  if (mEditorFragment != null) {
    getFragmentManager().putFragment(outState,STATE_KEY_EDITOR_FRAGMENT,mEditorFragment);
  }
}

Fixed version (ground truth):
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  savePostAsync();
  outState.putSerializable(STATE_KEY_CURRENT_POST,mPost);
  outState.putSerializable(STATE_KEY_ORIGINAL_POST,mOriginalPost);
  if (mEditorFragment != null) {
    getFragmentManager().putFragment(outState,STATE_KEY_EDITOR_FRAGMENT,mEditorFragment);
  }
}
Program: 14148
Project: 14148
Buggy source:
private void savePostToDb(){
  WordPress.wpDB.updatePost(mPost);
}

Fixed version (ground truth):
private synchronized void savePostToDb(){
  WordPress.wpDB.updatePost(mPost);
}
Program: 14149
Project: 14149
Buggy source:
private void actionMode(Bundle extras){
  int actionMode=SIGN_IN_REQUEST;
  if (extras != null) {
    actionMode=extras.getInt(EXTRA_START_FRAGMENT,-1);
    if (extras.containsKey(EXTRA_JETPACK_SITE_AUTH)) {
      Blog jetpackBlog=WordPress.getBlog(extras.getInt(EXTRA_JETPACK_SITE_AUTH));
      if (jetpackBlog != null) {
        String customMessage=extras.getString(EXTRA_JETPACK_MESSAGE_AUTH,null);
        mSignInFragment.setBlogAndCustomMessageForJetpackAuth(jetpackBlog,customMessage);
      }
    }
 else     if (extras.containsKey(EXTRA_IS_AUTH_ERROR)) {
      mSignInFragment.showAuthErrorMessage();
    }
  }
switch (actionMode) {
case ADD_SELF_HOSTED_BLOG:
    mSignInFragment.forceSelfHostedMode();
  break;
default :
break;
}
mSignInFragment.smartLockAutoFill();
}

Fixed version (ground truth):
private void actionMode(Bundle extras){
  int actionMode=SIGN_IN_REQUEST;
  if (extras != null) {
    actionMode=extras.getInt(EXTRA_START_FRAGMENT,-1);
    if (extras.containsKey(EXTRA_JETPACK_SITE_AUTH)) {
      Blog jetpackBlog=WordPress.getBlog(extras.getInt(EXTRA_JETPACK_SITE_AUTH));
      if (jetpackBlog != null) {
        String customMessage=extras.getString(EXTRA_JETPACK_MESSAGE_AUTH,null);
        mSignInFragment.setBlogAndCustomMessageForJetpackAuth(jetpackBlog,customMessage);
      }
    }
 else     if (extras.containsKey(EXTRA_IS_AUTH_ERROR)) {
      mSignInFragment.showAuthErrorMessage();
    }
  }
switch (actionMode) {
case ADD_SELF_HOSTED_BLOG:
    mSignInFragment.forceSelfHostedMode();
  break;
default :
break;
}
}
Program: 14150
Project: 14150
Buggy source:
public void onCredentialRetrieved(Credential credential){
  AppLog.d(T.NUX,"String_Node_Str" + credential.getId());
  AnalyticsTracker.track(Stat.LOGIN_AUTOFILL_CREDENTIALS_FILLED);
  mUsernameEditText.setText(credential.getId());
  mPasswordEditText.setText(credential.getPassword());
}

Fixed version (ground truth):
public void onCredentialRetrieved(Credential credential){
  AppLog.d(T.NUX,"String_Node_Str" + credential.getId());
  if (EditTextUtils.getText(mUsernameEditText).isEmpty() && EditTextUtils.getText(mPasswordEditText).isEmpty()) {
    AnalyticsTracker.track(Stat.LOGIN_AUTOFILL_CREDENTIALS_FILLED);
    mUsernameEditText.setText(credential.getId());
    mPasswordEditText.setText(credential.getPassword());
  }
}
Program: 14151
Project: 14151
Buggy source:
@Override public void onResponse(JSONObject jsonObject){
  setPrimaryBlog(jsonObject);
  finishCurrentActivity(userBlogList);
}

Fixed version (ground truth):
@Override public void onResponse(JSONObject jsonObject){
  setPrimaryBlog(jsonObject);
  finishCurrentActivity(userBlogList);
  String displayName=JSONUtils.getStringDecoded(jsonObject,"String_Node_Str");
  Uri profilePicture=Uri.parse(JSONUtils.getString(jsonObject,"String_Node_Str"));
  saveCrendentialsInSmartLock(mUsername,mPassword,displayName,profilePicture);
}
Program: 14152
Project: 14152
Buggy source:
private void signInAndFetchBlogListWPCom(){
  LoginWPCom login=new LoginWPCom(mUsername,mPassword,mTwoStepCode,mShouldSendTwoStepSMS,mJetpackBlog);
  login.execute(new LoginAbstract.Callback(){
    @Override public void onSuccess(){
      mShouldSendTwoStepSMS=false;
      saveCrendentialsInSmartLock();
      if (isJetpackAuth() && getActivity() != null) {
        getActivity().setResult(Activity.RESULT_OK);
        getActivity().finish();
        return;
      }
      FetchBlogListWPCom fetchBlogListWPCom=new FetchBlogListWPCom();
      fetchBlogListWPCom.execute(mFetchBlogListCallback);
    }
    @Override public void onError(    int errorMessageId,    boolean twoStepCodeRequired,    boolean httpAuthRequired,    boolean erroneousSslCertificate){
      mFetchBlogListCallback.onError(errorMessageId,twoStepCodeRequired,httpAuthRequired,erroneousSslCertificate,"String_Node_Str");
      mShouldSendTwoStepSMS=false;
      if (errorMessageId == R.string.username_or_password_incorrect) {
        deleteCredentialsInSmartLock();
      }
    }
  }
);
}

Fixed version (ground truth):
private void signInAndFetchBlogListWPCom(){
  LoginWPCom login=new LoginWPCom(mUsername,mPassword,mTwoStepCode,mShouldSendTwoStepSMS,mJetpackBlog);
  login.execute(new LoginAbstract.Callback(){
    @Override public void onSuccess(){
      mShouldSendTwoStepSMS=false;
      if (isJetpackAuth() && getActivity() != null) {
        getActivity().setResult(Activity.RESULT_OK);
        getActivity().finish();
        return;
      }
      FetchBlogListWPCom fetchBlogListWPCom=new FetchBlogListWPCom();
      fetchBlogListWPCom.execute(mFetchBlogListCallback);
    }
    @Override public void onError(    int errorMessageId,    boolean twoStepCodeRequired,    boolean httpAuthRequired,    boolean erroneousSslCertificate){
      mFetchBlogListCallback.onError(errorMessageId,twoStepCodeRequired,httpAuthRequired,erroneousSslCertificate,"String_Node_Str");
      mShouldSendTwoStepSMS=false;
      if (errorMessageId == R.string.username_or_password_incorrect) {
        deleteCredentialsInSmartLock();
      }
    }
  }
);
}