nus-yam/ex-repair huggingface dataset:
Program: 13525
Project: 13525
Buggy source:
@SuppressLint("String_Node_Str") @Override protected void setUp() throws Exception {
  super.setUp();
  mInstrumentation=getInstrumentation();
  Activity activity=getActivity();
  mSetUpLatch=new CountDownLatch(1);
  mDomLoadedCallbackLatch=new CountDownLatch(1);
  mSetUpLatch.countDown();
  String htmlEditor=Utils.getHtmlFromFile(activity,"String_Node_Str");
  if (htmlEditor != null) {
    htmlEditor=htmlEditor.replace("String_Node_Str",getActivity().getString(R.string.visual_editor));
    htmlEditor=htmlEditor.replace("String_Node_Str",String.valueOf(Build.VERSION.SDK_INT));
    htmlEditor=htmlEditor.replace("String_Node_Str","String_Node_Str" + getActivity().getString(R.string.edit) + "String_Node_Str"+ "String_Node_Str"+ getActivity().getString(R.string.uploading)+ "String_Node_Str"+ "String_Node_Str"+ getActivity().getString(R.string.uploading_gallery_placeholder)+ "String_Node_Str");
  }
  final String finalHtmlEditor=htmlEditor;
  activity.runOnUiThread(new Runnable(){
    @Override public void run(){
      mWebView=new EditorWebView(mInstrumentation.getContext(),null);
      if (Build.VERSION.SDK_INT < 17) {
        mWebView.setJsCallbackReceiver(new MockJsCallbackReceiver(new EditorFragmentForTests()));
      }
 else {
        mWebView.addJavascriptInterface(new MockJsCallbackReceiver(new EditorFragmentForTests()),JS_CALLBACK_HANDLER);
      }
      mWebView.loadDataWithBaseURL("String_Node_Str",finalHtmlEditor,"String_Node_Str","String_Node_Str","String_Node_Str");
      mSetUpLatch.countDown();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void setUp() throws Exception {
  super.setUp();
  mInstrumentation=getInstrumentation();
  Activity activity=getActivity();
  mSetUpLatch=new CountDownLatch(1);
  mDomLoadedCallbackLatch=new CountDownLatch(1);
  mSetUpLatch.countDown();
  String htmlEditor=Utils.getHtmlFromFile(activity,"String_Node_Str");
  if (htmlEditor != null) {
    htmlEditor=htmlEditor.replace("String_Node_Str",getActivity().getString(R.string.visual_editor));
    htmlEditor=htmlEditor.replace("String_Node_Str",String.valueOf(Build.VERSION.SDK_INT));
    htmlEditor=htmlEditor.replace("String_Node_Str","String_Node_Str" + getActivity().getString(R.string.edit) + "String_Node_Str"+ "String_Node_Str"+ getActivity().getString(R.string.uploading)+ "String_Node_Str"+ "String_Node_Str"+ getActivity().getString(R.string.uploading_gallery_placeholder)+ "String_Node_Str");
  }
  final String finalHtmlEditor=htmlEditor;
  activity.runOnUiThread(new Runnable(){
    @Override public void run(){
      mWebView=new EditorWebView(mInstrumentation.getContext(),null);
      if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
        mWebView.setJsCallbackReceiver(new MockJsCallbackReceiver(new EditorFragmentForTests()));
      }
 else {
        mWebView.addJavascriptInterface(new MockJsCallbackReceiver(new EditorFragmentForTests()),JS_CALLBACK_HANDLER);
      }
      mWebView.loadDataWithBaseURL("String_Node_Str",finalHtmlEditor,"String_Node_Str","String_Node_Str","String_Node_Str");
      mSetUpLatch.countDown();
    }
  }
);
}
Program: 13526
Project: 13526
Buggy source:
@Override public void run(){
  mWebView=new EditorWebView(mInstrumentation.getContext(),null);
  if (Build.VERSION.SDK_INT < 17) {
    mWebView.setJsCallbackReceiver(new MockJsCallbackReceiver(new EditorFragmentForTests()));
  }
 else {
    mWebView.addJavascriptInterface(new MockJsCallbackReceiver(new EditorFragmentForTests()),JS_CALLBACK_HANDLER);
  }
  mWebView.loadDataWithBaseURL("String_Node_Str",finalHtmlEditor,"String_Node_Str","String_Node_Str","String_Node_Str");
  mSetUpLatch.countDown();
}

Fixed version (ground truth):
@Override public void run(){
  mWebView=new EditorWebView(mInstrumentation.getContext(),null);
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
    mWebView.setJsCallbackReceiver(new MockJsCallbackReceiver(new EditorFragmentForTests()));
  }
 else {
    mWebView.addJavascriptInterface(new MockJsCallbackReceiver(new EditorFragmentForTests()),JS_CALLBACK_HANDLER);
  }
  mWebView.loadDataWithBaseURL("String_Node_Str",finalHtmlEditor,"String_Node_Str","String_Node_Str","String_Node_Str");
  mSetUpLatch.countDown();
}
Program: 13527
Project: 13527
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onSitePluginUpdated(OnSitePluginUpdated event){
  if (isFinishing())   return;
  mIsUpdatingPlugin=false;
  if (event.isError()) {
    AppLog.e(AppLog.T.PLUGINS,"String_Node_Str" + event.error.type);
    refreshPluginVersionViews();
    showUpdateFailedSnackbar();
    return;
  }
  refreshSitePluginFromStore();
  refreshViews();
  showSuccessfulUpdateSnackbar();
  AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.PLUGIN_UPDATED,mSite);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onSitePluginUpdated(OnSitePluginUpdated event){
  if (isFinishing())   return;
  mIsUpdatingPlugin=false;
  if (event.isError()) {
    AppLog.e(AppLog.T.PLUGINS,"String_Node_Str" + event.error.type + "String_Node_Str"+ event.error.message);
    refreshPluginVersionViews();
    showUpdateFailedSnackbar();
    return;
  }
  refreshSitePluginFromStore();
  refreshViews();
  showSuccessfulUpdateSnackbar();
  AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.PLUGIN_UPDATED,mSite);
}
Program: 13528
Project: 13528
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onSitePluginDeleted(OnSitePluginDeleted event){
  if (isFinishing())   return;
  mIsRemovingPlugin=false;
  cancelRemovePluginProgressDialog();
  if (event.isError()) {
    AppLog.e(AppLog.T.PLUGINS,"String_Node_Str" + event.error.type);
    String toastMessage=getString(R.string.plugin_updated_failed_detailed,mSitePlugin.getDisplayName(),event.error.message);
    ToastUtils.showToast(this,toastMessage,Duration.LONG);
    return;
  }
  AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.PLUGIN_REMOVED,mSite);
  String toastMessage=getString(R.string.plugin_removed_successfully,mSitePlugin.getDisplayName());
  ToastUtils.showToast(this,toastMessage,Duration.LONG);
  finish();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onSitePluginDeleted(OnSitePluginDeleted event){
  if (isFinishing())   return;
  mIsRemovingPlugin=false;
  cancelRemovePluginProgressDialog();
  if (event.isError()) {
    AppLog.e(AppLog.T.PLUGINS,"String_Node_Str" + event.error.type + "String_Node_Str"+ event.error.message);
    String toastMessage=getString(R.string.plugin_updated_failed_detailed,mSitePlugin.getDisplayName(),event.error.message);
    ToastUtils.showToast(this,toastMessage,Duration.LONG);
    return;
  }
  AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.PLUGIN_REMOVED,mSite);
  String toastMessage=getString(R.string.plugin_removed_successfully,mSitePlugin.getDisplayName());
  ToastUtils.showToast(this,toastMessage,Duration.LONG);
  finish();
}
Program: 13529
Project: 13529
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void OnSitePluginInstalled(OnSitePluginInstalled event){
  if (isFinishing())   return;
  mIsUpdatingPlugin=false;
  if (event.isError()) {
    AppLog.e(AppLog.T.PLUGINS,"String_Node_Str" + event.error.type);
    refreshPluginVersionViews();
    showInstallFailedSnackbar();
    return;
  }
  mSitePlugin=event.plugin;
  refreshViews();
  showSuccessfulInstallSnackbar();
  invalidateOptionsMenu();
  AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.PLUGIN_INSTALLED,mSite);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void OnSitePluginInstalled(OnSitePluginInstalled event){
  if (isFinishing())   return;
  mIsUpdatingPlugin=false;
  if (event.isError()) {
    AppLog.e(AppLog.T.PLUGINS,"String_Node_Str" + event.error.type + "String_Node_Str"+ event.error.message);
    refreshPluginVersionViews();
    showInstallFailedSnackbar();
    return;
  }
  mSitePlugin=event.plugin;
  refreshViews();
  showSuccessfulInstallSnackbar();
  invalidateOptionsMenu();
  AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.PLUGIN_INSTALLED,mSite);
}
Program: 13530
Project: 13530
Buggy source:
private void refreshUpdateVersionViews(){
  if (mSitePlugin != null) {
    mInstallButton.setVisibility(View.GONE);
    boolean isUpdateAvailable=PluginUtils.isUpdateAvailable(mSitePlugin,mWPOrgPlugin);
    boolean canUpdate=isUpdateAvailable && !mIsUpdatingPlugin;
    mUpdateButton.setVisibility(canUpdate ? View.VISIBLE : View.GONE);
    findViewById(R.id.plugin_installed).setVisibility(isUpdateAvailable || mIsUpdatingPlugin ? View.GONE : View.VISIBLE);
    if (canUpdate) {
      mUpdateButton.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          dispatchUpdatePluginAction();
        }
      }
);
    }
  }
 else   if (mWPOrgPlugin != null) {
    mUpdateButton.setVisibility(View.GONE);
    mInstallButton.setVisibility(View.VISIBLE);
    mInstallButton.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        dispatchInstallPluginAction();
      }
    }
);
  }
  findViewById(R.id.plugin_update_progress_bar).setVisibility(mIsUpdatingPlugin ? View.VISIBLE : View.GONE);
}

