nus-yam/ex-repair huggingface dataset:
Program: 14153
Project: 14153
Buggy source:
private void saveCrendentialsInSmartLock(){
  if (!isGooglePlayServicesAvailable() || mCredentialsClient == null) {
    return;
  }
  Credential credential=new Credential.Builder(mUsername).setPassword(mPassword).build();
  Auth.CredentialsApi.save(mCredentialsClient,credential).setResultCallback(new ResultCallback<Status>(){
    @Override public void onResult(    Status status){
      if (!status.isSuccess() && status.hasResolution()) {
        try {
          status.startResolutionForResult(getActivity(),SignInActivity.SMART_LOCK_SAVE);
        }
 catch (        IntentSender.SendIntentException e) {
        }
      }
    }
  }
);
}

Fixed version (ground truth):
private void saveCrendentialsInSmartLock(String username,String password,String displayName,Uri profilePicture){
  if (!isGooglePlayServicesAvailable() || mCredentialsClient == null || !mCredentialsClient.isConnected()) {
    return;
  }
  Credential credential=new Credential.Builder(username).setPassword(password).setName(displayName).setProfilePictureUri(profilePicture).build();
  Auth.CredentialsApi.save(mCredentialsClient,credential).setResultCallback(new ResultCallback<Status>(){
    @Override public void onResult(    Status status){
      if (!status.isSuccess() && status.hasResolution()) {
        try {
          status.startResolutionForResult(getActivity(),SignInActivity.SMART_LOCK_SAVE);
        }
 catch (        IntentSender.SendIntentException e) {
        }
      }
    }
  }
);
}
Program: 14154
Project: 14154
Buggy source:
@Override public void onConnected(Bundle bundle){
  AppLog.d(T.NUX,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void onConnected(Bundle bundle){
  AppLog.d(T.NUX,"String_Node_Str");
  smartLockAutoFill();
}
Program: 14155
Project: 14155
Buggy source:
private void deleteCredentialsInSmartLock(){
  if (!isGooglePlayServicesAvailable() || mCredentialsClient == null) {
    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 (!isGooglePlayServicesAvailable() || mCredentialsClient == null || !mCredentialsClient.isConnected()) {
    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: 14156
Project: 14156
Buggy source:
@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);
}

Fixed version (ground truth):
@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);
}
Program: 14157
Project: 14157
Buggy source:
@Override public void onPersonSelected(Person person){
  FragmentManager fragmentManager=getFragmentManager();
  PersonDetailFragment personDetailFragment=(PersonDetailFragment)fragmentManager.findFragmentByTag(KEY_PERSON_DETAIL_FRAGMENT);
  long personID=person.getPersonID();
  int localTableBlogID=person.getLocalTableBlogId();
  if (personDetailFragment == null) {
    personDetailFragment=PersonDetailFragment.newInstance(personID,localTableBlogID);
  }
 else {
    personDetailFragment.setPersonDetails(personID,localTableBlogID);
  }
  if (!personDetailFragment.isAdded()) {
    FragmentTransaction fragmentTransaction=getFragmentManager().beginTransaction();
    fragmentTransaction.setCustomAnimations(R.animator.fragment_slide_in_from_right,R.animator.fragment_slide_out_to_left,R.animator.fragment_slide_in_from_left,R.animator.fragment_slide_out_to_right);
    fragmentTransaction.replace(R.id.fragment_container,personDetailFragment,KEY_PERSON_DETAIL_FRAGMENT);
    fragmentTransaction.addToBackStack(null);
    fragmentTransaction.commit();
  }
}

Fixed version (ground truth):
@Override public void onPersonSelected(Person person){
  FragmentManager fragmentManager=getFragmentManager();
  PersonDetailFragment personDetailFragment=(PersonDetailFragment)fragmentManager.findFragmentByTag(KEY_PERSON_DETAIL_FRAGMENT);
  long personID=person.getPersonID();
  int localTableBlogID=person.getLocalTableBlogId();
  if (personDetailFragment == null) {
    personDetailFragment=PersonDetailFragment.newInstance(personID,localTableBlogID);
  }
 else {
    personDetailFragment.setPersonDetails(personID,localTableBlogID);
  }
  if (!personDetailFragment.isAdded()) {
    FragmentTransaction fragmentTransaction=getFragmentManager().beginTransaction();
    fragmentTransaction.setCustomAnimations(R.animator.fragment_slide_in_from_right,0,0,R.animator.fragment_slide_out_to_right);
    fragmentTransaction.add(R.id.fragment_container,personDetailFragment,KEY_PERSON_DETAIL_FRAGMENT);
    fragmentTransaction.addToBackStack(null);
    fragmentTransaction.commit();
  }
}
Program: 14158
Project: 14158
Buggy source:
private void refreshUsersList(String dotComBlogId,final int localBlogId){
  PeopleUtils.fetchUsers(dotComBlogId,localBlogId,new PeopleUtils.Callback(){
    @Override public void onSuccess(    List<Person> peopleList){
      PeopleTable.savePeople(peopleList);
      FragmentManager fragmentManager=getFragmentManager();
      PeopleListFragment peopleListFragment=(PeopleListFragment)fragmentManager.findFragmentByTag(KEY_PEOPLE_LIST_FRAGMENT);
      PersonDetailFragment personDetailFragment=(PersonDetailFragment)fragmentManager.findFragmentByTag(KEY_PERSON_DETAIL_FRAGMENT);
      if (peopleListFragment != null) {
        peopleListFragment.refreshPeopleList();
      }
      if (personDetailFragment != null) {
        personDetailFragment.refreshPersonDetails();
      }
    }
    @Override public void onError(    VolleyError error){
    }
    @Override public void onJSONException(    JSONException exception){
    }
  }
);
}

Fixed version (ground truth):
private void refreshUsersList(String dotComBlogId,final int localTableBlogId){
  PeopleUtils.fetchUsers(dotComBlogId,localTableBlogId,new PeopleUtils.Callback(){
    @Override public void onSuccess(    List<Person> peopleList){
      PeopleTable.savePeople(peopleList);
      FragmentManager fragmentManager=getFragmentManager();
      PeopleListFragment peopleListFragment=(PeopleListFragment)fragmentManager.findFragmentByTag(KEY_PEOPLE_LIST_FRAGMENT);
      PersonDetailFragment personDetailFragment=(PersonDetailFragment)fragmentManager.findFragmentByTag(KEY_PERSON_DETAIL_FRAGMENT);
      if (peopleListFragment != null) {
        peopleListFragment.refreshPeopleList();
      }
      if (personDetailFragment != null) {
        personDetailFragment.refreshPersonDetails();
      }
    }
    @Override public void onError(    VolleyError error){
    }
    @Override public void onJSONException(    JSONException exception){
    }
  }
);
}
Program: 14160
Project: 14160
Buggy source:
private String formatPostContentForWebView(Context context,Post post){
  if (context == null || post == null) {
    return null;
  }
  String title=(TextUtils.isEmpty(post.getTitle()) ? "String_Node_Str" + getResources().getText(R.string.untitled) + "String_Node_Str" : StringUtils.unescapeHTML(post.getTitle()));
  String postContent=PostUtils.collapseShortcodes(post.getDescription());
  if (!TextUtils.isEmpty(post.getMoreText())) {
    postContent+="String_Node_Str" + post.getMoreText();
  }
  if (post.isLocalDraft()) {
    postContent=postContent.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
  }
  String textColorStr=HtmlUtils.colorResToHtmlColor(context,R.color.grey_dark);
  String linkColorStr=HtmlUtils.colorResToHtmlColor(context,R.color.reader_hyperlink);
  int contentMargin=getResources().getDimensionPixelSize(R.dimen.content_margin);
  String marginStr=Integer.toString(contentMargin) + "String_Node_Str";
  return "String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + marginStr + "String_Node_Str"+ marginStr+ "String_Node_Str"+ "String_Node_Str"+ textColorStr+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ linkColorStr+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ title+ "String_Node_Str"+ StringUtils.addPTags(postContent)+ "String_Node_Str";
}

Fixed version (ground truth):
private String formatPostContentForWebView(Context context,Post post){
  if (context == null || post == null) {
    return null;
  }
  String title=(TextUtils.isEmpty(post.getTitle()) ? "String_Node_Str" + getResources().getText(R.string.untitled) + "String_Node_Str" : StringUtils.unescapeHTML(post.getTitle()));
  String postContent=PostUtils.collapseShortcodes(post.getDescription());
  if (!TextUtils.isEmpty(post.getMoreText())) {
    postContent+="String_Node_Str" + post.getMoreText();
  }
  if (post.isLocalDraft()) {
    postContent=postContent.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
  }
  return "String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + title + "String_Node_Str"+ StringUtils.addPTags(postContent)+ "String_Node_Str";
}
Program: 14161
Project: 14161
Buggy source:
void refreshPreview(){
  if (!isAdded())   return;
  new Thread(){
    @Override public void run(){
      Post post=WordPress.wpDB.getPostForLocalTablePostId(mLocalPostId);
      final String htmlContent=formatPostContentForWebView(getActivity(),post);
      getActivity().runOnUiThread(new Runnable(){
        @Override public void run(){
          if (!isAdded())           return;
          if (htmlContent != null) {
            mWebView.loadDataWithBaseURL(null,htmlContent,"String_Node_Str","String_Node_Str",null);
          }
 else {
            ToastUtils.showToast(getActivity(),R.string.post_not_found);
          }
        }
      }
);
    }
  }
.start();
}

Fixed version (ground truth):
void refreshPreview(){
  if (!isAdded())   return;
  new Thread(){
    @Override public void run(){
      Post post=WordPress.wpDB.getPostForLocalTablePostId(mLocalPostId);
      final String htmlContent=formatPostContentForWebView(getActivity(),post);
      getActivity().runOnUiThread(new Runnable(){
        @Override public void run(){
          if (!isAdded())           return;
          if (htmlContent != null) {
            mWebView.loadDataWithBaseURL("String_Node_Str",htmlContent,"String_Node_Str","String_Node_Str",null);
          }
 else {
            ToastUtils.showToast(getActivity(),R.string.post_not_found);
          }
        }
      }
);
    }
  }
.start();
}
Program: 14162
Project: 14162
Buggy source:
@Override public void run(){
  if (!isAdded())   return;
  if (htmlContent != null) {
    mWebView.loadDataWithBaseURL(null,htmlContent,"String_Node_Str","String_Node_Str",null);
  }
 else {
    ToastUtils.showToast(getActivity(),R.string.post_not_found);
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (!isAdded())   return;
  if (htmlContent != null) {
    mWebView.loadDataWithBaseURL("String_Node_Str",htmlContent,"String_Node_Str","String_Node_Str",null);
  }
 else {
    ToastUtils.showToast(getActivity(),R.string.post_not_found);
  }
}
Program: 14163
Project: 14163
Buggy source:
public static void fetchUsers(final String siteID,final PeopleUtils.Callback callback){
  com.wordpress.rest.RestRequest.Listener listener=new RestRequest.Listener(){
    @Override public void onResponse(    JSONObject jsonObject){
      if (jsonObject != null) {
        try {
          JSONArray jsonArray=jsonObject.getJSONArray("String_Node_Str");
          List<Person> people=peopleListFromJSON(jsonArray,siteID);
          PeopleTable.savePeople(people);
          if (callback != null) {
            callback.onSuccess();
          }
        }
 catch (        JSONException e) {
          AppLog.e(T.API,e);
        }
      }
    }
  }
;
  RestRequest.ErrorListener errorListener=new RestRequest.ErrorListener(){
    @Override public void onErrorResponse(    VolleyError volleyError){
      AppLog.e(T.API,volleyError);
      if (callback != null) {
        callback.onError(volleyError);
      }
    }
  }
;
  String path=String.format("String_Node_Str",siteID);
  WordPress.getRestClientUtilsV1_1().get(path,listener,errorListener);
}

Fixed version (ground truth):
public static void fetchUsers(final String siteID,final PeopleUtils.Callback callback){
  com.wordpress.rest.RestRequest.Listener listener=new RestRequest.Listener(){
    @Override public void onResponse(    JSONObject jsonObject){
      if (jsonObject != null) {
        try {
          JSONArray jsonArray=jsonObject.getJSONArray("String_Node_Str");
          List<Person> people=peopleListFromJSON(jsonArray,siteID);
          PeopleTable.savePeople(people);
          if (callback != null) {
            callback.onSuccess();
          }
        }
 catch (        JSONException e) {
          AppLog.e(T.API,"String_Node_Str" + e);
        }
      }
    }
  }
;
  RestRequest.ErrorListener errorListener=new RestRequest.ErrorListener(){
    @Override public void onErrorResponse(    VolleyError volleyError){
      AppLog.e(T.API,volleyError);
      if (callback != null) {
        callback.onError(volleyError);
      }
    }
  }
;
  String path=String.format("String_Node_Str",siteID);
  WordPress.getRestClientUtilsV1_1().get(path,listener,errorListener);
}
Program: 14164
Project: 14164
Buggy source:
@Override public void onResponse(JSONObject jsonObject){
  if (jsonObject != null) {
    try {
      JSONArray jsonArray=jsonObject.getJSONArray("String_Node_Str");
      List<Person> people=peopleListFromJSON(jsonArray,siteID);
      PeopleTable.savePeople(people);
      if (callback != null) {
        callback.onSuccess();
      }
    }
 catch (    JSONException e) {
      AppLog.e(T.API,e);
    }
  }
}

Fixed version (ground truth):
@Override public void onResponse(JSONObject jsonObject){
  if (jsonObject != null) {
    try {
      JSONArray jsonArray=jsonObject.getJSONArray("String_Node_Str");
      List<Person> people=peopleListFromJSON(jsonArray,siteID);
      PeopleTable.savePeople(people);
      if (callback != null) {
        callback.onSuccess();
      }
    }
 catch (    JSONException e) {
      AppLog.e(T.API,"String_Node_Str" + e);
    }
  }
}
Program: 14165
Project: 14165
Buggy source:
private void handleBlogRemoved(){
  if (!AccountHelper.isSignedIn()) {
    ActivityLauncher.showSignInForResult(this);
  }
 else {
    Blog blog=WordPress.getCurrentBlog();
    MySiteFragment mySiteFragment=getMySiteFragment();
    if (mySiteFragment != null) {
      mySiteFragment.setBlog(blog);
    }
    if (blog != null) {
      int blogId=blog.getLocalTableBlogId();
      ActivityLauncher.showSitePickerForResult(this,blogId);
    }
  }
}

Fixed version (ground truth):
private void handleBlogRemoved(){
  if (!AccountHelper.isSignedIn()) {
    ActivityLauncher.showSignInForResult(this,true);
  }
 else {
    Blog blog=WordPress.getCurrentBlog();
    MySiteFragment mySiteFragment=getMySiteFragment();
    if (mySiteFragment != null) {
      mySiteFragment.setBlog(blog);
    }
    if (blog != null) {
      int blogId=blog.getLocalTableBlogId();
      ActivityLauncher.showSitePickerForResult(this,blogId);
    }
  }
}
Program: 14167
Project: 14167
Buggy source:
/** 
 * retrieve a single person
 * @param personId - unique id in people table
 * @return Person if found, null otherwise
 */
private static Person getPerson(long personId){
  String[] args={Long.toString(personId)};
  Cursor c=getReadableDb().rawQuery("String_Node_Str" + PEOPLE_TABLE + "String_Node_Str",args);
  try {
    if (!c.moveToFirst()) {
      return null;
    }
    String username=c.getString(c.getColumnIndex("String_Node_Str"));
    String firstName=c.getString(c.getColumnIndex("String_Node_Str"));
    String lastName=c.getString(c.getColumnIndex("String_Node_Str"));
    String displayName=c.getString(c.getColumnIndex("String_Node_Str"));
    String avatarUrl=c.getString(c.getColumnIndex("String_Node_Str"));
    return new Person(personId,username,firstName,lastName,displayName,avatarUrl,null);
  }
  finally {
    SqlUtils.closeCursor(c);
  }
}

Fixed version (ground truth):
/** 
 * retrieve a single person
 * @param personId - unique id in people table
 * @return Person if found, null otherwise
 */
public static Person getPerson(long personId){
  String[] args={Long.toString(personId)};
  Cursor c=getReadableDb().rawQuery("String_Node_Str" + PEOPLE_TABLE + "String_Node_Str",args);
  try {
    if (!c.moveToFirst()) {
      return null;
    }
    String username=c.getString(c.getColumnIndex("String_Node_Str"));
    String firstName=c.getString(c.getColumnIndex("String_Node_Str"));
    String lastName=c.getString(c.getColumnIndex("String_Node_Str"));
    String displayName=c.getString(c.getColumnIndex("String_Node_Str"));
    String avatarUrl=c.getString(c.getColumnIndex("String_Node_Str"));
    return new Person(personId,username,firstName,lastName,displayName,avatarUrl,null);
  }
  finally {
    SqlUtils.closeCursor(c);
  }
}
Program: 14168
Project: 14168
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  final PeopleViewHolder holder;
  if (convertView == null || convertView.getTag() == null) {
    convertView=mInflater.inflate(R.layout.people_list_row,parent,false);
    holder=new PeopleViewHolder(convertView);
    convertView.setTag(holder);
  }
 else {
    holder=(PeopleViewHolder)convertView.getTag();
  }
  Person person=getItem(position);
  if (person != null) {
    String avatarUrl=GravatarUtils.fixGravatarUrl(person.getAvatarUrl(),mAvatarSz);
    holder.imgAvatar.setImageUrl(avatarUrl,WPNetworkImageView.ImageType.AVATAR);
    holder.txtDisplayName.setText(person.getDisplayName());
    holder.txtUsername.setText(person.getUsername());
    holder.txtRole.setText(Role.toString(mContext,person.getRole()));
    holder.txtRole.setBackgroundColor(Role.backgroundColor(mContext,person.getRole()));
  }
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  final PeopleViewHolder holder;
  if (convertView == null || convertView.getTag() == null) {
    convertView=mInflater.inflate(R.layout.people_list_row,parent,false);
    holder=new PeopleViewHolder(convertView);
    convertView.setTag(holder);
  }
 else {
    holder=(PeopleViewHolder)convertView.getTag();
  }
  Person person=getItem(position);
  if (person != null) {
    String avatarUrl=GravatarUtils.fixGravatarUrl(person.getAvatarUrl(),mAvatarSz);
    holder.imgAvatar.setImageUrl(avatarUrl,WPNetworkImageView.ImageType.AVATAR);
    holder.txtDisplayName.setText(person.getDisplayName());
    holder.txtUsername.setText(person.getUsername());
    holder.txtRole.setText(Role.getLabel(mContext,person.getRole()));
    holder.txtRole.setBackgroundColor(Role.backgroundColor(mContext,person.getRole()));
  }
  return convertView;
}
Program: 14169
Project: 14169
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mPersonId=getIntent().getExtras().getInt(EXTRA_PERSON_ID);
  ActionBar actionBar=getSupportActionBar();
  if (actionBar != null) {
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  setContentView(R.layout.person_activity);
  setTitle(R.string.edit_user);
  refreshUserDetails();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mPersonId=getIntent().getExtras().getLong(EXTRA_PERSON_ID);
  ActionBar actionBar=getSupportActionBar();
  if (actionBar != null) {
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  setContentView(R.layout.person_activity);
  setTitle(R.string.edit_user);
  refreshUserDetails();
}
Program: 14170
Project: 14170
Buggy source:
private void refreshUserDetails(){
  WPNetworkImageView imgAvatar=(WPNetworkImageView)findViewById(R.id.person_avatar);
  TextView txtDisplayName=(TextView)findViewById(R.id.person_display_name);
  TextView txtUsername=(TextView)findViewById(R.id.person_username);
  TextView txtRole=(TextView)findViewById(R.id.person_role);
  TextView txtRemove=(TextView)findViewById(R.id.person_remove);
  Person person=PeopleTable.getPerson(mPersonId);
  if (person != null) {
    int avatarSz=getResources().getDimensionPixelSize(R.dimen.avatar_sz_large);
    String avatarUrl=GravatarUtils.fixGravatarUrl(person.getAvatarUrl(),avatarSz);
    imgAvatar.setImageUrl(avatarUrl,WPNetworkImageView.ImageType.AVATAR);
    txtDisplayName.setText(person.getDisplayName());
    txtUsername.setText(person.getUsername());
    txtRole.setText(Role.toString(this,person.getRole()));
    txtRemove.setText(String.format(getString(R.string.remove_user),person.getFirstName().toUpperCase()));
    txtRemove.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
      }
    }
);
  }
}

