nus-yam/ex-repair huggingface dataset:
Program: 14856
Project: 14856
Buggy source:
@Override public void onBlogChanged(){
  super.onBlogChanged();
  stopService(new Intent(this,StatsService.class));
  FragmentManager fm=getSupportFragmentManager();
  FragmentTransaction ft=fm.beginTransaction();
  StatsAbsViewFragment fragment;
  fragment=StatsAbsViewFragment.newInstance(StatsViewType.VISITORS_AND_VIEWS);
  ft.replace(R.id.stats_visitors_and_views_container,fragment,StatsVisitorsAndViewsFragment.TAG);
  fragment=StatsAbsViewFragment.newInstance(StatsViewType.TOP_POSTS_AND_PAGES);
  ft.replace(R.id.stats_top_posts_container,fragment,StatsTopPostsAndPagesFragment.TAG);
  fragment=StatsAbsViewFragment.newInstance(StatsViewType.VIEWS_BY_COUNTRY);
  ft.replace(R.id.stats_geoviews_container,fragment,StatsGeoviewsFragment.TAG);
  fragment=StatsAbsViewFragment.newInstance(StatsViewType.CLICKS);
  ft.replace(R.id.stats_clicks_container,fragment,StatsClicksFragment.TAG);
  fragment=StatsAbsViewFragment.newInstance(StatsViewType.SEARCH_ENGINE_TERMS);
  ft.replace(R.id.stats_searchengine_container,fragment,StatsSearchEngineTermsFragment.TAG);
  fragment=StatsAbsViewFragment.newInstance(StatsViewType.TOTALS_FOLLOWERS_AND_SHARES);
  ft.replace(R.id.stats_totals_followers_shares_container,fragment,StatsTotalsFollowersAndSharesFragment.TAG);
  fragment=StatsReferrersFragment.newInstance(StatsViewType.REFERRERS);
  ft.replace(R.id.stats_referrers_container,fragment,StatsReferrersFragment.TAG);
  ft.commit();
  refreshStats();
}

Fixed version (ground truth):
@Override public void onBlogChanged(){
  super.onBlogChanged();
  stopStatsService();
  FragmentManager fm=getSupportFragmentManager();
  FragmentTransaction ft=fm.beginTransaction();
  StatsAbsViewFragment fragment;
  fragment=StatsAbsViewFragment.newInstance(StatsViewType.VISITORS_AND_VIEWS);
  ft.replace(R.id.stats_visitors_and_views_container,fragment,StatsVisitorsAndViewsFragment.TAG);
  fragment=StatsAbsViewFragment.newInstance(StatsViewType.TOP_POSTS_AND_PAGES);
  ft.replace(R.id.stats_top_posts_container,fragment,StatsTopPostsAndPagesFragment.TAG);
  fragment=StatsAbsViewFragment.newInstance(StatsViewType.VIEWS_BY_COUNTRY);
  ft.replace(R.id.stats_geoviews_container,fragment,StatsGeoviewsFragment.TAG);
  fragment=StatsAbsViewFragment.newInstance(StatsViewType.CLICKS);
  ft.replace(R.id.stats_clicks_container,fragment,StatsClicksFragment.TAG);
  fragment=StatsAbsViewFragment.newInstance(StatsViewType.SEARCH_ENGINE_TERMS);
  ft.replace(R.id.stats_searchengine_container,fragment,StatsSearchEngineTermsFragment.TAG);
  fragment=StatsAbsViewFragment.newInstance(StatsViewType.TOTALS_FOLLOWERS_AND_SHARES);
  ft.replace(R.id.stats_totals_followers_shares_container,fragment,StatsTotalsFollowersAndSharesFragment.TAG);
  fragment=StatsReferrersFragment.newInstance(StatsViewType.REFERRERS);
  ft.replace(R.id.stats_referrers_container,fragment,StatsReferrersFragment.TAG);
  ft.commit();
  refreshStats();
}
Program: 14857
Project: 14857
Buggy source:
@Override protected void onDestroy(){
  stopService(new Intent(this,StatsService.class));
  super.onDestroy();
}

Fixed version (ground truth):
@Override protected void onDestroy(){
  stopStatsService();
  super.onDestroy();
}
Program: 14858
Project: 14858
Buggy source:
synchronized void waitForResponse(){
  if (!mIsCompleted) {
    AppLog.d(AppLog.T.STATS,"String_Node_Str" + getTaskName());
    while (!mIsCompleted) {
      try {
        Thread.sleep(250);
      }
 catch (      InterruptedException e) {
        AppLog.w(AppLog.T.STATS,"String_Node_Str" + getTaskName());
        return;
      }
    }
  }
  AppLog.d(AppLog.T.STATS,"String_Node_Str" + getTaskName());
}

Fixed version (ground truth):
synchronized void waitForResponse(){
  if (!mIsCompleted) {
    AppLog.d(AppLog.T.STATS,"String_Node_Str" + getTaskName());
    while (!mIsCompleted) {
      try {
        Thread.sleep(100);
      }
 catch (      InterruptedException e) {
        AppLog.w(AppLog.T.STATS,"String_Node_Str" + getTaskName());
        return;
      }
    }
  }
  AppLog.d(AppLog.T.STATS,"String_Node_Str" + getTaskName());
}
Program: 14859
Project: 14859
Buggy source:
@Override public void onLoadMore(boolean loadMore){
  if (mCanLoadMorePosts)   requestPosts(loadMore);
}

