nus-yam/ex-repair huggingface dataset:
Program: 14065
Project: 14065
Buggy source:
@SuppressLint("String_Node_Str") @Override protected void configureWebView(){
  mWebView.getSettings().setJavaScriptEnabled(true);
  mWebView.getSettings().setDomStorageEnabled(true);
  WebViewClient webViewClient;
  Bundle extras=getIntent().getExtras();
  ArrayList<String> allowedURL=null;
  if (extras.getBoolean(DISABLE_LINKS_ON_PAGE,false)) {
    String addressToLoad=extras.getString(URL_TO_LOAD);
    String authURL=extras.getString(AUTHENTICATION_URL);
    allowedURL=new ArrayList<>();
    if (!TextUtils.isEmpty(addressToLoad)) {
      allowedURL.add(addressToLoad);
    }
    if (!TextUtils.isEmpty(authURL)) {
      allowedURL.add(authURL);
    }
  }
  if (getIntent().hasExtra(LOCAL_BLOG_ID)) {
    Blog blog=WordPress.getBlog(getIntent().getIntExtra(LOCAL_BLOG_ID,-1));
    if (blog == null) {
      AppLog.e(AppLog.T.UTILS,"String_Node_Str");
      finish();
    }
    webViewClient=new WPWebViewClient(blog,allowedURL,mAccountStore.getAccessToken());
  }
 else {
    webViewClient=new URLFilteredWebViewClient(allowedURL);
  }
  mWebView.setWebViewClient(webViewClient);
  mWebView.setWebChromeClient(new WPWebChromeClient(this,(ProgressBar)findViewById(R.id.progress_bar)));
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") @Override protected void configureWebView(){
  mWebView.getSettings().setJavaScriptEnabled(true);
  mWebView.getSettings().setDomStorageEnabled(true);
  WebViewClient webViewClient;
  Bundle extras=getIntent().getExtras();
  ArrayList<String> allowedURL=null;
  if (extras.getBoolean(DISABLE_LINKS_ON_PAGE,false)) {
    String addressToLoad=extras.getString(URL_TO_LOAD);
    String authURL=extras.getString(AUTHENTICATION_URL);
    allowedURL=new ArrayList<>();
    if (!TextUtils.isEmpty(addressToLoad)) {
      allowedURL.add(addressToLoad);
    }
    if (!TextUtils.isEmpty(authURL)) {
      allowedURL.add(authURL);
    }
  }
  if (getIntent().hasExtra(LOCAL_BLOG_ID)) {
    SiteModel site=mSiteStore.getSiteByLocalId(getIntent().getIntExtra(LOCAL_BLOG_ID,-1));
    if (site == null) {
      AppLog.e(AppLog.T.UTILS,"String_Node_Str");
      finish();
    }
    webViewClient=new WPWebViewClient(site,allowedURL,mAccountStore.getAccessToken());
  }
 else {
    webViewClient=new URLFilteredWebViewClient(allowedURL);
  }
  mWebView.setWebViewClient(webViewClient);
  mWebView.setWebChromeClient(new WPWebChromeClient(this,(ProgressBar)findViewById(R.id.progress_bar)));
}
Program: 14066
Project: 14066
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ((WordPress)getApplication()).component().inject(this);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  ((WordPress)getApplication()).component().inject(this);
  super.onCreate(savedInstanceState);
}
Program: 14067
Project: 14067
Buggy source:
/** 
 * Get the URL of the WordPress login page.
 * @return URL of the login page.
 */
public static String getSiteLoginUrl(SiteModel site){
  String loginURL=null;
  if (loginURL == null) {
    if (site.getUrl().lastIndexOf("String_Node_Str") != -1) {
      return site.getUrl().substring(0,site.getUrl().lastIndexOf("String_Node_Str")) + "String_Node_Str";
    }
 else {
      return site.getUrl().replace("String_Node_Str","String_Node_Str");
    }
  }
  return loginURL;
}

Fixed version (ground truth):
/** 
 * Get the URL of the WordPress login page.
 * @return URL of the login page.
 */
public static String getSiteLoginUrl(SiteModel site){
  String loginURL=null;
  if (loginURL == null) {
    if (site.getUrl() != null) {
      return site.getUrl() + "String_Node_Str";
    }
 else {
      return site.getXmlRpcUrl().replace("String_Node_Str","String_Node_Str");
    }
  }
  return loginURL;
}
Program: 14068
Project: 14068
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.post_preview_fragment,container,false);
  mWebView=(WebView)view.findViewById(R.id.webView);
  WPWebViewClient client=new WPWebViewClient(WordPress.wpDB.instantiateBlogByLocalId(mLocalBlogId),mAccountStore.getAccessToken());
  mWebView.setWebViewClient(client);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.post_preview_fragment,container,false);
  mWebView=(WebView)view.findViewById(R.id.webView);
  WPWebViewClient client=new WPWebViewClient(mSiteStore.getSiteByLocalId(mLocalBlogId),mAccountStore.getAccessToken());
  mWebView.setWebViewClient(client);
  return view;
}
Program: 14069
Project: 14069
Buggy source:
private static void openWPCOMURL(Activity activity,String url,Theme currentTheme,SiteModel site,Boolean isCurrentTheme){
  if (activity == null) {
    AppLog.e(AppLog.T.UTILS,"String_Node_Str");
    return;
  }
  if (TextUtils.isEmpty(url)) {
    AppLog.e(AppLog.T.UTILS,"String_Node_Str");
    Toast.makeText(activity,activity.getResources().getText(R.string.invalid_site_url_message),Toast.LENGTH_SHORT).show();
    return;
  }
  String authURL=ThemeWebActivity.getSiteLoginUrl(site);
  Intent intent=new Intent(activity,ThemeWebActivity.class);
  intent.putExtra(ThemeWebActivity.AUTHENTICATION_USER,site.getUsername());
  intent.putExtra(ThemeWebActivity.AUTHENTICATION_PASSWD,site.getPassword());
  intent.putExtra(ThemeWebActivity.URL_TO_LOAD,url);
  intent.putExtra(ThemeWebActivity.AUTHENTICATION_URL,authURL);
  intent.putExtra(ThemeWebActivity.LOCAL_BLOG_ID,site.getId());
  intent.putExtra(IS_PREMIUM_THEME,currentTheme.isPremium());
  intent.putExtra(IS_CURRENT_THEME,isCurrentTheme);
  intent.putExtra(THEME_NAME,currentTheme.getName());
  intent.putExtra(ThemeBrowserActivity.THEME_ID,currentTheme.getId());
  activity.startActivityForResult(intent,ThemeBrowserActivity.ACTIVATE_THEME);
}