Fixed version (ground truth):
private void refreshUpdateVersionViews(){
  if (mSitePlugin != null) {
    mInstallButton.setVisibility(View.GONE);
    boolean isUpdateAvailable=PluginUtils.isUpdateAvailable(mSitePlugin,mWPOrgPlugin);
    boolean canUpdate=isUpdateAvailable && !mIsUpdatingPlugin;
    mUpdateButton.setVisibility(canUpdate ? View.VISIBLE : View.GONE);
    findViewById(R.id.plugin_installed).setVisibility(isUpdateAvailable || mIsUpdatingPlugin ? View.GONE : View.VISIBLE);
    if (canUpdate) {
      mUpdateButton.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          dispatchUpdatePluginAction();
        }
      }
);
    }
  }
 else   if (mWPOrgPlugin != null) {
    mUpdateButton.setVisibility(View.GONE);
    mInstallButton.setVisibility(mIsUpdatingPlugin ? View.GONE : View.VISIBLE);
    mInstallButton.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        dispatchInstallPluginAction();
      }
    }
);
  }
  findViewById(R.id.plugin_update_progress_bar).setVisibility(mIsUpdatingPlugin ? View.VISIBLE : View.GONE);
}
Program: 13531
Project: 13531
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onSitePluginsFetched(PluginStore.OnSitePluginsFetched event){
  if (event.isError()) {
    AppLog.e(AppLog.T.PLUGINS,"String_Node_Str" + event.error.type);
    mSitePluginsListStatus.setValue(PluginListStatus.ERROR);
    return;
  }
  mSitePluginsListStatus.setValue(PluginListStatus.DONE);
  reloadSitePlugins();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onSitePluginsFetched(PluginStore.OnSitePluginsFetched event){
  if (event.isError()) {
    AppLog.e(AppLog.T.PLUGINS,"String_Node_Str" + event.error.type + "String_Node_Str"+ event.error.message);
    mSitePluginsListStatus.setValue(PluginListStatus.ERROR);
    return;
  }
  mSitePluginsListStatus.setValue(PluginListStatus.DONE);
  reloadSitePlugins();
}
Program: 13532
Project: 13532
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onPluginDirectoryFetched(PluginStore.OnPluginDirectoryFetched event){
  if (event.isError()) {
    AppLog.e(AppLog.T.PLUGINS,"String_Node_Str" + event.type);
    if (event.type == PluginDirectoryType.NEW) {
      mNewPluginsListStatus.setValue(PluginListStatus.ERROR);
    }
 else     if (event.type == PluginDirectoryType.POPULAR) {
      mPopularPluginsListStatus.setValue(PluginListStatus.ERROR);
    }
    return;
  }
  PluginListStatus listStatus=event.canLoadMore ? PluginListStatus.CAN_LOAD_MORE : PluginListStatus.DONE;
switch (event.type) {
case NEW:
    reloadNewPlugins();
  mNewPluginsListStatus.setValue(listStatus);
break;
case POPULAR:
reloadPopularPlugins();
mPopularPluginsListStatus.setValue(listStatus);
break;
}
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onPluginDirectoryFetched(PluginStore.OnPluginDirectoryFetched event){
  if (event.isError()) {
    AppLog.e(AppLog.T.PLUGINS,"String_Node_Str" + event.type + "String_Node_Str"+ event.error.message);
    if (event.type == PluginDirectoryType.NEW) {
      mNewPluginsListStatus.setValue(PluginListStatus.ERROR);
    }
 else     if (event.type == PluginDirectoryType.POPULAR) {
      mPopularPluginsListStatus.setValue(PluginListStatus.ERROR);
    }
    return;
  }
  PluginListStatus listStatus=event.canLoadMore ? PluginListStatus.CAN_LOAD_MORE : PluginListStatus.DONE;
switch (event.type) {
case NEW:
    reloadNewPlugins();
  mNewPluginsListStatus.setValue(listStatus);
break;
case POPULAR:
reloadPopularPlugins();
mPopularPluginsListStatus.setValue(listStatus);
break;
}
}
Program: 13533
Project: 13533
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onPluginDirectorySearched(PluginStore.OnPluginDirectorySearched event){
  if (mSearchQuery == null || !mSearchQuery.equals(event.searchTerm)) {
    return;
  }
  if (event.isError()) {
    AppLog.e(AppLog.T.PLUGINS,"String_Node_Str");
    mSearchPluginsListStatus.setValue(PluginListStatus.ERROR);
    return;
  }
  mSearchResults.setValue(event.plugins);
  mSearchPluginsListStatus.setValue(PluginListStatus.DONE);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onPluginDirectorySearched(PluginStore.OnPluginDirectorySearched event){
  if (mSearchQuery == null || !mSearchQuery.equals(event.searchTerm)) {
    return;
  }
  if (event.isError()) {
    AppLog.e(AppLog.T.PLUGINS,"String_Node_Str" + event.error.type + "String_Node_Str"+ event.error.message);
    mSearchPluginsListStatus.setValue(PluginListStatus.ERROR);
    return;
  }
  mSearchResults.setValue(event.plugins);
  mSearchPluginsListStatus.setValue(PluginListStatus.DONE);
}
Program: 13534
Project: 13534
Buggy source:
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putBoolean(KEY_LOGIN_FINISHED,mLoginFinished);
  outState.putString(KEY_REQUESTED_USERNAME,mRequestedUsername);
  outState.putString(KEY_REQUESTED_PASSWORD,mRequestedPassword);
  outState.putIntegerArrayList(KEY_REQUESTED_PASSWORD,mOldSitesIDs);
}

Fixed version (ground truth):
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putBoolean(KEY_LOGIN_FINISHED,mLoginFinished);
  outState.putString(KEY_REQUESTED_USERNAME,mRequestedUsername);
  outState.putString(KEY_REQUESTED_PASSWORD,mRequestedPassword);
  outState.putIntegerArrayList(KEY_OLD_SITES_IDS,mOldSitesIDs);
}
Program: 13536
Project: 13536
Buggy source:
private DomainViewHolder(View itemView){
  super(itemView);
  mRadioButton=itemView.findViewById(R.id.radio_button);
  mTextView=itemView.findViewById(R.id.text);
}

Fixed version (ground truth):
private DomainViewHolder(View itemView){
  super(itemView);
  mRadioButton=itemView.findViewById(R.id.radio_button);
}
Program: 13537
Project: 13537
Buggy source:
private void bindSuggest(final DomainViewHolder domainViewHolder,int position){
  final String suggestion=getItem(position);
  final boolean onSelectedItem=suggestion.equals(mSelectedDomain);
  domainViewHolder.mRadioButton.setChecked(onSelectedItem);
  domainViewHolder.mTextView.setText(suggestion);
  View.OnClickListener clickListener=new View.OnClickListener(){
    @Override public void onClick(    View view){
      if (!onSelectedItem) {
        mSelectedDomain=suggestion;
        notifyDataSetChanged();
        mOnAdapterListener.onSelectionChange(suggestion);
      }
    }
  }
;
  domainViewHolder.itemView.setOnClickListener(clickListener);
  domainViewHolder.mRadioButton.setOnClickListener(clickListener);
}

Fixed version (ground truth):
private void bindSuggest(final DomainViewHolder domainViewHolder,int position){
  final String suggestion=getItem(position);
  final boolean onSelectedItem=suggestion.equals(mSelectedDomain);
  domainViewHolder.mRadioButton.setChecked(onSelectedItem);
  domainViewHolder.mRadioButton.setText(suggestion);
  View.OnClickListener clickListener=new View.OnClickListener(){
    @Override public void onClick(    View view){
      if (!onSelectedItem) {
        mSelectedDomain=suggestion;
        notifyDataSetChanged();
        mOnAdapterListener.onSelectionChange(suggestion);
      }
    }
  }
;
  domainViewHolder.mRadioButton.setOnClickListener(clickListener);
}
Program: 13539
Project: 13539
Buggy source:
@SuppressLint("String_Node_Str") @Override public View configureView(View view){
  final NoteHeaderBlockHolder noteBlockHolder=(NoteHeaderBlockHolder)view.getTag();
  Spannable spannable=NotificationsUtils.getSpannableContentForRanges(mHeaderArray.optJSONObject(0));
  noteBlockHolder.nameTextView.setText(spannable);
  noteBlockHolder.avatarImageView.setImageUrl(getAvatarUrl(),mImageType);
  if (!TextUtils.isEmpty(getUserUrl())) {
    noteBlockHolder.avatarImageView.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        long siteId=Long.valueOf(JSONUtils.queryJSON(mHeaderArray,"String_Node_Str",0));
        long userId=Long.valueOf(JSONUtils.queryJSON(mHeaderArray,"String_Node_Str",0));
        String siteUrl=getUserUrl();
        if (siteId > 0 && userId > 0) {
          mGravatarClickedListener.onGravatarClicked(siteId,userId,siteUrl);
        }
      }
    }
);
    noteBlockHolder.avatarImageView.setOnTouchListener(mOnGravatarTouchListener);
  }
 else {
    noteBlockHolder.avatarImageView.setOnTouchListener(null);
  }
  noteBlockHolder.snippetTextView.setText(getSnippet());
  if (mIsComment) {
    View footerView=view.findViewById(R.id.header_footer);
    View footerCommentView=view.findViewById(R.id.header_footer_comment);
    footerView.setVisibility(View.GONE);
    footerCommentView.setVisibility(View.VISIBLE);
  }
  return view;
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") @Override public View configureView(View view){
  final NoteHeaderBlockHolder noteBlockHolder=(NoteHeaderBlockHolder)view.getTag();
  Spannable spannable=NotificationsUtils.getSpannableContentForRanges(mHeaderArray.optJSONObject(0));
  noteBlockHolder.nameTextView.setText(spannable);
  noteBlockHolder.avatarImageView.setImageUrl(getAvatarUrl(),mImageType);
  if (!TextUtils.isEmpty(getUserUrl())) {
    noteBlockHolder.avatarImageView.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        long siteId=Long.valueOf(JSONUtils.queryJSON(mHeaderArray,"String_Node_Str",0));
        long userId=Long.valueOf(JSONUtils.queryJSON(mHeaderArray,"String_Node_Str",0));
        String siteUrl=getUserUrl();
        if (siteId > 0 && userId > 0) {
          mGravatarClickedListener.onGravatarClicked(siteId,userId,siteUrl);
        }
      }
    }
);
    noteBlockHolder.avatarImageView.setOnTouchListener(mOnGravatarTouchListener);
  }
 else {
    noteBlockHolder.avatarImageView.setOnClickListener(null);
    noteBlockHolder.avatarImageView.setOnTouchListener(null);
  }
  noteBlockHolder.snippetTextView.setText(getSnippet());
  if (mIsComment) {
    View footerView=view.findViewById(R.id.header_footer);
    View footerCommentView=view.findViewById(R.id.header_footer_comment);
    footerView.setVisibility(View.GONE);
    footerCommentView.setVisibility(View.VISIBLE);
  }
  return view;
}
Program: 13541
Project: 13541
Buggy source:
@Override public void onResponse(ImageLoader.ImageContainer response,boolean isImmediate){
  if (response.getBitmap() == null) {
    AppLog.w(T.UTILS,"String_Node_Str");
  }
  TextView view=getView();
  if (view == null) {
    AppLog.w(T.UTILS,"String_Node_Str");
    return;
  }
  int maxWidth=view.getWidth() - view.getPaddingLeft() - view.getPaddingRight();
  if (mMaxSize > 0 && (maxWidth > mMaxSize || maxWidth == 0)) {
    maxWidth=mMaxSize;
  }
  Drawable drawable=new BitmapDrawable(view.getContext().getResources(),response.getBitmap());
  remote.setRemoteDrawable(drawable,maxWidth);
  if (!isImmediate) {
    view.setText(view.getText());
  }
}