Fixed version (ground truth):
@Override public void onLoadMore(boolean loadMore){
  if (mCanLoadMorePosts && !mIsFetchingPosts)   requestPosts(loadMore);
}
Program: 14860
Project: 14860
Buggy source:
@Override public void onClick(View v){
  mParentActivity.newPost();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  if (hasActivity()) {
    PostsActivity postsActivity=(PostsActivity)getActivity();
    postsActivity.newPost();
  }
}
Program: 14861
Project: 14861
Buggy source:
@Override public void onFailure(ApiHelper.ErrorType errorType,String errorMessage,Throwable throwable){
  if (!hasActivity())   return;
  mOnRefreshListener.onRefresh(false);
  if (mProgressFooterView != null)   mProgressFooterView.setVisibility(View.GONE);
  if (!TextUtils.isEmpty(errorMessage) && !getActivity().isFinishing()) {
    FragmentTransaction ft=getFragmentManager().beginTransaction();
    WPAlertDialogFragment alert=WPAlertDialogFragment.newAlertDialog(mIsPage ? getString(R.string.error_refresh_pages) : getString(R.string.error_refresh_posts));
    try {
      alert.show(ft,"String_Node_Str");
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override public void onFailure(ApiHelper.ErrorType errorType,String errorMessage,Throwable throwable){
  mIsFetchingPosts=false;
  if (!hasActivity())   return;
  mOnRefreshListener.onRefresh(false);
  if (mProgressFooterView != null)   mProgressFooterView.setVisibility(View.GONE);
  if (!TextUtils.isEmpty(errorMessage) && !getActivity().isFinishing()) {
    FragmentTransaction ft=getFragmentManager().beginTransaction();
    WPAlertDialogFragment alert=WPAlertDialogFragment.newAlertDialog(mIsPage ? getString(R.string.error_refresh_pages) : getString(R.string.error_refresh_posts));
    try {
      alert.show(ft,"String_Node_Str");
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 14862
Project: 14862
Buggy source:
public void onItemClick(AdapterView<?> arg0,View v,int position,long id){
  if (position >= getPostListAdapter().getCount())   return;
  if (v == null)   return;
  PostsListPost postsListPost=(PostsListPost)getPostListAdapter().getItem(position);
  if (postsListPost == null)   return;
  if (!mParentActivity.mIsRefreshing) {
    showPost(postsListPost.getPostId());
  }
 else {
    Toast.makeText(mParentActivity,R.string.please_wait_refresh_done,Toast.LENGTH_SHORT).show();
  }
}

Fixed version (ground truth):
public void onItemClick(AdapterView<?> arg0,View v,int position,long id){
  if (position >= getPostListAdapter().getCount())   return;
  if (v == null)   return;
  PostsListPost postsListPost=(PostsListPost)getPostListAdapter().getItem(position);
  if (postsListPost == null)   return;
  if (!mIsFetchingPosts) {
    showPost(postsListPost.getPostId());
  }
 else   if (hasActivity()) {
    Toast.makeText(getActivity(),R.string.please_wait_refresh_done,Toast.LENGTH_SHORT).show();
  }
}
Program: 14863
Project: 14863
Buggy source:
public PostsListAdapter getPostListAdapter(){
  if (mPostsListAdapter == null) {
    PostsListAdapter.OnLoadMoreListener loadMoreListener=new PostsListAdapter.OnLoadMoreListener(){
      @Override public void onLoadMore(      boolean loadMore){
        if (mCanLoadMorePosts)         requestPosts(loadMore);
      }
    }
;
    PostsListAdapter.OnPostsLoadedListener postsLoadedListener=new PostsListAdapter.OnPostsLoadedListener(){
      @Override public void onPostsLoaded(){
        if (mShouldSelectFirstPost) {
          mShouldSelectFirstPost=false;
          if (mPostsListAdapter.getCount() > 0) {
            PostsListPost postsListPost=(PostsListPost)mPostsListAdapter.getItem(0);
            if (postsListPost != null) {
              showPost(postsListPost.getPostId());
              getListView().setItemChecked(0,true);
            }
          }
        }
      }
    }
;
    mPostsListAdapter=new PostsListAdapter(getActivity(),mIsPage,loadMoreListener,postsLoadedListener);
  }
  return mPostsListAdapter;
}

Fixed version (ground truth):
public PostsListAdapter getPostListAdapter(){
  if (mPostsListAdapter == null) {
    PostsListAdapter.OnLoadMoreListener loadMoreListener=new PostsListAdapter.OnLoadMoreListener(){
      @Override public void onLoadMore(      boolean loadMore){
        if (mCanLoadMorePosts && !mIsFetchingPosts)         requestPosts(loadMore);
      }
    }
;
    PostsListAdapter.OnPostsLoadedListener postsLoadedListener=new PostsListAdapter.OnPostsLoadedListener(){
      @Override public void onPostsLoaded(      int postCount){
        if (postCount == 0 && mCanLoadMorePosts) {
          requestPosts(false);
        }
 else         if (mShouldSelectFirstPost) {
          mShouldSelectFirstPost=false;
          if (mPostsListAdapter.getCount() > 0) {
            PostsListPost postsListPost=(PostsListPost)mPostsListAdapter.getItem(0);
            if (postsListPost != null) {
              showPost(postsListPost.getPostId());
              getListView().setItemChecked(0,true);
            }
          }
        }
      }
    }
;
    mPostsListAdapter=new PostsListAdapter(getActivity(),mIsPage,loadMoreListener,postsLoadedListener);
  }
  return mPostsListAdapter;
}
Program: 14864
Project: 14864
Buggy source:
public void onResume(){
  super.onResume();
  mParentActivity=(PostsActivity)getActivity();
  if (WordPress.getCurrentBlog() != null) {
    getListView().setAdapter(getPostListAdapter());
    getPostListAdapter().loadPosts();
  }
}

Fixed version (ground truth):
public void onResume(){
  super.onResume();
  if (WordPress.getCurrentBlog() != null) {
    getListView().setAdapter(getPostListAdapter());
    getPostListAdapter().loadPosts();
  }
}
Program: 14866
Project: 14866
Buggy source:
@Override public void onPostsLoaded(){
  if (mShouldSelectFirstPost) {
    mShouldSelectFirstPost=false;
    if (mPostsListAdapter.getCount() > 0) {
      PostsListPost postsListPost=(PostsListPost)mPostsListAdapter.getItem(0);
      if (postsListPost != null) {
        showPost(postsListPost.getPostId());
        getListView().setItemChecked(0,true);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onPostsLoaded(int postCount){
  if (postCount == 0 && mCanLoadMorePosts) {
    requestPosts(false);
  }
 else   if (mShouldSelectFirstPost) {
    mShouldSelectFirstPost=false;
    if (mPostsListAdapter.getCount() > 0) {
      PostsListPost postsListPost=(PostsListPost)mPostsListAdapter.getItem(0);
      if (postsListPost != null) {
        showPost(postsListPost.getPostId());
        getListView().setItemChecked(0,true);
      }
    }
  }
}
Program: 14868
Project: 14868
Buggy source:
@Override public void onSuccess(int postCount){
  if (!hasActivity())   return;
  mOnRefreshListener.onRefresh(false);
  if (postCount == 0) {
    mCanLoadMorePosts=false;
    return;
  }
 else   if (postCount == getPostListAdapter().getRemotePostCount() && postCount != POSTS_REQUEST_COUNT) {
    mCanLoadMorePosts=false;
    if (mProgressFooterView != null) {
      mProgressFooterView.setVisibility(View.GONE);
    }
    return;
  }
  getPostListAdapter().loadPosts();
}

Fixed version (ground truth):
@Override public void onSuccess(int postCount){
  mIsFetchingPosts=false;
  if (!hasActivity())   return;
  mOnRefreshListener.onRefresh(false);
  if (postCount == 0) {
    mCanLoadMorePosts=false;
  }
 else   if (postCount == getPostListAdapter().getRemotePostCount() && postCount != POSTS_REQUEST_COUNT) {
    mCanLoadMorePosts=false;
    if (mProgressFooterView != null) {
      mProgressFooterView.setVisibility(View.GONE);
    }
    return;
  }
  getPostListAdapter().loadPosts();
}
Program: 14869
Project: 14869
Buggy source:
@Override protected Void doInBackground(Void... nada){
  if (WordPress.getCurrentBlog() != null) {
    List<PostsListPost> postsList=WordPress.wpDB.getPostsListPosts(WordPress.getCurrentBlog().getLocalTableBlogId(),mIsPage);
    if (postsList.size() == 0 && mOnLoadMoreListener != null) {
      mOnLoadMoreListener.onLoadMore(false);
    }
 else {
      setPosts(postsList);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override protected Void doInBackground(Void... nada){
  if (WordPress.getCurrentBlog() != null) {
    List<PostsListPost> postsList=WordPress.wpDB.getPostsListPosts(WordPress.getCurrentBlog().getLocalTableBlogId(),mIsPage);
    setPosts(postsList);
  }
  return null;
}
Program: 14870
Project: 14870
Buggy source:
public void onPostsLoaded();

Fixed version (ground truth):
public void onPostsLoaded(int postCount);
Program: 14871
Project: 14871
Buggy source:
@Override protected void onPostExecute(Void nada){
  notifyDataSetChanged();
  if (mOnPostsLoadedListener != null) {
    mOnPostsLoadedListener.onPostsLoaded();
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(Void nada){
  notifyDataSetChanged();
  if (mOnPostsLoadedListener != null && mPosts != null) {
    mOnPostsLoadedListener.onPostsLoaded(mPosts.size());
  }
}
Program: 14872
Project: 14872
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (WordPress.wpDB == null) {
    Toast.makeText(this,R.string.fatal_db_error,Toast.LENGTH_LONG).show();
    finish();
    return;
  }
  mNoMenuDrawer=getIntent().getBooleanExtra(ARG_NO_MENU_DRAWER,false);
  if (mNoMenuDrawer) {
    setContentView(R.layout.stats_activity);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  }
 else {
    createMenuDrawer(R.layout.stats_activity);
  }
  mFragmentContainer=(LinearLayout)findViewById(R.id.stats_fragment_container);
  mColumnLeft=(LinearLayout)findViewById(R.id.stats_tablet_col_left);
  mColumnRight=(LinearLayout)findViewById(R.id.stats_tablet_col_right);
  loadStatsFragments();
  setTitle(R.string.stats);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (WordPress.wpDB == null) {
    Toast.makeText(this,R.string.fatal_db_error,Toast.LENGTH_LONG).show();
    finish();
    return;
  }
  mNoMenuDrawer=getIntent().getBooleanExtra(ARG_NO_MENU_DRAWER,false);
  if (mNoMenuDrawer) {
    setContentView(R.layout.stats_activity);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  }
 else {
    createMenuDrawer(R.layout.stats_activity);
  }
  mFragmentContainer=(LinearLayout)findViewById(R.id.stats_fragment_container);
  mColumnLeft=(LinearLayout)findViewById(R.id.stats_tablet_col_left);
  mColumnRight=(LinearLayout)findViewById(R.id.stats_tablet_col_right);
  loadStatsFragments();
  setTitle(R.string.stats);
  restoreState(savedInstanceState);
}
Program: 14873
Project: 14873
Buggy source:
public String getTitleForWPImageSpan(Context ctx,String filePath){
  if (filePath == null)   return null;
  Uri curStream=null;
  String title="String_Node_Str";
  if (filePath != null) {
    if (!filePath.contains("String_Node_Str"))     curStream=Uri.parse("String_Node_Str" + filePath);
 else     curStream=Uri.parse(filePath);
  }
  if (curStream == null) {
    return null;
  }
  if (filePath.contains("String_Node_Str")) {
    return "String_Node_Str";
  }
 else {
    String[] projection=new String[]{Images.Thumbnails.DATA};
    String path="String_Node_Str";
    Cursor cur;
    try {
      cur=ctx.getContentResolver().query(curStream,projection,null,null,null);
    }
 catch (    Exception e1) {
      return null;
    }
    File jpeg=null;
    if (cur != null) {
      String thumbData="String_Node_Str";
      if (cur.moveToFirst()) {
        int dataColumn=cur.getColumnIndex(Images.Media.DATA);
        thumbData=cur.getString(dataColumn);
      }
      cur.close();
      if (thumbData == null) {
        return null;
      }
      jpeg=new File(thumbData);
      path=thumbData;
    }
 else {
      path=filePath.toString().replace("String_Node_Str","String_Node_Str");
      jpeg=new File(path);
    }
    title=jpeg.getName();
    return title;
  }
}

Fixed version (ground truth):
public String getTitleForWPImageSpan(Context ctx,String filePath){
  if (filePath == null)   return null;
  Uri curStream=null;
  String title="String_Node_Str";
  if (filePath != null) {
    if (!filePath.contains("String_Node_Str"))     curStream=Uri.parse("String_Node_Str" + filePath);
 else     curStream=Uri.parse(filePath);
  }
  if (curStream == null) {
    return null;
  }
  if (filePath.contains("String_Node_Str")) {
    return "String_Node_Str";
  }
 else {
    String[] projection=new String[]{Images.Thumbnails.DATA};
    Cursor cur;
    try {
      cur=ctx.getContentResolver().query(curStream,projection,null,null,null);
    }
 catch (    Exception e1) {
      AppLog.e(T.UTILS,e1);
      return null;
    }
    File jpeg=null;
    if (cur != null) {
      String thumbData="String_Node_Str";
      if (cur.moveToFirst()) {
        int dataColumn=cur.getColumnIndex(Images.Media.DATA);
        thumbData=cur.getString(dataColumn);
      }
      cur.close();
      if (thumbData == null) {
        return null;
      }
      jpeg=new File(thumbData);
    }
 else {
      String path=filePath.toString().replace("String_Node_Str","String_Node_Str");
      jpeg=new File(path);
    }
    title=jpeg.getName();
    return title;
  }
}
Program: 14875
Project: 14875
Buggy source:
public static int[] getImageSize(Uri uri,Context context){
  String path=null;
  if (uri.toString().contains("String_Node_Str")) {
    String[] projection;
    Uri imgPath;
    projection=new String[]{Images.Media._ID,Images.Media.DATA};
    imgPath=uri;
    Cursor cur=context.getContentResolver().query(imgPath,projection,null,null,null);
    String thumbData="String_Node_Str";
    if (cur.moveToFirst()) {
      int dataColumn;
      dataColumn=cur.getColumnIndex(Images.Media.DATA);
      thumbData=cur.getString(dataColumn);
      path=thumbData;
    }
    cur.close();
  }
 else {
    path=uri.toString().replace("String_Node_Str","String_Node_Str");
  }
  BitmapFactory.Options options=new BitmapFactory.Options();
  options.inJustDecodeBounds=true;
  BitmapFactory.decodeFile(path,options);
  int imageHeight=options.outHeight;
  int imageWidth=options.outWidth;
  int[] dimensions={imageWidth,imageHeight};
  return dimensions;
}

Fixed version (ground truth):
public static int[] getImageSize(Uri uri,Context context){
  String path=null;
  BitmapFactory.Options options=new BitmapFactory.Options();
  options.inJustDecodeBounds=true;
  if (uri.toString().contains("String_Node_Str")) {
    String[] projection=new String[]{Images.Media._ID,Images.Media.DATA};
    Cursor cur=context.getContentResolver().query(uri,projection,null,null,null);
    if (cur != null) {
      if (cur.moveToFirst()) {
        int dataColumn=cur.getColumnIndex(Images.Media.DATA);
        path=cur.getString(dataColumn);
      }
      cur.close();
    }
  }
  if (TextUtils.isEmpty(path)) {
    path=uri.toString().replace("String_Node_Str","String_Node_Str");
    path=path.replace("String_Node_Str","String_Node_Str");
  }
  BitmapFactory.decodeFile(path,options);
  int imageHeight=options.outHeight;
  int imageWidth=options.outWidth;
  int[] dimensions={imageWidth,imageHeight};
  return dimensions;
}
Program: 14877
Project: 14877
Buggy source:
public static void showToastOrAuthAlert(Context context,String xmlrpcMessage,String friendlyMessage){
  if (context == null)   return;
  if ((context instanceof FragmentActivity) && !TextUtils.isEmpty(xmlrpcMessage) && xmlrpcMessage.contains("String_Node_Str") || xmlrpcMessage.contains("String_Node_Str")) {
    FragmentActivity activity=(FragmentActivity)context;
    if (activity.isFinishing())     return;
    FragmentTransaction ft=activity.getSupportFragmentManager().beginTransaction();
    AuthErrorDialogFragment authAlert=AuthErrorDialogFragment.newInstance(WordPress.getCurrentBlog().isDotcomFlag());
    ft.add(authAlert,"String_Node_Str");
    ft.commitAllowingStateLoss();
  }
 else {
    String errorMessage=TextUtils.isEmpty(friendlyMessage) ? context.getString(R.string.error_generic) : friendlyMessage;
    showToast(context,errorMessage,Duration.LONG);
  }
}

Fixed version (ground truth):
public static void showToastOrAuthAlert(Context context,String xmlrpcMessage,String friendlyMessage){
  if (context == null)   return;
  boolean isLoginLimitReached=false;
  if (!TextUtils.isEmpty(xmlrpcMessage)) {
    String lowerCaseXmlrpcMessage=xmlrpcMessage.toLowerCase();
    if (lowerCaseXmlrpcMessage.contains("String_Node_Str") && (lowerCaseXmlrpcMessage.contains("String_Node_Str") || lowerCaseXmlrpcMessage.contains("String_Node_Str")))     isLoginLimitReached=true;
  }
  if ((context instanceof FragmentActivity) && !TextUtils.isEmpty(xmlrpcMessage) && xmlrpcMessage.contains("String_Node_Str")) {
    FragmentActivity activity=(FragmentActivity)context;
    if (activity.isFinishing())     return;
    FragmentTransaction ft=activity.getSupportFragmentManager().beginTransaction();
    AuthErrorDialogFragment authAlert=AuthErrorDialogFragment.newInstance(WordPress.getCurrentBlog().isDotcomFlag());
    ft.add(authAlert,"String_Node_Str");
    ft.commitAllowingStateLoss();
  }
 else {
    String errorMessage=null;
    if (isLoginLimitReached) {
      errorMessage=context.getString(R.string.limit_reached);
    }
 else {
      errorMessage=TextUtils.isEmpty(friendlyMessage) ? context.getString(R.string.error_generic) : friendlyMessage;
    }
    showToast(context,errorMessage,Duration.LONG);
  }
}
Program: 14878
Project: 14878
Buggy source:
@Override public void onFailure(VolleyError error){
  if (mSignInDialog != null && mSignInDialog.isShowing()) {
    return;
  }
  if (!isFinishing() && error.networkResponse != null && error.networkResponse.statusCode == 403) {
    AlertDialog.Builder builder=new AlertDialog.Builder(StatsActivity.this);
    builder.setTitle(getString(R.string.jetpack_stats_unauthorized)).setMessage(getString(R.string.jetpack_stats_switch_user));
    builder.setPositiveButton(R.string.yes,new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int id){
        startWPComLoginActivity();
      }
    }
);
    builder.setNegativeButton(R.string.no,new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int id){
      }
    }
);
    mSignInDialog=builder.create();
    mSignInDialog.show();
    return;
  }
  if (!isFinishing()) {
    ToastUtils.showToast(getBaseContext(),R.string.error_refresh_stats,ToastUtils.Duration.LONG);
  }
}

Fixed version (ground truth):
@Override public void onFailure(VolleyError error){
  if (mSignInDialog != null && mSignInDialog.isShowing()) {
    return;
  }
  if (isFinishing())   return;
  if (error.networkResponse != null && error.networkResponse.statusCode == 403) {
    AlertDialog.Builder builder=new AlertDialog.Builder(StatsActivity.this);
    builder.setTitle(getString(R.string.jetpack_stats_unauthorized)).setMessage(getString(R.string.jetpack_stats_switch_user));
    builder.setPositiveButton(R.string.yes,new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int id){
        startWPComLoginActivity();
      }
    }
);
    builder.setNegativeButton(R.string.no,new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int id){
      }
    }
);
    mSignInDialog=builder.create();
    mSignInDialog.show();
    return;
  }
  ToastUtils.showToastOrAuthAlert(StatsActivity.this,error,StatsActivity.this.getString(R.string.error_refresh_stats));
}
Program: 14880
Project: 14880
Buggy source:
public static void showToastOrAuthAlert(Context context,String xmlrpcMessage,String friendlyMessage){
  if (context == null)   return;
  if ((context instanceof FragmentActivity) && !TextUtils.isEmpty(xmlrpcMessage) && xmlrpcMessage.contains("String_Node_Str") || xmlrpcMessage.contains("String_Node_Str")) {
    FragmentActivity activity=(FragmentActivity)context;
    if (activity.isFinishing())     return;
    FragmentTransaction ft=activity.getSupportFragmentManager().beginTransaction();
    AuthErrorDialogFragment authAlert=AuthErrorDialogFragment.newInstance(WordPress.getCurrentBlog().isDotcomFlag());
    ft.add(authAlert,"String_Node_Str");
    ft.commitAllowingStateLoss();
  }
 else {
    String errorMessage=TextUtils.isEmpty(friendlyMessage) ? context.getString(R.string.error_generic) : friendlyMessage;
    showToast(context,errorMessage);
  }
}

Fixed version (ground truth):
public static void showToastOrAuthAlert(Context context,String xmlrpcMessage,String friendlyMessage){
  if (context == null)   return;
  if ((context instanceof FragmentActivity) && !TextUtils.isEmpty(xmlrpcMessage) && xmlrpcMessage.contains("String_Node_Str") || xmlrpcMessage.contains("String_Node_Str")) {
    FragmentActivity activity=(FragmentActivity)context;
    if (activity.isFinishing())     return;
    FragmentTransaction ft=activity.getSupportFragmentManager().beginTransaction();
    AuthErrorDialogFragment authAlert=AuthErrorDialogFragment.newInstance(WordPress.getCurrentBlog().isDotcomFlag());
    ft.add(authAlert,"String_Node_Str");
    ft.commitAllowingStateLoss();
  }
 else {
    String errorMessage=TextUtils.isEmpty(friendlyMessage) ? context.getString(R.string.error_generic) : friendlyMessage;
    showToast(context,errorMessage,Duration.LONG);
  }
}
Program: 14881
Project: 14881
Buggy source:
private void checkMenuDrawer(){
  if (mMenuDrawer == null) {
    AppLog.w(T.READER,"String_Node_Str");
    return;
  }
  mMenuDrawer.setDrawerIndicatorEnabled(!hasDetailFragment());
}

Fixed version (ground truth):
private void checkMenuDrawer(){
  if (mMenuDrawer == null) {
    AppLog.w(T.READER,"String_Node_Str");
    return;
  }
  int entryCount=getSupportFragmentManager().getBackStackEntryCount();
  mMenuDrawer.setDrawerIndicatorEnabled(entryCount == 0);
}
Program: 14882
Project: 14882
Buggy source:
private void showDetailFragment(long blogId,long postId){
  Fragment fragment=ReaderPostDetailFragment.newInstance(blogId,postId);
  FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
  ft.add(R.id.fragment_container,fragment,FRAGMENT_TAG_POST_DETAIL);
  if (hasListFragment()) {
    ft.addToBackStack(FRAGMENT_TAG_POST_DETAIL);
  }
  ft.commit();
}

Fixed version (ground truth):
private void showDetailFragment(long blogId,long postId){
  Fragment fragment=ReaderPostDetailFragment.newInstance(blogId,postId);
  FragmentTransaction ft=getSupportFragmentManager().beginTransaction();
  ft.add(R.id.fragment_container,fragment,FRAGMENT_TAG_POST_DETAIL);
  if (hasListFragment()) {
    ft.addToBackStack(FRAGMENT_TAG_POST_DETAIL);
    ft.hide(getListFragment());
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
  }
  ft.commit();
}
Program: 14883
Project: 14883
Buggy source:
@Override public void onDetach(){
  if (getActivity() != null && mOriginalTitle != null)   getActivity().setTitle(mOriginalTitle);
  super.onDetach();
}

Fixed version (ground truth):
@Override public void onDetach(){
  if (getActivity() != null && mOriginalTitle != null) {
    setTitle(mOriginalTitle);
  }
  super.onDetach();
}
Program: 14884
Project: 14884
Buggy source:
@Override public void onAttach(Activity activity){
  super.onAttach(activity);
  mOriginalTitle=activity.getTitle();
  activity.setTitle(null);
  if (activity instanceof ReaderFullScreenUtils.FullScreenListener)   mFullScreenListener=(ReaderFullScreenUtils.FullScreenListener)activity;
  if (activity instanceof PostChangeListener)   mPostChangeListener=(PostChangeListener)activity;
}

Fixed version (ground truth):
@Override public void onAttach(Activity activity){
  super.onAttach(activity);
  mOriginalTitle=getTitle();
  setTitle(null);
  if (activity instanceof ReaderFullScreenUtils.FullScreenListener)   mFullScreenListener=(ReaderFullScreenUtils.FullScreenListener)activity;
  if (activity instanceof PostChangeListener)   mPostChangeListener=(PostChangeListener)activity;
}
Program: 14885
Project: 14885
Buggy source:
private void updatePostsWithTag(final String tagName,final ReaderActions.RequestDataAction updateAction,RefreshType refreshType){
  if (TextUtils.isEmpty(tagName))   return;
  if (!NetworkUtils.isNetworkAvailable(getActivity())) {
    AppLog.i(T.READER,"String_Node_Str");
    return;
  }
  setIsUpdating(true,updateAction);
  setEmptyTitleAndDescriptionForCurrentTag();
  if (refreshType == RefreshType.MANUAL && isCurrentTagName(tagName)) {
    if (tagName.equals(ReaderTag.TAG_NAME_LIKED) || tagName.equals(ReaderTag.TAG_NAME_FOLLOWING))     refreshPosts();
  }
  ReaderPostActions.updatePostsWithTag(tagName,updateAction,new ReaderActions.UpdateResultAndCountListener(){
    @Override public void onUpdateResult(    ReaderActions.UpdateResult result,    int numNewPosts){
      if (!hasActivity()) {
        AppLog.w(T.READER,"String_Node_Str");
        return;
      }
      setIsUpdating(false,updateAction);
      if (result == ReaderActions.UpdateResult.CHANGED && numNewPosts > 0 && isCurrentTagName(tagName)) {
        if (!isPostAdapterEmpty() && updateAction == ReaderActions.RequestDataAction.LOAD_NEWER) {
          showNewPostsBar(numNewPosts);
        }
 else {
          refreshPosts();
        }
      }
 else {
        setEmptyTitleAndDescriptionForCurrentTag();
      }
    }
  }
);
}

Fixed version (ground truth):
private void updatePostsWithTag(final String tagName,final ReaderActions.RequestDataAction updateAction,RefreshType refreshType){
  if (TextUtils.isEmpty(tagName))   return;
  if (!NetworkUtils.isNetworkAvailable(getActivity())) {
    AppLog.i(T.READER,"String_Node_Str");
    return;
  }
  setIsUpdating(true,updateAction);
  setEmptyTitleAndDescriptionForCurrentTag();
  if (refreshType == RefreshType.MANUAL && isCurrentTag(tagName)) {
    if (tagName.equals(ReaderTag.TAG_NAME_LIKED) || tagName.equals(ReaderTag.TAG_NAME_FOLLOWING))     refreshPosts();
  }
  ReaderPostActions.updatePostsWithTag(tagName,updateAction,new ReaderActions.UpdateResultAndCountListener(){
    @Override public void onUpdateResult(    ReaderActions.UpdateResult result,    int numNewPosts){
      if (!hasActivity()) {
        AppLog.w(T.READER,"String_Node_Str");
        return;
      }
      setIsUpdating(false,updateAction);
      if (result == ReaderActions.UpdateResult.CHANGED && numNewPosts > 0 && isCurrentTag(tagName)) {
        if (!isPostAdapterEmpty() && updateAction == ReaderActions.RequestDataAction.LOAD_NEWER) {
          showNewPostsBar(numNewPosts);
        }
 else {
          refreshPosts();
        }
      }
 else {
        setEmptyTitleAndDescriptionForCurrentTag();
      }
    }
  }
);
}
Program: 14886
Project: 14886
Buggy source:
private void setCurrentTag(final String tagName){
  if (TextUtils.isEmpty(tagName))   return;
  if (isCurrentTagName(tagName) && tagName.equals(getPostAdapter().getCurrentTag()))   return;
  mCurrentTag=tagName;
  UserPrefs.setReaderTag(tagName);
  hideLoadingProgress();
  getPostAdapter().setCurrentTag(tagName);
  hideNewPostsBar();
  if (ReaderTagTable.shouldAutoUpdateTag(tagName))   updatePostsWithTag(tagName,ReaderActions.RequestDataAction.LOAD_NEWER,RefreshType.AUTOMATIC);
}

Fixed version (ground truth):
private void setCurrentTag(final String tagName){
  if (TextUtils.isEmpty(tagName))   return;
  if (isCurrentTag(tagName) && hasPostAdapter() && tagName.equals(getPostAdapter().getCurrentTag()))   return;
  mCurrentTag=tagName;
  UserPrefs.setReaderTag(tagName);
  hideLoadingProgress();
  getPostAdapter().setCurrentTag(tagName);
  hideNewPostsBar();
  if (ReaderTagTable.shouldAutoUpdateTag(tagName))   updatePostsWithTag(tagName,ReaderActions.RequestDataAction.LOAD_NEWER,RefreshType.AUTOMATIC);
}
Program: 14887
Project: 14887
Buggy source:
private ReaderActionBarTagAdapter getActionBarAdapter(){
  if (mActionBarAdapter == null) {
    ReaderActions.DataLoadedListener dataListener=new ReaderActions.DataLoadedListener(){
      @Override public void onDataLoaded(      boolean isEmpty){
        AppLog.d(T.READER,"String_Node_Str");
        selectTagInActionBar(getCurrentTagName());
      }
    }
;
    boolean isStaticMenuDrawer;
    if (getActivity() instanceof WPActionBarActivity) {
      isStaticMenuDrawer=((WPActionBarActivity)getActivity()).isStaticMenuDrawer();
    }
 else {
      isStaticMenuDrawer=false;
    }
    mActionBarAdapter=new ReaderActionBarTagAdapter(getActivity(),isStaticMenuDrawer,dataListener);
  }
  return mActionBarAdapter;
}

Fixed version (ground truth):
private ReaderActionBarTagAdapter getActionBarAdapter(){
  if (mActionBarAdapter == null) {
    ReaderActions.DataLoadedListener dataListener=new ReaderActions.DataLoadedListener(){
      @Override public void onDataLoaded(      boolean isEmpty){
        AppLog.d(T.READER,"String_Node_Str");
        selectTagInActionBar(getCurrentTag());
      }
    }
;
    boolean isStaticMenuDrawer;
    if (getActivity() instanceof WPActionBarActivity) {
      isStaticMenuDrawer=((WPActionBarActivity)getActivity()).isStaticMenuDrawer();
    }
 else {
      isStaticMenuDrawer=false;
    }
    mActionBarAdapter=new ReaderActionBarTagAdapter(getActivity(),isStaticMenuDrawer,dataListener);
  }
  return mActionBarAdapter;
}
Program: 14888
Project: 14888
Buggy source:
private void selectTagInActionBar(final String tagName){
  if (TextUtils.isEmpty(tagName))   return;
  ActionBar actionBar=getActionBar();
  if (actionBar == null)   return;
  int position=getActionBarAdapter().getIndexOfTagName(tagName);
  if (position == -1 || position == actionBar.getSelectedNavigationIndex())   return;
  actionBar.setSelectedNavigationItem(position);
}

Fixed version (ground truth):
private void selectTagInActionBar(final String tagName){
  if (TextUtils.isEmpty(tagName))   return;
  ActionBar actionBar=getActionBar();
  if (actionBar == null)   return;
  int position=getActionBarAdapter().getIndexOfTagName(tagName);
  if (position == -1 || position == actionBar.getSelectedNavigationIndex())   return;
  if (actionBar.getNavigationMode() != ActionBar.NAVIGATION_MODE_LIST) {
    AppLog.w(T.READER,"String_Node_Str");
    return;
  }
  actionBar.setSelectedNavigationItem(position);
}
Program: 14889
Project: 14889
Buggy source:
protected void refreshPosts(){
  getPostAdapter().refresh();
}

Fixed version (ground truth):
private void refreshPosts(){
  getPostAdapter().refresh();
}
Program: 14890
Project: 14890
Buggy source:
private void checkCurrentTag(){
  if (hasCurrentTag() && !ReaderTagTable.tagExists(getCurrentTagName()))   mCurrentTag=ReaderTag.TAG_NAME_DEFAULT;
}

Fixed version (ground truth):
private void checkCurrentTag(){
  if (hasCurrentTag() && !ReaderTagTable.tagExists(getCurrentTag()))   mCurrentTag=ReaderTag.TAG_NAME_DEFAULT;
}
Program: 14891
Project: 14891
Buggy source:
@Override public void onUpdateResult(ReaderActions.UpdateResult result,int numNewPosts){
  if (!hasActivity()) {
    AppLog.w(T.READER,"String_Node_Str");
    return;
  }
  setIsUpdating(false,updateAction);
  if (result == ReaderActions.UpdateResult.CHANGED && numNewPosts > 0 && isCurrentTagName(tagName)) {
    if (!isPostAdapterEmpty() && updateAction == ReaderActions.RequestDataAction.LOAD_NEWER) {
      showNewPostsBar(numNewPosts);
    }
 else {
      refreshPosts();
    }
  }
 else {
    setEmptyTitleAndDescriptionForCurrentTag();
  }
}

Fixed version (ground truth):
@Override public void onUpdateResult(ReaderActions.UpdateResult result,int numNewPosts){
  if (!hasActivity()) {
    AppLog.w(T.READER,"String_Node_Str");
    return;
  }
  setIsUpdating(false,updateAction);
  if (result == ReaderActions.UpdateResult.CHANGED && numNewPosts > 0 && isCurrentTag(tagName)) {
    if (!isPostAdapterEmpty() && updateAction == ReaderActions.RequestDataAction.LOAD_NEWER) {
      showNewPostsBar(numNewPosts);
    }
 else {
      refreshPosts();
    }
  }
 else {
    setEmptyTitleAndDescriptionForCurrentTag();
  }
}
Program: 14892
Project: 14892
Buggy source:
@Override public void onDataLoaded(boolean isEmpty){
  AppLog.d(T.READER,"String_Node_Str");
  selectTagInActionBar(getCurrentTagName());
}

Fixed version (ground truth):
@Override public void onDataLoaded(boolean isEmpty){
  AppLog.d(T.READER,"String_Node_Str");
  selectTagInActionBar(getCurrentTag());
}
Program: 14893
Project: 14893
Buggy source:
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  setHasOptionsMenu(true);
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
    actionBar.setListNavigationCallbacks(getActionBarAdapter(),this);
  }
  if (savedInstanceState != null) {
    mCurrentTag=savedInstanceState.getString(KEY_TAG_NAME);
    mListState=savedInstanceState.getParcelable(LIST_STATE);
  }
  selectTagInActionBar(getCurrentTagName());
}

Fixed version (ground truth):
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  if (savedInstanceState != null) {
    AppLog.d(T.READER,"String_Node_Str");
    mCurrentTag=savedInstanceState.getString(KEY_TAG_NAME);
    mListState=savedInstanceState.getParcelable(KEY_LIST_STATE);
  }
  setHasOptionsMenu(true);
  checkActionBar();
}
Program: 14894
Project: 14894
Buggy source:
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  AppLog.d(T.READER,"String_Node_Str");
  if (hasCurrentTag())   outState.putString(KEY_TAG_NAME,mCurrentTag);
  if (mListView != null && mListView.getFirstVisiblePosition() > 0)   outState.putParcelable(LIST_STATE,mListView.onSaveInstanceState());
}

Fixed version (ground truth):
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  AppLog.d(T.READER,"String_Node_Str");
  if (hasCurrentTag())   outState.putString(KEY_TAG_NAME,mCurrentTag);
  if (mListView != null && mListView.getFirstVisiblePosition() > 0)   outState.putParcelable(KEY_LIST_STATE,mListView.onSaveInstanceState());
}
Program: 14895
Project: 14895
Buggy source:
@Override public void onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu,com.actionbarsherlock.view.MenuInflater inflater){
  super.onCreateOptionsMenu(menu,inflater);
  menu.clear();
  inflater.inflate(R.menu.reader_native,menu);
  mRefreshMenuItem=menu.findItem(R.id.menu_refresh);
}