Fixed version (ground truth):
private void refreshUserDetails(){
  WPNetworkImageView imgAvatar=(WPNetworkImageView)findViewById(R.id.person_avatar);
  TextView txtDisplayName=(TextView)findViewById(R.id.person_display_name);
  TextView txtUsername=(TextView)findViewById(R.id.person_username);
  TextView txtRole=(TextView)findViewById(R.id.person_role);
  TextView txtRemove=(TextView)findViewById(R.id.person_remove);
  Person person=PeopleTable.getPerson(mPersonId);
  if (person != null) {
    int avatarSz=getResources().getDimensionPixelSize(R.dimen.avatar_sz_large);
    String avatarUrl=GravatarUtils.fixGravatarUrl(person.getAvatarUrl(),avatarSz);
    imgAvatar.setImageUrl(avatarUrl,WPNetworkImageView.ImageType.AVATAR);
    txtDisplayName.setText(person.getDisplayName());
    txtUsername.setText(person.getUsername());
    txtRole.setText(Role.getLabel(this,person.getRole()));
    txtRemove.setText(String.format(getString(R.string.remove_user),person.getFirstName().toUpperCase()));
    txtRemove.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
      }
    }
);
  }
}
Program: 14171
Project: 14171
Buggy source:
public static void setFloat(ExtraKey key,float value){
  Crashlytics.setFloat(key.name(),value);
}