Fixed version (ground truth):
private static void openWPCOMURL(Activity activity,String url,Theme currentTheme,SiteModel site,Boolean isCurrentTheme){
  if (activity == null) {
    AppLog.e(AppLog.T.UTILS,"String_Node_Str");
    return;
  }
  if (TextUtils.isEmpty(url)) {
    AppLog.e(AppLog.T.UTILS,"String_Node_Str");
    Toast.makeText(activity,activity.getResources().getText(R.string.invalid_site_url_message),Toast.LENGTH_SHORT).show();
    return;
  }
  String authURL=ThemeWebActivity.getSiteLoginUrl(site);
  Intent intent=new Intent(activity,ThemeWebActivity.class);
  intent.putExtra(WPWebViewActivity.URL_TO_LOAD,url);
  intent.putExtra(WPWebViewActivity.AUTHENTICATION_URL,authURL);
  intent.putExtra(WPWebViewActivity.LOCAL_BLOG_ID,site.getId());
  intent.putExtra(WPWebViewActivity.USE_GLOBAL_WPCOM_USER,true);
  intent.putExtra(IS_PREMIUM_THEME,currentTheme.isPremium());
  intent.putExtra(IS_CURRENT_THEME,isCurrentTheme);
  intent.putExtra(THEME_NAME,currentTheme.getName());
  intent.putExtra(ThemeBrowserActivity.THEME_ID,currentTheme.getId());
  activity.startActivityForResult(intent,ThemeBrowserActivity.ACTIVATE_THEME);
}
Program: 14070
Project: 14070
Buggy source:
public WPWebViewClient(Blog blog,List<String> urls,String token){
  super(urls);
  mBlog=blog;
  mToken=token;
}

Fixed version (ground truth):
public WPWebViewClient(SiteModel site,List<String> urls,String token){
  super(urls);
  mSite=site;
  mToken=token;
}
Program: 14071
Project: 14071
Buggy source:
@Override public WebResourceResponse shouldInterceptRequest(WebView view,String stringUrl){
  URL imageUrl=null;
  if (mBlog != null && mBlog.isPrivate() && UrlUtils.isImageUrl(stringUrl)) {
    try {
      imageUrl=new URL(UrlUtils.makeHttps(stringUrl));
    }
 catch (    MalformedURLException e) {
      AppLog.e(AppLog.T.READER,e);
    }
  }
  if (imageUrl != null && WPUrlUtils.safeToAddWordPressComAuthToken(imageUrl) && !TextUtils.isEmpty(mToken)) {
    try {
      HttpURLConnection urlConnection=(HttpURLConnection)imageUrl.openConnection();
      urlConnection.setRequestProperty("String_Node_Str","String_Node_Str" + mToken);
      urlConnection.setReadTimeout(WPRestClient.REST_TIMEOUT_MS);
      urlConnection.setConnectTimeout(WPRestClient.REST_TIMEOUT_MS);
      WebResourceResponse response=new WebResourceResponse(urlConnection.getContentType(),urlConnection.getContentEncoding(),urlConnection.getInputStream());
      return response;
    }
 catch (    ClassCastException e) {
      AppLog.e(AppLog.T.POSTS,"String_Node_Str" + stringUrl);
    }
catch (    MalformedURLException e) {
      AppLog.e(AppLog.T.POSTS,"String_Node_Str" + stringUrl);
    }
catch (    IOException e) {
      AppLog.e(AppLog.T.POSTS,"String_Node_Str" + e.getMessage());
    }
  }
  return super.shouldInterceptRequest(view,stringUrl);
}

Fixed version (ground truth):
@Override public WebResourceResponse shouldInterceptRequest(WebView view,String stringUrl){
  URL imageUrl=null;
  if (mSite != null && UrlUtils.isImageUrl(stringUrl)) {
    try {
      imageUrl=new URL(UrlUtils.makeHttps(stringUrl));
    }
 catch (    MalformedURLException e) {
      AppLog.e(AppLog.T.READER,e);
    }
  }
  if (imageUrl != null && WPUrlUtils.safeToAddWordPressComAuthToken(imageUrl) && !TextUtils.isEmpty(mToken)) {
    try {
      HttpURLConnection urlConnection=(HttpURLConnection)imageUrl.openConnection();
      urlConnection.setRequestProperty("String_Node_Str","String_Node_Str" + mToken);
      urlConnection.setReadTimeout(WPRestClient.REST_TIMEOUT_MS);
      urlConnection.setConnectTimeout(WPRestClient.REST_TIMEOUT_MS);
      WebResourceResponse response=new WebResourceResponse(urlConnection.getContentType(),urlConnection.getContentEncoding(),urlConnection.getInputStream());
      return response;
    }
 catch (    ClassCastException e) {
      AppLog.e(AppLog.T.POSTS,"String_Node_Str" + stringUrl);
    }
catch (    MalformedURLException e) {
      AppLog.e(AppLog.T.POSTS,"String_Node_Str" + stringUrl);
    }
catch (    IOException e) {
      AppLog.e(AppLog.T.POSTS,"String_Node_Str" + e.getMessage());
    }
  }
  return super.shouldInterceptRequest(view,stringUrl);
}
Program: 14072
Project: 14072
Buggy source:
private void removeSelectedPerson(){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  Person person=getCurrentPerson();
  if (person == null) {
    return;
  }
  String blogId=WordPress.getCurrentRemoteBlogId();
  if (blogId == null) {
    return;
  }
  final Person.PersonType personType=person.getPersonType();
  final String displayName=person.getDisplayName();
  PeopleUtils.RemoveUserCallback callback=new PeopleUtils.RemoveUserCallback(){
    @Override public void onSuccess(    long personID,    int localTableBlogId){
      if (personType == Person.PersonType.USER) {
        AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.PERSON_REMOVED);
      }
      Person person=PeopleTable.getUser(personID,localTableBlogId);
      if (person != null) {
        PeopleTable.deleteUser(personID,localTableBlogId);
      }
      String message=getString(R.string.person_removed,displayName);
      ToastUtils.showToast(PeopleManagementActivity.this,message,ToastUtils.Duration.LONG);
      navigateBackToPeopleListFragment();
      refreshPeopleListFragment();
    }
    @Override public void onError(){
      ToastUtils.showToast(PeopleManagementActivity.this,R.string.error_remove_user,ToastUtils.Duration.LONG);
    }
  }