Fixed version (ground truth):
@Override public void onResponse(ImageLoader.ImageContainer response,boolean isImmediate){
  if (response.getBitmap() == null) {
    AppLog.w(T.UTILS,"String_Node_Str");
  }
  TextView view=getView();
  if (view == null) {
    AppLog.w(T.UTILS,"String_Node_Str");
    return;
  }
  int maxWidth=view.getWidth() - ViewCompat.getPaddingStart(view) - ViewCompat.getPaddingEnd(view);
  if (mMaxSize > 0 && (maxWidth > mMaxSize || maxWidth == 0)) {
    maxWidth=mMaxSize;
  }
  Drawable drawable=new BitmapDrawable(view.getContext().getResources(),response.getBitmap());
  remote.setRemoteDrawable(drawable,maxWidth);
  if (!isImmediate) {
    view.setText(view.getText());
  }
}
Program: 13542
Project: 13542
Buggy source:
@Override public Drawable getDrawable(String source){
  if (mImageLoader == null || mLoadingDrawable == null || mFailedDrawable == null) {
    throw new RuntimeException("String_Node_Str");
  }
  if (TextUtils.isEmpty(source)) {
    return null;
  }
  if (source.startsWith("String_Node_Str")) {
    source="String_Node_Str" + source;
  }
  if (mMaxSize > 0) {
    source=PhotonUtils.getPhotonImageUrl(source,mMaxSize,0);
  }
  final RemoteDrawable remote=new RemoteDrawable(mLoadingDrawable,mFailedDrawable);
  mImageLoader.get(source,new ImageLoader.ImageListener(){
    @Override public void onErrorResponse(    VolleyError error){
      remote.displayFailed();
      TextView view=getView();
      if (view != null) {
        view.invalidate();
      }
    }
    @Override public void onResponse(    ImageLoader.ImageContainer response,    boolean isImmediate){
      if (response.getBitmap() == null) {
        AppLog.w(T.UTILS,"String_Node_Str");
      }
      TextView view=getView();
      if (view == null) {
        AppLog.w(T.UTILS,"String_Node_Str");
        return;
      }
      int maxWidth=view.getWidth() - view.getPaddingLeft() - view.getPaddingRight();
      if (mMaxSize > 0 && (maxWidth > mMaxSize || maxWidth == 0)) {
        maxWidth=mMaxSize;
      }
      Drawable drawable=new BitmapDrawable(view.getContext().getResources(),response.getBitmap());
      remote.setRemoteDrawable(drawable,maxWidth);
      if (!isImmediate) {
        view.setText(view.getText());
      }
    }
  }
);
  return remote;
}