Fixed version (ground truth):
public static void setFloat(ExtraKey key,float value){
  if (!Fabric.isInitialized()) {
    return;
  }
  Crashlytics.setFloat(key.name(),value);
}
Program: 14172
Project: 14172
Buggy source:
public static void setString(ExtraKey key,String value){
  Crashlytics.setString(key.name(),value);
}

Fixed version (ground truth):
public static void setString(ExtraKey key,String value){
  if (!Fabric.isInitialized()) {
    return;
  }
  Crashlytics.setString(key.name(),value);
}
Program: 14173
Project: 14173
Buggy source:
public static void setBool(ExtraKey key,boolean value){
  Crashlytics.setBool(key.name(),value);
}

Fixed version (ground truth):
public static void setBool(ExtraKey key,boolean value){
  if (!Fabric.isInitialized()) {
    return;
  }
  Crashlytics.setBool(key.name(),value);
}
Program: 14174
Project: 14174
Buggy source:
public static void setInt(ExtraKey key,int value){
  Crashlytics.setInt(key.name(),value);
}

Fixed version (ground truth):
public static void setInt(ExtraKey key,int value){
  if (!Fabric.isInitialized()) {
    return;
  }
  Crashlytics.setInt(key.name(),value);
}
Program: 14175
Project: 14175
Buggy source:
public static void setFloat(ExtraKey key,float value){
  Crashlytics.setFloat(key.name(),value);
}