;
  if (personType == Person.PersonType.FOLLOWER || personType == Person.PersonType.EMAIL_FOLLOWER) {
    PeopleUtils.removeFollower(blogId,person.getPersonID(),person.getLocalTableBlogId(),personType,callback);
  }
 else {
    PeopleUtils.removeUser(blogId,person.getPersonID(),person.getLocalTableBlogId(),callback);
  }
}

Fixed version (ground truth):
private void removeSelectedPerson(){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  Person person=getCurrentPerson();
  if (person == null) {
    return;
  }
  String blogId=WordPress.getCurrentRemoteBlogId();
  if (blogId == null) {
    return;
  }
  final Person.PersonType personType=person.getPersonType();
  final String displayName=person.getDisplayName();
  PeopleUtils.RemovePersonCallback callback=new PeopleUtils.RemovePersonCallback(){
    @Override public void onSuccess(    long personID,    int localTableBlogId){
      if (personType == Person.PersonType.USER) {
        AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.PERSON_REMOVED);
      }
      PeopleTable.deletePerson(personID,localTableBlogId,personType);
      String message=getString(R.string.person_removed,displayName);
      ToastUtils.showToast(PeopleManagementActivity.this,message,ToastUtils.Duration.LONG);
      navigateBackToPeopleListFragment();
      refreshPeopleListFragment();
    }
    @Override public void onError(){
      ToastUtils.showToast(PeopleManagementActivity.this,R.string.error_remove_user,ToastUtils.Duration.LONG);
    }
  }
;
  if (personType == Person.PersonType.FOLLOWER || personType == Person.PersonType.EMAIL_FOLLOWER) {
    PeopleUtils.removeFollower(blogId,person.getPersonID(),person.getLocalTableBlogId(),personType,callback);
  }
 else {
    PeopleUtils.removeUser(blogId,person.getPersonID(),person.getLocalTableBlogId(),callback);
  }
}
Program: 14073
Project: 14073
Buggy source:
@Override public void onSuccess(long personID,int localTableBlogId){
  if (personType == Person.PersonType.USER) {
    AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.PERSON_REMOVED);
  }
  Person person=PeopleTable.getUser(personID,localTableBlogId);
  if (person != null) {
    PeopleTable.deleteUser(personID,localTableBlogId);
  }
  String message=getString(R.string.person_removed,displayName);
  ToastUtils.showToast(PeopleManagementActivity.this,message,ToastUtils.Duration.LONG);
  navigateBackToPeopleListFragment();
  refreshPeopleListFragment();
}

Fixed version (ground truth):
@Override public void onSuccess(long personID,int localTableBlogId){
  if (personType == Person.PersonType.USER) {
    AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.PERSON_REMOVED);
  }
  PeopleTable.deletePerson(personID,localTableBlogId,personType);
  String message=getString(R.string.person_removed,displayName);
  ToastUtils.showToast(PeopleManagementActivity.this,message,ToastUtils.Duration.LONG);
  navigateBackToPeopleListFragment();
  refreshPeopleListFragment();
}
Program: 14074
Project: 14074
Buggy source:
public static void removeFollower(String blogId,final long personID,final int localTableBlogId,Person.PersonType personType,final RemoveUserCallback callback){
  com.wordpress.rest.RestRequest.Listener listener=new RestRequest.Listener(){
    @Override public void onResponse(    JSONObject jsonObject){
      if (jsonObject != null && callback != null) {
        boolean success=jsonObject.optBoolean("String_Node_Str");
        if (success) {
          callback.onSuccess(personID,localTableBlogId);
        }
 else {
          callback.onError();
        }
      }
    }
  }
;
  RestRequest.ErrorListener errorListener=new RestRequest.ErrorListener(){
    @Override public void onErrorResponse(    VolleyError volleyError){
      AppLog.e(T.API,volleyError);
      if (callback != null) {
        callback.onError();
      }
    }
  }
;
  String path;
  if (personType == Person.PersonType.EMAIL_FOLLOWER) {
    path=String.format("String_Node_Str",blogId,personID);
  }
 else {
    path=String.format("String_Node_Str",blogId,personID);
  }
  WordPress.getRestClientUtilsV1_1().post(path,listener,errorListener);
}

Fixed version (ground truth):
public static void removeFollower(String blogId,final long personID,final int localTableBlogId,Person.PersonType personType,final RemovePersonCallback callback){
  com.wordpress.rest.RestRequest.Listener listener=new RestRequest.Listener(){
    @Override public void onResponse(    JSONObject jsonObject){
      if (jsonObject != null && callback != null) {
        boolean success=jsonObject.optBoolean("String_Node_Str");
        if (success) {
          callback.onSuccess(personID,localTableBlogId);
        }
 else {
          callback.onError();
        }
      }
    }
  }
;
  RestRequest.ErrorListener errorListener=new RestRequest.ErrorListener(){
    @Override public void onErrorResponse(    VolleyError volleyError){
      AppLog.e(T.API,volleyError);
      if (callback != null) {
        callback.onError();
      }
    }
  }
;
  String path;
  if (personType == Person.PersonType.EMAIL_FOLLOWER) {
    path=String.format("String_Node_Str",blogId,personID);
  }
 else {
    path=String.format("String_Node_Str",blogId,personID);
  }
  WordPress.getRestClientUtilsV1_1().post(path,listener,errorListener);
}
Program: 14075
Project: 14075
Buggy source:
public static void removeUser(String blogId,final long personID,final int localTableBlogId,final RemoveUserCallback callback){
  com.wordpress.rest.RestRequest.Listener listener=new RestRequest.Listener(){
    @Override public void onResponse(    JSONObject jsonObject){
      if (jsonObject != null && callback != null) {
        boolean success=jsonObject.optBoolean("String_Node_Str");
        if (success) {
          callback.onSuccess(personID,localTableBlogId);
        }
 else {
          callback.onError();
        }
      }
    }
  }
;
  RestRequest.ErrorListener errorListener=new RestRequest.ErrorListener(){
    @Override public void onErrorResponse(    VolleyError volleyError){
      AppLog.e(T.API,volleyError);
      if (callback != null) {
        callback.onError();
      }
    }
  }
;
  String path=String.format("String_Node_Str",blogId,personID);
  WordPress.getRestClientUtilsV1_1().post(path,listener,errorListener);
}