Fixed version (ground truth):
@Override public void onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu,com.actionbarsherlock.view.MenuInflater inflater){
  super.onCreateOptionsMenu(menu,inflater);
  menu.clear();
  inflater.inflate(R.menu.reader_native,menu);
  mRefreshMenuItem=menu.findItem(R.id.menu_refresh);
  checkActionBar();
}
Program: 14897
Project: 14897
Buggy source:
@Override public void run(){
  if (getListView().getAdapter() == null)   getListView().setAdapter(getCommentAdapter());
  if (mWebView.getVisibility() != View.VISIBLE) {
    mWebView.setVisibility(View.VISIBLE);
    AppLog.w(T.READER,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (hasActivity())   getListView().setVisibility(View.VISIBLE);
}
Program: 14901
Project: 14901
Buggy source:
@Override public void onPageFinished(WebView view,String url){
  if (view.getVisibility() != View.VISIBLE)   view.setVisibility(View.VISIBLE);
}

Fixed version (ground truth):
@Override public void onPageFinished(WebView view,String url){
}
Program: 14904
Project: 14904
Buggy source:
@Override public void onActionResult(boolean succeeded){
  mIsSubmittingReply=false;
  if (!hasActivity())   return;
  mEditReply.setEnabled(true);
  mImgSubmitReply.setVisibility(View.VISIBLE);
  progress.setVisibility(View.GONE);
  if (succeeded) {
    if (mOnCommentChangeListener != null)     mOnCommentChangeListener.onCommentChanged(ChangedFrom.COMMENT_DETAIL);
    MessageBarUtils.showMessageBar(getActivity(),getString(R.string.note_reply_successful));
    mEditReply.setText(null);
  }
 else {
    ToastUtils.showToast(getActivity(),R.string.reply_failed,ToastUtils.Duration.LONG);
    mEditReply.requestFocus();
    InputMethodManager imm=(InputMethodManager)getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.showSoftInput(mEditReply,InputMethodManager.SHOW_IMPLICIT);
  }
}

Fixed version (ground truth):
@Override public void onActionResult(boolean succeeded){
  mIsSubmittingReply=false;
  if (succeeded && mOnCommentChangeListener != null)   mOnCommentChangeListener.onCommentChanged(ChangedFrom.COMMENT_DETAIL);
  if (hasActivity()) {
    mEditReply.setEnabled(true);
    mImgSubmitReply.setVisibility(View.VISIBLE);
    progress.setVisibility(View.GONE);
    if (succeeded) {
      MessageBarUtils.showMessageBar(getActivity(),getString(R.string.note_reply_successful));
      mEditReply.setText(null);
    }
 else {
      ToastUtils.showToast(getActivity(),R.string.reply_failed,ToastUtils.Duration.LONG);
      mEditReply.requestFocus();
      InputMethodManager imm=(InputMethodManager)getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
      imm.showSoftInput(mEditReply,InputMethodManager.SHOW_IMPLICIT);
    }
  }
}
Program: 14906
Project: 14906
Buggy source:
protected CommentAdapter(Context context,OnLoadMoreListener onLoadMoreListener,OnSelectedItemsChangeListener onChangeListener){
  mInflater=LayoutInflater.from(context);
  mOnLoadMoreListener=onLoadMoreListener;
  mOnSelectedChangeListener=onChangeListener;
  final Resources resources=context.getResources();
  mStatusColorSpam=Color.RED;
  mStatusColorUnapproved=resources.getColor(R.color.orange_medium);
  mStatusTextSpam=resources.getString(R.string.spam);
  mStatusTextUnapproved=resources.getString(R.string.unapproved);
  mAnonymous=resources.getString(R.string.anonymous);
  mAvatarSz=resources.getDimensionPixelSize(R.dimen.avatar_sz_medium);
  mDefaultAvatar=resources.getDrawable(R.drawable.placeholder);
  mSelectedBackground=new ColorDrawable(resources.getColor(R.color.blue_extra_light));
}

Fixed version (ground truth):
protected CommentAdapter(Context context,OnLoadMoreListener onLoadMoreListener,OnSelectedItemsChangeListener onChangeListener){
  mInflater=LayoutInflater.from(context);
  mOnLoadMoreListener=onLoadMoreListener;
  mOnSelectedChangeListener=onChangeListener;
  final Resources resources=context.getResources();
  mStatusColorSpam=Color.RED;
  mStatusColorUnapproved=resources.getColor(R.color.orange_medium);
  mSelectionColor=resources.getColor(R.color.blue_extra_light);
  mStatusTextSpam=resources.getString(R.string.spam);
  mStatusTextUnapproved=resources.getString(R.string.unapproved);
  mAnonymous=resources.getString(R.string.anonymous);
  mAvatarSz=resources.getDimensionPixelSize(R.dimen.avatar_sz_medium);
  mDefaultAvatar=resources.getDrawable(R.drawable.placeholder);
}
Program: 14907
Project: 14907
Buggy source:
private void updateBlogOptions(Map<?,?> blogOptions){
  boolean isModified=false;
  Gson gson=new Gson();
  String blogOptionsJson=gson.toJson(blogOptions);
  if (blogOptionsJson != null) {
    isModified|=mBlog.bsetBlogOptions(blogOptionsJson);
  }
  if (!mBlog.isDotcomFlag()) {
    Map<?,?> sv=(HashMap<?,?>)blogOptions.get("String_Node_Str");
    String wpVersion=sv.get("String_Node_Str").toString();
    if (wpVersion.length() > 0) {
      isModified|=mBlog.bsetWpVersion(wpVersion);
    }
  }
  Map<?,?> featuredImageHash=(HashMap<?,?>)blogOptions.get("String_Node_Str");
  if (featuredImageHash != null) {
    boolean featuredImageCapable=Boolean.parseBoolean(featuredImageHash.get("String_Node_Str").toString());
    isModified|=mBlog.bsetFeaturedImageCapable(featuredImageCapable);
  }
 else {
    isModified|=mBlog.bsetFeaturedImageCapable(false);
  }
  if (isModified && WordPress.getCurrentBlog() != null && WordPress.getCurrentBlog().isActive()) {
    mBlog.save();
  }
}

Fixed version (ground truth):
private void updateBlogOptions(Map<?,?> blogOptions){
  boolean isModified=false;
  Gson gson=new Gson();
  String blogOptionsJson=gson.toJson(blogOptions);
  if (blogOptionsJson != null) {
    isModified|=mBlog.bsetBlogOptions(blogOptionsJson);
  }
  if (!mBlog.isDotcomFlag()) {
    Map<?,?> sv=(HashMap<?,?>)blogOptions.get("String_Node_Str");
    String wpVersion=MapUtils.getMapStr(sv,"String_Node_Str");
    if (wpVersion.length() > 0) {
      isModified|=mBlog.bsetWpVersion(wpVersion);
    }
  }
  Map<?,?> featuredImageHash=(HashMap<?,?>)blogOptions.get("String_Node_Str");
  if (featuredImageHash != null) {
    boolean featuredImageCapable=MapUtils.getMapBool(featuredImageHash,"String_Node_Str");
    isModified|=mBlog.bsetFeaturedImageCapable(featuredImageCapable);
  }
 else {
    isModified|=mBlog.bsetFeaturedImageCapable(false);
  }
  if (isModified && WordPress.getCurrentBlog() != null && WordPress.getCurrentBlog().isActive()) {
    WordPress.wpDB.saveBlog(mBlog);
  }
}
Program: 14908
Project: 14908
Buggy source:
@Override public void onAnimateRefreshButton(boolean start){
  if (start) {
    shouldAnimateRefreshButton=true;
    this.startAnimatingRefreshButton(refreshMenuItem);
  }
 else {
    shouldAnimateRefreshButton=false;
    this.stopAnimatingRefreshButton(refreshMenuItem);
  }
}

Fixed version (ground truth):
@Override public void onAnimateRefreshButton(boolean start){
  if (start) {
    mShouldAnimateRefreshButton=true;
    this.startAnimatingRefreshButton(refreshMenuItem);
  }
 else {
    mShouldAnimateRefreshButton=false;
    this.stopAnimatingRefreshButton(refreshMenuItem);
  }
}
Program: 14909
Project: 14909
Buggy source:
@Override public boolean onCreateOptionsMenu(Menu menu){
  super.onCreateOptionsMenu(menu);
  MenuInflater inflater=getSupportMenuInflater();
  inflater.inflate(R.menu.basic_menu,menu);
  refreshMenuItem=menu.findItem(R.id.menu_refresh);
  if (shouldAnimateRefreshButton) {
    shouldAnimateRefreshButton=false;
    startAnimatingRefreshButton(refreshMenuItem);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onCreateOptionsMenu(Menu menu){
  super.onCreateOptionsMenu(menu);
  MenuInflater inflater=getSupportMenuInflater();
  inflater.inflate(R.menu.basic_menu,menu);
  refreshMenuItem=menu.findItem(R.id.menu_refresh);
  if (mShouldAnimateRefreshButton) {
    mShouldAnimateRefreshButton=false;
    startAnimatingRefreshButton(refreshMenuItem);
  }
  return true;
}