Fixed version (ground truth):
public static void setFloat(ExtraKey key,float value){
  if (!Fabric.isInitialized()) {
    return;
  }
  Crashlytics.setFloat(key.name(),value);
}
Program: 14176
Project: 14176
Buggy source:
public static void setString(ExtraKey key,String value){
  Crashlytics.setString(key.name(),value);
}

Fixed version (ground truth):
public static void setString(ExtraKey key,String value){
  if (!Fabric.isInitialized()) {
    return;
  }
  Crashlytics.setString(key.name(),value);
}
Program: 14177
Project: 14177
Buggy source:
public static void setBool(ExtraKey key,boolean value){
  Crashlytics.setBool(key.name(),value);
}

Fixed version (ground truth):
public static void setBool(ExtraKey key,boolean value){
  if (!Fabric.isInitialized()) {
    return;
  }
  Crashlytics.setBool(key.name(),value);
}
Program: 14178
Project: 14178
Buggy source:
public static void setInt(ExtraKey key,int value){
  Crashlytics.setInt(key.name(),value);
}

Fixed version (ground truth):
public static void setInt(ExtraKey key,int value){
  if (!Fabric.isInitialized()) {
    return;
  }
  Crashlytics.setInt(key.name(),value);
}
Program: 14179
Project: 14179
Buggy source:
public void onEventMainThread(PrefsEvents.AccountSettingsPostError event){
  if (isAdded()) {
    ToastUtils.showToast(getActivity(),R.string.error_post_account_settings,ToastUtils.Duration.LONG);
  }
}