Fixed version (ground truth):
@Override public Drawable getDrawable(String source){
  if (mImageLoader == null || mLoadingDrawable == null || mFailedDrawable == null) {
    throw new RuntimeException("String_Node_Str");
  }
  if (TextUtils.isEmpty(source)) {
    return null;
  }
  if (source.startsWith("String_Node_Str")) {
    source="String_Node_Str" + source;
  }
  if (mMaxSize > 0) {
    source=PhotonUtils.getPhotonImageUrl(source,mMaxSize,0);
  }
  final RemoteDrawable remote=new RemoteDrawable(mLoadingDrawable,mFailedDrawable);
  mImageLoader.get(source,new ImageLoader.ImageListener(){
    @Override public void onErrorResponse(    VolleyError error){
      remote.displayFailed();
      TextView view=getView();
      if (view != null) {
        view.invalidate();
      }
    }
    @Override public void onResponse(    ImageLoader.ImageContainer response,    boolean isImmediate){
      if (response.getBitmap() == null) {
        AppLog.w(T.UTILS,"String_Node_Str");
      }
      TextView view=getView();
      if (view == null) {
        AppLog.w(T.UTILS,"String_Node_Str");
        return;
      }
      int maxWidth=view.getWidth() - ViewCompat.getPaddingStart(view) - ViewCompat.getPaddingEnd(view);
      if (mMaxSize > 0 && (maxWidth > mMaxSize || maxWidth == 0)) {
        maxWidth=mMaxSize;
      }
      Drawable drawable=new BitmapDrawable(view.getContext().getResources(),response.getBitmap());
      remote.setRemoteDrawable(drawable,maxWidth);
      if (!isImmediate) {
        view.setText(view.getText());
      }
    }
  }
);
  return remote;
}
Program: 13543
Project: 13543
Buggy source:
public void setToolbarLeftPadding(int paddingLeft){
  ViewCompat.setPaddingRelative(mToolbar,paddingLeft,mToolbar.getPaddingTop(),mToolbar.getPaddingRight(),mToolbar.getPaddingBottom());
}