Fixed version (ground truth):
public static void removeUser(String blogId,final long personID,final int localTableBlogId,final RemovePersonCallback callback){
  com.wordpress.rest.RestRequest.Listener listener=new RestRequest.Listener(){
    @Override public void onResponse(    JSONObject jsonObject){
      if (jsonObject != null && callback != null) {
        boolean success=jsonObject.optBoolean("String_Node_Str");
        if (success) {
          callback.onSuccess(personID,localTableBlogId);
        }
 else {
          callback.onError();
        }
      }
    }
  }
;
  RestRequest.ErrorListener errorListener=new RestRequest.ErrorListener(){
    @Override public void onErrorResponse(    VolleyError volleyError){
      AppLog.e(T.API,volleyError);
      if (callback != null) {
        callback.onError();
      }
    }
  }
;
  String path=String.format("String_Node_Str",blogId,personID);
  WordPress.getRestClientUtilsV1_1().post(path,listener,errorListener);
}
Program: 14077
Project: 14077
Buggy source:
void beginRender(){
  final Handler handler=new Handler();
  mRenderBuilder=new StringBuilder(getPostContent());
  new Thread(){
    @Override public void run(){
      if (!mResourceVars.isWideDisplay) {
        resizeImages();
      }
      resizeIframes();
      final String htmlContent=formatPostContentForWebView(mRenderBuilder.toString(),mResourceVars.isWideDisplay);
      mRenderBuilder=null;
      handler.post(new Runnable(){
        @Override public void run(){
          renderHtmlContent(htmlContent);
        }
      }
);
    }
  }
.start();
}

Fixed version (ground truth):
void beginRender(){
  final Handler handler=new Handler();
  mRenderBuilder=new StringBuilder(getPostContent());
  new Thread(){
    @Override public void run(){
      final boolean renderAsTiledGallery=shouldRenderAsTiledGallery();
      if (!renderAsTiledGallery) {
        resizeImages();
      }
      resizeIframes();
      final String htmlContent=formatPostContentForWebView(mRenderBuilder.toString(),renderAsTiledGallery);
      mRenderBuilder=null;
      handler.post(new Runnable(){
        @Override public void run(){
          renderHtmlContent(htmlContent);
        }
      }
);
    }
  }
.start();
}
Program: 14078
Project: 14078
Buggy source:
public static void save(String table,Person person,SQLiteDatabase database){
  ContentValues values=new ContentValues();
  values.put("String_Node_Str",person.getPersonID());
  values.put("String_Node_Str",person.getLocalTableBlogId());
  values.put("String_Node_Str",person.getUsername());
  values.put("String_Node_Str",person.getDisplayName());
  values.put("String_Node_Str",person.getAvatarUrl());
  values.put("String_Node_Str",person.getRole());
  values.put("String_Node_Str",person.getSubscribed());
  database.insertWithOnConflict(table,null,values,SQLiteDatabase.CONFLICT_REPLACE);
}

Fixed version (ground truth):
private static void save(String table,Person person,SQLiteDatabase database){
  ContentValues values=new ContentValues();
  values.put("String_Node_Str",person.getPersonID());
  values.put("String_Node_Str",person.getLocalTableBlogId());
  values.put("String_Node_Str",person.getUsername());
  values.put("String_Node_Str",person.getDisplayName());
  values.put("String_Node_Str",person.getAvatarUrl());
  values.put("String_Node_Str",person.getRole());
  values.put("String_Node_Str",person.getSubscribed());
  database.insertWithOnConflict(table,null,values,SQLiteDatabase.CONFLICT_REPLACE);
}
Program: 14079
Project: 14079
Buggy source:
private static void savePeople(String table,List<Person> peopleList,int localTableBlogId,boolean isFreshList){
  getWritableDb().beginTransaction();
  try {
    if (isFreshList) {
      PeopleTable.deletePeople(table,localTableBlogId);
    }
    for (    Person person : peopleList) {
      PeopleTable.save(table,person);
    }
    getWritableDb().setTransactionSuccessful();
  }
  finally {
    getWritableDb().endTransaction();
  }
}

Fixed version (ground truth):
private static void savePeople(String table,List<Person> peopleList,int localTableBlogId,boolean isFreshList){
  getWritableDb().beginTransaction();
  try {
    if (isFreshList) {
      PeopleTable.deletePeople(table,localTableBlogId);
    }
    for (    Person person : peopleList) {
      PeopleTable.save(table,person,getWritableDb());
    }
    getWritableDb().setTransactionSuccessful();
  }
  finally {
    getWritableDb().endTransaction();
  }
}
Program: 14080
Project: 14080
Buggy source:
public void onEventMainThread(RoleChangeDialogFragment.RoleChangeEvent event){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  final Person person=PeopleTable.getPerson(event.personID,event.localTableBlogId,false,false);
  if (person == null || event.newRole == null || event.newRole.equalsIgnoreCase(person.getRole())) {
    return;
  }
  final PersonDetailFragment personDetailFragment=getDetailFragment();
  if (personDetailFragment != null) {
    personDetailFragment.changeRole(event.newRole);
  }
  PeopleUtils.updateRole(person.getBlogId(),person.getPersonID(),event.newRole,event.localTableBlogId,new PeopleUtils.UpdateUserCallback(){
    @Override public void onSuccess(    Person person){
      AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.PERSON_UPDATED);
      PeopleTable.save(person);
      refreshOnScreenFragmentDetails();
    }
    @Override public void onError(){
      if (personDetailFragment != null) {
        personDetailFragment.refreshPersonDetails();
      }
      ToastUtils.showToast(PeopleManagementActivity.this,R.string.error_update_role,ToastUtils.Duration.LONG);
    }
  }
);
}

Fixed version (ground truth):
public void onEventMainThread(RoleChangeDialogFragment.RoleChangeEvent event){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  final Person person=PeopleTable.getUser(event.personID,event.localTableBlogId);
  if (person == null || event.newRole == null || event.newRole.equalsIgnoreCase(person.getRole())) {
    return;
  }
  final PersonDetailFragment personDetailFragment=getDetailFragment();
  if (personDetailFragment != null) {
    personDetailFragment.changeRole(event.newRole);
  }
  PeopleUtils.updateRole(person.getBlogId(),person.getPersonID(),event.newRole,event.localTableBlogId,new PeopleUtils.UpdateUserCallback(){
    @Override public void onSuccess(    Person person){
      AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.PERSON_UPDATED);
      PeopleTable.saveUser(person);
      refreshOnScreenFragmentDetails();
    }
    @Override public void onError(){
      if (personDetailFragment != null) {
        personDetailFragment.refreshPersonDetails();
      }
      ToastUtils.showToast(PeopleManagementActivity.this,R.string.error_update_role,ToastUtils.Duration.LONG);
    }
  }
);
}
Program: 14082
Project: 14082
Buggy source:
private void removeSelectedPerson(){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  Person person=getCurrentPerson();
  if (person == null) {
    return;
  }
  final boolean isFollower=person.isFollower();
  final boolean isEmailFollower=person.isEmailFollower();
  final boolean isViewer=person.isViewer();
  final String displayName=person.getDisplayName();
  PeopleUtils.RemoveUserCallback callback=new PeopleUtils.RemoveUserCallback(){
    @Override public void onSuccess(    long personID,    int localTableBlogId){
      if (!isFollower && !isEmailFollower && !isViewer) {
        AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.PERSON_REMOVED);
      }
      Person person=PeopleTable.getPerson(personID,localTableBlogId,isFollower,isViewer);
      if (person != null) {
        PeopleTable.deletePerson(personID,localTableBlogId,isFollower,isViewer);
      }
      String message=getString(R.string.person_removed,displayName);
      ToastUtils.showToast(PeopleManagementActivity.this,message,ToastUtils.Duration.LONG);
      navigateBackToPeopleListFragment();
      refreshPeopleListFragment();
    }
    @Override public void onError(){
      ToastUtils.showToast(PeopleManagementActivity.this,R.string.error_remove_user,ToastUtils.Duration.LONG);
    }
  }
