nus-yam/ex-repair huggingface dataset:
Program: 13373
Project: 13373
Buggy source:
void trackPluginListOpened(PluginListType listType){
  if (listType == PluginListType.SEARCH) {
    AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.PLUGIN_SEARCH_PERFORMED,mViewModel.getSite());
    return;
  }
  Map<String,Object> properties=new HashMap<>();
  String type=null;
switch (listType) {
case SITE:
    type="String_Node_Str";
  break;
case FEATURED:
type="String_Node_Str";
break;
case POPULAR:
type="String_Node_Str";
break;
case NEW:
type="String_Node_Str";
break;
}
properties.put("String_Node_Str",type);
AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.OPENED_PLUGIN_LIST,mViewModel.getSite(),properties);
}

Fixed version (ground truth):
private void trackPluginListOpened(PluginListType listType){
  if (listType == PluginListType.SEARCH) {
    AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.PLUGIN_SEARCH_PERFORMED,mViewModel.getSite());
    return;
  }
  Map<String,Object> properties=new HashMap<>();
  String type=null;
switch (listType) {
case SITE:
    type="String_Node_Str";
  break;
case FEATURED:
type="String_Node_Str";
break;
case POPULAR:
type="String_Node_Str";
break;
case NEW:
type="String_Node_Str";
break;
}
properties.put("String_Node_Str",type);
AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.OPENED_PLUGIN_LIST,mViewModel.getSite(),properties);
}
Program: 13376
Project: 13376
Buggy source:
@Override public boolean onCreateOptionsMenu(Menu menu){
  getMenuInflater().inflate(R.menu.search,menu);
  mSearchMenuItem=menu.findItem(R.id.menu_search);
  mSearchView=(SearchView)mSearchMenuItem.getActionView();
  if (!TextUtils.isEmpty(mViewModel.getSearchQuery())) {
    mSearchMenuItem.expandActionView();
    mSearchView.setQuery(mViewModel.getSearchQuery(),false);
    mSearchView.setOnQueryTextListener(this);
  }
  mSearchMenuItem.setOnActionExpandListener(this);
  return super.onCreateOptionsMenu(menu);
}

Fixed version (ground truth):
@Override public boolean onCreateOptionsMenu(Menu menu){
  getMenuInflater().inflate(R.menu.search,menu);
  mSearchMenuItem=menu.findItem(R.id.menu_search);
  mSearchView=(SearchView)mSearchMenuItem.getActionView();
  PluginListFragment currentFragment=getCurrentFragment();
  if (currentFragment != null && currentFragment.getListType() == PluginListType.SEARCH) {
    mSearchMenuItem.expandActionView();
    mSearchView.setQuery(mViewModel.getSearchQuery(),false);
    mSearchView.setOnQueryTextListener(this);
  }
  mSearchMenuItem.setOnActionExpandListener(this);
  return super.onCreateOptionsMenu(menu);
}
Program: 13377
Project: 13377
Buggy source:
private boolean canShowSettings(){
  return mPlugin.isInstalled() && mPlugin.isActive() && !TextUtils.isEmpty(mPlugin.getSettingsUrl());
}

Fixed version (ground truth):
private boolean canShowSettings(){
  return mPlugin.isInstalled() && isNotAutoManaged() && mPlugin.isActive()&& !TextUtils.isEmpty(mPlugin.getSettingsUrl());
}
Program: 13378
Project: 13378
Buggy source:
private boolean canPluginBeDisabledOrRemoved(){
  if (!mPlugin.isInstalled()) {
    return false;
  }
  String pluginName=mPlugin.getName();
  if (pluginName == null || pluginName.equals("String_Node_Str")) {
    return false;
  }
  return !mSite.isAutomatedTransfer() || (!pluginName.equals("String_Node_Str") && !pluginName.equals("String_Node_Str"));
}

Fixed version (ground truth):
private boolean canPluginBeDisabledOrRemoved(){
  if (!mPlugin.isInstalled()) {
    return false;
  }
  if (PluginUtils.isJetpack(mPlugin)) {
    return false;
  }
  return isNotAutoManaged();
}
Program: 13379
Project: 13379
Buggy source:
private void refreshPluginVersionViews(){
  String pluginVersion=TextUtils.isEmpty(mPlugin.getInstalledVersion()) ? "String_Node_Str" : mPlugin.getInstalledVersion();
  String availableVersion=mPlugin.getWPOrgPluginVersion();
  String versionTopText="String_Node_Str";
  String versionBottomText="String_Node_Str";
  if (mPlugin.isInstalled()) {
    if (PluginUtils.isUpdateAvailable(mPlugin)) {
      versionTopText=String.format(getString(R.string.plugin_available_version),availableVersion);
      versionBottomText=String.format(getString(R.string.plugin_installed_version),pluginVersion);
    }
 else {
      versionTopText=String.format(getString(R.string.plugin_version),pluginVersion);
    }
  }
 else   if (!TextUtils.isEmpty(availableVersion)) {
    versionTopText=String.format(getString(R.string.plugin_version),availableVersion);
  }
  mVersionTopTextView.setText(versionTopText);
  mVersionBottomTextView.setVisibility(TextUtils.isEmpty(versionBottomText) ? View.GONE : View.VISIBLE);
  mVersionBottomTextView.setText(versionBottomText);
  refreshUpdateVersionViews();
}

Fixed version (ground truth):
private void refreshPluginVersionViews(){
  String pluginVersion=TextUtils.isEmpty(mPlugin.getInstalledVersion()) ? "String_Node_Str" : mPlugin.getInstalledVersion();
  String availableVersion=mPlugin.getWPOrgPluginVersion();
  String versionTopText="String_Node_Str";
  String versionBottomText="String_Node_Str";
  if (mPlugin.isInstalled() && isNotAutoManaged()) {
    if (PluginUtils.isUpdateAvailable(mPlugin)) {
      versionTopText=String.format(getString(R.string.plugin_available_version),availableVersion);
      versionBottomText=String.format(getString(R.string.plugin_installed_version),pluginVersion);
    }
 else {
      versionTopText=String.format(getString(R.string.plugin_version),pluginVersion);
    }
  }
 else   if (!TextUtils.isEmpty(availableVersion)) {
    versionTopText=String.format(getString(R.string.plugin_version),availableVersion);
  }
  mVersionTopTextView.setText(versionTopText);
  mVersionBottomTextView.setVisibility(TextUtils.isEmpty(versionBottomText) ? View.GONE : View.VISIBLE);
  mVersionBottomTextView.setText(versionBottomText);
  refreshUpdateVersionViews();
}
Program: 13381
Project: 13381
Buggy source:
private void refreshUpdateVersionViews(){
  if (mPlugin.isInstalled()) {
    mInstallButton.setVisibility(View.GONE);
    boolean isUpdateAvailable=PluginUtils.isUpdateAvailable(mPlugin);
    boolean canUpdate=isUpdateAvailable && !mIsUpdatingPlugin;
    mUpdateButton.setVisibility(canUpdate ? View.VISIBLE : View.GONE);
    mInstalledText.setVisibility(isUpdateAvailable || mIsUpdatingPlugin ? View.GONE : View.VISIBLE);
  }
 else {
    mUpdateButton.setVisibility(View.GONE);
    mInstalledText.setVisibility(View.GONE);
    mInstallButton.setVisibility(mIsInstallingPlugin ? View.GONE : View.VISIBLE);
  }
  findViewById(R.id.plugin_update_progress_bar).setVisibility(mIsUpdatingPlugin || mIsInstallingPlugin ? View.VISIBLE : View.GONE);
}