Fixed version (ground truth):
public void setToolbarLeftPadding(int paddingLeft){
  ViewCompat.setPaddingRelative(mToolbar,paddingLeft,mToolbar.getPaddingTop(),ViewCompat.getPaddingEnd(mToolbar),mToolbar.getPaddingBottom());
}
Program: 13544
Project: 13544
Buggy source:
public void setToolbarRightPadding(int paddingRight){
  ViewCompat.setPaddingRelative(mToolbar,mToolbar.getPaddingLeft(),mToolbar.getPaddingTop(),paddingRight,mToolbar.getPaddingBottom());
}

Fixed version (ground truth):
public void setToolbarRightPadding(int paddingRight){
  ViewCompat.setPaddingRelative(mToolbar,ViewCompat.getPaddingStart(mToolbar),mToolbar.getPaddingTop(),paddingRight,mToolbar.getPaddingBottom());
}
Program: 13545
Project: 13545
Buggy source:
private void moveBottomButtons(){
  if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
    mBottomButtonsLayout.setOrientation(LinearLayout.HORIZONTAL);
    if (getResources().getInteger(R.integer.isSW600DP) == 0) {
      setSecondaryButtonVisible(true);
    }
 else {
      setSecondaryButtonVisible(false);
    }
    ViewCompat.setPaddingRelative(mIconSwitcher,mIconSwitcher.getPaddingLeft(),mIconSwitcher.getPaddingBottom(),mIconSwitcher.getPaddingRight(),mIconSwitcher.getPaddingBottom());
  }
 else {
    mBottomButtonsLayout.setOrientation(LinearLayout.VERTICAL);
    setSecondaryButtonVisible(false);
    ViewCompat.setPaddingRelative(mIconSwitcher,mIconSwitcher.getPaddingLeft(),0,mIconSwitcher.getPaddingRight(),mIconSwitcher.getPaddingBottom());
  }
}

Fixed version (ground truth):
private void moveBottomButtons(){
  if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
    mBottomButtonsLayout.setOrientation(LinearLayout.HORIZONTAL);
    if (getResources().getInteger(R.integer.isSW600DP) == 0) {
      setSecondaryButtonVisible(true);
    }
 else {
      setSecondaryButtonVisible(false);
    }
    ViewCompat.setPaddingRelative(mIconSwitcher,ViewCompat.getPaddingStart(mIconSwitcher),mIconSwitcher.getPaddingBottom(),ViewCompat.getPaddingEnd(mIconSwitcher),mIconSwitcher.getPaddingBottom());
  }
 else {
    mBottomButtonsLayout.setOrientation(LinearLayout.VERTICAL);
    setSecondaryButtonVisible(false);
    ViewCompat.setPaddingRelative(mIconSwitcher,ViewCompat.getPaddingStart(mIconSwitcher),0,ViewCompat.getPaddingEnd(mIconSwitcher),mIconSwitcher.getPaddingBottom());
  }
}
Program: 13546
Project: 13546
Buggy source:
@Override public void onGlobalLayout(){
  mTabLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
  if (mTabLayout.getChildCount() > 0) {
    int tabLayoutWidth=0;
    LinearLayout tabFirstChild=(LinearLayout)mTabLayout.getChildAt(0);
    for (int i=0; i < mTabLayout.getTabCount(); i++) {
      LinearLayout tabView=(LinearLayout)(tabFirstChild.getChildAt(i));
      tabLayoutWidth+=(tabView.getMeasuredWidth() + tabView.getPaddingLeft() + tabView.getPaddingRight());
    }
    int displayWidth=DisplayUtils.getDisplayPixelWidth(MediaBrowserActivity.this);
    if (tabLayoutWidth < displayWidth) {
      mTabLayout.setTabMode(TabLayout.MODE_FIXED);
      mTabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
    }
  }
}

Fixed version (ground truth):
@Override public void onGlobalLayout(){
  mTabLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
  if (mTabLayout.getChildCount() > 0) {
    int tabLayoutWidth=0;
    LinearLayout tabFirstChild=(LinearLayout)mTabLayout.getChildAt(0);
    for (int i=0; i < mTabLayout.getTabCount(); i++) {
      LinearLayout tabView=(LinearLayout)(tabFirstChild.getChildAt(i));
      tabLayoutWidth+=(tabView.getMeasuredWidth() + ViewCompat.getPaddingStart(tabView) + ViewCompat.getPaddingEnd(tabView));
    }
    int displayWidth=DisplayUtils.getDisplayPixelWidth(MediaBrowserActivity.this);
    if (tabLayoutWidth < displayWidth) {
      mTabLayout.setTabMode(TabLayout.MODE_FIXED);
      mTabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
    }
  }
}
Program: 13549
Project: 13549
Buggy source:
@Override public void onDraw(Canvas c,RecyclerView parent,RecyclerView.State state){
  int left=parent.getPaddingLeft();
  int right=parent.getWidth() - parent.getPaddingRight();
  int childCount=parent.getChildCount();
  for (int i=0; i < childCount; i++) {
    View child=parent.getChildAt(i);
    RecyclerView.LayoutParams params=(RecyclerView.LayoutParams)child.getLayoutParams();
    int top=child.getBottom() + params.bottomMargin;
    int bottom=top + mDivider.getIntrinsicHeight();
    mDivider.setBounds(left,top,right,bottom);
    mDivider.draw(c);
  }
}