;
  if (isFollower || isEmailFollower) {
    PeopleUtils.removeFollower(person.getBlogId(),person.getPersonID(),person.getLocalTableBlogId(),isEmailFollower,callback);
  }
 else {
    PeopleUtils.removeUser(person.getBlogId(),person.getPersonID(),person.getLocalTableBlogId(),callback);
  }
}

Fixed version (ground truth):
private void removeSelectedPerson(){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  Person person=getCurrentPerson();
  if (person == null) {
    return;
  }
  final boolean isFollower=person.isFollower();
  final boolean isEmailFollower=person.isEmailFollower();
  final String displayName=person.getDisplayName();
  PeopleUtils.RemoveUserCallback callback=new PeopleUtils.RemoveUserCallback(){
    @Override public void onSuccess(    long personID,    int localTableBlogId){
      if (!isFollower && !isEmailFollower) {
        AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.PERSON_REMOVED);
      }
      Person person=PeopleTable.getUser(personID,localTableBlogId);
      if (person != null) {
        PeopleTable.deleteUser(personID,localTableBlogId);
      }
      String message=getString(R.string.person_removed,displayName);
      ToastUtils.showToast(PeopleManagementActivity.this,message,ToastUtils.Duration.LONG);
      navigateBackToPeopleListFragment();
      refreshPeopleListFragment();
    }
    @Override public void onError(){
      ToastUtils.showToast(PeopleManagementActivity.this,R.string.error_remove_user,ToastUtils.Duration.LONG);
    }
  }
;
  if (isFollower || isEmailFollower) {
    PeopleUtils.removeFollower(person.getBlogId(),person.getPersonID(),person.getLocalTableBlogId(),isEmailFollower,callback);
  }
 else {
    PeopleUtils.removeUser(person.getBlogId(),person.getPersonID(),person.getLocalTableBlogId(),callback);
  }
}
Program: 14083
Project: 14083
Buggy source:
@Override public void onPersonSelected(Person person){
  PersonDetailFragment personDetailFragment=getDetailFragment();
  long personID=person.getPersonID();
  int localTableBlogID=person.getLocalTableBlogId();
  boolean isFollower=person.isFollower();
  boolean isViewer=person.isViewer();
  if (personDetailFragment == null) {
    personDetailFragment=PersonDetailFragment.newInstance(personID,localTableBlogID,isFollower,isViewer);
  }
 else {
    personDetailFragment.setPersonDetails(personID,localTableBlogID);
  }
  if (!personDetailFragment.isAdded()) {
    AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.OPENED_PERSON);
    FragmentTransaction fragmentTransaction=getFragmentManager().beginTransaction();
    fragmentTransaction.replace(R.id.fragment_container,personDetailFragment,KEY_PERSON_DETAIL_FRAGMENT);
    fragmentTransaction.addToBackStack(null);
    ActionBar actionBar=getSupportActionBar();
    if (actionBar != null) {
      actionBar.setTitle("String_Node_Str");
    }
    removeToolbarElevation();
    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.replace(R.id.fragment_container,personDetailFragment,KEY_PERSON_DETAIL_FRAGMENT);
    fragmentTransaction.addToBackStack(null);
    ActionBar actionBar=getSupportActionBar();
    if (actionBar != null) {
      actionBar.setTitle("String_Node_Str");
    }
    removeToolbarElevation();
    fragmentTransaction.commit();
  }
}
Program: 14084
Project: 14084
Buggy source:
@Override public void onSuccess(long personID,int localTableBlogId){
  if (!isFollower && !isEmailFollower && !isViewer) {
    AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.PERSON_REMOVED);
  }
  Person person=PeopleTable.getPerson(personID,localTableBlogId,isFollower,isViewer);
  if (person != null) {
    PeopleTable.deletePerson(personID,localTableBlogId,isFollower,isViewer);
  }
  String message=getString(R.string.person_removed,displayName);
  ToastUtils.showToast(PeopleManagementActivity.this,message,ToastUtils.Duration.LONG);
  navigateBackToPeopleListFragment();
  refreshPeopleListFragment();
}

Fixed version (ground truth):
@Override public void onSuccess(long personID,int localTableBlogId){
  if (!isFollower && !isEmailFollower) {
    AnalyticsUtils.trackWithCurrentBlogDetails(AnalyticsTracker.Stat.PERSON_REMOVED);
  }
  Person person=PeopleTable.getUser(personID,localTableBlogId);
  if (person != null) {
    PeopleTable.deleteUser(personID,localTableBlogId);
  }
  String message=getString(R.string.person_removed,displayName);
  ToastUtils.showToast(PeopleManagementActivity.this,message,ToastUtils.Duration.LONG);
  navigateBackToPeopleListFragment();
  refreshPeopleListFragment();
}
Program: 14085
Project: 14085
Buggy source:
public static PersonDetailFragment newInstance(long personID,int localTableBlogID,boolean isFollower,boolean isViewer){
  PersonDetailFragment personDetailFragment=new PersonDetailFragment();
  Bundle bundle=new Bundle();
  bundle.putLong(ARG_PERSON_ID,personID);
  bundle.putInt(ARG_LOCAL_TABLE_BLOG_ID,localTableBlogID);
  bundle.putBoolean(ARG_IS_FOLLOWER,isFollower);
  bundle.putBoolean(ARG_IS_VIEWER,isViewer);
  personDetailFragment.setArguments(bundle);
  return personDetailFragment;
}

