nus-yam/ex-repair huggingface dataset:
Program: 13632
Project: 13632
Buggy source:
@Override public void run(){
  if (mSitesList.computeVerticalScrollRange() > mSitesList.getHeight()) {
    mBottomShadow.setVisibility(View.VISIBLE);
    mBottomButtonsContainer.setBackgroundResource(R.color.white);
    ViewUtils.setButtonBackgroundColor(getContext(),mConnectMore,R.style.WordPress_Button_Grey,R.attr.colorButtonNormal);
  }
 else {
    mBottomShadow.setVisibility(View.GONE);
    mBottomButtonsContainer.setBackground(null);
    ViewUtils.setButtonBackgroundColor(getContext(),mConnectMore,R.style.WordPress_Button,R.attr.colorButtonNormal);
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (!isAdded()) {
    return;
  }
  if (mSitesList.computeVerticalScrollRange() > mSitesList.getHeight()) {
    mBottomShadow.setVisibility(View.VISIBLE);
    mBottomButtonsContainer.setBackgroundResource(R.color.white);
    ViewUtils.setButtonBackgroundColor(getContext(),mConnectMore,R.style.WordPress_Button_Grey,R.attr.colorButtonNormal);
  }
 else {
    mBottomShadow.setVisibility(View.GONE);
    mBottomButtonsContainer.setBackground(null);
    ViewUtils.setButtonBackgroundColor(getContext(),mConnectMore,R.style.WordPress_Button,R.attr.colorButtonNormal);
  }
}
Program: 13633
Project: 13633
Buggy source:
private void setNewAdapter(){
  mAdapter=new SitePickerAdapter(getActivity(),R.layout.login_epilogue_sites_listitem,0,"String_Node_Str",false,new SitePickerAdapter.OnDataLoadedListener(){
    @Override public void onBeforeLoad(    boolean isEmpty){
    }
    @Override public void onAfterLoad(){
      mSitesList.post(new Runnable(){
        @Override public void run(){
          if (mSitesList.computeVerticalScrollRange() > mSitesList.getHeight()) {
            mBottomShadow.setVisibility(View.VISIBLE);
            mBottomButtonsContainer.setBackgroundResource(R.color.white);
            ViewUtils.setButtonBackgroundColor(getContext(),mConnectMore,R.style.WordPress_Button_Grey,R.attr.colorButtonNormal);
          }
 else {
            mBottomShadow.setVisibility(View.GONE);
            mBottomButtonsContainer.setBackground(null);
            ViewUtils.setButtonBackgroundColor(getContext(),mConnectMore,R.style.WordPress_Button,R.attr.colorButtonNormal);
          }
        }
      }
);
    }
  }
,new SitePickerAdapter.HeaderHandler(){
    @Override public RecyclerView.ViewHolder onCreateViewHolder(    LayoutInflater layoutInflater,    ViewGroup parent,    boolean attachToRoot){
      return new LoginHeaderViewHolder(layoutInflater.inflate(R.layout.login_epilogue_header,parent,false));
    }
    @Override public void onBindViewHolder(    RecyclerView.ViewHolder holder,    SiteList sites){
      refreshAccountDetails((LoginHeaderViewHolder)holder,sites);
    }
  }
,mOldSitesIds);
}

Fixed version (ground truth):
private void setNewAdapter(){
  mAdapter=new SitePickerAdapter(getActivity(),R.layout.login_epilogue_sites_listitem,0,"String_Node_Str",false,new SitePickerAdapter.OnDataLoadedListener(){
    @Override public void onBeforeLoad(    boolean isEmpty){
    }
    @Override public void onAfterLoad(){
      mSitesList.post(new Runnable(){
        @Override public void run(){
          if (!isAdded()) {
            return;
          }
          if (mSitesList.computeVerticalScrollRange() > mSitesList.getHeight()) {
            mBottomShadow.setVisibility(View.VISIBLE);
            mBottomButtonsContainer.setBackgroundResource(R.color.white);
            ViewUtils.setButtonBackgroundColor(getContext(),mConnectMore,R.style.WordPress_Button_Grey,R.attr.colorButtonNormal);
          }
 else {
            mBottomShadow.setVisibility(View.GONE);
            mBottomButtonsContainer.setBackground(null);
            ViewUtils.setButtonBackgroundColor(getContext(),mConnectMore,R.style.WordPress_Button,R.attr.colorButtonNormal);
          }
        }
      }
);
    }
  }
,new SitePickerAdapter.HeaderHandler(){
    @Override public RecyclerView.ViewHolder onCreateViewHolder(    LayoutInflater layoutInflater,    ViewGroup parent,    boolean attachToRoot){
      return new LoginHeaderViewHolder(layoutInflater.inflate(R.layout.login_epilogue_header,parent,false));
    }
    @Override public void onBindViewHolder(    RecyclerView.ViewHolder holder,    SiteList sites){
      refreshAccountDetails((LoginHeaderViewHolder)holder,sites);
    }
  }
,mOldSitesIds);
}
Program: 13634
Project: 13634
Buggy source:
@Override public void onAfterLoad(){
  mSitesList.post(new Runnable(){
    @Override public void run(){
      if (mSitesList.computeVerticalScrollRange() > mSitesList.getHeight()) {
        mBottomShadow.setVisibility(View.VISIBLE);
        mBottomButtonsContainer.setBackgroundResource(R.color.white);
        ViewUtils.setButtonBackgroundColor(getContext(),mConnectMore,R.style.WordPress_Button_Grey,R.attr.colorButtonNormal);
      }
 else {
        mBottomShadow.setVisibility(View.GONE);
        mBottomButtonsContainer.setBackground(null);
        ViewUtils.setButtonBackgroundColor(getContext(),mConnectMore,R.style.WordPress_Button,R.attr.colorButtonNormal);
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void onAfterLoad(){
  mSitesList.post(new Runnable(){
    @Override public void run(){
      if (!isAdded()) {
        return;
      }
      if (mSitesList.computeVerticalScrollRange() > mSitesList.getHeight()) {
        mBottomShadow.setVisibility(View.VISIBLE);
        mBottomButtonsContainer.setBackgroundResource(R.color.white);
        ViewUtils.setButtonBackgroundColor(getContext(),mConnectMore,R.style.WordPress_Button_Grey,R.attr.colorButtonNormal);
      }
 else {
        mBottomShadow.setVisibility(View.GONE);
        mBottomButtonsContainer.setBackground(null);
        ViewUtils.setButtonBackgroundColor(getContext(),mConnectMore,R.style.WordPress_Button,R.attr.colorButtonNormal);
      }
    }
  }
);
}
Program: 13635
Project: 13635
Buggy source:
@Override public void onRedoEnabled(){
  invalidateOptionsHandler.removeCallbacks(invalidateOptionsRunnable);
  invalidateOptionsHandler.postDelayed(invalidateOptionsRunnable,getResources().getInteger(android.R.integer.config_mediumAnimTime));
}

Fixed version (ground truth):
@Override public void onRedoEnabled(){
  if (!isAdded()) {
    return;
  }
  invalidateOptionsHandler.removeCallbacks(invalidateOptionsRunnable);
  invalidateOptionsHandler.postDelayed(invalidateOptionsRunnable,getResources().getInteger(android.R.integer.config_mediumAnimTime));
}
Program: 13636
Project: 13636
Buggy source:
@Override public void onUndoEnabled(){
  invalidateOptionsHandler.removeCallbacks(invalidateOptionsRunnable);
  invalidateOptionsHandler.postDelayed(invalidateOptionsRunnable,getResources().getInteger(android.R.integer.config_mediumAnimTime));
}

Fixed version (ground truth):
@Override public void onUndoEnabled(){
  if (!isAdded()) {
    return;
  }
  invalidateOptionsHandler.removeCallbacks(invalidateOptionsRunnable);
  invalidateOptionsHandler.postDelayed(invalidateOptionsRunnable,getResources().getInteger(android.R.integer.config_mediumAnimTime));
}
Program: 13637
Project: 13637
Buggy source:
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putInt(MediaPreviewFragment.ARG_MEDIA_ID,mMediaId);
  outState.putString(MediaPreviewFragment.ARG_MEDIA_CONTENT_URI,mContentUri);
  if (mMediaIdList != null) {
    outState.putStringArrayList(ARG_ID_LIST,mMediaIdList);
  }
}

Fixed version (ground truth):
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putSerializable(WordPress.SITE,mSite);
  outState.putInt(MediaPreviewFragment.ARG_MEDIA_ID,mMediaId);
  outState.putString(MediaPreviewFragment.ARG_MEDIA_CONTENT_URI,mContentUri);
  if (mMediaIdList != null) {
    outState.putStringArrayList(ARG_ID_LIST,mMediaIdList);
  }
}
Program: 13638
Project: 13638
Buggy source:
private void savePostAsync(final AfterSavePostListener listener){
  new Thread(new Runnable(){
    @Override public void run(){
      try {
        updatePostObject(false);
      }
 catch (      IllegalEditorStateException e) {
        AppLog.e(T.EDITOR,"String_Node_Str");
        return;
      }
      savePostToDb();
      if (listener != null) {
        listener.onPostSave();
      }
    }
  }
).start();
}

Fixed version (ground truth):
private void savePostAsync(final AfterSavePostListener listener){
  new Thread(new Runnable(){
    @Override public void run(){
      try {
        updatePostObject(false);
      }
 catch (      EditorFragmentNotAddedException e) {
        AppLog.e(T.EDITOR,"String_Node_Str");
        return;
      }
      savePostToDb();
      if (listener != null) {
        listener.onPostSave();
      }
    }
  }
).start();
}
Program: 13639
Project: 13639
Buggy source:
private boolean updatePostObject(){
  try {
    updatePostObject(false);
  }
 catch (  IllegalEditorStateException e) {
    AppLog.e(T.EDITOR,"String_Node_Str");
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean updatePostObject(){
  try {
    updatePostObject(false);
  }
 catch (  EditorFragmentNotAddedException e) {
    AppLog.e(T.EDITOR,"String_Node_Str");
    return false;
  }
  return true;
}
Program: 13641
Project: 13641
Buggy source:
@Override public void run(){
  titleText.setText("String_Node_Str");
  contentText.setText("String_Node_Str");
  try {
    assertEquals("String_Node_Str",mFragment.getTitle());
    assertEquals("String_Node_Str",mFragment.getContent());
  }
 catch (  IllegalEditorStateException e) {
    throw new RuntimeException();
  }
  htmlButton.performClick();
  uiThreadLatch2.countDown();
}

Fixed version (ground truth):
@Override public void run(){
  titleText.setText("String_Node_Str");
  contentText.setText("String_Node_Str");
  try {
    assertEquals("String_Node_Str",mFragment.getTitle());
    assertEquals("String_Node_Str",mFragment.getContent());
  }
 catch (  EditorFragmentNotAddedException e) {
    throw new RuntimeException();
  }
  htmlButton.performClick();
  uiThreadLatch2.countDown();
}
Program: 13643
Project: 13643
Buggy source:
/** 
 * Returns the contents of the title field from the JavaScript editor. Should be called from a background thread where possible.
 */
@Override public CharSequence getTitle() throws IllegalEditorStateException {
  if (!isAdded()) {
    throw new IllegalEditorStateException();
  }
  if (mSourceView != null && mSourceView.getVisibility() == View.VISIBLE) {
    mTitle=mSourceViewTitle.getText().toString();
    return StringUtils.notNullStr(mTitle);
  }
  if (Looper.myLooper() == Looper.getMainLooper()) {
    AppLog.d(T.EDITOR,"String_Node_Str");
  }
  mGetTitleCountDownLatch=new CountDownLatch(1);
  getActivity().runOnUiThread(new Runnable(){
    @Override public void run(){
      mWebView.execJavaScriptFromString("String_Node_Str");
    }
  }
);
  try {
    mGetTitleCountDownLatch.await(1,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    AppLog.e(T.EDITOR,e);
    Thread.currentThread().interrupt();
  }
  return StringUtils.notNullStr(mTitle.replaceAll("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Returns the contents of the title field from the JavaScript editor. Should be called from a background thread where possible.
 */
@Override public CharSequence getTitle() throws EditorFragmentNotAddedException {
  if (!isAdded()) {
    throw new EditorFragmentNotAddedException();
  }
  if (mSourceView != null && mSourceView.getVisibility() == View.VISIBLE) {
    mTitle=mSourceViewTitle.getText().toString();
    return StringUtils.notNullStr(mTitle);
  }
  if (Looper.myLooper() == Looper.getMainLooper()) {
    AppLog.d(T.EDITOR,"String_Node_Str");
  }
  mGetTitleCountDownLatch=new CountDownLatch(1);
  getActivity().runOnUiThread(new Runnable(){
    @Override public void run(){
      mWebView.execJavaScriptFromString("String_Node_Str");
    }
  }
);
  try {
    mGetTitleCountDownLatch.await(1,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    AppLog.e(T.EDITOR,e);
    Thread.currentThread().interrupt();
  }
  return StringUtils.notNullStr(mTitle.replaceAll("String_Node_Str","String_Node_Str"));
}
Program: 13644
Project: 13644
Buggy source:
/** 
 * Returns the contents of the content field from the JavaScript editor. Should be called from a background thread where possible.
 */
@Override public CharSequence getContent() throws IllegalEditorStateException {
  if (!isAdded()) {
    throw new IllegalEditorStateException();
  }
  if (mSourceView != null && mSourceView.getVisibility() == View.VISIBLE) {
    mContentHtml=mSourceViewContent.getText().toString();
    return StringUtils.notNullStr(mContentHtml);
  }
  if (Looper.myLooper() == Looper.getMainLooper()) {
    AppLog.d(T.EDITOR,"String_Node_Str");
  }
  mGetContentCountDownLatch=new CountDownLatch(1);
  getActivity().runOnUiThread(new Runnable(){
    @Override public void run(){
      mWebView.execJavaScriptFromString("String_Node_Str");
    }
  }
);
  try {
    mGetContentCountDownLatch.await(1,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    AppLog.e(T.EDITOR,e);
    Thread.currentThread().interrupt();
  }
  return StringUtils.notNullStr(mContentHtml);
}

Fixed version (ground truth):
/** 
 * Returns the contents of the content field from the JavaScript editor. Should be called from a background thread where possible.
 */
@Override public CharSequence getContent() throws EditorFragmentNotAddedException {
  if (!isAdded()) {
    throw new EditorFragmentNotAddedException();
  }
  if (mSourceView != null && mSourceView.getVisibility() == View.VISIBLE) {
    mContentHtml=mSourceViewContent.getText().toString();
    return StringUtils.notNullStr(mContentHtml);
  }
  if (Looper.myLooper() == Looper.getMainLooper()) {
    AppLog.d(T.EDITOR,"String_Node_Str");
  }
  mGetContentCountDownLatch=new CountDownLatch(1);
  getActivity().runOnUiThread(new Runnable(){
    @Override public void run(){
      mWebView.execJavaScriptFromString("String_Node_Str");
    }
  }
);
  try {
    mGetContentCountDownLatch.await(1,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    AppLog.e(T.EDITOR,e);
    Thread.currentThread().interrupt();
  }
  return StringUtils.notNullStr(mContentHtml);
}
Program: 13646
Project: 13646
Buggy source:
@Override public void onSaveInstanceState(Bundle outState){
  try {
    outState.putCharSequence(ATTR_TITLE,getTitle());
    outState.putCharSequence(ATTR_CONTENT,getContent());
  }
 catch (  IllegalEditorStateException e) {
    AppLog.e(T.EDITOR,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onSaveInstanceState(Bundle outState){
  try {
    outState.putCharSequence(ATTR_TITLE,getTitle());
    outState.putCharSequence(ATTR_CONTENT,getContent());
  }
 catch (  EditorFragmentNotAddedException e) {
    AppLog.e(T.EDITOR,"String_Node_Str");
  }
}
Program: 13647
Project: 13647
Buggy source:
public abstract CharSequence getContent() throws IllegalEditorStateException ;

Fixed version (ground truth):
public abstract CharSequence getContent() throws EditorFragmentNotAddedException ;
Program: 13648
Project: 13648
Buggy source:
public abstract CharSequence getTitle() throws IllegalEditorStateException ;

Fixed version (ground truth):
public abstract CharSequence getTitle() throws EditorFragmentNotAddedException ;
Program: 13650
Project: 13650
Buggy source:
private void showBottomBar(){
  if (!isBottomBarShowing() && mBrowserType != MediaBrowserType.AZTEC_EDITOR_PICKER) {
    AniUtils.animateBottomBar(mBottomBar,true);
  }
}

Fixed version (ground truth):
private void showBottomBar(){
  if (!isBottomBarShowing() && canShowBottomBar()) {
    AniUtils.animateBottomBar(mBottomBar,true);
  }
}
Program: 13651
Project: 13651
Buggy source:
private void hideBottomBar(){
  if (isBottomBarShowing() && mBrowserType != MediaBrowserType.AZTEC_EDITOR_PICKER) {
    AniUtils.animateBottomBar(mBottomBar,false);
  }
}

Fixed version (ground truth):
private void hideBottomBar(){
  if (isBottomBarShowing() && canShowBottomBar()) {
    AniUtils.animateBottomBar(mBottomBar,false);
  }
}
Program: 13653
Project: 13653
Buggy source:
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  savePostAsync(null);
  outState.putInt(STATE_KEY_POST_LOCAL_ID,mPost.getId());
  if (!mPost.isLocalDraft()) {
    outState.putLong(STATE_KEY_POST_REMOTE_ID,mPost.getRemotePostId());
  }
  outState.putBoolean(STATE_KEY_IS_NEW_POST,mIsNewPost);
  outState.putSerializable(WordPress.SITE,mSite);
  outState.putParcelableArrayList(STATE_KEY_DROPPED_MEDIA_URIS,mDroppedMediaUris);
  if (mEditorFragment != null) {
    getFragmentManager().putFragment(outState,STATE_KEY_EDITOR_FRAGMENT,mEditorFragment);
  }
}

Fixed version (ground truth):
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  savePostAsync(null);
  outState.putInt(STATE_KEY_POST_LOCAL_ID,mPost.getId());
  if (!mPost.isLocalDraft()) {
    outState.putLong(STATE_KEY_POST_REMOTE_ID,mPost.getRemotePostId());
  }
  outState.putBoolean(STATE_KEY_IS_NEW_POST,mIsNewPost);
  outState.putBoolean(STATE_KEY_IS_PHOTO_PICKER_VISIBLE,isPhotoPickerShowing());
  outState.putSerializable(WordPress.SITE,mSite);
  outState.putParcelableArrayList(STATE_KEY_DROPPED_MEDIA_URIS,mDroppedMediaUris);
  if (mEditorFragment != null) {
    getFragmentManager().putFragment(outState,STATE_KEY_EDITOR_FRAGMENT,mEditorFragment);
  }
}
Program: 13654
Project: 13654
Buggy source:
@Override public void onMediaToolbarButtonClicked(MediaToolbarAction button){
switch (button) {
case CAMERA:
    mPhotoPickerFragment.showCameraPopupMenu(findViewById(button.getButtonId()));
  break;
case GALLERY:
mPhotoPickerFragment.showPickerPopupMenu(findViewById(button.getButtonId()));
break;
case LIBRARY:
mPhotoPickerFragment.doIconClicked(PhotoPickerIcon.WP_MEDIA);
break;
}
}

Fixed version (ground truth):
@Override public void onMediaToolbarButtonClicked(MediaToolbarAction action){
  if (!isPhotoPickerShowing())   return;
switch (action) {
case CAMERA:
    mPhotoPickerFragment.showCameraPopupMenu(findViewById(action.getButtonId()));
  break;
case GALLERY:
mPhotoPickerFragment.showPickerPopupMenu(findViewById(action.getButtonId()));
break;
case LIBRARY:
mPhotoPickerFragment.doIconClicked(PhotoPickerIcon.WP_MEDIA);
break;
}
}
Program: 13655
Project: 13655
Buggy source:
public void enableMediaMode(boolean enable){
  formattingToolbar.enableMediaMode(enable);
  formattingToolbar.toggleMediaToolbar();
  getActivity().invalidateOptionsMenu();
}

Fixed version (ground truth):
public void enableMediaMode(boolean enable){
  formattingToolbar.enableMediaMode(enable);
  if (enable) {
    formattingToolbar.showMediaToolbar();
  }
 else {
    formattingToolbar.hideMediaToolbar();
  }
  getActivity().invalidateOptionsMenu();
}
Program: 13656
Project: 13656
Buggy source:
@Override public boolean onToolbarMediaButtonClicked(){
  mEditorFragmentListener.onTrackableEvent(TrackableEvent.MEDIA_BUTTON_TAPPED);
  if (isActionInProgress()) {
    ToastUtils.showToast(getActivity(),R.string.alert_action_while_uploading,ToastUtils.Duration.LONG);
  }
  if (source.isFocused()) {
    ToastUtils.showToast(getActivity(),R.string.alert_insert_image_html_mode,ToastUtils.Duration.LONG);
  }
 else {
    mEditorFragmentListener.onAddMediaClicked();
    return true;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onToolbarMediaButtonClicked(){
  mEditorFragmentListener.onTrackableEvent(TrackableEvent.MEDIA_BUTTON_TAPPED);
  if (isActionInProgress()) {
    ToastUtils.showToast(getActivity(),R.string.alert_action_while_uploading,ToastUtils.Duration.LONG);
  }
  if (source.isFocused()) {
    ToastUtils.showToast(getActivity(),R.string.alert_insert_image_html_mode,ToastUtils.Duration.LONG);
  }
 else {
    mEditorFragmentListener.onAddMediaClicked();
  }
  return true;
}
Program: 13658
Project: 13658
Buggy source:
private void registerPostModelsForMedia(List<MediaModel> mediaList,boolean isRetry){
  if (mediaList != null && !mediaList.isEmpty()) {
    Set<PostModel> postsToRefresh=PostUtils.getPostsThatIncludeAnyOfTheseMedia(mPostStore,mediaList);
    for (    PostModel post : postsToRefresh) {
      mUploadStore.registerPostModel(post,mediaList);
      if (isThisPostTotallyNewOrFailed(post)) {
        mPostUploadNotifier.addPostInfoToForegroundNotification(post,null);
      }
    }
    if (isRetry) {
      AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_UPLOAD_MEDIA_ERROR_RETRY);
      EventBus.getDefault().post(new UploadService.UploadMediaRetryEvent(mediaList));
    }
  }
}

Fixed version (ground truth):
private void registerPostModelsForMedia(List<MediaModel> mediaList,boolean isRetry){
  if (mediaList != null && !mediaList.isEmpty()) {
    Set<PostModel> postsToRefresh=PostUtils.getPostsThatIncludeAnyOfTheseMedia(mPostStore,mediaList);
    for (    PostModel post : postsToRefresh) {
      if (!mUploadStore.isRegisteredPostModel(post)) {
        mUploadStore.registerPostModel(post,mediaList);
      }
    }
    if (isRetry) {
      AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_UPLOAD_MEDIA_ERROR_RETRY);
      EventBus.getDefault().post(new UploadService.UploadMediaRetryEvent(mediaList));
    }
  }
}
Program: 13659
Project: 13659
Buggy source:
private void unpackPostIntent(@NonNull Intent intent){
  PostModel post=mPostStore.getPostByLocalPostId(intent.getIntExtra(KEY_LOCAL_POST_ID,0));
  if (post != null) {
    boolean shouldTrackAnalytics=intent.getBooleanExtra(KEY_SHOULD_TRACK_ANALYTICS,false);
    if (shouldTrackAnalytics) {
      mPostUploadHandler.registerPostForAnalyticsTracking(post);
    }
    mPostUploadNotifier.cancelFinalNotification(this,post);
    if (intent.getBooleanExtra(KEY_SHOULD_PUBLISH,false)) {
      makePostPublishable(post);
      PostUtils.trackSavePostAnalytics(post,mSiteStore.getSiteByLocalId(post.getLocalSiteId()));
    }
    if (intent.getBooleanExtra(KEY_SHOULD_RETRY,false)) {
      if (AppPrefs.isAztecEditorEnabled()) {
        if (!NetworkUtils.isNetworkAvailable(this)) {
          rebuildNotificationError(post,getString(R.string.no_network_message));
          return;
        }
        aztecRetryUpload(post);
      }
 else {
        ToastUtils.showToast(this,R.string.retry_needs_aztec);
      }
      return;
    }
    if (isThisPostTotallyNewOrFailed(post)) {
      mPostUploadNotifier.addPostInfoToForegroundNotification(post,null);
    }
    if (!hasPendingOrInProgressMediaUploadsForPost(post)) {
      mPostUploadHandler.upload(post);
    }
 else {
      List<MediaModel> activeMedia=MediaUploadHandler.getPendingOrInProgressMediaUploadsForPost(post);
      mUploadStore.registerPostModel(post,activeMedia);
    }
  }
}

Fixed version (ground truth):
private void unpackPostIntent(@NonNull Intent intent){
  PostModel post=mPostStore.getPostByLocalPostId(intent.getIntExtra(KEY_LOCAL_POST_ID,0));
  if (post != null) {
    boolean shouldTrackAnalytics=intent.getBooleanExtra(KEY_SHOULD_TRACK_ANALYTICS,false);
    if (shouldTrackAnalytics) {
      mPostUploadHandler.registerPostForAnalyticsTracking(post);
    }
    mPostUploadNotifier.cancelFinalNotification(this,post);
    if (intent.getBooleanExtra(KEY_SHOULD_PUBLISH,false)) {
      makePostPublishable(post);
      PostUtils.trackSavePostAnalytics(post,mSiteStore.getSiteByLocalId(post.getLocalSiteId()));
    }
    if (intent.getBooleanExtra(KEY_SHOULD_RETRY,false)) {
      if (AppPrefs.isAztecEditorEnabled()) {
        if (!NetworkUtils.isNetworkAvailable(this)) {
          rebuildNotificationError(post,getString(R.string.no_network_message));
          return;
        }
        aztecRetryUpload(post);
      }
 else {
        ToastUtils.showToast(this,R.string.retry_needs_aztec);
      }
      return;
    }
    if (isThisPostTotallyNewOrFailed(post) && !PostUploadHandler.isPostUploadingOrQueued(post)) {
      mPostUploadNotifier.addPostInfoToForegroundNotification(post,null);
    }
    if (!hasPendingOrInProgressMediaUploadsForPost(post)) {
      mPostUploadHandler.upload(post);
    }
 else {
      List<MediaModel> activeMedia=MediaUploadHandler.getPendingOrInProgressMediaUploadsForPost(post);
      mUploadStore.registerPostModel(post,activeMedia);
    }
  }
}
Program: 13660
Project: 13660
Buggy source:
private void refreshPluginVersionViews(){
  if (TextUtils.isEmpty(mPlugin.getVersion())) {
    mInstalledVersionTextView.setVisibility(View.GONE);
  }
 else {
    mInstalledVersionTextView.setVisibility(View.VISIBLE);
    mInstalledVersionTextView.setText(getString(R.string.plugin_installed_version,mPlugin.getVersion()));
  }
  if (!PluginUtils.isUpdateAvailable(mPlugin,mPluginInfo)) {
    mAvailableVersionTextView.setVisibility(View.GONE);
  }
 else {
    mAvailableVersionTextView.setVisibility(View.VISIBLE);
    mAvailableVersionTextView.setText(getString(R.string.plugin_available_version,mPluginInfo.getVersion()));
  }
  refreshUpdateVersionViews();
}

Fixed version (ground truth):
private void refreshPluginVersionViews(){
  if (TextUtils.isEmpty(mPlugin.getVersion())) {
    mInstalledVersionTextView.setVisibility(View.GONE);
  }
 else {
    mInstalledVersionTextView.setVisibility(View.VISIBLE);
    mInstalledVersionTextView.setText(getString(R.string.plugin_installed_version,mPlugin.getVersion()));
  }
  if (!PluginUtils.isUpdateAvailable(mPlugin,mWPOrgPlugin)) {
    mAvailableVersionTextView.setVisibility(View.GONE);
  }
 else {
    mAvailableVersionTextView.setVisibility(View.VISIBLE);
    mAvailableVersionTextView.setText(getString(R.string.plugin_available_version,mWPOrgPlugin.getVersion()));
  }
  refreshUpdateVersionViews();
}
Program: 13661
Project: 13661
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onWPOrgPluginFetched(PluginStore.OnWPOrgPluginFetched event){
  if (isFinishing()) {
    return;
  }
  if (event.isError()) {
    AppLog.e(AppLog.T.API,"String_Node_Str" + event.error.type);
    return;
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onWPOrgPluginFetched(OnWPOrgPluginFetched event){
  if (isFinishing()) {
    return;
  }
  if (event.isError()) {
    AppLog.e(AppLog.T.API,"String_Node_Str" + event.error.type);
    return;
  }
  if (!TextUtils.isEmpty(mPlugin.getSlug()) && mPlugin.getSlug().equals(event.pluginSlug)) {
    mWPOrgPlugin=mPluginStore.getWPOrgPluginBySlug(event.pluginSlug);
    refreshPluginVersionViews();
  }
}
Program: 13663
Project: 13663
Buggy source:
private void dispatchUpdatePluginAction(){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  if (!PluginUtils.isUpdateAvailable(mPlugin,mPluginInfo) || mIsUpdatingPlugin) {
    return;
  }
  mIsUpdatingPlugin=true;
  refreshUpdateVersionViews();
  UpdateSitePluginPayload payload=new UpdateSitePluginPayload(mSite,mPlugin);
  mDispatcher.dispatch(PluginActionBuilder.newUpdateSitePluginAction(payload));
}

Fixed version (ground truth):
private void dispatchUpdatePluginAction(){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  if (!PluginUtils.isUpdateAvailable(mPlugin,mWPOrgPlugin) || mIsUpdatingPlugin) {
    return;
  }
  mIsUpdatingPlugin=true;
  refreshUpdateVersionViews();
  UpdateSitePluginPayload payload=new UpdateSitePluginPayload(mSite,mPlugin);
  mDispatcher.dispatch(PluginActionBuilder.newUpdateSitePluginAction(payload));
}
Program: 13664
Project: 13664
Buggy source:
private void refreshUpdateVersionViews(){
  boolean isUpdateAvailable=PluginUtils.isUpdateAvailable(mPlugin,mPluginInfo);
  if (isUpdateAvailable && !mIsUpdatingPlugin) {
    mUpdateTextView.setVisibility(View.VISIBLE);
  }
 else {
    mUpdateTextView.setVisibility(View.GONE);
  }
  if (mIsUpdatingPlugin) {
    mUpdateProgressBar.setVisibility(View.VISIBLE);
  }
 else {
    mUpdateProgressBar.setVisibility(View.GONE);
  }
}

Fixed version (ground truth):
private void refreshUpdateVersionViews(){
  boolean isUpdateAvailable=PluginUtils.isUpdateAvailable(mPlugin,mWPOrgPlugin);
  if (isUpdateAvailable && !mIsUpdatingPlugin) {
    mUpdateTextView.setVisibility(View.VISIBLE);
  }
 else {
    mUpdateTextView.setVisibility(View.GONE);
  }
  if (mIsUpdatingPlugin) {
    mUpdateProgressBar.setVisibility(View.VISIBLE);
  }
 else {
    mUpdateProgressBar.setVisibility(View.GONE);
  }
}
Program: 13665
Project: 13665
Buggy source:
@Override public void onBindViewHolder(ViewHolder holder,int position){
  SitePluginModel pluginModel=getItem(position);
  if (pluginModel != null) {
    PluginViewHolder pluginHolder=(PluginViewHolder)holder;
    pluginHolder.name.setText(pluginModel.getDisplayName());
    pluginHolder.status.setText(getPluginStatusText(pluginModel));
    WPOrgPluginModel pluginInfo=PluginUtils.getPluginInfo(mPluginStore,pluginModel);
    if (pluginInfo == null) {
      mDispatcher.dispatch(PluginActionBuilder.newFetchWporgPluginAction(pluginModel.getSlug()));
    }
    String iconUrl=pluginInfo != null ? pluginInfo.getIcon() : "String_Node_Str";
    pluginHolder.icon.setImageUrl(iconUrl,ImageType.PLUGIN_ICON);
    if (pluginInfo != null && PluginUtils.isUpdateAvailable(pluginModel,pluginInfo)) {
      pluginHolder.updateAvailableIcon.setVisibility(View.VISIBLE);
    }
 else {
      pluginHolder.updateAvailableIcon.setVisibility(View.GONE);
    }
  }
}

Fixed version (ground truth):
@Override public void onBindViewHolder(ViewHolder holder,int position){
  SitePluginModel pluginModel=getItem(position);
  if (pluginModel != null) {
    PluginViewHolder pluginHolder=(PluginViewHolder)holder;
    pluginHolder.name.setText(pluginModel.getDisplayName());
    pluginHolder.status.setText(getPluginStatusText(pluginModel));
    WPOrgPluginModel wpOrgPlugin=PluginUtils.getWPOrgPlugin(mPluginStore,pluginModel);
    if (wpOrgPlugin == null) {
      mDispatcher.dispatch(PluginActionBuilder.newFetchWporgPluginAction(pluginModel.getSlug()));
    }
    String iconUrl=wpOrgPlugin != null ? wpOrgPlugin.getIcon() : "String_Node_Str";
    pluginHolder.icon.setImageUrl(iconUrl,ImageType.PLUGIN_ICON);
    if (wpOrgPlugin != null && PluginUtils.isUpdateAvailable(pluginModel,wpOrgPlugin)) {
      pluginHolder.updateAvailableIcon.setVisibility(View.VISIBLE);
    }
 else {
      pluginHolder.updateAvailableIcon.setVisibility(View.GONE);
    }
  }
}
Program: 13666
Project: 13666
Buggy source:
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onWPOrgPluginFetched(OnWPOrgPluginFetched event){
  if (isFinishing()) {
    return;
  }
  if (event.isError()) {
    AppLog.e(T.API,"String_Node_Str" + event.error.type);
    return;
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Subscribe(threadMode=ThreadMode.MAIN) public void onWPOrgPluginFetched(OnWPOrgPluginFetched event){
  if (isFinishing()) {
    return;
  }
  if (event.isError()) {
    AppLog.e(T.API,"String_Node_Str" + event.error.type);
    return;
  }
  if (!TextUtils.isEmpty(event.pluginSlug)) {
    mAdapter.refreshPluginWithSlug(event.pluginSlug);
  }
}
Program: 13667
Project: 13667
Buggy source:
static boolean isUpdateAvailable(SitePluginModel plugin,WPOrgPluginModel pluginInfo){
  if (pluginInfo == null || TextUtils.isEmpty(plugin.getVersion()) || TextUtils.isEmpty(pluginInfo.getVersion())) {
    return false;
  }
  Version currentVersion=new Version(plugin.getVersion());
  Version availableVersion=new Version(pluginInfo.getVersion());
  return currentVersion.compareTo(availableVersion) == -1;
}

Fixed version (ground truth):
static boolean isUpdateAvailable(SitePluginModel plugin,WPOrgPluginModel wpOrgPlugin){
  if (wpOrgPlugin == null || TextUtils.isEmpty(plugin.getVersion()) || TextUtils.isEmpty(wpOrgPlugin.getVersion())) {
    return false;
  }
  Version currentVersion=new Version(plugin.getVersion());
  Version availableVersion=new Version(wpOrgPlugin.getVersion());
  return currentVersion.compareTo(availableVersion) == -1;
}
Program: 13669
Project: 13669
Buggy source:
public BitmapDrawable getAztecPlaceholderDrawableFromResID(int drawableId){
  Drawable drawable=getResources().getDrawable(drawableId);
  Bitmap bitmap;
  if (drawable instanceof BitmapDrawable) {
    bitmap=((BitmapDrawable)drawable).getBitmap();
    bitmap=ImageUtils.getScaledBitmapAtLongestSide(bitmap,maxImageWidthForVisualEditor);
  }
 else   if (drawable instanceof VectorDrawable) {
    bitmap=getScaledBitmapFromVectorDrawable((VectorDrawable)drawable,maxImageWidthForVisualEditor,maxImageWidthForVisualEditor);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
  bitmap.setDensity(DisplayMetrics.DENSITY_DEFAULT);
  return new BitmapDrawable(getResources(),bitmap);
}

Fixed version (ground truth):
public BitmapDrawable getAztecPlaceholderDrawableFromResID(@DrawableRes int drawableId){
  Drawable drawable=getResources().getDrawable(drawableId);
  Bitmap bitmap;
  if (drawable instanceof BitmapDrawable) {
    bitmap=((BitmapDrawable)drawable).getBitmap();
    bitmap=ImageUtils.getScaledBitmapAtLongestSide(bitmap,maxImageWidthForVisualEditor);
  }
 else   if (drawable instanceof VectorDrawableCompat || drawable instanceof VectorDrawable) {
    bitmap=Bitmap.createBitmap(maxImageWidthForVisualEditor,maxImageWidthForVisualEditor,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");
  }
  bitmap.setDensity(DisplayMetrics.DENSITY_DEFAULT);
  return new BitmapDrawable(getResources(),bitmap);
}
Program: 13670
Project: 13670
Buggy source:
boolean hasChanges(){
  return !StringUtils.equals(mTerm.getName(),EditTextUtils.getText(mNameView)) || !StringUtils.equals(mTerm.getDescription(),EditTextUtils.getText(mDescriptionView));
}

Fixed version (ground truth):
boolean hasChanges(){
  return !TextUtils.isEmpty(mTerm.getName()) && (!StringUtils.equals(mTerm.getName(),EditTextUtils.getText(mNameView)) || !StringUtils.equals(mTerm.getDescription(),EditTextUtils.getText(mDescriptionView)));
}
Program: 13671
Project: 13671
Buggy source:
public static TagDetailFragment newInstance(@Nullable TermModel term){
  TagDetailFragment fragment=new TagDetailFragment();
  Bundle args=new Bundle();
  if (term == null) {
    args.putBoolean(ARGS_IS_NEW_TERM,true);
    term=new TermModel();
    term.setTaxonomy(TaxonomyStore.DEFAULT_TAXONOMY_TAG);
  }
  args.putSerializable(ARGS_TERM,term);
  fragment.setArguments(args);
  return fragment;
}

Fixed version (ground truth):
public static TagDetailFragment newInstance(@Nullable TermModel term){
  TagDetailFragment fragment=new TagDetailFragment();
  Bundle args=new Bundle();
  if (term == null) {
    args.putBoolean(ARGS_IS_NEW_TERM,true);
    term=new TermModel();
    term.setName("String_Node_Str");
    term.setDescription("String_Node_Str");
    term.setTaxonomy(TaxonomyStore.DEFAULT_TAXONOMY_TAG);
  }
  args.putSerializable(ARGS_TERM,term);
  fragment.setArguments(args);
  return fragment;
}
Program: 13672
Project: 13672
Buggy source:
private void saveTag(@NonNull TermModel term,boolean isNewTerm){
  if (TextUtils.isEmpty(term.getName())) {
    return;
  }
  if (isNewTerm && termExists(term.getName())) {
    ToastUtils.showToast(this,R.string.error_tag_exists);
    return;
  }
  showProgressDialog(R.string.dlg_saving_tag);
  Action action=TaxonomyActionBuilder.newPushTermAction(new TaxonomyStore.RemoteTermPayload(term,mSite));
  mDispatcher.dispatch(action);
}

Fixed version (ground truth):
private void saveTag(@NonNull TermModel term,boolean isNewTerm){
  if (isNewTerm && tagExists(term.getName())) {
    ToastUtils.showToast(this,R.string.error_tag_exists);
    return;
  }
  showProgressDialog(R.string.dlg_saving_tag);
  Action action=TaxonomyActionBuilder.newPushTermAction(new TaxonomyStore.RemoteTermPayload(term,mSite));
  mDispatcher.dispatch(action);
}
Program: 13674
Project: 13674
Buggy source:
@Override public void onMediaDeleted(AztecAttributes aztecAttributes){
  String localMediaId=aztecAttributes.getValue(ATTR_ID_WP);
  mUploadingMediaProgressMax.remove(localMediaId);
  if (!TextUtils.isEmpty(localMediaId)) {
    mEditorFragmentListener.onMediaDeleted(localMediaId);
    removeCaptionFromDeletedMedia(localMediaId);
  }
}

Fixed version (ground truth):
@Override public void onMediaDeleted(AztecAttributes aztecAttributes){
  String localMediaId=aztecAttributes.getValue(ATTR_ID_WP);
  mUploadingMediaProgressMax.remove(localMediaId);
  if (!TextUtils.isEmpty(localMediaId)) {
    mEditorFragmentListener.onMediaDeleted(localMediaId);
  }
}
Program: 13675
Project: 13675
Buggy source:
public void activateTheme(String themeId){
  if (!mSite.isUsingWpComRestApi()) {
    AppLog.i(T.THEMES,"String_Node_Str");
    return;
  }
  ThemeModel theme=mThemeStore.getInstalledThemeByThemeId(mSite,themeId);
  if (theme == null) {
    theme=mThemeStore.getWpComThemeByThemeId(themeId);
    if (theme == null) {
      AppLog.w(T.THEMES,"String_Node_Str");
      return;
    }
    if (mSite.isJetpackConnected()) {
      mDispatcher.dispatch(ThemeActionBuilder.newInstallThemeAction(new ActivateThemePayload(mSite,theme)));
      return;
    }
  }
  mDispatcher.dispatch(ThemeActionBuilder.newActivateThemeAction(new ActivateThemePayload(mSite,theme)));
}

Fixed version (ground truth):
public void activateTheme(String themeId){
  if (!mSite.isUsingWpComRestApi()) {
    AppLog.i(T.THEMES,"String_Node_Str");
    return;
  }
  ThemeModel theme=mThemeStore.getInstalledThemeByThemeId(mSite,themeId);
  if (theme == null) {
    theme=mThemeStore.getWpComThemeByThemeId(themeId);
    if (theme == null) {
      AppLog.w(T.THEMES,"String_Node_Str");
      return;
    }
    if (mSite.isJetpackConnected()) {
      mDispatcher.dispatch(ThemeActionBuilder.newInstallThemeAction(new SiteThemePayload(mSite,theme)));
      return;
    }
  }
  mDispatcher.dispatch(ThemeActionBuilder.newActivateThemeAction(new SiteThemePayload(mSite,theme)));
}
Program: 13676
Project: 13676
Buggy source:
@Override public void onClick(View v){
  getDialog().cancel();
  if (!AppPrefs.isAztecEditorEnabled()) {
    AnalyticsTracker.track(AnalyticsTracker.Stat.EDITOR_AZTEC_PROMO_POSITIVE);
    AppPrefs.setAztecEditorEnabled(true);
    AppPrefs.setVisualEditorEnabled(false);
    SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(getActivity());
    preferences.edit().putString(getString(R.string.pref_key_editor_type),"String_Node_Str").apply();
  }
  ActivityLauncher.addNewPostOrPageForResult(getActivity(),((WPMainActivity)getActivity()).getSelectedSite(),false,true);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  getDialog().cancel();
  if (!AppPrefs.isAztecEditorEnabled()) {
    AnalyticsTracker.track(AnalyticsTracker.Stat.EDITOR_AZTEC_PROMO_POSITIVE);
    AppPrefs.setAztecEditorEnabled(true);
    AppPrefs.setVisualEditorEnabled(false);
    AppPrefs.setNewEditorPromoRequired(false);
  }
  ActivityLauncher.addNewPostOrPageForResult(getActivity(),((WPMainActivity)getActivity()).getSelectedSite(),false,true);
}
Program: 13678
Project: 13678
Buggy source:
public static boolean isVisualEditorEnabled(){
  return isVisualEditorAvailable() && getBoolean(DeletablePrefKey.VISUAL_EDITOR_ENABLED,!isAztecEditorEnabled());
}

Fixed version (ground truth):
public static boolean isVisualEditorEnabled(){
  return isVisualEditorAvailable() && getBoolean(UndeletablePrefKey.VISUAL_EDITOR_ENABLED,!isAztecEditorEnabled());
}
Program: 13679
Project: 13679
Buggy source:
public static void setAztecEditorToolbarExpanded(boolean isExpanded){
  setBoolean(DeletablePrefKey.AZTEC_EDITOR_TOOLBAR_EXPANDED,isExpanded);
}

Fixed version (ground truth):
public static void setAztecEditorToolbarExpanded(boolean isExpanded){
  setBoolean(UndeletablePrefKey.AZTEC_EDITOR_TOOLBAR_EXPANDED,isExpanded);
}
Program: 13680
Project: 13680
Buggy source:
public static boolean isAztecEditorToolbarExpanded(){
  return getBoolean(DeletablePrefKey.AZTEC_EDITOR_TOOLBAR_EXPANDED,false);
}

Fixed version (ground truth):
public static boolean isAztecEditorToolbarExpanded(){
  return getBoolean(UndeletablePrefKey.AZTEC_EDITOR_TOOLBAR_EXPANDED,false);
}
Program: 13681
Project: 13681
Buggy source:
public static void setAztecEditorEnabled(boolean isEnabled){
  setBoolean(DeletablePrefKey.AZTEC_EDITOR_ENABLED,isEnabled);
  AnalyticsTracker.track(isEnabled ? Stat.EDITOR_AZTEC_TOGGLED_ON : Stat.EDITOR_AZTEC_TOGGLED_OFF);
}

Fixed version (ground truth):
public static void setAztecEditorEnabled(boolean isEnabled){
  setBoolean(UndeletablePrefKey.AZTEC_EDITOR_ENABLED,isEnabled);
  AnalyticsTracker.track(isEnabled ? Stat.EDITOR_AZTEC_TOGGLED_ON : Stat.EDITOR_AZTEC_TOGGLED_OFF);
}
Program: 13682
Project: 13682
Buggy source:
public static void setVisualEditorEnabled(boolean visualEditorEnabled){
  setBoolean(DeletablePrefKey.VISUAL_EDITOR_ENABLED,visualEditorEnabled);
  AnalyticsTracker.track(visualEditorEnabled ? Stat.EDITOR_HYBRID_TOGGLED_ON : Stat.EDITOR_HYBRID_TOGGLED_OFF);
}

Fixed version (ground truth):
public static void setVisualEditorEnabled(boolean visualEditorEnabled){
  setBoolean(UndeletablePrefKey.VISUAL_EDITOR_ENABLED,visualEditorEnabled);
  AnalyticsTracker.track(visualEditorEnabled ? Stat.EDITOR_HYBRID_TOGGLED_ON : Stat.EDITOR_HYBRID_TOGGLED_OFF);
}
Program: 13683
Project: 13683
Buggy source:
public static boolean isAztecEditorEnabled(){
  return getBoolean(DeletablePrefKey.AZTEC_EDITOR_ENABLED,false);
}

Fixed version (ground truth):
public static boolean isAztecEditorEnabled(){
  return getBoolean(UndeletablePrefKey.AZTEC_EDITOR_ENABLED,false);
}
Program: 13685
Project: 13685
Buggy source:
@Override public void onVideoPressInfoRequested(final String videoId){
  String videoUrl=mMediaStore.getUrlForSiteVideoWithVideoPressGuid(mSite,videoId);
  if (videoUrl.isEmpty()) {
    if (PermissionUtils.checkAndRequestCameraAndStoragePermissions(this,WPPermissionUtils.EDITOR_MEDIA_PERMISSION_REQUEST_CODE)) {
      runOnUiThread(new Runnable(){
        @Override public void run(){
          if (mPendingVideoPressInfoRequests == null) {
            mPendingVideoPressInfoRequests=new ArrayList<>();
          }
          mPendingVideoPressInfoRequests.add(videoId);
          refreshBlogMedia();
        }
      }
);
    }
 else {
      AppLockManager.getInstance().setExtendedTimeout();
    }
  }
  String posterUrl=WPMediaUtils.getVideoPressVideoPosterFromURL(videoUrl);
  mEditorFragment.setUrlForVideoPressId(videoId,videoUrl,posterUrl);
}

Fixed version (ground truth):
@Override public void onVideoPressInfoRequested(final String videoId){
  String videoUrl=mMediaStore.getUrlForSiteVideoWithVideoPressGuid(mSite,videoId);
  if (videoUrl == null) {
    AppLog.w(T.EDITOR,"String_Node_Str" + videoId + "String_Node_Str"+ mSite.getUrl()+ "String_Node_Str");
    return;
  }
  if (videoUrl.isEmpty()) {
    if (PermissionUtils.checkAndRequestCameraAndStoragePermissions(this,WPPermissionUtils.EDITOR_MEDIA_PERMISSION_REQUEST_CODE)) {
      runOnUiThread(new Runnable(){
        @Override public void run(){
          if (mPendingVideoPressInfoRequests == null) {
            mPendingVideoPressInfoRequests=new ArrayList<>();
          }
          mPendingVideoPressInfoRequests.add(videoId);
          refreshBlogMedia();
        }
      }
);
    }
 else {
      AppLockManager.getInstance().setExtendedTimeout();
    }
  }
  String posterUrl=WPMediaUtils.getVideoPressVideoPosterFromURL(videoUrl);
  mEditorFragment.setUrlForVideoPressId(videoId,videoUrl,posterUrl);
}
Program: 13686
Project: 13686
Buggy source:
private void verifyMediaOnlyUploadsAndNotify(){
  if (!mMediaBatchUploaded.isEmpty()) {
    ArrayList<MediaModel> standAloneMediaItems=new ArrayList<>();
    for (    MediaModel media : mMediaBatchUploaded) {
      MediaModel currentMedia=mMediaStore.getMediaWithLocalId(media.getId());
      if (currentMedia.getLocalPostId() == 0 && MediaUploadState.fromString(currentMedia.getUploadState()) == MediaUploadState.UPLOADED) {
        standAloneMediaItems.add(currentMedia);
      }
    }
    if (!standAloneMediaItems.isEmpty()) {
      SiteModel site=mSiteStore.getSiteByLocalId(standAloneMediaItems.get(0).getLocalSiteId());
      mPostUploadNotifier.updateNotificationSuccessForMedia(standAloneMediaItems,site);
      mMediaBatchUploaded.clear();
    }
  }
}

Fixed version (ground truth):
private void verifyMediaOnlyUploadsAndNotify(){
  if (!mMediaBatchUploaded.isEmpty()) {
    ArrayList<MediaModel> standAloneMediaItems=new ArrayList<>();
    for (    MediaModel media : mMediaBatchUploaded) {
      MediaModel currentMedia=mMediaStore.getMediaWithLocalId(media.getId());
      if (currentMedia != null && currentMedia.getLocalPostId() == 0 && MediaUploadState.fromString(currentMedia.getUploadState()) == MediaUploadState.UPLOADED) {
        standAloneMediaItems.add(currentMedia);
      }
    }
    if (!standAloneMediaItems.isEmpty()) {
      SiteModel site=mSiteStore.getSiteByLocalId(standAloneMediaItems.get(0).getLocalSiteId());
      mPostUploadNotifier.updateNotificationSuccessForMedia(standAloneMediaItems,site);
      mMediaBatchUploaded.clear();
    }
  }
}
Program: 13688
Project: 13688
Buggy source:
@Override public void onFocusChange(View view,boolean hasFocus){
  if (hasFocus && !isDisplayingEmailHints && !hasDismissedEmailHints) {
    isDisplayingEmailHints=true;
    getEmailHints();
  }
}

Fixed version (ground truth):
@Override public void onFocusChange(View view,boolean hasFocus){
  if (hasFocus && !mIsDisplayingEmailHints && !mHasDismissedEmailHints) {
    mIsDisplayingEmailHints=true;
    getEmailHints();
  }
}
Program: 13689
Project: 13689
Buggy source:
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  if (requestCode == EMAIL_CREDENTIALS_REQUEST_CODE) {
    if (resultCode == RESULT_OK) {
      Credential credential=data.getParcelableExtra(Credential.EXTRA_KEY);
      mEmailInput.getEditText().setText(credential.getId());
      next(getCleanedEmail());
    }
 else {
      hasDismissedEmailHints=true;
      mEmailInput.getEditText().postDelayed(new Runnable(){
        @Override public void run(){
          if (isAdded()) {
            EditTextUtils.showSoftInput(mEmailInput.getEditText());
          }
        }
      }
,getResources().getInteger(android.R.integer.config_mediumAnimTime));
    }
    isDisplayingEmailHints=false;
  }
}

Fixed version (ground truth):
@Override public void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  if (requestCode == EMAIL_CREDENTIALS_REQUEST_CODE) {
    if (resultCode == RESULT_OK) {
      Credential credential=data.getParcelableExtra(Credential.EXTRA_KEY);
      mEmailInput.getEditText().setText(credential.getId());
      next(getCleanedEmail());
    }
 else {
      mHasDismissedEmailHints=true;
      mEmailInput.getEditText().postDelayed(new Runnable(){
        @Override public void run(){
          if (isAdded()) {
            EditTextUtils.showSoftInput(mEmailInput.getEditText());
          }
        }
      }
,getResources().getInteger(android.R.integer.config_mediumAnimTime));
    }
    mIsDisplayingEmailHints=false;
  }
}