Fixed version (ground truth):
@Override public void onDraw(Canvas c,RecyclerView parent,RecyclerView.State state){
  int left=ViewCompat.getPaddingStart(parent);
  int right=parent.getWidth() - ViewCompat.getPaddingEnd(parent);
  int childCount=parent.getChildCount();
  for (int i=0; i < childCount; i++) {
    View child=parent.getChildAt(i);
    RecyclerView.LayoutParams params=(RecyclerView.LayoutParams)child.getLayoutParams();
    int top=child.getBottom() + params.bottomMargin;
    int bottom=top + mDivider.getIntrinsicHeight();
    mDivider.setBounds(left,top,right,bottom);
    mDivider.draw(c);
  }
}
Program: 13552
Project: 13552
Buggy source:
/** 
 * Padding information are reset when changing the background Drawable on a View. The reason why setting an image resets the padding is because 9-patch images can encode padding. <p> See http://stackoverflow.com/a/10469121 and http://www.mail-archive.com/android-developers@googlegroups.com/msg09595.html
 * @param v               The view to apply the background resource
 * @param backgroundResId The resource ID
 */
private static void setViewBackgroundWithoutResettingPadding(final View v,final int backgroundResId){
  final int paddingBottom=v.getPaddingBottom(), paddingLeft=v.getPaddingLeft();
  final int paddingRight=v.getPaddingRight(), paddingTop=v.getPaddingTop();
  v.setBackgroundResource(backgroundResId);
  ViewCompat.setPaddingRelative(v,paddingLeft,paddingTop,paddingRight,paddingBottom);
}

Fixed version (ground truth):
/** 
 * Padding information are reset when changing the background Drawable on a View. The reason why setting an image resets the padding is because 9-patch images can encode padding. <p> See http://stackoverflow.com/a/10469121 and http://www.mail-archive.com/android-developers@googlegroups.com/msg09595.html
 * @param v               The view to apply the background resource
 * @param backgroundResId The resource ID
 */
private static void setViewBackgroundWithoutResettingPadding(final View v,final int backgroundResId){
  final int paddingBottom=v.getPaddingBottom(), paddingLeft=ViewCompat.getPaddingStart(v);
  final int paddingRight=ViewCompat.getPaddingEnd(v), paddingTop=v.getPaddingTop();
  v.setBackgroundResource(backgroundResId);
  ViewCompat.setPaddingRelative(v,paddingLeft,paddingTop,paddingRight,paddingBottom);
}
Program: 13553
Project: 13553
Buggy source:
public void drawVertical(Canvas c,RecyclerView parent){
  final int left=parent.getPaddingLeft();
  final int right=parent.getWidth() - parent.getPaddingRight();
  final int childCount=parent.getChildCount();
  for (int i=0; i < childCount; i++) {
    final View child=parent.getChildAt(i);
    final RecyclerView.LayoutParams params=(RecyclerView.LayoutParams)child.getLayoutParams();
    final int top=child.getBottom() + params.bottomMargin;
    final int bottom=top + mDivider.getIntrinsicHeight();
    mDivider.setBounds(left,top,right,bottom);
    mDivider.draw(c);
  }
}

Fixed version (ground truth):
public void drawVertical(Canvas c,RecyclerView parent){
  final int left=ViewCompat.getPaddingStart(parent);
  final int right=parent.getWidth() - ViewCompat.getPaddingEnd(parent);
  final int childCount=parent.getChildCount();
  for (int i=0; i < childCount; i++) {
    final View child=parent.getChildAt(i);
    final RecyclerView.LayoutParams params=(RecyclerView.LayoutParams)child.getLayoutParams();
    final int top=child.getBottom() + params.bottomMargin;
    final int bottom=top + mDivider.getIntrinsicHeight();
    mDivider.setBounds(left,top,right,bottom);
    mDivider.draw(c);
  }
}
Program: 13554
Project: 13554
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int widthSize=MeasureSpec.getSize(widthMeasureSpec) - getPaddingRight() - getPaddingLeft();
  int widthMode=MeasureSpec.getMode(widthMeasureSpec);
  boolean growHeight=widthMode != MeasureSpec.UNSPECIFIED;
  int width=0;
  int height=getPaddingTop();
  int currentWidth=getPaddingLeft();
  int currentHeight=0;
  boolean newLine=false;
  int spacing=0;
  final int count=getChildCount();
  for (int i=0; i < count; i++) {
    View child=getChildAt(i);
    measureChild(child,widthMeasureSpec,heightMeasureSpec);
    LayoutParams lp=(LayoutParams)child.getLayoutParams();
    spacing=mHorizontalSpacing;
    if (lp.horizontalSpacing >= 0) {
      spacing=lp.horizontalSpacing;
    }
    if (growHeight && currentWidth + child.getMeasuredWidth() > widthSize) {
      height+=currentHeight + mVerticalSpacing;
      currentHeight=0;
      width=Math.max(width,currentWidth - spacing);
      currentWidth=getPaddingLeft();
      newLine=true;
    }
 else {
      newLine=false;
    }
    lp.x=currentWidth;
    lp.y=height;
    currentWidth+=child.getMeasuredWidth() + spacing;
    currentHeight=Math.max(currentHeight,child.getMeasuredHeight());
  }
  if (!newLine) {
    width=Math.max(width,currentWidth - spacing);
  }
  width+=getPaddingRight();
  height+=currentHeight + getPaddingBottom();
  setMeasuredDimension(resolveSize(width,widthMeasureSpec),resolveSize(height,heightMeasureSpec));
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int widthSize=MeasureSpec.getSize(widthMeasureSpec) - ViewCompat.getPaddingEnd(this) - ViewCompat.getPaddingStart(this);
  int widthMode=MeasureSpec.getMode(widthMeasureSpec);
  boolean growHeight=widthMode != MeasureSpec.UNSPECIFIED;
  int width=0;
  int height=getPaddingTop();
  int currentWidth=ViewCompat.getPaddingStart(this);
  int currentHeight=0;
  boolean newLine=false;
  int spacing=0;
  final int count=getChildCount();
  for (int i=0; i < count; i++) {
    View child=getChildAt(i);
    measureChild(child,widthMeasureSpec,heightMeasureSpec);
    LayoutParams lp=(LayoutParams)child.getLayoutParams();
    spacing=mHorizontalSpacing;
    if (lp.horizontalSpacing >= 0) {
      spacing=lp.horizontalSpacing;
    }
    if (growHeight && currentWidth + child.getMeasuredWidth() > widthSize) {
      height+=currentHeight + mVerticalSpacing;
      currentHeight=0;
      width=Math.max(width,currentWidth - spacing);
      currentWidth=ViewCompat.getPaddingStart(this);
      newLine=true;
    }
 else {
      newLine=false;
    }
    lp.x=currentWidth;
    lp.y=height;
    currentWidth+=child.getMeasuredWidth() + spacing;
    currentHeight=Math.max(currentHeight,child.getMeasuredHeight());
  }
  if (!newLine) {
    width=Math.max(width,currentWidth - spacing);
  }
  width+=ViewCompat.getPaddingEnd(this);
  height+=currentHeight + getPaddingBottom();
  setMeasuredDimension(resolveSize(width,widthMeasureSpec),resolveSize(height,heightMeasureSpec));
}
Program: 13555
Project: 13555
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int targetWidth=HeaderGridView.this.getMeasuredWidth() - HeaderGridView.this.getPaddingLeft() - HeaderGridView.this.getPaddingRight();
  widthMeasureSpec=MeasureSpec.makeMeasureSpec(targetWidth,MeasureSpec.getMode(widthMeasureSpec));
  super.onMeasure(widthMeasureSpec,heightMeasureSpec);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int targetWidth=HeaderGridView.this.getMeasuredWidth() - ViewCompat.getPaddingStart(HeaderGridView.this) - ViewCompat.getPaddingEnd(HeaderGridView.this);
  widthMeasureSpec=MeasureSpec.makeMeasureSpec(targetWidth,MeasureSpec.getMode(widthMeasureSpec));
  super.onMeasure(widthMeasureSpec,heightMeasureSpec);
}
Program: 13556
Project: 13556
Buggy source:
@Nullable Object getItem(int position){
  if (position < size()) {
    return get(position);
  }
  return null;
}