Fixed version (ground truth):
public static PersonDetailFragment newInstance(long personID,int localTableBlogID){
  PersonDetailFragment personDetailFragment=new PersonDetailFragment();
  Bundle bundle=new Bundle();
  bundle.putLong(ARG_PERSON_ID,personID);
  bundle.putInt(ARG_LOCAL_TABLE_BLOG_ID,localTableBlogID);
  personDetailFragment.setArguments(bundle);
  return personDetailFragment;
}
Program: 14086
Project: 14086
Buggy source:
public Person loadPerson(){
  return PeopleTable.getPerson(mPersonID,mLocalTableBlogID,mIsFollower,mIsViewer);
}

Fixed version (ground truth):
public Person loadPerson(){
  return PeopleTable.getUser(mPersonID,mLocalTableBlogID);
}
Program: 14087
Project: 14087
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  final ViewGroup rootView=(ViewGroup)inflater.inflate(R.layout.person_detail_fragment,container,false);
  mPersonID=getArguments().getLong(ARG_PERSON_ID);
  mLocalTableBlogID=getArguments().getInt(ARG_LOCAL_TABLE_BLOG_ID);
  mIsFollower=getArguments().getBoolean(ARG_IS_FOLLOWER);
  mIsViewer=getArguments().getBoolean(ARG_IS_VIEWER);
  mAvatarImageView=(WPNetworkImageView)rootView.findViewById(R.id.person_avatar);
  mDisplayNameTextView=(TextView)rootView.findViewById(R.id.person_display_name);
  mUsernameTextView=(TextView)rootView.findViewById(R.id.person_username);
  mRoleContainer=(LinearLayout)rootView.findViewById(R.id.person_role_container);
  mRoleTextView=(TextView)rootView.findViewById(R.id.person_role);
  mSubscribedTextView=(TextView)rootView.findViewById(R.id.follower_subscribed_date);
  Account account=AccountHelper.getDefaultAccount();
  boolean isCurrentUser=account.getUserId() == mPersonID;
  Blog blog=WordPress.getBlog(mLocalTableBlogID);
  if (!isCurrentUser && blog != null && blog.hasCapability(Capability.REMOVE_USERS)) {
    setHasOptionsMenu(true);
  }
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  final ViewGroup rootView=(ViewGroup)inflater.inflate(R.layout.person_detail_fragment,container,false);
  mPersonID=getArguments().getLong(ARG_PERSON_ID);
  mLocalTableBlogID=getArguments().getInt(ARG_LOCAL_TABLE_BLOG_ID);
  mAvatarImageView=(WPNetworkImageView)rootView.findViewById(R.id.person_avatar);
  mDisplayNameTextView=(TextView)rootView.findViewById(R.id.person_display_name);
  mUsernameTextView=(TextView)rootView.findViewById(R.id.person_username);
  mRoleContainer=(LinearLayout)rootView.findViewById(R.id.person_role_container);
  mRoleTextView=(TextView)rootView.findViewById(R.id.person_role);
  mSubscribedTextView=(TextView)rootView.findViewById(R.id.follower_subscribed_date);
  Account account=AccountHelper.getDefaultAccount();
  boolean isCurrentUser=account.getUserId() == mPersonID;
  Blog blog=WordPress.getBlog(mLocalTableBlogID);
  if (!isCurrentUser && blog != null && blog.hasCapability(Capability.REMOVE_USERS)) {
    setHasOptionsMenu(true);
  }
  return rootView;
}
Program: 14088
Project: 14088
Buggy source:
public ReaderWebView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  init(context,null);
}

Fixed version (ground truth):
public ReaderWebView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  init(context,attrs);
}
Program: 14089
Project: 14089
Buggy source:
@Override public String onShowEmptyViewMessage(EmptyViewMessageType emptyViewMsgType){
  if (emptyViewMsgType == EmptyViewMessageType.NO_CONTENT) {
    if (mPeopleListFilter == null) {
      return "String_Node_Str";
    }
 else {
switch (mPeopleListFilter) {
case FOLLOWERS:
        return getString(R.string.people_empty_list_filtered_followers);
case EMAIL_FOLLOWERS:
      return getString(R.string.people_empty_list_filtered_email_followers);
case VIEWERS:
    return getString(R.string.people_empty_list_filtered_viewers);
default :
  return "String_Node_Str";
}
}
}
 else {
int stringId=0;
switch (emptyViewMsgType) {
case LOADING:
stringId=R.string.people_fetching;
break;
case NETWORK_ERROR:
stringId=R.string.no_network_message;
break;
case GENERIC_ERROR:
switch (mPeopleListFilter) {
case TEAM:
stringId=R.string.error_fetch_users_list;
break;
case FOLLOWERS:
stringId=R.string.error_fetch_followers_list;
break;
case EMAIL_FOLLOWERS:
stringId=R.string.error_fetch_viewers_list;
break;
}
break;
}
return getString(stringId);
}
}

Fixed version (ground truth):
@Override public String onShowEmptyViewMessage(EmptyViewMessageType emptyViewMsgType){
  if (emptyViewMsgType == EmptyViewMessageType.NO_CONTENT) {
    if (mPeopleListFilter == null) {
      return "String_Node_Str";
    }
 else {
switch (mPeopleListFilter) {
case FOLLOWERS:
        return getString(R.string.people_empty_list_filtered_followers);
case EMAIL_FOLLOWERS:
      return getString(R.string.people_empty_list_filtered_email_followers);
case VIEWERS:
    return getString(R.string.people_empty_list_filtered_viewers);
default :
  return "String_Node_Str";
}
}
}
 else {
int stringId=0;
switch (emptyViewMsgType) {
case LOADING:
stringId=R.string.people_fetching;
break;
case NETWORK_ERROR:
stringId=R.string.no_network_message;
break;
case GENERIC_ERROR:
switch (mPeopleListFilter) {
case TEAM:
stringId=R.string.error_fetch_users_list;
break;
case FOLLOWERS:
stringId=R.string.error_fetch_followers_list;
break;
case EMAIL_FOLLOWERS:
stringId=R.string.error_fetch_email_followers_list;
break;
case VIEWERS:
stringId=R.string.error_fetch_viewers_list;
break;
}
break;
}
return getString(stringId);
}
}
Program: 14091
Project: 14091
Buggy source:
public ReaderThumbnailStrip(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  super(context,attrs,defStyleAttr,defStyleRes);
  initView(context);
}

Fixed version (ground truth):
@TargetApi(Build.VERSION_CODES.LOLLIPOP) public ReaderThumbnailStrip(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  super(context,attrs,defStyleAttr,defStyleRes);
  initView(context);
}
Program: 14092
Project: 14092
Buggy source:
public void initView(Context context){
  mView=inflate(context,R.layout.reader_thumbnail_strip,this);
  mContainer=(LinearLayout)mView.findViewById(R.id.thumbnail_strip_container);
  mThumbnailSize=context.getResources().getDimensionPixelSize(R.dimen.reader_thumbnail_strip_image_size);
  mCountStr=context.getResources().getString(R.string.reader_label_image_count);
}