Fixed version (ground truth):
private void refreshUpdateVersionViews(){
  if (mPlugin.isInstalled()) {
    mInstallButton.setVisibility(View.GONE);
    if (isNotAutoManaged()) {
      boolean isUpdateAvailable=PluginUtils.isUpdateAvailable(mPlugin);
      boolean canUpdate=isUpdateAvailable && !mIsUpdatingPlugin;
      mUpdateButton.setVisibility(canUpdate ? View.VISIBLE : View.GONE);
      mInstalledText.setVisibility(isUpdateAvailable || mIsUpdatingPlugin ? View.GONE : View.VISIBLE);
    }
 else {
      mUpdateButton.setVisibility(View.GONE);
      mInstalledText.setVisibility(View.GONE);
    }
  }
 else {
    mUpdateButton.setVisibility(View.GONE);
    mInstalledText.setVisibility(View.GONE);
    mInstallButton.setVisibility(mIsInstallingPlugin ? View.GONE : View.VISIBLE);
  }
  findViewById(R.id.plugin_update_progress_bar).setVisibility(mIsUpdatingPlugin || mIsInstallingPlugin ? View.VISIBLE : View.GONE);
}
Program: 13382
Project: 13382
Buggy source:
protected @Nullable Object getItem(int position){
  return mItems.getItem(position);
}

Fixed version (ground truth):
private @Nullable Object getItem(int position){
  return mItems.getItem(position);
}
Program: 13383
Project: 13383
Buggy source:
protected void refreshProgressBars(@Nullable ListState listState){
  if (!isAdded() || getView() == null || listState == null) {
    return;
  }
  mSwipeToRefreshHelper.setRefreshing(listState.isFetchingFirstPage());
  getView().findViewById(R.id.progress).setVisibility(listState.isLoadingMore() ? View.VISIBLE : View.GONE);
}

Fixed version (ground truth):
private void refreshProgressBars(@Nullable ListState listState){
  if (!isAdded() || getView() == null || listState == null) {
    return;
  }
  mSwipeToRefreshHelper.setRefreshing(listState.isFetchingFirstPage());
  getView().findViewById(R.id.progress).setVisibility(listState.isLoadingMore() ? View.VISIBLE : View.GONE);
}
Program: 13385
Project: 13385
Buggy source:
void showEmptyView(boolean show){
  if (isAdded() && getView() != null) {
    getView().findViewById(R.id.text_empty).setVisibility(show ? View.VISIBLE : View.GONE);
  }
}

Fixed version (ground truth):
private void showEmptyView(boolean show){
  if (isAdded() && getView() != null) {
    getView().findViewById(R.id.text_empty).setVisibility(show ? View.VISIBLE : View.GONE);
  }
}
Program: 13386
Project: 13386
Buggy source:
@Override protected void onBindView(@NonNull View view){
  super.onBindView(view);
  TextView titleView=(TextView)view.findViewById(android.R.id.title);
  if (titleView != null) {
    Resources res=getContext().getResources();
    titleView.setTextSize(TypedValue.COMPLEX_UNIT_PX,res.getDimensionPixelSize(R.dimen.text_sz_large));
    titleView.setTextColor(res.getColor(isEnabled() ? R.color.grey_dark : R.color.grey_lighten_10));
    if (!TextUtils.isEmpty(getDependency())) {
      ViewCompat.setPaddingRelative(titleView,res.getDimensionPixelSize(R.dimen.margin_large),0,0,0);
    }
  }
}

Fixed version (ground truth):
@Override protected void onBindView(@NonNull View view){
  super.onBindView(view);
  TextView titleView=view.findViewById(android.R.id.title);
  if (titleView != null) {
    Resources res=getContext().getResources();
    titleView.setTextSize(TypedValue.COMPLEX_UNIT_PX,res.getDimensionPixelSize(R.dimen.text_sz_large));
    titleView.setTextColor(res.getColor(isEnabled() ? R.color.grey_dark : R.color.grey_lighten_10));
    if (!TextUtils.isEmpty(getDependency())) {
      ViewCompat.setPaddingRelative(titleView,res.getDimensionPixelSize(R.dimen.margin_large),0,0,0);
    }
  }
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
    Switch switchControl=getSwitch((ViewGroup)view);
    if (switchControl != null) {
      switchControl.setThumbTintList(ContextCompat.getColorStateList(this.getContext(),R.color.dialog_compound_button));
    }
  }
}
Program: 13387
Project: 13387
Buggy source:
@Override public void onResume(){
  super.onResume();
  if (NetworkUtils.isNetworkAvailable(getActivity())) {
    mDispatcher.dispatch(AccountActionBuilder.newFetchSettingsAction());
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  if (mAccountStore.hasAccessToken() && NetworkUtils.isNetworkAvailable(getActivity())) {
    mDispatcher.dispatch(AccountActionBuilder.newFetchSettingsAction());
  }
}
Program: 13388
Project: 13388
Buggy source:
@Override public void onClick(View v){
  String error=null;
  CharSequence text=getEditText().getText();
  if (mValidationType == ValidationType.EMAIL) {
    error=ValidationUtils.validateEmail(text) ? getContext().getString(R.string.invalid_email_message) : null;
  }
 else   if (!TextUtils.isEmpty(text) && mValidationType == ValidationType.URL) {
    error=ValidationUtils.validateUrl(text) ? getContext().getString(R.string.invalid_url_message) : null;
  }
  if (error != null) {
    getEditText().setError(error);
  }
 else {
    callChangeListener(text);
    dialog.dismiss();
  }
}

Fixed version (ground truth):
@Override public void onClick(View v){
  String error=null;
  CharSequence text=getEditText().getText();
  if (mValidationType == ValidationType.EMAIL) {
    error=ValidationUtils.validateEmail(text) ? null : getContext().getString(R.string.invalid_email_message);
  }
 else   if (!TextUtils.isEmpty(text) && mValidationType == ValidationType.URL) {
    error=ValidationUtils.validateUrl(text) ? null : getContext().getString(R.string.invalid_url_message);
  }
  if (error != null) {
    getEditText().setError(error);
  }
 else {
    callChangeListener(text);
    dialog.dismiss();
  }
}
Program: 13389
Project: 13389
Buggy source:
@Override protected void showDialog(Bundle state){
  super.showDialog(state);
  final AlertDialog dialog=(AlertDialog)getDialog();
  Button positiveButton=dialog.getButton(DialogInterface.BUTTON_POSITIVE);
  if (positiveButton != null) {
    positiveButton.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        String error=null;
        CharSequence text=getEditText().getText();
        if (mValidationType == ValidationType.EMAIL) {
          error=ValidationUtils.validateEmail(text) ? getContext().getString(R.string.invalid_email_message) : null;
        }
 else         if (!TextUtils.isEmpty(text) && mValidationType == ValidationType.URL) {
          error=ValidationUtils.validateUrl(text) ? getContext().getString(R.string.invalid_url_message) : null;
        }
        if (error != null) {
          getEditText().setError(error);
        }
 else {
          callChangeListener(text);
          dialog.dismiss();
        }
      }
    }
);
  }
  CharSequence summary=getSummary();
  if (summary == null || summary.equals(mStringToIgnoreForPrefilling)) {
    getEditText().setText("String_Node_Str");
  }
 else {
    getEditText().setText(summary);
    getEditText().setSelection(0,summary.length());
  }
  getEditText().setError(null);
}