Fixed version (ground truth):
@Nullable Object getItem(int position){
  if (position >= 0 && position < size()) {
    return get(position);
  }
  return null;
}
Program: 13557
Project: 13557
Buggy source:
private void dispatchRemovePluginAction(){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  mRemovePluginProgressDialog.setMessage(getRemovingPluginMessage());
  DeleteSitePluginPayload payload=new DeleteSitePluginPayload(mSite,getSitePlugin());
  mDispatcher.dispatch(PluginActionBuilder.newDeleteSitePluginAction(payload));
}

Fixed version (ground truth):
protected void dispatchRemovePluginAction(){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  mRemovePluginProgressDialog.setMessage(getRemovingPluginMessage());
  DeleteSitePluginPayload payload=new DeleteSitePluginPayload(mSite,getSitePlugin());
  mDispatcher.dispatch(PluginActionBuilder.newDeleteSitePluginAction(payload));
}
Program: 13559
Project: 13559
Buggy source:
private void toggleText(@NonNull final TextView textView,@NonNull ImageView chevron){
  AniUtils.Duration duration=AniUtils.Duration.SHORT;
  boolean isExpanded=textView.getVisibility() == View.VISIBLE;
  if (isExpanded) {
    AniUtils.fadeOut(textView,duration);
  }
 else {
    AniUtils.fadeIn(textView,duration);
  }
  float startRotate=isExpanded ? -180f : 0f;
  float endRotate=isExpanded ? 0f : -180f;
  ObjectAnimator animRotate=ObjectAnimator.ofFloat(chevron,View.ROTATION,startRotate,endRotate);
  animRotate.setDuration(duration.toMillis(this));
  animRotate.start();
}

Fixed version (ground truth):
protected void toggleText(@NonNull final TextView textView,@NonNull ImageView chevron){
  AniUtils.Duration duration=AniUtils.Duration.SHORT;
  boolean isExpanded=textView.getVisibility() == View.VISIBLE;
  if (isExpanded) {
    AniUtils.fadeOut(textView,duration);
  }
 else {
    AniUtils.fadeIn(textView,duration);
  }
  float startRotate=isExpanded ? -180f : 0f;
  float endRotate=isExpanded ? 0f : -180f;
  ObjectAnimator animRotate=ObjectAnimator.ofFloat(chevron,View.ROTATION,startRotate,endRotate);
  animRotate.setDuration(duration.toMillis(this));
  animRotate.start();
}
Program: 13560
Project: 13560
Buggy source:
private String getWpOrgReviewsUrl(){
  return "String_Node_Str" + mSlug + "String_Node_Str";
}

Fixed version (ground truth):
protected String getWpOrgReviewsUrl(){
  return "String_Node_Str" + mSlug + "String_Node_Str";
}
Program: 13561
Project: 13561
Buggy source:
private void disableAndRemovePlugin(){
  if (!canPluginBeDisabledOrRemoved()) {
    return;
  }
  mIsRemovingPlugin=true;
  showRemovePluginProgressDialog();
  mIsActive=false;
  dispatchConfigurePluginAction(false);
}

Fixed version (ground truth):
protected void disableAndRemovePlugin(){
  if (!canPluginBeDisabledOrRemoved()) {
    return;
  }
  mIsRemovingPlugin=true;
  showRemovePluginProgressDialog();
  mIsActive=false;
  dispatchConfigurePluginAction(false);
}
Program: 13562
Project: 13562
Buggy source:
private void dispatchUpdatePluginAction(){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  if (!PluginUtils.isUpdateAvailable(getSitePlugin(),getWPOrgPlugin()) || mIsUpdatingPlugin) {
    return;
  }
  mIsUpdatingPlugin=true;
  refreshUpdateVersionViews();
  UpdateSitePluginPayload payload=new UpdateSitePluginPayload(mSite,getSitePlugin());
  mDispatcher.dispatch(PluginActionBuilder.newUpdateSitePluginAction(payload));
}

Fixed version (ground truth):
protected void dispatchUpdatePluginAction(){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  if (!PluginUtils.isUpdateAvailable(getSitePlugin(),getWPOrgPlugin()) || mIsUpdatingPlugin) {
    return;
  }
  mIsUpdatingPlugin=true;
  refreshUpdateVersionViews();
  UpdateSitePluginPayload payload=new UpdateSitePluginPayload(mSite,getSitePlugin());
  mDispatcher.dispatch(PluginActionBuilder.newUpdateSitePluginAction(payload));
}
Program: 13563
Project: 13563
Buggy source:
private void openUrl(@Nullable String url){
  if (url != null) {
    ActivityLauncher.openUrlExternal(this,url);
  }
}

Fixed version (ground truth):
protected void openUrl(@Nullable String url){
  if (url != null) {
    ActivityLauncher.openUrlExternal(this,url);
  }
}
Program: 13564
Project: 13564
Buggy source:
private String getWpOrgPluginUrl(){
  return "String_Node_Str" + mSlug;
}