Fixed version (ground truth):
private void initView(Context context){
  mView=inflate(context,R.layout.reader_thumbnail_strip,this);
  mContainer=(LinearLayout)mView.findViewById(R.id.thumbnail_strip_container);
  mThumbnailSize=context.getResources().getDimensionPixelSize(R.dimen.reader_thumbnail_strip_image_size);
  mCountStr=context.getResources().getString(R.string.reader_label_image_count);
}
Program: 14093
Project: 14093
Buggy source:
public void loadThumbnails(@NonNull final ReaderPost post){
  mContainer.removeAllViews();
  ReaderImageScanner scanner=new ReaderImageScanner(post.getText(),post.isPrivate);
  final ReaderImageList imageList=new ReaderImageScanner(post.getText(),post.isPrivate).getImageList(ReaderPhotoViewerActivity.MIN_IMAGE_WIDTH);
  if (imageList.size() < MIN_IMAGE_COUNT) {
    fadeOut();
    return;
  }
  int numAdded=0;
  LayoutInflater inflater=LayoutInflater.from(getContext());
  for (  final String imageUrl : imageList) {
    View view=inflater.inflate(R.layout.reader_thumbnail_strip_image,mContainer,false);
    WPNetworkImageView imageView=(WPNetworkImageView)view.findViewById(R.id.thumbnail_strip_image);
    mContainer.addView(view);
    String photonUrl=PhotonUtils.getPhotonImageUrl(imageUrl,mThumbnailSize,mThumbnailSize);
    imageView.setImageUrl(photonUrl,WPNetworkImageView.ImageType.PHOTO);
    numAdded++;
    if (numAdded >= MAX_IMAGE_COUNT) {
      break;
    }
  }
  View labelView=inflater.inflate(R.layout.reader_thumbnail_strip_labels,mContainer,false);
  TextView txtCount=(TextView)labelView.findViewById(R.id.text_gallery_count);
  txtCount.setText(String.format(mCountStr,imageList.size()));
  mContainer.addView(labelView);
  mView.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View view){
      ReaderActivityLauncher.showReaderPhotoViewer(view.getContext(),imageList.get(0),post.getText(),view,post.isPrivate,0,0);
    }
  }
);
  fadeIn();
}

Fixed version (ground truth):
public void loadThumbnails(@NonNull final ReaderPost post){
  mContainer.removeAllViews();
  final ReaderImageList imageList=new ReaderImageScanner(post.getText(),post.isPrivate).getImageList(ReaderPhotoViewerActivity.MIN_IMAGE_WIDTH);
  if (imageList.size() < MIN_IMAGE_COUNT) {
    fadeOut();
    return;
  }
  int numAdded=0;
  LayoutInflater inflater=LayoutInflater.from(getContext());
  for (  final String imageUrl : imageList) {
    View view=inflater.inflate(R.layout.reader_thumbnail_strip_image,mContainer,false);
    WPNetworkImageView imageView=(WPNetworkImageView)view.findViewById(R.id.thumbnail_strip_image);
    mContainer.addView(view);
    String photonUrl=PhotonUtils.getPhotonImageUrl(imageUrl,mThumbnailSize,mThumbnailSize);
    imageView.setImageUrl(photonUrl,WPNetworkImageView.ImageType.PHOTO);
    numAdded++;
    if (numAdded >= MAX_IMAGE_COUNT) {
      break;
    }
  }
  View labelView=inflater.inflate(R.layout.reader_thumbnail_strip_labels,mContainer,false);
  TextView txtCount=(TextView)labelView.findViewById(R.id.text_gallery_count);
  txtCount.setText(String.format(mCountStr,imageList.size()));
  mContainer.addView(labelView);
  mView.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View view){
      ReaderActivityLauncher.showReaderPhotoViewer(view.getContext(),imageList.get(0),post.getText(),view,post.isPrivate,0,0);
    }
  }
);
  fadeIn();
}
Program: 14094
Project: 14094
Buggy source:
@Override protected CommentList doInBackground(Void... args){
  if (!isAdded()) {
    return null;
  }
  final Blog blog=WordPress.getCurrentBlog();
  if (blog == null) {
    mErrorType=ErrorType.INVALID_CURRENT_BLOG;
    return null;
  }
  Map<String,Object> hPost=new HashMap<>();
  if (mIsLoadingMore) {
    int numExisting=getAdapter().getItemCount();
    hPost.put("String_Node_Str",numExisting);
    hPost.put("String_Node_Str",COMMENTS_PER_PAGE);
  }
 else {
    hPost.put("String_Node_Str",COMMENTS_PER_PAGE);
  }
  if (mStatusFilter != null) {
    if (!mStatusFilter.equals(CommentStatus.UNKNOWN)) {
      hPost.put("String_Node_Str",CommentStatus.toString(mStatusFilter));
    }
  }
  Object[] params={blog.getRemoteBlogId(),blog.getUsername(),blog.getPassword(),hPost};
  try {
    return ApiHelper.refreshComments(blog,params,new ApiHelper.DatabasePersistCallback(){
      @Override public void onDataReadyToSave(      List list){
        int localBlogId=blog.getLocalTableBlogId();
        CommentTable.deleteCommentsForBlogWithFilter(localBlogId,mStatusFilter);
        CommentTable.saveComments(localBlogId,(CommentList)list);
      }
    }
);
  }
 catch (  XMLRPCFault xmlrpcFault) {
    mErrorType=ErrorType.UNKNOWN_ERROR;
    if (xmlrpcFault.getFaultCode() == 401) {
      mErrorType=ErrorType.UNAUTHORIZED;
    }
  }
catch (  Exception e) {
    mErrorType=ErrorType.UNKNOWN_ERROR;
  }
  return null;
}