Fixed version (ground truth):
@Override protected void showDialog(Bundle state){
  super.showDialog(state);
  final AlertDialog dialog=(AlertDialog)getDialog();
  Button positiveButton=dialog.getButton(DialogInterface.BUTTON_POSITIVE);
  if (positiveButton != null) {
    positiveButton.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        String error=null;
        CharSequence text=getEditText().getText();
        if (mValidationType == ValidationType.EMAIL) {
          error=ValidationUtils.validateEmail(text) ? null : getContext().getString(R.string.invalid_email_message);
        }
 else         if (!TextUtils.isEmpty(text) && mValidationType == ValidationType.URL) {
          error=ValidationUtils.validateUrl(text) ? null : getContext().getString(R.string.invalid_url_message);
        }
        if (error != null) {
          getEditText().setError(error);
        }
 else {
          callChangeListener(text);
          dialog.dismiss();
        }
      }
    }
);
  }
  CharSequence summary=getSummary();
  if (summary == null || summary.equals(mStringToIgnoreForPrefilling)) {
    getEditText().setText("String_Node_Str");
  }
 else {
    getEditText().setText(summary);
    getEditText().setSelection(0,summary.length());
  }
  getEditText().setError(null);
}
Program: 13390
Project: 13390
Buggy source:
@Override public void onClick(View v){
  if (mDialog != null) {
    return;
  }
  AnalyticsTracker.track(Stat.SITE_SETTINGS_LEARN_MORE_CLICKED);
  showDialog();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  if (mDialog != null) {
    return;
  }
  AnalyticsTracker.track(Stat.SITE_SETTINGS_LEARN_MORE_CLICKED);
  if (mOpenInDialog) {
    showDialog();
  }
 else {
    Intent browserIntent=new Intent(Intent.ACTION_VIEW,Uri.parse(mUrl));
    if (browserIntent.resolveActivity(v.getContext().getPackageManager()) != null) {
      v.getContext().startActivity(browserIntent);
    }
  }
}
Program: 13391
Project: 13391
Buggy source:
@Override public void onRestoreInstanceState(@NonNull Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
  }
 else {
    super.onRestoreInstanceState(((SavedState)state).getSuperState());
    showDialog();
  }
}

Fixed version (ground truth):
@Override public void onRestoreInstanceState(@NonNull Parcelable state){
  if (!(state instanceof SavedState)) {
    super.onRestoreInstanceState(state);
  }
 else {
    super.onRestoreInstanceState(((SavedState)state).getSuperState());
    if (mOpenInDialog) {
      showDialog();
    }
  }
}
Program: 13392
Project: 13392
Buggy source:
public LearnMorePreference(Context context,AttributeSet attrs){
  super(context,attrs);
  TypedArray array=context.obtainStyledAttributes(attrs,R.styleable.LearnMorePreference);
  for (int i=0; i < array.getIndexCount(); ++i) {
    int index=array.getIndex(i);
    if (index == R.styleable.LearnMorePreference_url) {
      mUrl=array.getString(index);
    }
 else     if (index == R.styleable.LearnMorePreference_useCustomJsFormatting) {
      mUseCustomJsFormatting=array.getBoolean(index,false);
    }
 else     if (index == R.styleable.LearnMorePreference_caption) {
      int id=array.getResourceId(index,-1);
      if (id != -1) {
        mCaption=array.getResources().getString(id);
      }
    }
 else     if (index == R.styleable.LearnMorePreference_button) {
      int id=array.getResourceId(index,-1);
      if (id != -1) {
        mButtonText=array.getResources().getString(id);
      }
    }
 else     if (index == R.styleable.LearnMorePreference_icon) {
      mIcon=array.getResourceId(index,-1);
    }
 else     if (index == R.styleable.LearnMorePreference_layout) {
      mLayout=array.getResourceId(index,-1);
    }
  }
  array.recycle();
}

Fixed version (ground truth):
public LearnMorePreference(Context context,AttributeSet attrs){
  super(context,attrs);
  TypedArray array=context.obtainStyledAttributes(attrs,R.styleable.LearnMorePreference);
  for (int i=0; i < array.getIndexCount(); ++i) {
    int index=array.getIndex(i);
    if (index == R.styleable.LearnMorePreference_url) {
      mUrl=array.getString(index);
    }
 else     if (index == R.styleable.LearnMorePreference_useCustomJsFormatting) {
      mUseCustomJsFormatting=array.getBoolean(index,false);
    }
 else     if (index == R.styleable.LearnMorePreference_caption) {
      int id=array.getResourceId(index,-1);
      if (id != -1) {
        mCaption=array.getResources().getString(id);
      }
    }
 else     if (index == R.styleable.LearnMorePreference_button) {
      int id=array.getResourceId(index,-1);
      if (id != -1) {
        mButtonText=array.getResources().getString(id);
      }
    }
 else     if (index == R.styleable.LearnMorePreference_icon) {
      mIcon=array.getResourceId(index,-1);
    }
 else     if (index == R.styleable.LearnMorePreference_layout) {
      mLayout=array.getResourceId(index,-1);
    }
 else     if (index == R.styleable.LearnMorePreference_openInDialog) {
      mOpenInDialog=array.getBoolean(index,false);
    }
  }
  array.recycle();
}
Program: 13393
Project: 13393
Buggy source:
private void initSiteSettings(){
  mSiteSettings=SiteSettingsInterface.getInterface(getActivity(),getSelectedSite(),this);
  mSiteSettings.init(true);
}