Fixed version (ground truth):
protected String getWpOrgPluginUrl(){
  return "String_Node_Str" + mSlug;
}
Program: 13565
Project: 13565
Buggy source:
private void dispatchConfigurePluginAction(boolean forceUpdate){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  if (!forceUpdate && mIsConfiguringPlugin) {
    return;
  }
  if (getSitePlugin() == null) {
    return;
  }
  mIsConfiguringPlugin=true;
  getSitePlugin().setIsActive(mIsActive);
  getSitePlugin().setIsAutoUpdateEnabled(mIsAutoUpdateEnabled);
  mDispatcher.dispatch(PluginActionBuilder.newConfigureSitePluginAction(new ConfigureSitePluginPayload(mSite,getSitePlugin())));
}

Fixed version (ground truth):
protected void dispatchConfigurePluginAction(boolean forceUpdate){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  if (!forceUpdate && mIsConfiguringPlugin) {
    return;
  }
  if (getSitePlugin() == null) {
    return;
  }
  mIsConfiguringPlugin=true;
  getSitePlugin().setIsActive(mIsActive);
  getSitePlugin().setIsAutoUpdateEnabled(mIsAutoUpdateEnabled);
  mDispatcher.dispatch(PluginActionBuilder.newConfigureSitePluginAction(new ConfigureSitePluginPayload(mSite,getSitePlugin())));
}
Program: 13567
Project: 13567
Buggy source:
private void dispatchInstallPluginAction(){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  mIsUpdatingPlugin=true;
  refreshUpdateVersionViews();
  PluginStore.InstallSitePluginPayload payload=new InstallSitePluginPayload(mSite,mSlug);
  mDispatcher.dispatch(PluginActionBuilder.newInstallSitePluginAction(payload));
}

Fixed version (ground truth):
protected void dispatchInstallPluginAction(){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  mIsUpdatingPlugin=true;
  refreshUpdateVersionViews();
  PluginStore.InstallSitePluginPayload payload=new InstallSitePluginPayload(mSite,mSlug);
  mDispatcher.dispatch(PluginActionBuilder.newInstallSitePluginAction(payload));
}
Program: 13568
Project: 13568
Buggy source:
private void moveBottomButtons(){
  if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
    mBottomButtonsLayout.setOrientation(LinearLayout.HORIZONTAL);
    if (getResources().getInteger(R.integer.isSW600DP) == 0) {
      setSecondaryButtonVisible(true);
    }
 else {
      setSecondaryButtonVisible(false);
    }
    mIconSwitcher.setPadding(mIconSwitcher.getPaddingLeft(),mIconSwitcher.getPaddingBottom(),mIconSwitcher.getPaddingRight(),mIconSwitcher.getPaddingBottom());
  }
 else {
    mBottomButtonsLayout.setOrientation(LinearLayout.VERTICAL);
    setSecondaryButtonVisible(false);
    mIconSwitcher.setPadding(mIconSwitcher.getPaddingLeft(),0,mIconSwitcher.getPaddingRight(),mIconSwitcher.getPaddingBottom());
  }
}

Fixed version (ground truth):
private void moveBottomButtons(){
  if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
    mBottomButtonsLayout.setOrientation(LinearLayout.HORIZONTAL);
    if (getResources().getInteger(R.integer.isSW600DP) == 0) {
      setSecondaryButtonVisible(true);
    }
 else {
      setSecondaryButtonVisible(false);
    }
    ViewCompat.setPaddingRelative(mIconSwitcher,mIconSwitcher.getPaddingLeft(),mIconSwitcher.getPaddingBottom(),mIconSwitcher.getPaddingRight(),mIconSwitcher.getPaddingBottom());
  }
 else {
    mBottomButtonsLayout.setOrientation(LinearLayout.VERTICAL);
    setSecondaryButtonVisible(false);
    ViewCompat.setPaddingRelative(mIconSwitcher,mIconSwitcher.getPaddingLeft(),0,mIconSwitcher.getPaddingRight(),mIconSwitcher.getPaddingBottom());
  }
}
Program: 13570
Project: 13570
Buggy source:
@NonNull @Override public View getView(int position,@Nullable View convertView,@NonNull ViewGroup parent){
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View rowView=inflater.inflate(mResourceId,parent,false);
  TextView textView=(TextView)rowView.findViewById(R.id.categoryRowText);
  CategoryNode node=getItem(position);
  if (node != null) {
    textView.setText(StringEscapeUtils.unescapeHtml4(node.getName()));
    textView.setPadding(DisplayUtils.dpToPx(getContext(),16) * node.getLevel(),0,DisplayUtils.dpToPx(getContext(),16),0);
  }
  return rowView;
}

Fixed version (ground truth):
@NonNull @Override public View getView(int position,@Nullable View convertView,@NonNull ViewGroup parent){
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View rowView=inflater.inflate(mResourceId,parent,false);
  TextView textView=(TextView)rowView.findViewById(R.id.categoryRowText);
  CategoryNode node=getItem(position);
  if (node != null) {
    textView.setText(StringEscapeUtils.unescapeHtml4(node.getName()));
    ViewCompat.setPaddingRelative(textView,DisplayUtils.dpToPx(getContext(),16) * node.getLevel(),0,DisplayUtils.dpToPx(getContext(),16),0);
  }
  return rowView;
}
Program: 13571
Project: 13571
Buggy source:
@Override public View getDropDownView(int position,View convertView,ViewGroup parent){
  LayoutInflater inflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View rowView=inflater.inflate(mResourceId,parent,false);
  TextView textView=(TextView)rowView.findViewById(R.id.categoryRowText);
  textView.setText(StringEscapeUtils.unescapeHtml4(getItem(position).getName()));
  CategoryNode node=getItem(position);
  if (node != null) {
    textView.setText(StringEscapeUtils.unescapeHtml4(node.getName()));
    textView.setPadding(DisplayUtils.dpToPx(getContext(),16) * (node.getLevel() + 1),0,DisplayUtils.dpToPx(getContext(),16),0);
  }
  return rowView;
}

Fixed version (ground truth):
@Override public View getDropDownView(int position,View convertView,ViewGroup parent){
  LayoutInflater inflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View rowView=inflater.inflate(mResourceId,parent,false);
  TextView textView=(TextView)rowView.findViewById(R.id.categoryRowText);
  textView.setText(StringEscapeUtils.unescapeHtml4(getItem(position).getName()));
  CategoryNode node=getItem(position);
  if (node != null) {
    textView.setText(StringEscapeUtils.unescapeHtml4(node.getName()));
    ViewCompat.setPaddingRelative(textView,DisplayUtils.dpToPx(getContext(),16) * (node.getLevel() + 1),0,DisplayUtils.dpToPx(getContext(),16),0);
  }
  return rowView;
}