Fixed version (ground truth):
public void onEventMainThread(PrefsEvents.AccountSettingsPostError event){
  if (isAdded()) {
    ToastUtils.showToast(getActivity(),R.string.error_post_account_settings,ToastUtils.Duration.LONG);
    checkIfEmailChangeIsPending();
  }
}
Program: 14180
Project: 14180
Buggy source:
private void checkIfEmailChangeIsPending(){
  final Account account=AccountHelper.getDefaultAccount();
  if (account.getPendingEmailChange()) {
    showPendingEmailChangeSnackbar(account.getNewEmail());
  }
  mEmailPreference.setEnabled(!account.getPendingEmailChange());
}

Fixed version (ground truth):
private void checkIfEmailChangeIsPending(){
  final Account account=AccountHelper.getDefaultAccount();
  if (account.getPendingEmailChange()) {
    showPendingEmailChangeSnackbar(account.getNewEmail());
  }
 else   if (mEmailSnackbar != null && mEmailSnackbar.isShown()) {
    mEmailSnackbar.dismiss();
  }
  mEmailPreference.setEnabled(!account.getPendingEmailChange());
}
Program: 14181
Project: 14181
Buggy source:
private void sortLanguages(){
  if (mLanguagePref == null)   return;
  Pair<String[],String[]> pair=WPPrefUtils.createSortedLanguageDisplayStrings(mLanguagePref.getEntryValues(),WPPrefUtils.languageLocale(null));
  String[] sortedEntries=pair.first;
  String[] sortedValues=pair.second;
  mLanguagePref.setEntries(sortedEntries);
  mLanguagePref.setEntryValues(sortedValues);
  mLanguagePref.setDetails(WPPrefUtils.createLanguageDetailDisplayStrings(sortedValues));
}

Fixed version (ground truth):
private void sortLanguages(){
  if (mLanguagePref == null)   return;
  Pair<String[],String[]> pair=WPPrefUtils.createSortedLanguageDisplayStrings(mLanguagePref.getEntryValues(),WPPrefUtils.languageLocale(null));
  if (pair != null) {
    String[] sortedEntries=pair.first;
    String[] sortedValues=pair.second;
    mLanguagePref.setEntries(sortedEntries);
    mLanguagePref.setEntryValues(sortedValues);
    mLanguagePref.setDetails(WPPrefUtils.createLanguageDetailDisplayStrings(sortedValues));
  }
}
Program: 14182
Project: 14182
Buggy source:
/** 
 * Generates display strings for given language codes. Used as entries in language preference.
 */
public static Pair<String[],String[]> createSortedLanguageDisplayStrings(CharSequence[] languageCodes,Locale locale){
  if (languageCodes == null || languageCodes.length < 1)   return null;
  String[] entryStrings=new String[languageCodes.length];
  for (int i=0; i < languageCodes.length; ++i) {
    entryStrings[i]=StringUtils.capitalize(getLanguageString(languageCodes[i].toString(),locale)) + "String_Node_Str" + languageCodes[i];
  }
  Arrays.sort(entryStrings);
  String[] sortedEntries=new String[languageCodes.length];
  String[] sortedValues=new String[languageCodes.length];
  for (int i=0; i < entryStrings.length; ++i) {
    String[] split=entryStrings[i].split("String_Node_Str");
    sortedEntries[i]=split[0];
    sortedValues[i]=split[1];
  }
  return new Pair<>(sortedEntries,sortedValues);
}

Fixed version (ground truth):
/** 
 * Generates display strings for given language codes. Used as entries in language preference.
 */
@Nullable public static Pair<String[],String[]> createSortedLanguageDisplayStrings(CharSequence[] languageCodes,Locale locale){
  if (languageCodes == null || languageCodes.length < 1)   return null;
  ArrayList<String> entryStrings=new ArrayList<>(languageCodes.length);
  for (int i=0; i < languageCodes.length; ++i) {
    entryStrings.add(i,StringUtils.capitalize(getLanguageString(languageCodes[i].toString(),locale)) + "String_Node_Str" + languageCodes[i]);
  }
  Collections.sort(entryStrings,Collator.getInstance(locale));
  String[] sortedEntries=new String[languageCodes.length];
  String[] sortedValues=new String[languageCodes.length];
  for (int i=0; i < entryStrings.size(); ++i) {
    String[] split=entryStrings.get(i).split("String_Node_Str");
    sortedEntries[i]=split[0];
    sortedValues[i]=split[1];
  }
  return new Pair<>(sortedEntries,sortedValues);
}
Program: 14183
Project: 14183
Buggy source:
/** 
 * Generates detail display strings in the currently selected locale. Used as detail text in language preference dialog.
 */
public static String[] createLanguageDetailDisplayStrings(CharSequence[] languageCodes){
  if (languageCodes == null || languageCodes.length < 1)   return null;
  String[] detailStrings=new String[languageCodes.length];
  for (int i=0; i < languageCodes.length; ++i) {
    detailStrings[i]=StringUtils.capitalize(getLanguageString(languageCodes[i].toString(),WPPrefUtils.languageLocale(languageCodes[i].toString())));
  }
  return detailStrings;
}

Fixed version (ground truth):
/** 
 * Generates detail display strings in the currently selected locale. Used as detail text in language preference dialog.
 */