Fixed version (ground truth):
private void initSiteSettings(){
  mSiteSettings=SiteSettingsInterface.getInterface(getActivity(),getSelectedSite(),this);
  if (mSiteSettings != null) {
    mSiteSettings.init(true);
  }
}
Program: 13394
Project: 13394
Buggy source:
/** 
 * We can't just use fluxc OnSiteChanged event, as the order of events is not guaranteed -> getSelectedSite() method might return an out of date SiteModel, if the OnSiteChanged event handler in the WPMainActivity wasn't called yet.
 */
public void onSiteChanged(){
  refreshSelectedSiteDetails(getSelectedSite());
  showSiteIconProgressBar(false);
}

Fixed version (ground truth):
/** 
 * We can't just use fluxc OnSiteChanged event, as the order of events is not guaranteed -> getSelectedSite() method might return an out of date SiteModel, if the OnSiteChanged event handler in the WPMainActivity wasn't called yet.
 */
public void onSiteChanged(SiteModel site){
  refreshSelectedSiteDetails(site);
  showSiteIconProgressBar(false);
}
Program: 13395
Project: 13395
Buggy source:
@SuppressWarnings("String_Node_Str") public void onEventMainThread(UploadService.UploadMediaSuccessEvent event){
  AnalyticsTracker.track(Stat.MY_SITE_ICON_UPLOADED);
  EventBus.getDefault().removeStickyEvent(event);
  SiteModel site=getSelectedSite();
  if (site != null) {
    if (isMediaUploadInProgress()) {
      if (event.mediaModelList.size() > 0) {
        MediaModel media=event.mediaModelList.get(0);
        mBlavatarImageView.setImageUrl(media.getUrl(),ImageType.BLAVATAR);
        mSiteSettings.setSiteIconMediaId((int)media.getMediaId());
        mSiteSettings.saveSettings();
      }
    }
 else {
      if (event.mediaModelList != null && !event.mediaModelList.isEmpty()) {
        UploadUtils.onMediaUploadedSnackbarHandler(getActivity(),getActivity().findViewById(R.id.coordinator),false,event.mediaModelList,site,event.successMessage);
      }
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void onEventMainThread(UploadService.UploadMediaSuccessEvent event){
  AnalyticsTracker.track(Stat.MY_SITE_ICON_UPLOADED);
  EventBus.getDefault().removeStickyEvent(event);
  SiteModel site=getSelectedSite();
  if (site != null) {
    if (isMediaUploadInProgress()) {
      if (event.mediaModelList.size() > 0) {
        MediaModel media=event.mediaModelList.get(0);
        mBlavatarImageView.setImageUrl(media.getUrl(),ImageType.BLAVATAR);
        mSiteSettings.setSiteIconMediaId((int)media.getMediaId());
        mSiteSettings.saveSettings();
        showSiteIconProgressBar(false);
      }
    }
 else {
      if (event.mediaModelList != null && !event.mediaModelList.isEmpty()) {
        UploadUtils.onMediaUploadedSnackbarHandler(getActivity(),getActivity().findViewById(R.id.coordinator),false,event.mediaModelList,site,event.successMessage);
      }
    }
  }
}
Program: 13396
Project: 13396
Buggy source:
private void startSiteIconUpload(final String filePath){
  if (TextUtils.isEmpty(filePath)) {
    ToastUtils.showToast(getActivity(),R.string.error_locating_image,ToastUtils.Duration.SHORT);
    return;
  }
  File file=new File(filePath);
  if (!file.exists()) {
    ToastUtils.showToast(getActivity(),R.string.error_locating_image,ToastUtils.Duration.SHORT);
    return;
  }
  SiteModel site=getSelectedSite();
  if (site != null) {
    MediaModel media=buildMediaModel(file,site);
    UploadService.uploadMedia(getActivity(),media);
  }
}

Fixed version (ground truth):
private void startSiteIconUpload(final String filePath){
  if (TextUtils.isEmpty(filePath)) {
    ToastUtils.showToast(getActivity(),R.string.error_locating_image,ToastUtils.Duration.SHORT);
    return;
  }
  File file=new File(filePath);
  if (!file.exists()) {
    ToastUtils.showToast(getActivity(),R.string.file_error_create,ToastUtils.Duration.SHORT);
    return;
  }
  SiteModel site=getSelectedSite();
  if (site != null) {
    MediaModel media=buildMediaModel(file,site);
    UploadService.uploadMedia(getActivity(),media);
  }
 else {
    ToastUtils.showToast(getActivity(),R.string.error_generic,ToastUtils.Duration.SHORT);
    AppLog.e(T.MAIN,"String_Node_Str");
  }
}
Program: 13397
Project: 13397
Buggy source:
@Override public void onPositiveClicked(@NonNull String instanceTag){
switch (instanceTag) {
case TAG_ADD_SITE_ICON_DIALOG:
    ActivityLauncher.showPhotoPickerForResult(getActivity(),MediaBrowserType.SITE_ICON_PICKER,getSelectedSite());
  break;
case TAG_CHANGE_SITE_ICON_DIALOG:
ActivityLauncher.showPhotoPickerForResult(getActivity(),MediaBrowserType.SITE_ICON_PICKER,getSelectedSite());
break;
default :
AppLog.e(T.EDITOR,"String_Node_Str");
throw new UnsupportedOperationException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public void onPositiveClicked(@NonNull String instanceTag){
switch (instanceTag) {
case TAG_ADD_SITE_ICON_DIALOG:
case TAG_CHANGE_SITE_ICON_DIALOG:
    ActivityLauncher.showPhotoPickerForResult(getActivity(),MediaBrowserType.SITE_ICON_PICKER,getSelectedSite());
  break;
default :
AppLog.e(T.EDITOR,"String_Node_Str");
throw new UnsupportedOperationException("String_Node_Str");
}
}
Program: 13398
Project: 13398
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onSiteChanged(OnSiteChanged event){
  if (getSelectedSite() == null && mSiteStore.hasSite()) {
    setSelectedSite(mSiteStore.getSites().get(0));
  }
  if (getSelectedSite() == null) {
    return;
  }
  SiteModel site=mSiteStore.getSiteByLocalId(getSelectedSite().getId());
  if (site != null) {
    mSelectedSite=site;
  }
  if (getMySiteFragment() != null) {
    getMySiteFragment().onSiteChanged();
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onSiteChanged(OnSiteChanged event){
  if (getSelectedSite() == null && mSiteStore.hasSite()) {
    setSelectedSite(mSiteStore.getSites().get(0));
  }
  if (getSelectedSite() == null) {
    return;
  }
  SiteModel site=mSiteStore.getSiteByLocalId(getSelectedSite().getId());
  if (site != null) {
    mSelectedSite=site;
  }
  if (getMySiteFragment() != null) {
    getMySiteFragment().onSiteChanged(site);
  }
}
Program: 13399
Project: 13399
Buggy source:
@Override public void onNegativeClicked(@NonNull String instanceTag){
  Fragment fragment=getMySiteFragment();
  if (fragment != null) {
    getMySiteFragment().onNegativeClicked(instanceTag);
  }
}

Fixed version (ground truth):
@Override public void onNegativeClicked(@NonNull String instanceTag){
  MySiteFragment fragment=getMySiteFragment();
  if (fragment != null) {
    fragment.onNegativeClicked(instanceTag);
  }
}
Program: 13400
Project: 13400
Buggy source:
@Override public void onPositiveClicked(@NonNull String instanceTag){
  Fragment fragment=getMySiteFragment();
  if (fragment != null) {
    getMySiteFragment().onPositiveClicked(instanceTag);
  }
}

Fixed version (ground truth):
@Override public void onPositiveClicked(@NonNull String instanceTag){
  MySiteFragment fragment=getMySiteFragment();
  if (fragment != null) {
    getMySiteFragment().onPositiveClicked(instanceTag);
  }
}
Program: 13401
Project: 13401
Buggy source:
public void setSiteIconMediaId(int siteIconMediaId){
  if (mSettings.siteIconMediaId != siteIconMediaId) {
    mSettings.siteIconMediaId=siteIconMediaId;
  }
}

Fixed version (ground truth):
public void setSiteIconMediaId(int siteIconMediaId){
  mSettings.siteIconMediaId=siteIconMediaId;
}
Program: 13404
Project: 13404
Buggy source:
private static void requestPostsWithTag(final ReaderTag tag,final UpdateAction updateAction,final ReaderActions.UpdateResultListener resultListener){
  String path=getRelativeEndpointForTag(tag);
  if (TextUtils.isEmpty(path)) {
    resultListener.onUpdateResult(ReaderActions.UpdateResult.FAILED);
    return;
  }
  StringBuilder sb=new StringBuilder(path);
  sb.append("String_Node_Str").append(ReaderConstants.READER_MAX_POSTS_TO_REQUEST);
  sb.append("String_Node_Str");
  String beforeDate;
switch (updateAction) {
case REQUEST_OLDER:
    beforeDate=ReaderPostTable.getOldestDateWithTag(tag);
  break;
case REQUEST_OLDER_THAN_GAP:
beforeDate=ReaderPostTable.getGapMarkerDateForTag(tag);
break;
default :
beforeDate=null;
break;
}
if (!TextUtils.isEmpty(beforeDate)) {
sb.append("String_Node_Str").append(UrlUtils.urlEncode(beforeDate));
}
sb.append("String_Node_Str");
com.wordpress.rest.RestRequest.Listener listener=new RestRequest.Listener(){
@Override public void onResponse(JSONObject jsonObject){
if (updateAction == UpdateAction.REQUEST_NEWER) {
ReaderTagTable.setTagLastUpdated(tag);
}
handleUpdatePostsResponse(tag,jsonObject,updateAction,resultListener);
}
}
;
RestRequest.ErrorListener errorListener=new RestRequest.ErrorListener(){
@Override public void onErrorResponse(VolleyError volleyError){
AppLog.e(AppLog.T.READER,volleyError);
resultListener.onUpdateResult(ReaderActions.UpdateResult.FAILED);
}
}
;
WordPress.getRestClientUtilsV1_2().get(sb.toString(),null,null,listener,errorListener);
}

Fixed version (ground truth):
private static void requestPostsWithTag(final ReaderTag tag,final UpdateAction updateAction,final ReaderActions.UpdateResultListener resultListener){
  String path=getRelativeEndpointForTag(tag);
  if (TextUtils.isEmpty(path)) {
    resultListener.onUpdateResult(ReaderActions.UpdateResult.FAILED);
    return;
  }
  StringBuilder sb=new StringBuilder(path);
  sb.append("String_Node_Str").append(ReaderConstants.READER_MAX_POSTS_TO_REQUEST);
  sb.append("String_Node_Str");
  String beforeDate;
switch (updateAction) {
case REQUEST_OLDER:
    beforeDate=ReaderPostTable.getOldestDateWithTag(tag);
  break;
case REQUEST_OLDER_THAN_GAP:
beforeDate=ReaderPostTable.getGapMarkerDateForTag(tag);
break;
case REQUEST_NEWER:
default :
beforeDate=null;
break;
}
if (!TextUtils.isEmpty(beforeDate)) {
sb.append("String_Node_Str").append(UrlUtils.urlEncode(beforeDate));
}
sb.append("String_Node_Str");
com.wordpress.rest.RestRequest.Listener listener=new RestRequest.Listener(){
@Override public void onResponse(JSONObject jsonObject){
if (updateAction == UpdateAction.REQUEST_NEWER) {
ReaderTagTable.setTagLastUpdated(tag);
}
handleUpdatePostsResponse(tag,jsonObject,updateAction,resultListener);
}
}
;
RestRequest.ErrorListener errorListener=new RestRequest.ErrorListener(){
@Override public void onErrorResponse(VolleyError volleyError){
AppLog.e(AppLog.T.READER,volleyError);
resultListener.onUpdateResult(ReaderActions.UpdateResult.FAILED);
}
}
;
WordPress.getRestClientUtilsV1_2().get(sb.toString(),null,null,listener,errorListener);
}
Program: 13405
Project: 13405
Buggy source:
@Override public void run(){
  ReaderPostList serverPosts=ReaderPostList.fromJson(jsonObject);
  ReaderActions.UpdateResult updateResult=ReaderPostTable.comparePosts(serverPosts);
  if (updateResult.isNewOrChanged()) {
    ReaderPost postWithGap=null;
    if (tag != null) {
switch (updateAction) {
case REQUEST_NEWER:
        int numServerPosts=serverPosts.size();
      if (numServerPosts >= 2 && ReaderPostTable.getNumPostsWithTag(tag) > 0 && !ReaderPostTable.hasOverlap(serverPosts)) {
        postWithGap=serverPosts.get(numServerPosts - 2);
        serverPosts.remove(numServerPosts - 1);
        AppLog.d(AppLog.T.READER,"String_Node_Str" + tag.getTagNameForLog());
      }
    ReaderPostTable.removeGapMarkerForTag(tag);
  break;
case REQUEST_OLDER_THAN_GAP:
ReaderPostTable.deletePostsBeforeGapMarkerForTag(tag);
ReaderPostTable.removeGapMarkerForTag(tag);
break;
}
}
ReaderPostTable.addOrUpdatePosts(tag,serverPosts);
if (postWithGap != null) {
ReaderPostTable.setGapMarkerForTag(postWithGap.blogId,postWithGap.postId,tag);
}
}
 else if (updateResult == ReaderActions.UpdateResult.UNCHANGED && updateAction == UpdateAction.REQUEST_OLDER_THAN_GAP) {
ReaderPostTable.removeGapMarkerForTag(tag);
AppLog.w(AppLog.T.READER,"String_Node_Str");
}
AppLog.d(AppLog.T.READER,"String_Node_Str" + updateResult.toString());
resultListener.onUpdateResult(updateResult);
}

Fixed version (ground truth):
@Override public void run(){
  ReaderPostList serverPosts=ReaderPostList.fromJson(jsonObject);
  ReaderActions.UpdateResult updateResult=ReaderPostTable.comparePosts(serverPosts);
  if (updateResult.isNewOrChanged()) {
    ReaderPost postWithGap=null;
    if (tag != null) {
switch (updateAction) {
case REQUEST_NEWER:
        int numServerPosts=serverPosts.size();
      if (numServerPosts >= 2 && ReaderPostTable.getNumPostsWithTag(tag) > 0 && !ReaderPostTable.hasOverlap(serverPosts)) {
        postWithGap=serverPosts.get(numServerPosts - 2);
        serverPosts.remove(numServerPosts - 1);
        ReaderBlogIdPostId gapMarker=ReaderPostTable.getGapMarkerIdsForTag(tag);
        if (gapMarker != null) {
          ReaderPostTable.deletePostsBeforeGapMarkerForTag(tag);
          ReaderPostTable.removeGapMarkerForTag(tag);
        }
      }
    break;
case REQUEST_OLDER_THAN_GAP:
  ReaderPostTable.deletePostsBeforeGapMarkerForTag(tag);
ReaderPostTable.removeGapMarkerForTag(tag);
break;
case REQUEST_OLDER:
break;
}
}
ReaderPostTable.addOrUpdatePosts(tag,serverPosts);
if (postWithGap != null) {
ReaderPostTable.setGapMarkerForTag(postWithGap.blogId,postWithGap.postId,tag);
AppLog.d(AppLog.T.READER,"String_Node_Str" + tag.getTagNameForLog());
}
}
 else if (updateResult == ReaderActions.UpdateResult.UNCHANGED && updateAction == UpdateAction.REQUEST_OLDER_THAN_GAP) {
ReaderPostTable.removeGapMarkerForTag(tag);
AppLog.w(AppLog.T.READER,"String_Node_Str");
}
AppLog.d(AppLog.T.READER,"String_Node_Str" + updateResult.toString());
resultListener.onUpdateResult(updateResult);
}
Program: 13407
Project: 13407
Buggy source:
@Override protected void onPostExecute(ReaderTagList tagList){
  if (tagList != null && !tagList.isSameList(mTags)) {
    mTags.clear();
    mTags.addAll(tagList);
    if (mFilterCriteriaLoaderListener != null) {
      mFilterCriteriaLoaderListener.onFilterCriteriasLoaded((List)mTags);
    }
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(ReaderTagList tagList){
  if (mFilterCriteriaLoaderListener != null) {
    mFilterCriteriaLoaderListener.onFilterCriteriasLoaded((List)tagList);
  }
}
Program: 13409
Project: 13409
Buggy source:
public static void updatePost(@NonNull ReaderPost post){
  ContentValues values=new ContentValues();
  values.put("String_Node_Str",post.getTitle());
  values.put("String_Node_Str",post.getText());
  values.put("String_Node_Str",post.numReplies);
  values.put("String_Node_Str",post.numLikes);
  values.put("String_Node_Str",post.isLikedByCurrentUser);
  values.put("String_Node_Str",post.isFollowedByCurrentUser);
  values.put("String_Node_Str",post.isCommentsOpen);
  ReaderDatabase.getWritableDb().update("String_Node_Str",values,"String_Node_Str",new String[]{post.getPseudoId()});
  ReaderPostList posts=new ReaderPostList();
  posts.add(post);
  addOrUpdatePosts(null,posts);
}

Fixed version (ground truth):
public static void updatePost(@NonNull ReaderPost post){
  ContentValues values=new ContentValues();
  values.put("String_Node_Str",post.getTitle());
  values.put("String_Node_Str",post.getText());
  values.put("String_Node_Str",post.getExcerpt());
  values.put("String_Node_Str",post.numReplies);
  values.put("String_Node_Str",post.numLikes);
  values.put("String_Node_Str",post.isLikedByCurrentUser);
  values.put("String_Node_Str",post.isFollowedByCurrentUser);
  values.put("String_Node_Str",post.isCommentsOpen);
  values.put("String_Node_Str",post.useExcerpt);
  ReaderDatabase.getWritableDb().update("String_Node_Str",values,"String_Node_Str",new String[]{post.getPseudoId()});
  ReaderPostList posts=new ReaderPostList();
  posts.add(post);
  addOrUpdatePosts(null,posts);
}
Program: 13410
Project: 13410
Buggy source:
public boolean shouldShowExcerpt(){
  return isJetpack && useExcerpt;
}

Fixed version (ground truth):
public boolean shouldShowExcerpt(){
  return isJetpack && useExcerpt && hasExcerpt();
}
Program: 13412
Project: 13412
Buggy source:
private boolean showPhotoViewer(String imageUrl,View sourceView,int startX,int startY){
  if (!isAdded() || TextUtils.isEmpty(imageUrl)) {
    return false;
  }
  if (!imageUrl.startsWith("String_Node_Str")) {
    return false;
  }
  String postContent=(mRenderer != null ? mRenderer.getRenderedHtml() : null);
  boolean isPrivatePost=(mPost != null && mPost.isPrivate);
  EnumSet<PhotoViewerOption> options=EnumSet.noneOf(PhotoViewerOption.class);
  if (isPrivatePost) {
    options.add(ReaderActivityLauncher.PhotoViewerOption.IS_PRIVATE_IMAGE);
  }
  ReaderActivityLauncher.showReaderPhotoViewer(getActivity(),imageUrl,postContent,sourceView,options,startX,startY);
  return true;
}

Fixed version (ground truth):
private boolean showPhotoViewer(String imageUrl,View sourceView,int startX,int startY){
  if (!isAdded() || TextUtils.isEmpty(imageUrl)) {
    return false;
  }
  if (!imageUrl.startsWith("String_Node_Str")) {
    return false;
  }
  String postContent=(mPost != null ? mPost.getText() : null);
  boolean isPrivatePost=(mPost != null && mPost.isPrivate);
  EnumSet<PhotoViewerOption> options=EnumSet.noneOf(PhotoViewerOption.class);
  if (isPrivatePost) {
    options.add(ReaderActivityLauncher.PhotoViewerOption.IS_PRIVATE_IMAGE);
  }
  ReaderActivityLauncher.showReaderPhotoViewer(getActivity(),imageUrl,postContent,sourceView,options,startX,startY);
  return true;
}
Program: 13413
Project: 13413
Buggy source:
public String getFirstUsableVideo(){
  Matcher matcher=IFRAME_TAG_PATTERN.matcher(mContent);
  while (matcher.find()) {
    String src=matcher.group(2);
    if (ReaderVideoUtils.canShowVideoThumbnail(src)) {
      return src;
    }
  }
  return null;
}

Fixed version (ground truth):
public String getFirstUsableVideo(){
  Matcher matcher=IFRAME_TAG_PATTERN.matcher(mContent);
  while (matcher.find()) {
    String src=matcher.group(1);
    if (ReaderVideoUtils.canShowVideoThumbnail(src)) {
      return src;
    }
  }
  return null;
}
Program: 13414
Project: 13414
Buggy source:
public void beginScan(ReaderHtmlUtils.HtmlScannerListener listener){
  if (listener == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Matcher matcher=IFRAME_TAG_PATTERN.matcher(mContent);
  while (matcher.find()) {
    String tag=matcher.group(1);
    String src=matcher.group(2);
    listener.onTagFound(tag,src);
  }
}

Fixed version (ground truth):
public void beginScan(ReaderHtmlUtils.HtmlScannerListener listener){
  if (listener == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Matcher matcher=IFRAME_TAG_PATTERN.matcher(mContent);
  while (matcher.find()) {
    String tag=matcher.group(0);
    String src=matcher.group(1);
    listener.onTagFound(tag,src);
  }
}
Program: 13415
Project: 13415
Buggy source:
public ReaderImageList getImageList(int maxImageCount,int minImageWidth){
  ReaderImageList imageList=new ReaderImageList(mIsPrivate);
  if (!mContentContainsImages) {
    return imageList;
  }
  Matcher imgMatcher=IMG_TAG_PATTERN.matcher(mContent);
  while (imgMatcher.find()) {
    String imageTag=imgMatcher.group(1);
    String imageUrl=imgMatcher.group(2);
    if (minImageWidth == 0) {
      imageList.addImageUrl(imageUrl);
    }
 else {
      int width=Math.max(ReaderHtmlUtils.getWidthAttrValue(imageTag),ReaderHtmlUtils.getIntQueryParam(imageUrl,"String_Node_Str"));
      if (width >= minImageWidth) {
        imageList.addImageUrl(imageUrl);
        if (maxImageCount > 0 && imageList.size() >= maxImageCount) {
          break;
        }
      }
    }
  }
  return imageList;
}

Fixed version (ground truth):
public ReaderImageList getImageList(int maxImageCount,int minImageWidth){
  ReaderImageList imageList=new ReaderImageList(mIsPrivate);
  if (!mContentContainsImages) {
    return imageList;
  }
  Matcher imgMatcher=IMG_TAG_PATTERN.matcher(mContent);
  while (imgMatcher.find()) {
    String imageTag=imgMatcher.group(0);
    String imageUrl=imgMatcher.group(1);
    if (minImageWidth == 0) {
      imageList.addImageUrl(imageUrl);
    }
 else {
      int width=Math.max(ReaderHtmlUtils.getWidthAttrValue(imageTag),ReaderHtmlUtils.getIntQueryParam(imageUrl,"String_Node_Str"));
      if (width >= minImageWidth) {
        imageList.addImageUrl(imageUrl);
        if (maxImageCount > 0 && imageList.size() >= maxImageCount) {
          break;
        }
      }
    }
  }
  return imageList;
}
Program: 13416
Project: 13416
Buggy source:
public void beginScan(ReaderHtmlUtils.HtmlScannerListener listener){
  if (listener == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!mContentContainsImages) {
    return;
  }
  Matcher imgMatcher=IMG_TAG_PATTERN.matcher(mContent);
  while (imgMatcher.find()) {
    String imageTag=imgMatcher.group(1);
    String imageUrl=imgMatcher.group(2);
    listener.onTagFound(imageTag,imageUrl);
  }
}

Fixed version (ground truth):
public void beginScan(ReaderHtmlUtils.HtmlScannerListener listener){
  if (listener == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!mContentContainsImages) {
    return;
  }
  Matcher imgMatcher=IMG_TAG_PATTERN.matcher(mContent);
  while (imgMatcher.find()) {
    String imageTag=imgMatcher.group(0);
    String imageUrl=imgMatcher.group(1);
    listener.onTagFound(imageTag,imageUrl);
  }
}
Program: 13418
Project: 13418
Buggy source:
private ReaderTag getReaderTagFromBundleParams(PersistableBundle bundle){
  String slug=bundle.getString(ARG_TAG_PARAM_SLUG);
  String displayName=bundle.getString(ARG_TAG_PARAM_DISPLAY_NAME);
  String title=bundle.getString(ARG_TAG_PARAM_TITLE);
  String endpoint=bundle.getString(ARG_TAG_PARAM_ENDPOINT);
  int tagType=bundle.getInt(ARG_TAG_PARAM_TAGTYPE);
  ReaderTag tag=new ReaderTag(slug,displayName,title,endpoint,ReaderTagType.values()[tagType]);
  return tag;
}

Fixed version (ground truth):
private ReaderTag getReaderTagFromBundleParams(PersistableBundle bundle){
  String slug=bundle.getString(ARG_TAG_PARAM_SLUG);
  String displayName=bundle.getString(ARG_TAG_PARAM_DISPLAY_NAME);
  String title=bundle.getString(ARG_TAG_PARAM_TITLE);
  String endpoint=bundle.getString(ARG_TAG_PARAM_ENDPOINT);
  int tagType=bundle.getInt(ARG_TAG_PARAM_TAGTYPE);
  ReaderTag tag=new ReaderTag(slug,displayName,title,endpoint,ReaderTagType.fromInt(tagType));
  return tag;
}
Program: 13419
Project: 13419
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onAutomatedTransferInitiated(OnAutomatedTransferInitiated event){
  if (isFinishing()) {
    return;
  }
  if (!event.isError()) {
    handleAutomatedTransferFailed(event.error.message);
  }
 else {
    mDispatcher.dispatch(SiteActionBuilder.newCheckAutomatedTransferStatusAction(mSite));
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onAutomatedTransferInitiated(OnAutomatedTransferInitiated event){
  if (isFinishing()) {
    return;
  }
  if (event.isError()) {
    handleAutomatedTransferFailed(event.error.message);
  }
 else {
    mDispatcher.dispatch(SiteActionBuilder.newCheckAutomatedTransferStatusAction(mSite));
  }
}
Program: 13420
Project: 13420
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onAutomatedTransferStatusChecked(OnAutomatedTransferStatusChecked event){
  if (isFinishing()) {
    return;
  }
  if (!event.isError()) {
    handleAutomatedTransferFailed(event.error.message);
  }
 else {
    if (event.isCompleted) {
      cancelAutomatedTransferDialog();
      handlePluginInstalled();
    }
 else {
      mAutomatedTransferProgressDialog.setProgress(event.currentStep);
      mAutomatedTransferProgressDialog.setMax(event.totalSteps);
      if (mHandler == null) {
        mHandler=new Handler();
      }
      mHandler.postDelayed(new Runnable(){
        @Override public void run(){
          mDispatcher.dispatch(SiteActionBuilder.newCheckAutomatedTransferStatusAction(mSite));
        }
      }
,1000);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onAutomatedTransferStatusChecked(OnAutomatedTransferStatusChecked event){
  if (isFinishing()) {
    return;
  }
  if (event.isError()) {
    handleAutomatedTransferFailed(event.error.message);
  }
 else {
    if (event.isCompleted) {
      cancelAutomatedTransferDialog();
      handlePluginInstalled();
    }
 else {
      mAutomatedTransferProgressDialog.setProgress(event.currentStep);
      mAutomatedTransferProgressDialog.setMax(event.totalSteps);
      if (mHandler == null) {
        mHandler=new Handler();
      }
      mHandler.postDelayed(new Runnable(){
        @Override public void run(){
          mDispatcher.dispatch(SiteActionBuilder.newCheckAutomatedTransferStatusAction(mSite));
        }
      }
,1000);
    }
  }
}
Program: 13421
Project: 13421
Buggy source:
private void showEmptyView(@StringRes int titleResId,@StringRes int descriptionResId,@StringRes int buttonResId){
  if (isAdded() && mEmptyView != null) {
    mEmptyView.setVisibility(View.VISIBLE);
    mFilterDivider.setVisibility(View.GONE);
    mRecyclerView.setVisibility(View.GONE);
    mConnectJetpackView.setVisibility(View.GONE);
    setFilterViewScrollable(false);
    ((TextView)mEmptyView.findViewById(R.id.text_empty)).setText(titleResId);
    TextView descriptionTextView=(TextView)mEmptyView.findViewById(R.id.text_empty_description);
    if (descriptionResId > 0) {
      descriptionTextView.setText(descriptionResId);
    }
 else {
      descriptionTextView.setVisibility(View.GONE);
    }
    TextView btnAction=(TextView)mEmptyView.findViewById(R.id.button_empty_action);
    if (buttonResId > 0) {
      btnAction.setText(buttonResId);
      btnAction.setVisibility(View.VISIBLE);
    }
 else {
      btnAction.setVisibility(View.GONE);
    }
    btnAction.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        performActionForActiveFilter();
      }
    }
);
  }
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") private void showEmptyView(@StringRes int titleResId,@StringRes int descriptionResId,@StringRes int buttonResId){
  if (isAdded() && mEmptyView != null) {
    mEmptyView.setVisibility(View.VISIBLE);
    mFilterDivider.setVisibility(View.GONE);
    mRecyclerView.setVisibility(View.GONE);
    mConnectJetpackView.setVisibility(View.GONE);
    setFilterViewScrollable(false);
    ((TextView)mEmptyView.findViewById(R.id.text_empty)).setText(titleResId);
    TextView descriptionTextView=(TextView)mEmptyView.findViewById(R.id.text_empty_description);
    if (descriptionResId > 0) {
      descriptionTextView.setText(descriptionResId);
    }
 else {
      descriptionTextView.setVisibility(View.GONE);
    }
    TextView btnAction=(TextView)mEmptyView.findViewById(R.id.button_empty_action);
    if (buttonResId > 0) {
      btnAction.setText(buttonResId);
      btnAction.setVisibility(View.VISIBLE);
    }
 else {
      btnAction.setVisibility(View.GONE);
    }
    btnAction.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        performActionForActiveFilter();
      }
    }
);
  }
}
Program: 13422
Project: 13422
Buggy source:
public static BitmapDrawable getAztecPlaceholderDrawableFromResID(Context context,@DrawableRes int drawableId,int maxImageSizeForVisualEditor){
  Drawable drawable=ContextCompat.getDrawable(context,drawableId);
  Bitmap bitmap;
  if (drawable instanceof BitmapDrawable) {
    bitmap=((BitmapDrawable)drawable).getBitmap();
    bitmap=ImageUtils.getScaledBitmapAtLongestSide(bitmap,maxImageSizeForVisualEditor);
  }
 else   if (drawable instanceof VectorDrawableCompat || drawable instanceof VectorDrawable) {
    bitmap=Bitmap.createBitmap(maxImageSizeForVisualEditor,maxImageSizeForVisualEditor,Bitmap.Config.ARGB_8888);
    Canvas canvas=new Canvas(bitmap);
    drawable.setBounds(0,0,canvas.getWidth(),canvas.getHeight());
    drawable.draw(canvas);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + drawable.getClass().getName());
  }
  bitmap.setDensity(DisplayMetrics.DENSITY_DEFAULT);
  return new BitmapDrawable(context.getResources(),bitmap);
}

Fixed version (ground truth):
public static BitmapDrawable getAztecPlaceholderDrawableFromResID(Context context,@DrawableRes int drawableId,int maxImageSizeForVisualEditor){
  Drawable drawable=ContextCompat.getDrawable(context,drawableId);
  Bitmap bitmap;
  if (drawable instanceof BitmapDrawable) {
    bitmap=((BitmapDrawable)drawable).getBitmap();
    bitmap=ImageUtils.getScaledBitmapAtLongestSide(bitmap,maxImageSizeForVisualEditor);
  }
 else   if (drawable instanceof VectorDrawableCompat || Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && drawable instanceof VectorDrawable) {
    bitmap=Bitmap.createBitmap(maxImageSizeForVisualEditor,maxImageSizeForVisualEditor,Bitmap.Config.ARGB_8888);
    Canvas canvas=new Canvas(bitmap);
    drawable.setBounds(0,0,canvas.getWidth(),canvas.getHeight());
    drawable.draw(canvas);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + drawable.getClass().getName());
  }
  bitmap.setDensity(DisplayMetrics.DENSITY_DEFAULT);
  return new BitmapDrawable(context.getResources(),bitmap);
}