Fixed version (ground truth):
@Override protected CommentList doInBackground(Void... args){
  if (!isAdded()) {
    return null;
  }
  final Blog blog=WordPress.getCurrentBlog();
  if (blog == null) {
    mErrorType=ErrorType.INVALID_CURRENT_BLOG;
    return null;
  }
  Map<String,Object> hPost=new HashMap<>();
  if (mIsLoadingMore) {
    int numExisting=getAdapter().getItemCount();
    hPost.put("String_Node_Str",numExisting);
    hPost.put("String_Node_Str",COMMENTS_PER_PAGE);
  }
 else {
    hPost.put("String_Node_Str",COMMENTS_PER_PAGE);
  }
  if (mStatusFilter != null) {
    if (!mStatusFilter.equals(CommentStatus.UNKNOWN)) {
      hPost.put("String_Node_Str",CommentStatus.toString(mStatusFilter));
    }
  }
  Object[] params={blog.getRemoteBlogId(),blog.getUsername(),blog.getPassword(),hPost};
  try {
    return ApiHelper.refreshComments(blog,params,new ApiHelper.DatabasePersistCallback(){
      @Override public void onDataReadyToSave(      List list){
        int localBlogId=blog.getLocalTableBlogId();
        if (!mIsLoadingMore) {
          CommentTable.deleteCommentsForBlogWithFilter(localBlogId,mStatusFilter);
        }
        CommentTable.saveComments(localBlogId,(CommentList)list);
      }
    }
);
  }
 catch (  XMLRPCFault xmlrpcFault) {
    mErrorType=ErrorType.UNKNOWN_ERROR;
    if (xmlrpcFault.getFaultCode() == 401) {
      mErrorType=ErrorType.UNAUTHORIZED;
    }
  }
catch (  Exception e) {
    mErrorType=ErrorType.UNKNOWN_ERROR;
  }
  return null;
}
Program: 14095
Project: 14095
Buggy source:
@Override public void onDataReadyToSave(List list){
  int localBlogId=blog.getLocalTableBlogId();
  CommentTable.deleteCommentsForBlogWithFilter(localBlogId,mStatusFilter);
  CommentTable.saveComments(localBlogId,(CommentList)list);
}

Fixed version (ground truth):
@Override public void onDataReadyToSave(List list){
  int localBlogId=blog.getLocalTableBlogId();
  if (!mIsLoadingMore) {
    CommentTable.deleteCommentsForBlogWithFilter(localBlogId,mStatusFilter);
  }
  CommentTable.saveComments(localBlogId,(CommentList)list);
}
Program: 14096
Project: 14096
Buggy source:
public void hidePost(PostsListPost post){
  mHiddenPosts.add(post);
  int position=mPosts.indexOfPost(post);
  if (position > -1) {
    mPosts.remove(position);
    if (mPosts.size() > 0) {
      notifyItemRemoved(position);
    }
 else {
      notifyDataSetChanged();
    }
  }
}

Fixed version (ground truth):
public void hidePost(PostsListPost post){
  mHiddenPosts.add(post);
  int position=mPosts.indexOfPost(post);
  if (position > -1) {
    mPosts.remove(position);
    if (mPosts.size() > 0) {
      notifyItemRemoved(position);
      if (mIsPage) {
        notifyItemChanged(position);
      }
    }
 else {
      notifyDataSetChanged();
    }
  }
}
Program: 14097
Project: 14097
Buggy source:
public PageViewHolder(View view){
  super(view);
  txtTitle=(TextView)view.findViewById(R.id.text_title);
  txtStatus=(TextView)view.findViewById(R.id.text_status);
  btnMore=view.findViewById(R.id.btn_more);
  dividerTop=view.findViewById(R.id.divider_top);
  dateHeader=(ViewGroup)view.findViewById(R.id.header_date);
  txtDate=(TextView)dateHeader.findViewById(R.id.text_date);
}

Fixed version (ground truth):
public PageViewHolder(View view){
  super(view);
  txtTitle=(TextView)view.findViewById(R.id.text_title);
  txtStatus=(TextView)view.findViewById(R.id.text_status);
  btnMore=view.findViewById(R.id.btn_more);
  dividerTop=view.findViewById(R.id.divider_top);
  dateHeader=(ViewGroup)view.findViewById(R.id.header_date);
  txtDate=(TextView)dateHeader.findViewById(R.id.text_date);
  disabledOverlay=view.findViewById(R.id.disabled_overlay);
}
Program: 14099
Project: 14099
Buggy source:
public static void followFeedByUrl(final String feedUrl,final ActionListener actionListener){
  if (TextUtils.isEmpty(feedUrl)) {
    if (actionListener != null) {
      actionListener.onActionResult(false);
    }
    return;
  }
  ReaderBlog blogInfo=ReaderBlogTable.getFeedInfo(ReaderBlogTable.getFeedIdFromUrl(feedUrl));
  if (blogInfo != null) {
    internalFollowFeed(blogInfo.feedId,blogInfo.getFeedUrl(),true,actionListener);
    return;
  }
  updateFeedInfo(0,feedUrl,new UpdateBlogInfoListener(){
    @Override public void onResult(    ReaderBlog blogInfo){
      if (blogInfo != null) {
        internalFollowFeed(blogInfo.feedId,blogInfo.getFeedUrl(),true,actionListener);
      }
 else       if (actionListener != null) {
        actionListener.onActionResult(false);
      }
    }
  }
);
}

Fixed version (ground truth):
public static void followFeedByUrl(final String feedUrl,final ActionListener actionListener){
  if (TextUtils.isEmpty(feedUrl)) {
    ReaderActions.callActionListener(actionListener,false);
    return;
  }
  ReaderBlog blogInfo=ReaderBlogTable.getFeedInfo(ReaderBlogTable.getFeedIdFromUrl(feedUrl));
  if (blogInfo != null) {
    internalFollowFeed(blogInfo.feedId,blogInfo.getFeedUrl(),true,actionListener);
    return;
  }
  updateFeedInfo(0,feedUrl,new UpdateBlogInfoListener(){
    @Override public void onResult(    ReaderBlog blogInfo){
      long feedIdToFollow=blogInfo != null ? blogInfo.feedId : 0;
      String feedUrlToFollow=(blogInfo != null && blogInfo.hasFeedUrl()) ? blogInfo.getFeedUrl() : feedUrl;
      internalFollowFeed(feedIdToFollow,feedUrlToFollow,true,actionListener);
    }
  }
);
}
Program: 14100
Project: 14100
Buggy source:
@Override public void onResult(ReaderBlog blogInfo){
  if (blogInfo != null) {
    internalFollowFeed(blogInfo.feedId,blogInfo.getFeedUrl(),true,actionListener);
  }
 else   if (actionListener != null) {
    actionListener.onActionResult(false);
  }
}

Fixed version (ground truth):
@Override public void onResult(ReaderBlog blogInfo){
  long feedIdToFollow=blogInfo != null ? blogInfo.feedId : 0;
  String feedUrlToFollow=(blogInfo != null && blogInfo.hasFeedUrl()) ? blogInfo.getFeedUrl() : feedUrl;
  internalFollowFeed(feedIdToFollow,feedUrlToFollow,true,actionListener);
}