@Nullable public static String[] createLanguageDetailDisplayStrings(CharSequence[] languageCodes){
  if (languageCodes == null || languageCodes.length < 1)   return null;
  String[] detailStrings=new String[languageCodes.length];
  for (int i=0; i < languageCodes.length; ++i) {
    detailStrings[i]=StringUtils.capitalize(getLanguageString(languageCodes[i].toString(),WPPrefUtils.languageLocale(languageCodes[i].toString())));
  }
  return detailStrings;
}
Program: 14184
Project: 14184
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ActionBar actionBar=getSupportActionBar();
  if (actionBar != null) {
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  FragmentManager fragmentManager=getFragmentManager();
  Fragment settingsFragment=fragmentManager.findFragmentByTag(KEY_SETTINGS_FRAGMENT);
  Fragment passcodeFragment=fragmentManager.findFragmentByTag(KEY_PASSCODE_FRAGMENT);
  if (settingsFragment == null || passcodeFragment == null) {
    Bundle passcodeArgs=new Bundle();
    passcodeArgs.putBoolean(PasscodePreferenceFragment.KEY_SHOULD_INFLATE,false);
    settingsFragment=new SettingsFragment();
    passcodeFragment=new PasscodePreferenceFragment();
    passcodeFragment.setArguments(passcodeArgs);
    fragmentManager.beginTransaction().replace(android.R.id.content,passcodeFragment,KEY_PASSCODE_FRAGMENT).add(android.R.id.content,settingsFragment,KEY_SETTINGS_FRAGMENT).commit();
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ActionBar actionBar=getSupportActionBar();
  if (actionBar != null) {
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  FragmentManager fragmentManager=getFragmentManager();
  mSettingsFragment=(SettingsFragment)fragmentManager.findFragmentByTag(KEY_SETTINGS_FRAGMENT);
  mPasscodePreferenceFragment=(PasscodePreferenceFragment)fragmentManager.findFragmentByTag(KEY_PASSCODE_FRAGMENT);
  if (mSettingsFragment == null || mPasscodePreferenceFragment == null) {
    Bundle passcodeArgs=new Bundle();
    passcodeArgs.putBoolean(PasscodePreferenceFragment.KEY_SHOULD_INFLATE,false);
    mSettingsFragment=new SettingsFragment();
    mPasscodePreferenceFragment=new PasscodePreferenceFragment();
    mPasscodePreferenceFragment.setArguments(passcodeArgs);
    fragmentManager.beginTransaction().replace(android.R.id.content,mPasscodePreferenceFragment,KEY_PASSCODE_FRAGMENT).add(android.R.id.content,mSettingsFragment,KEY_SETTINGS_FRAGMENT).commit();
  }
}
Program: 14186
Project: 14186
Buggy source:
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  Resources res=getResources();
  DisplayMetrics dm=res.getDisplayMetrics();
  Configuration conf=res.getConfiguration();
  String localString=localeMap.get(values[position]);
  if (localString.contains("String_Node_Str")) {
    conf.locale=new Locale(localString.substring(0,localString.indexOf("String_Node_Str")),localString.substring(localString.indexOf("String_Node_Str") + 1,localString.length()));
  }
 else {
    conf.locale=new Locale(localString);
  }
  res.updateConfiguration(conf,dm);
  mSettings.edit().putString(LANGUAGE_PREF_KEY,localeMap.get(values[position])).apply();
  if (position != 0) {
    Map<String,Object> properties=new HashMap<String,Object>();
    properties.put("String_Node_Str",conf.locale.toString());
    AnalyticsTracker.track(Stat.ACCOUNT_SETTINGS_LANGUAGE_SELECTION_FORCED,properties);
  }
  AnalyticsUtils.refreshMetadata();
  Intent refresh=new Intent(getActivity(),getActivity().getClass());
  startActivity(refresh);
  getActivity().setResult(LANGUAGE_CHANGED);
  getActivity().finish();
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  Resources res=getResources();
  DisplayMetrics dm=res.getDisplayMetrics();
  Configuration conf=res.getConfiguration();
  String localString=localeMap.get(values[position]);
  if (localString.contains("String_Node_Str")) {
    conf.locale=new Locale(localString.substring(0,localString.indexOf("String_Node_Str")),localString.substring(localString.indexOf("String_Node_Str") + 1,localString.length()));
  }
 else {
    conf.locale=new Locale(localString);
  }
  res.updateConfiguration(conf,dm);
  if (position > 0) {
    mSettings.edit().putString(LANGUAGE_PREF_KEY,localeMap.get(values[position])).apply();
  }
 else {
    mSettings.edit().remove(LANGUAGE_PREF_KEY).apply();
  }
  if (position != 0) {
    Map<String,Object> properties=new HashMap<String,Object>();
    properties.put("String_Node_Str",conf.locale.toString());
    AnalyticsTracker.track(Stat.ACCOUNT_SETTINGS_LANGUAGE_SELECTION_FORCED,properties);
  }
  AnalyticsUtils.refreshMetadata();
  Intent refresh=new Intent(getActivity(),getActivity().getClass());
  startActivity(refresh);
  getActivity().setResult(LANGUAGE_CHANGED);
  getActivity().finish();
}
Program: 14187
Project: 14187
Buggy source:
public static void applyLocale(Activity context,boolean restart){
  SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(context);
  if (sharedPreferences.contains(SettingsFragment.LANGUAGE_PREF_KEY)) {
    Locale contextLocale=context.getResources().getConfiguration().locale;
    String contextLanguage=contextLocale.getLanguage();
    String contextCountry=contextLocale.getCountry();
    String locale=sharedPreferences.getString(SettingsFragment.LANGUAGE_PREF_KEY,"String_Node_Str");
    if (!TextUtils.isEmpty(contextCountry)) {
      contextLanguage+="String_Node_Str" + contextCountry;
    }
    if (!locale.equals(contextLanguage)) {
      Resources resources=context.getResources();
      Configuration conf=resources.getConfiguration();
      conf.locale=new Locale(locale);
      resources.updateConfiguration(conf,resources.getDisplayMetrics());
      if (restart) {
        Intent refresh=new Intent(context,context.getClass());
        refresh.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
        context.startActivity(refresh);
        context.finish();
        context.overridePendingTransition(0,0);
      }
    }
  }
}

Fixed version (ground truth):
public static void applyLocale(Activity context,boolean restart){
  SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(context);
  if (sharedPreferences.contains(SettingsFragment.LANGUAGE_PREF_KEY)) {
    Locale contextLocale=context.getResources().getConfiguration().locale;
    String contextLanguage=contextLocale.getLanguage();
    String contextCountry=contextLocale.getCountry();
    String locale=sharedPreferences.getString(SettingsFragment.LANGUAGE_PREF_KEY,"String_Node_Str");
    if (!TextUtils.isEmpty(contextCountry)) {
      contextLanguage+="String_Node_Str" + contextCountry;
    }
    if (!locale.equals(contextLanguage)) {
      Resources resources=context.getResources();
      Configuration conf=resources.getConfiguration();
      conf.locale=new Locale(locale);
      resources.updateConfiguration(conf,resources.getDisplayMetrics());
      if (restart) {
        Intent refresh=context.getIntent();
        if (refresh == null) {
          refresh=new Intent(context,context.getClass());
        }
        refresh.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
        context.startActivity(refresh);
        context.finish();
        context.overridePendingTransition(0,0);
      }
    }
  }
}
Program: 14188
Project: 14188
Buggy source:
public static void showFab(final View view,final boolean show){
  if (view == null)   return;
  Context context=view.getContext();
  int fabHeight=context.getResources().getDimensionPixelSize(android.support.design.R.dimen.design_fab_size_normal);
  int fabMargin=context.getResources().getDimensionPixelSize(R.dimen.fab_margin);
  int max=(fabHeight + fabMargin) * 2;
  float fromY=(show ? max : 0f);
  float toY=(show ? 0f : max);
  ObjectAnimator anim=ObjectAnimator.ofFloat(view,View.TRANSLATION_Y,fromY,toY);
  anim.setInterpolator(show ? new DecelerateInterpolator() : new AccelerateInterpolator());
  anim.setDuration(show ? Duration.LONG.toMillis(context) : Duration.SHORT.toMillis(context));
  anim.addListener(new AnimatorListenerAdapter(){
    @Override public void onAnimationStart(    Animator animation){
      super.onAnimationStart(animation);
      if (view.getVisibility() != View.VISIBLE) {
        view.setVisibility(View.VISIBLE);
      }
    }
    @Override public void onAnimationEnd(    Animator animation){
      super.onAnimationEnd(animation);
      if (!show) {
        view.setVisibility(View.GONE);
      }
    }
  }
);
  anim.start();
}

Fixed version (ground truth):
public static void showFab(final View view,final boolean show){
  if (view == null)   return;
  Context context=view.getContext();
  int fabHeight=context.getResources().getDimensionPixelSize(android.support.design.R.dimen.design_fab_size_normal);
  int fabMargin=context.getResources().getDimensionPixelSize(R.dimen.fab_margin);
  int max=(fabHeight + fabMargin) * 2;
  float fromY=(show ? max : 0f);
  float toY=(show ? 0f : max);
  ObjectAnimator anim=ObjectAnimator.ofFloat(view,View.TRANSLATION_Y,fromY,toY);
  if (show) {
    anim.setInterpolator(new DecelerateInterpolator());
  }
 else {
    anim.setInterpolator(new AccelerateInterpolator());
  }
  anim.setDuration(show ? Duration.LONG.toMillis(context) : Duration.SHORT.toMillis(context));
  anim.addListener(new AnimatorListenerAdapter(){
    @Override public void onAnimationStart(    Animator animation){
      super.onAnimationStart(animation);
      if (view.getVisibility() != View.VISIBLE) {
        view.setVisibility(View.VISIBLE);
      }
    }
    @Override public void onAnimationEnd(    Animator animation){
      super.onAnimationEnd(animation);
      if (!show) {
        view.setVisibility(View.GONE);
      }
    }
  }
);
  anim.start();
}
Program: 14190
Project: 14190
Buggy source:
public static void save(Account account,SQLiteDatabase database){
  ContentValues values=new ContentValues();
  values.put("String_Node_Str",0);
  values.put("String_Node_Str",account.getUserName());
  values.put("String_Node_Str",account.getUserId());
  values.put("String_Node_Str",account.getDisplayName());
  values.put("String_Node_Str",account.getProfileUrl());
  values.put("String_Node_Str",account.getAvatarUrl());
  values.put("String_Node_Str",account.getPrimaryBlogId());
  values.put("String_Node_Str",account.getSiteCount());
  values.put("String_Node_Str",account.getVisibleSiteCount());
  values.put("String_Node_Str",account.getAccessToken());
  values.put("String_Node_Str",account.getEmail());
  values.put("String_Node_Str",account.getFirstName());
  values.put("String_Node_Str",account.getLastName());
  values.put("String_Node_Str",account.getAboutMe());
  values.put("String_Node_Str",account.getNewEmail());
  values.put("String_Node_Str",account.getPendingEmailChange());
  values.put("String_Node_Str",account.getPendingEmailChange());
  database.insertWithOnConflict(ACCOUNT_TABLE,null,values,SQLiteDatabase.CONFLICT_REPLACE);
}

Fixed version (ground truth):
public static void save(Account account,SQLiteDatabase database){
  ContentValues values=new ContentValues();
  values.put("String_Node_Str",0);
  values.put("String_Node_Str",account.getUserName());
  values.put("String_Node_Str",account.getUserId());
  values.put("String_Node_Str",account.getDisplayName());
  values.put("String_Node_Str",account.getProfileUrl());
  values.put("String_Node_Str",account.getAvatarUrl());
  values.put("String_Node_Str",account.getPrimaryBlogId());
  values.put("String_Node_Str",account.getSiteCount());
  values.put("String_Node_Str",account.getVisibleSiteCount());
  values.put("String_Node_Str",account.getAccessToken());
  values.put("String_Node_Str",account.getEmail());
  values.put("String_Node_Str",account.getFirstName());
  values.put("String_Node_Str",account.getLastName());
  values.put("String_Node_Str",account.getAboutMe());
  values.put("String_Node_Str",account.getNewEmail());
  values.put("String_Node_Str",account.getPendingEmailChange());
  values.put("String_Node_Str",account.getWebAddress());
  database.insertWithOnConflict(ACCOUNT_TABLE,null,values,SQLiteDatabase.CONFLICT_REPLACE);
}
Program: 14191
Project: 14191
Buggy source:
private void bumpPromoAnaylticsAndShowPromoDialogIfNecessary(){
  if (mIsUpdatingStats || mThereWasAnErrorLoadingStats) {
    return;
  }
  AppPrefs.bumpAnalyticsForStatsWidgetPromo();
  String prevWidgetKeysString=AppPrefs.getStatsWidgetsKeys();
  if (StringUtils.isEmpty(prevWidgetKeysString)) {
    int counter=AppPrefs.getAnalyticsForStatsWidgetPromo();
    if (counter == 3 || counter == 1000 || counter == 10000) {
      DialogFragment newFragment=StatsWidgetPromoDialogFragment.newInstance();
      newFragment.show(getFragmentManager(),"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void bumpPromoAnaylticsAndShowPromoDialogIfNecessary(){
  if (mIsUpdatingStats || mThereWasAnErrorLoadingStats) {
    return;
  }
  if (!StringUtils.isEmpty(AppPrefs.getStatsWidgetsKeys())) {
    return;
  }
  AppPrefs.bumpAnalyticsForStatsWidgetPromo();
  int counter=AppPrefs.getAnalyticsForStatsWidgetPromo();
  if (counter == 3 || counter == 1000 || counter == 10000) {
    DialogFragment newFragment=StatsWidgetPromoDialogFragment.newInstance();
    newFragment.show(getFragmentManager(),"String_Node_Str");
  }
}
Program: 14192
Project: 14192
Buggy source:
private void checkAllRequestsFinished(Request<JSONObject> req){
synchronized (mStatsNetworkRequests) {
    if (req != null) {
      mStatsNetworkRequests.remove(req);
    }
    boolean isStillWorking=mStatsNetworkRequests.size() > 0;
    EventBus.getDefault().post(new StatsEvents.UpdateStatusChanged(isStillWorking));
  }
}

Fixed version (ground truth):
private void checkAllRequestsFinished(Request<JSONObject> req){
synchronized (mStatsNetworkRequests) {
    if (req != null) {
      mStatsNetworkRequests.remove(req);
    }
    boolean isStillWorking=mStatsNetworkRequests.size() > 0 || singleThreadNetworkHandler.getQueue().size() > 0;
    EventBus.getDefault().post(new StatsEvents.UpdateStatusChanged(isStillWorking));
  }
}
Program: 14194
Project: 14194
Buggy source:
public boolean shouldUpdateFragmentOnErrorEvent(StatsEvents.SectionUpdateError errorEvent){
  StatsEvents.SectionUpdatedAbstract abstractEvent=errorEvent;
  if (!shouldUpdateFragmentOnUpdateEvent(abstractEvent)) {
    return false;
  }
  StatsService.StatsEndpointsEnum sectionToUpdate=errorEvent.mEndPointName;
  StatsService.StatsEndpointsEnum[] sectionsToUpdate=getSectionsToUpdate();
  int indexOfDatamodelMatch=-1;
  for (int i=0; i < getSectionsToUpdate().length; i++) {
    if (sectionToUpdate == sectionsToUpdate[i]) {
      indexOfDatamodelMatch=i;
      break;
    }
  }
  if (-1 == indexOfDatamodelMatch) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean shouldUpdateFragmentOnErrorEvent(StatsEvents.SectionUpdateError errorEvent){
  if (!shouldUpdateFragmentOnUpdateEvent(errorEvent)) {
    return false;
  }
  StatsService.StatsEndpointsEnum sectionToUpdate=errorEvent.mEndPointName;
  StatsService.StatsEndpointsEnum[] sectionsToUpdate=getSectionsToUpdate();
  int indexOfDatamodelMatch=-1;
  for (int i=0; i < getSectionsToUpdate().length; i++) {
    if (sectionToUpdate == sectionsToUpdate[i]) {
      indexOfDatamodelMatch=i;
      break;
    }
  }
  if (-1 == indexOfDatamodelMatch) {
    return false;
  }
  return true;
}
Program: 14195
Project: 14195
Buggy source:
/** 
 * This is called every time an App Widget is deleted from the App Widget host.
 * @param context
 * @param widgetIDs
 */
@Override public void onDeleted(Context context,int[] widgetIDs){
  setRemoteBlogIDForWidgetIDs(widgetIDs,null);
}

Fixed version (ground truth):
/** 
 * This is called every time an App Widget is deleted from the App Widget host.
 * @param context The Context in which this receiver is running.
 * @param widgetIDs Widget IDs to set blank. We cannot remove widget from home screen.
 */
@Override public void onDeleted(Context context,int[] widgetIDs){
  setRemoteBlogIDForWidgetIDs(widgetIDs,null);
}
Program: 14196
Project: 14196
Buggy source:
public void testNumberExceptionWithInvalidInteger() throws Exception {
  XMLRPCFactoryTest.setPrefixAllInstances("String_Node_Str");
  XMLRPCClientInterface xmlrpcClientInterface=XMLRPCFactory.instantiate(URI.create("String_Node_Str"),"String_Node_Str","String_Node_Str");
  try {
    xmlrpcClientInterface.call(ApiHelper.Methods.GET_MEDIA_LIBRARY,null);
  }
 catch (  NumberFormatException e) {
    return;
  }
  assertTrue("String_Node_Str",false);
}

Fixed version (ground truth):
public void testNumberExceptionWithInvalidInteger() throws Exception {
  XMLRPCFactoryTest.setPrefixAllInstances("String_Node_Str");
  XMLRPCClientInterface xmlrpcClientInterface=XMLRPCFactory.instantiate(URI.create("String_Node_Str"),"String_Node_Str","String_Node_Str");
  try {
    xmlrpcClientInterface.call(Method.GET_MEDIA_LIBRARY,null);
  }
 catch (  NumberFormatException e) {
    return;
  }
  assertTrue("String_Node_Str",false);
}
Program: 14197
Project: 14197
Buggy source:
public void testNumberExceptionWithInvalidDouble() throws Exception {
  XMLRPCFactoryTest.setPrefixAllInstances("String_Node_Str");
  XMLRPCClientInterface xmlrpcClientInterface=XMLRPCFactory.instantiate(URI.create("String_Node_Str"),"String_Node_Str","String_Node_Str");
  try {
    xmlrpcClientInterface.call(ApiHelper.Methods.GET_MEDIA_LIBRARY,null);
  }
 catch (  NumberFormatException e) {
    return;
  }
  assertTrue("String_Node_Str",false);
}

Fixed version (ground truth):
public void testNumberExceptionWithInvalidDouble() throws Exception {
  XMLRPCFactoryTest.setPrefixAllInstances("String_Node_Str");
  XMLRPCClientInterface xmlrpcClientInterface=XMLRPCFactory.instantiate(URI.create("String_Node_Str"),"String_Node_Str","String_Node_Str");
  try {
    xmlrpcClientInterface.call(Method.GET_MEDIA_LIBRARY,null);
  }
 catch (  NumberFormatException e) {
    return;
  }
  assertTrue("String_Node_Str",false);
}