nus-yam/ex-repair huggingface dataset:
Program: 14338
Project: 14338
Buggy source:
@Override public void onPostSelected(ReaderPost post){
  if (!isAdded() || post == null)   return;
  long blogId=post.blogId;
  long postId=post.postId;
  if (post.isDiscoverPost()) {
    ReaderPostDiscoverData discoverData=post.getDiscoverData();
    if (discoverData != null && discoverData.getDiscoverType() == ReaderPostDiscoverData.DiscoverType.EDITOR_PICK) {
      if (discoverData.getBlogId() != 0 && discoverData.getPostId() != 0) {
        blogId=discoverData.getBlogId();
        postId=discoverData.getPostId();
      }
 else       if (discoverData.hasPermalink()) {
        ReaderActivityLauncher.openUrl(getActivity(),discoverData.getPermaLink());
        return;
      }
    }
  }
  ReaderPostListType type=getPostListType();
  Map<String,Object> analyticsProperties=new HashMap<>();
switch (type) {
case TAG_FOLLOWED:
case TAG_PREVIEW:
    String key=(type == ReaderPostListType.TAG_PREVIEW ? AnalyticsTracker.READER_DETAIL_TYPE_TAG_PREVIEW : AnalyticsTracker.READER_DETAIL_TYPE_NORMAL);
  analyticsProperties.put(AnalyticsTracker.READER_DETAIL_TYPE_KEY,key);
ReaderActivityLauncher.showReaderPostPagerForTag(getActivity(),getCurrentTag(),getPostListType(),blogId,postId);
break;
case BLOG_PREVIEW:
analyticsProperties.put(AnalyticsTracker.READER_DETAIL_TYPE_KEY,AnalyticsTracker.READER_DETAIL_TYPE_BLOG_PREVIEW);
ReaderActivityLauncher.showReaderPostPagerForBlog(getActivity(),blogId,postId);
break;
}
AnalyticsTracker.track(AnalyticsTracker.Stat.READER_OPENED_ARTICLE,analyticsProperties);
}

Fixed version (ground truth):
@Override public void onPostSelected(ReaderPost post){
  if (!isAdded() || post == null)   return;
  if (post.isDiscoverPost()) {
    ReaderPostDiscoverData discoverData=post.getDiscoverData();
    if (discoverData != null && discoverData.getDiscoverType() == ReaderPostDiscoverData.DiscoverType.EDITOR_PICK) {
      if (discoverData.getBlogId() != 0 && discoverData.getPostId() != 0) {
        ReaderActivityLauncher.showReaderPostDetail(getActivity(),discoverData.getBlogId(),discoverData.getPostId());
        return;
      }
 else       if (discoverData.hasPermalink()) {
        ReaderActivityLauncher.openUrl(getActivity(),discoverData.getPermaLink());
        return;
      }
    }
  }
  ReaderPostListType type=getPostListType();
  Map<String,Object> analyticsProperties=new HashMap<>();
switch (type) {
case TAG_FOLLOWED:
case TAG_PREVIEW:
    String key=(type == ReaderPostListType.TAG_PREVIEW ? AnalyticsTracker.READER_DETAIL_TYPE_TAG_PREVIEW : AnalyticsTracker.READER_DETAIL_TYPE_NORMAL);
  analyticsProperties.put(AnalyticsTracker.READER_DETAIL_TYPE_KEY,key);
ReaderActivityLauncher.showReaderPostPagerForTag(getActivity(),getCurrentTag(),getPostListType(),post.blogId,post.postId);
break;
case BLOG_PREVIEW:
analyticsProperties.put(AnalyticsTracker.READER_DETAIL_TYPE_KEY,AnalyticsTracker.READER_DETAIL_TYPE_BLOG_PREVIEW);
ReaderActivityLauncher.showReaderPostPagerForBlog(getActivity(),post.blogId,post.postId);
break;
}
AnalyticsTracker.track(AnalyticsTracker.Stat.READER_OPENED_ARTICLE,analyticsProperties);
}
Program: 14342
Project: 14342
Buggy source:
@Override public void onResume(){
  super.onResume();
  mNotificationsEnabled=NotificationsUtils.isNotificationsEnabled(getActivity());
  if (hasNotificationsSettings()) {
    new LoadNotificationsTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,true);
  }
  refreshSettings();
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  mNotificationsEnabled=NotificationsUtils.isNotificationsEnabled(getActivity());
  refreshSettings();
}
Program: 14343
Project: 14343
Buggy source:
@Override public void onResponse(JSONObject response){
  AppLog.d(T.NOTIFS,"String_Node_Str");
  if (!isAdded())   return;
  boolean settingsExisted=hasNotificationsSettings();
  if (!settingsExisted) {
    EventBus.getDefault().post(new NotificationEvents.NotificationsSettingsStatusChanged(null));
  }
  SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(getActivity());
  SharedPreferences.Editor editor=settings.edit();
  editor.putString(NotificationsUtils.WPCOM_PUSH_DEVICE_NOTIFICATION_SETTINGS,response.toString());
  editor.apply();
  new LoadNotificationsTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,!settingsExisted);
}

Fixed version (ground truth):
@Override public void onResponse(JSONObject response){
  AppLog.d(T.NOTIFS,"String_Node_Str");
  if (!isAdded())   return;
  boolean settingsExisted=hasNotificationsSettings();
  if (!settingsExisted) {
    EventBus.getDefault().post(new NotificationEvents.NotificationsSettingsStatusChanged(null));
  }
  SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(getActivity());
  SharedPreferences.Editor editor=settings.edit();
  editor.putString(NotificationsUtils.WPCOM_PUSH_DEVICE_NOTIFICATION_SETTINGS,response.toString());
  editor.apply();
  loadNotificationsAndUpdateUI(!settingsExisted);
  updateUIForNotificationsEnabledState();
}
Program: 14344
Project: 14344
Buggy source:
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(getActivity());
  mDeviceId=settings.getString(NotificationsUtils.WPCOM_PUSH_DEVICE_SERVER_ID,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(getActivity());
  mDeviceId=settings.getString(NotificationsUtils.WPCOM_PUSH_DEVICE_SERVER_ID,"String_Node_Str");
  if (hasNotificationsSettings()) {
    loadNotificationsAndUpdateUI(true);
  }
}
Program: 14345
Project: 14345
Buggy source:
private void refreshSettings(){
  if (!hasNotificationsSettings()) {
    EventBus.getDefault().post(new NotificationEvents.NotificationsSettingsStatusChanged(getString(R.string.loading)));
  }
  NotificationsUtils.getPushNotificationSettings(getActivity(),new RestRequest.Listener(){
    @Override public void onResponse(    JSONObject response){
      AppLog.d(T.NOTIFS,"String_Node_Str");
      if (!isAdded())       return;
      boolean settingsExisted=hasNotificationsSettings();
      if (!settingsExisted) {
        EventBus.getDefault().post(new NotificationEvents.NotificationsSettingsStatusChanged(null));
      }
      SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(getActivity());
      SharedPreferences.Editor editor=settings.edit();
      editor.putString(NotificationsUtils.WPCOM_PUSH_DEVICE_NOTIFICATION_SETTINGS,response.toString());
      editor.apply();
      new LoadNotificationsTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,!settingsExisted);
    }
  }
,new RestRequest.ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      if (!isAdded())       return;
      AppLog.e(T.NOTIFS,"String_Node_Str",error);
      if (!hasNotificationsSettings()) {
        EventBus.getDefault().post(new NotificationEvents.NotificationsSettingsStatusChanged(getString(R.string.error_loading_notifications)));
      }
    }
  }
);
}

Fixed version (ground truth):
private void refreshSettings(){
  if (!hasNotificationsSettings()) {
    EventBus.getDefault().post(new NotificationEvents.NotificationsSettingsStatusChanged(getString(R.string.loading)));
  }
  if (hasNotificationsSettings()) {
    updateUIForNotificationsEnabledState();
  }
  NotificationsUtils.getPushNotificationSettings(getActivity(),new RestRequest.Listener(){
    @Override public void onResponse(    JSONObject response){
      AppLog.d(T.NOTIFS,"String_Node_Str");
      if (!isAdded())       return;
      boolean settingsExisted=hasNotificationsSettings();
      if (!settingsExisted) {
        EventBus.getDefault().post(new NotificationEvents.NotificationsSettingsStatusChanged(null));
      }
      SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(getActivity());
      SharedPreferences.Editor editor=settings.edit();
      editor.putString(NotificationsUtils.WPCOM_PUSH_DEVICE_NOTIFICATION_SETTINGS,response.toString());
      editor.apply();
      loadNotificationsAndUpdateUI(!settingsExisted);
      updateUIForNotificationsEnabledState();
    }
  }
,new RestRequest.ErrorListener(){
    @Override public void onErrorResponse(    VolleyError error){
      if (!isAdded())       return;
      AppLog.e(T.NOTIFS,"String_Node_Str",error);
      if (!hasNotificationsSettings()) {
        EventBus.getDefault().post(new NotificationEvents.NotificationsSettingsStatusChanged(getString(R.string.error_loading_notifications)));
      }
    }
  }
);
}
Program: 14348
Project: 14348
Buggy source:
private void saveHiddenSites(){
  WordPress.wpDB.getDatabase().beginTransaction();
  try {
    WordPress.wpDB.setAllDotComBlogsVisibility(true);
    boolean skippedCurrentSite=false;
    String currentSiteName=null;
    SiteList hiddenSites=getAdapter().getHiddenSites();
    for (    SiteRecord site : hiddenSites) {
      if (site.localId == mCurrentLocalId) {
        skippedCurrentSite=true;
        currentSiteName=site.getBlogNameOrHostName();
      }
 else {
        WordPress.wpDB.setDotComBlogsVisibility(site.localId,false);
        StatsTable.deleteStatsForBlog(this,site.localId);
      }
    }
    if (skippedCurrentSite) {
      ToastUtils.showToast(this,getString(R.string.site_picker_cant_hide_current_site,currentSiteName),ToastUtils.Duration.LONG);
    }
    WordPress.wpDB.getDatabase().setTransactionSuccessful();
  }
  finally {
    WordPress.wpDB.getDatabase().endTransaction();
  }
}

Fixed version (ground truth):
private void saveHiddenSites(){
  WordPress.wpDB.getDatabase().beginTransaction();
  try {
    WordPress.wpDB.setAllDotComBlogsVisibility(true);
    boolean skippedCurrentSite=false;
    String currentSiteName=null;
    SiteList hiddenSites=getAdapter().getHiddenSites();
    for (    SiteRecord site : hiddenSites) {
      if (site.localId == mCurrentLocalId) {
        skippedCurrentSite=true;
        currentSiteName=site.getBlogNameOrHostName();
      }
 else {
        WordPress.wpDB.setDotComBlogsVisibility(site.localId,false);
        StatsTable.deleteStatsForBlog(this,site.localId);
      }
    }
    if (skippedCurrentSite) {
      String cantHideCurrentSite=getString(R.string.site_picker_cant_hide_current_site);
      ToastUtils.showToast(this,String.format(cantHideCurrentSite,currentSiteName),ToastUtils.Duration.LONG);
    }
    WordPress.wpDB.getDatabase().setTransactionSuccessful();
  }
  finally {
    WordPress.wpDB.getDatabase().endTransaction();
  }
}
Program: 14349
Project: 14349
Buggy source:
private void updateActionModeTitle(){
  if (mActionMode != null) {
    int numSelected=getAdapter().getNumSelected();
    mActionMode.setTitle(getString(R.string.cab_selected,numSelected));
  }
}

Fixed version (ground truth):
private void updateActionModeTitle(){
  if (mActionMode != null) {
    int numSelected=getAdapter().getNumSelected();
    String cabSelected=getString(R.string.cab_selected);
    mActionMode.setTitle(String.format(cabSelected,numSelected));
  }
}
Program: 14350
Project: 14350
Buggy source:
private void updateTitle(int position){
  if (isFinishing() || !canShowTitle()) {
    return;
  }
  final String title=getString(R.string.reader_title_photo_viewer,position + 1,getImageCount());
  if (title.equals(mTxtTitle.getText())) {
    return;
  }
  mTxtTitle.setText(title);
}

Fixed version (ground truth):
private void updateTitle(int position){
  if (isFinishing() || !canShowTitle()) {
    return;
  }
  String titlePhotoViewer=getString(R.string.reader_title_photo_viewer);
  String title=String.format(titlePhotoViewer,position + 1,getImageCount());
  if (title.equals(mTxtTitle.getText())) {
    return;
  }
  mTxtTitle.setText(title);
}
Program: 14351
Project: 14351
Buggy source:
@Override public void onTagDeleted(ReaderTag tag){
  mTagsChanged=true;
  AnalyticsTracker.track(AnalyticsTracker.Stat.READER_UNFOLLOWED_READER_TAG);
  if (mLastAddedTagName != null && mLastAddedTagName.equalsIgnoreCase(tag.getTagName())) {
    mLastAddedTagName=null;
  }
  showInfoToast(getString(R.string.reader_label_removed_tag,tag.getCapitalizedTagName()));
}

Fixed version (ground truth):
@Override public void onTagDeleted(ReaderTag tag){
  mTagsChanged=true;
  AnalyticsTracker.track(AnalyticsTracker.Stat.READER_UNFOLLOWED_READER_TAG);
  if (mLastAddedTagName != null && mLastAddedTagName.equalsIgnoreCase(tag.getTagName())) {
    mLastAddedTagName=null;
  }
  String labelRemovedTag=getString(R.string.reader_label_removed_tag);
  showInfoToast(String.format(labelRemovedTag,tag.getCapitalizedTagName()));
}
Program: 14352
Project: 14352
Buggy source:
private void performAddTag(final String tagName){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  ReaderActions.ActionListener actionListener=new ReaderActions.ActionListener(){
    @Override public void onActionResult(    boolean succeeded){
      if (!succeeded && !isFinishing()) {
        getPageAdapter().refreshFollowedTagFragment();
        ToastUtils.showToast(ReaderSubsActivity.this,R.string.reader_toast_err_add_tag);
        mLastAddedTagName=null;
      }
    }
  }
;
  ReaderTag tag=new ReaderTag(tagName,ReaderTagType.FOLLOWED);
  if (ReaderTagActions.performTagAction(tag,TagAction.ADD,actionListener)) {
    AnalyticsTracker.track(AnalyticsTracker.Stat.READER_FOLLOWED_READER_TAG);
    mLastAddedTagName=tag.getTagName();
    getPageAdapter().refreshFollowedTagFragment();
    showInfoToast(getString(R.string.reader_label_added_tag,tag.getCapitalizedTagName()));
  }
}

Fixed version (ground truth):
private void performAddTag(final String tagName){
  if (!NetworkUtils.checkConnection(this)) {
    return;
  }
  ReaderActions.ActionListener actionListener=new ReaderActions.ActionListener(){
    @Override public void onActionResult(    boolean succeeded){
      if (!succeeded && !isFinishing()) {
        getPageAdapter().refreshFollowedTagFragment();
        ToastUtils.showToast(ReaderSubsActivity.this,R.string.reader_toast_err_add_tag);
        mLastAddedTagName=null;
      }
    }
  }
;
  ReaderTag tag=new ReaderTag(tagName,ReaderTagType.FOLLOWED);
  if (ReaderTagActions.performTagAction(tag,TagAction.ADD,actionListener)) {
    AnalyticsTracker.track(AnalyticsTracker.Stat.READER_FOLLOWED_READER_TAG);
    mLastAddedTagName=tag.getTagName();
    getPageAdapter().refreshFollowedTagFragment();
    String labelAddedTag=getString(R.string.reader_label_added_tag);
    showInfoToast(String.format(labelAddedTag,tag.getCapitalizedTagName()));
  }
}
Program: 14353
Project: 14353
Buggy source:
public static String getLongLikeLabelText(Context context,int numLikes,boolean isLikedByCurrentUser){
  if (isLikedByCurrentUser) {
switch (numLikes) {
case 1:
      return context.getString(R.string.reader_likes_only_you);
case 2:
    return context.getString(R.string.reader_likes_you_and_one);
default :
  return context.getString(R.string.reader_likes_you_and_multi,numLikes - 1);
}
}
 else {
return (numLikes == 1 ? context.getString(R.string.reader_likes_one) : context.getString(R.string.reader_likes_multi,numLikes));
}
}

Fixed version (ground truth):
public static String getLongLikeLabelText(Context context,int numLikes,boolean isLikedByCurrentUser){
  if (isLikedByCurrentUser) {
switch (numLikes) {
case 1:
      return context.getString(R.string.reader_likes_only_you);
case 2:
    return context.getString(R.string.reader_likes_you_and_one);
default :
  return context.getString(R.string.reader_likes_you_and_multi,numLikes - 1);
}
}
 else {
if (numLikes == 1) {
return context.getString(R.string.reader_likes_one);
}
 else {
String likes=context.getString(R.string.reader_likes_multi);
return String.format(likes,numLikes);
}
}
}
Program: 14354
Project: 14354
Buggy source:
public static void openUrl(Context context,String url,OpenUrlType openUrlType){
  if (TextUtils.isEmpty(url)) {
    return;
  }
  if (openUrlType == OpenUrlType.INTERNAL) {
    WPWebViewActivity.openURL(context,url);
  }
 else {
    try {
      Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(url));
      context.startActivity(intent);
    }
 catch (    ActivityNotFoundException e) {
      ToastUtils.showToast(context,context.getString(R.string.reader_toast_err_url_intent,url),ToastUtils.Duration.LONG);
    }
  }
}

Fixed version (ground truth):
public static void openUrl(Context context,String url,OpenUrlType openUrlType){
  if (TextUtils.isEmpty(url)) {
    return;
  }
  if (openUrlType == OpenUrlType.INTERNAL) {
    WPWebViewActivity.openURL(context,url);
  }
 else {
    try {
      Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(url));
      context.startActivity(intent);
    }
 catch (    ActivityNotFoundException e) {
      String readerToastErrorUrlIntent=context.getString(R.string.reader_toast_err_url_intent);
      ToastUtils.showToast(context,String.format(readerToastErrorUrlIntent,url),ToastUtils.Duration.LONG);
    }
  }
}
Program: 14355
Project: 14355
Buggy source:
public static String getLongLikeLabelText(Context context,int numLikes,boolean isLikedByCurrentUser){
  if (isLikedByCurrentUser) {
switch (numLikes) {
case 1:
      return context.getString(R.string.reader_likes_only_you);
case 2:
    return context.getString(R.string.reader_likes_you_and_one);
default :
  return context.getString(R.string.reader_likes_you_and_multi,numLikes - 1);
}
}
 else {
if (numLikes == 1) {
return context.getString(R.string.reader_likes_one);
}
 else {
String likes=context.getString(R.string.reader_likes_multi);
return String.format(likes,numLikes);
}
}
}

Fixed version (ground truth):
public static String getLongLikeLabelText(Context context,int numLikes,boolean isLikedByCurrentUser){
  if (isLikedByCurrentUser) {
switch (numLikes) {
case 1:
      return context.getString(R.string.reader_likes_only_you);
case 2:
    return context.getString(R.string.reader_likes_you_and_one);
default :
  String youAndMultiLikes=context.getString(R.string.reader_likes_you_and_multi);
return String.format(youAndMultiLikes,numLikes - 1);
}
}
 else {
if (numLikes == 1) {
return context.getString(R.string.reader_likes_one);
}
 else {
String likes=context.getString(R.string.reader_likes_multi);
return String.format(likes,numLikes);
}
}
}
Program: 14356
Project: 14356
Buggy source:
private static void showTappedUrl(Context context,String url){
  if (context == null || TextUtils.isEmpty(url))   return;
  try {
    Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(url));
    context.startActivity(intent);
  }
 catch (  ActivityNotFoundException e) {
    ToastUtils.showToast(context,context.getString(R.string.reader_toast_err_url_intent,url),ToastUtils.Duration.LONG);
  }
}

Fixed version (ground truth):
private static void showTappedUrl(Context context,String url){
  if (context == null || TextUtils.isEmpty(url))   return;
  try {
    Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(url));
    context.startActivity(intent);
  }
 catch (  ActivityNotFoundException e) {
    String readerToastUrlErrorIntent=context.getString(R.string.reader_toast_err_url_intent);
    ToastUtils.showToast(context,String.format(readerToastUrlErrorIntent,url),ToastUtils.Duration.LONG);
  }
}
Program: 14359
Project: 14359
Buggy source:
/** 
 * returns text string from passed EditText
 */
public static String getText(EditText edit){
  if (edit.getText() == null) {
    return "String_Node_Str";
  }
  return edit.getText().toString();
}

Fixed version (ground truth):
/** 
 * returns non-null text string from passed TextView
 */
public static String getText(TextView textView){
  return (textView != null) ? textView.getText().toString() : "String_Node_Str";
}
Program: 14360
Project: 14360
Buggy source:
public static void viewStatsSinglePostDetails(Context context,PostModel post){
  if (post == null)   return;
  Intent statsPostViewIntent=new Intent(context,StatsSingleItemDetailsActivity.class);
  statsPostViewIntent.putExtra(StatsSingleItemDetailsActivity.ARG_REMOTE_BLOG_ID,post.getBlogID());
  statsPostViewIntent.putExtra(StatsSingleItemDetailsActivity.ARG_REMOTE_ITEM_ID,post.getItemID());
  statsPostViewIntent.putExtra(StatsSingleItemDetailsActivity.ARG_REMOTE_ITEM_TYPE,post.getPostType());
  statsPostViewIntent.putExtra(StatsSingleItemDetailsActivity.ARG_ITEM_TITLE,post.getTitle());
  statsPostViewIntent.putExtra(StatsSingleItemDetailsActivity.ARG_ITEM_URL,post.getTitle());
  context.startActivity(statsPostViewIntent);
}

Fixed version (ground truth):
public static void viewStatsSinglePostDetails(Context context,PostModel post){
  if (post == null)   return;
  Intent statsPostViewIntent=new Intent(context,StatsSingleItemDetailsActivity.class);
  statsPostViewIntent.putExtra(StatsSingleItemDetailsActivity.ARG_REMOTE_BLOG_ID,post.getBlogID());
  statsPostViewIntent.putExtra(StatsSingleItemDetailsActivity.ARG_REMOTE_ITEM_ID,post.getItemID());
  statsPostViewIntent.putExtra(StatsSingleItemDetailsActivity.ARG_REMOTE_ITEM_TYPE,post.getPostType());
  statsPostViewIntent.putExtra(StatsSingleItemDetailsActivity.ARG_ITEM_TITLE,post.getTitle());
  statsPostViewIntent.putExtra(StatsSingleItemDetailsActivity.ARG_ITEM_URL,post.getUrl());
  context.startActivity(statsPostViewIntent);
}
Program: 14361
Project: 14361
Buggy source:
@Override public View onCreateView(@NonNull LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.post_list,container,false);
  mRecyclerView=(RecyclerView)view.findViewById(R.id.recycler_view);
  mEmptyView=view.findViewById(R.id.empty_view);
  mEmptyViewImage=view.findViewById(R.id.empty_tags_box_top);
  mEmptyViewTitle=(TextView)view.findViewById(R.id.title_empty);
  mProgressLoadMore=(ProgressBar)view.findViewById(R.id.progress);
  Context context=getActivity();
  int spacingHorizontal=context.getResources().getDimensionPixelSize(R.dimen.content_margin);
  int spacingVertical=context.getResources().getDimensionPixelSize(R.dimen.reader_card_gutters);
  mRecyclerView.addItemDecoration(new ReaderItemDecoration(spacingHorizontal,spacingVertical));
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(@NonNull LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.post_list_fragment,container,false);
  mRecyclerView=(RecyclerView)view.findViewById(R.id.recycler_view);
  mEmptyView=view.findViewById(R.id.empty_view);
  mEmptyViewImage=view.findViewById(R.id.empty_tags_box_top);
  mEmptyViewTitle=(TextView)view.findViewById(R.id.title_empty);
  mProgressLoadMore=(ProgressBar)view.findViewById(R.id.progress);
  Context context=getActivity();
  mRecyclerView.setLayoutManager(new LinearLayoutManager(context));
  int spacingHorizontal=context.getResources().getDimensionPixelSize(R.dimen.content_margin);
  int spacingVertical=context.getResources().getDimensionPixelSize(R.dimen.reader_card_gutters);
  mRecyclerView.addItemDecoration(new ReaderItemDecoration(spacingHorizontal,spacingVertical));
  return view;
}
Program: 14364
Project: 14364
Buggy source:
public PostUploadNotifier(Post post){
  mNotificationManager=(NotificationManager)SystemServiceFactory.get(mContext,Context.NOTIFICATION_SERVICE);
  mNotificationBuilder=new NotificationCompat.Builder(getApplicationContext());
  mNotificationBuilder.setSmallIcon(android.R.drawable.stat_sys_upload);
  Intent notificationIntent=new Intent(mContext,post.isPage() ? PagesListActivity.class : PostsListActivity.class);
  notificationIntent.setData((Uri.parse("String_Node_Str" + post.getLocalTableBlogId())));
  notificationIntent.putExtra(PostsListActivity.EXTRA_VIEW_PAGES,post.isPage());
  PendingIntent pendingIntent=PendingIntent.getActivity(mContext,0,notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT);
  mNotificationBuilder.setContentIntent(pendingIntent);
  mNotificationId=(new Random()).nextInt() + post.getLocalTableBlogId();
  startForeground(mNotificationId,mNotificationBuilder.build());
}

Fixed version (ground truth):
public PostUploadNotifier(Post post){
  mNotificationManager=(NotificationManager)SystemServiceFactory.get(mContext,Context.NOTIFICATION_SERVICE);
  mNotificationBuilder=new NotificationCompat.Builder(getApplicationContext());
  mNotificationBuilder.setSmallIcon(android.R.drawable.stat_sys_upload);
  mNotificationId=(new Random()).nextInt() + post.getLocalTableBlogId();
  startForeground(mNotificationId,mNotificationBuilder.build());
}
Program: 14365
Project: 14365
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.media_browser_activity);
  Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  getSupportActionBar().setDisplayShowTitleEnabled(true);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setTitle(R.string.media);
  FragmentManager fm=getFragmentManager();
  fm.addOnBackStackChangedListener(mOnBackStackChangedListener);
  FragmentTransaction ft=fm.beginTransaction();
  mMediaAddFragment=(MediaAddFragment)fm.findFragmentById(R.id.mediaAddFragment);
  mMediaGridFragment=(MediaGridFragment)fm.findFragmentById(R.id.mediaGridFragment);
  mMediaItemFragment=(MediaItemFragment)fm.findFragmentByTag(MediaItemFragment.TAG);
  if (mMediaItemFragment != null)   ft.hide(mMediaGridFragment);
  mMediaEditFragment=(MediaEditFragment)fm.findFragmentByTag(MediaEditFragment.TAG);
  if (mMediaEditFragment != null && !mMediaEditFragment.isInLayout())   ft.hide(mMediaItemFragment);
  ft.commit();
  setupAddMenuPopup();
  String action=getIntent().getAction();
  if (Intent.ACTION_SEND.equals(action) || Intent.ACTION_SEND_MULTIPLE.equals(action)) {
    uploadSharedFiles();
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (WordPress.getCurrentBlog() == null) {
    ToastUtils.showToast(this,R.string.blog_not_found,ToastUtils.Duration.SHORT);
    finish();
    return;
  }
  setContentView(R.layout.media_browser_activity);
  Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  getSupportActionBar().setDisplayShowTitleEnabled(true);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setTitle(R.string.media);
  FragmentManager fm=getFragmentManager();
  fm.addOnBackStackChangedListener(mOnBackStackChangedListener);
  FragmentTransaction ft=fm.beginTransaction();
  mMediaAddFragment=(MediaAddFragment)fm.findFragmentById(R.id.mediaAddFragment);
  mMediaGridFragment=(MediaGridFragment)fm.findFragmentById(R.id.mediaGridFragment);
  mMediaItemFragment=(MediaItemFragment)fm.findFragmentByTag(MediaItemFragment.TAG);
  if (mMediaItemFragment != null)   ft.hide(mMediaGridFragment);
  mMediaEditFragment=(MediaEditFragment)fm.findFragmentByTag(MediaEditFragment.TAG);
  if (mMediaEditFragment != null && !mMediaEditFragment.isInLayout())   ft.hide(mMediaItemFragment);
  ft.commit();
  setupAddMenuPopup();
  String action=getIntent().getAction();
  if (Intent.ACTION_SEND.equals(action) || Intent.ACTION_SEND_MULTIPLE.equals(action)) {
    uploadSharedFiles();
  }
}
Program: 14366
Project: 14366
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ProfilingUtils.split("String_Node_Str");
  ProfilingUtils.dump();
  setContentView(R.layout.posts);
  Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  getSupportActionBar().setDisplayShowTitleEnabled(true);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  FragmentManager fm=getFragmentManager();
  mPostList=(PostsListFragment)fm.findFragmentById(R.id.postList);
  Bundle extras=getIntent().getExtras();
  if (extras != null) {
    mIsPage=extras.getBoolean(EXTRA_VIEW_PAGES);
    showErrorDialogIfNeeded(extras);
  }
  if (mIsPage) {
    getSupportActionBar().setTitle(getString(R.string.pages));
  }
 else {
    getSupportActionBar().setTitle(getString(R.string.posts));
  }
  WordPress.currentPost=null;
  if (savedInstanceState != null) {
    popPostDetail();
  }
  attemptToSelectPost();
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (WordPress.getCurrentBlog() == null) {
    ToastUtils.showToast(this,R.string.blog_not_found,ToastUtils.Duration.SHORT);
    finish();
    return;
  }
  ProfilingUtils.split("String_Node_Str");
  ProfilingUtils.dump();
  setContentView(R.layout.posts);
  Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  getSupportActionBar().setDisplayShowTitleEnabled(true);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  FragmentManager fm=getFragmentManager();
  mPostList=(PostsListFragment)fm.findFragmentById(R.id.postList);
  Bundle extras=getIntent().getExtras();
  if (extras != null) {
    mIsPage=extras.getBoolean(EXTRA_VIEW_PAGES);
    showErrorDialogIfNeeded(extras);
  }
  if (mIsPage) {
    getSupportActionBar().setTitle(getString(R.string.pages));
  }
 else {
    getSupportActionBar().setTitle(getString(R.string.posts));
  }
  WordPress.currentPost=null;
  if (savedInstanceState != null) {
    popPostDetail();
  }
  attemptToSelectPost();
}
Program: 14368
Project: 14368
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ActionBar actionBar=getSupportActionBar();
  if (actionBar != null) {
    actionBar.setElevation(0.0f);
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  setContentView(R.layout.settings_activity);
  Bundle passcodeArgs=new Bundle();
  passcodeArgs.putBoolean(PasscodePreferenceFragment.KEY_SHOULD_INFLATE,false);
  mSettingsFragment=new SettingsFragment();
  mPasscodePreferenceFragment=new PasscodePreferenceFragment();
  mPasscodePreferenceFragment.setArguments(passcodeArgs);
  if (savedInstanceState == null) {
    getFragmentManager().beginTransaction().add(R.id.fragment_container,mSettingsFragment).add(R.id.fragment_container,mPasscodePreferenceFragment).commit();
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ActionBar actionBar=getSupportActionBar();
  if (actionBar != null) {
    actionBar.setElevation(0.0f);
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  setContentView(R.layout.settings_activity);
  FragmentManager fragmentManager=getFragmentManager();
  if (savedInstanceState == null) {
    Bundle passcodeArgs=new Bundle();
    passcodeArgs.putBoolean(PasscodePreferenceFragment.KEY_SHOULD_INFLATE,false);
    mSettingsFragment=new SettingsFragment();
    mPasscodePreferenceFragment=new PasscodePreferenceFragment();
    mPasscodePreferenceFragment.setArguments(passcodeArgs);
    fragmentManager.beginTransaction().add(R.id.fragment_container,mSettingsFragment).add(R.id.fragment_container,mPasscodePreferenceFragment).commit();
  }
 else {
    mSettingsFragment=(SettingsFragment)fragmentManager.getFragment(savedInstanceState,KEY_SETTINGS_FRAGMENT);
    mPasscodePreferenceFragment=(PasscodePreferenceFragment)fragmentManager.getFragment(savedInstanceState,KEY_PASSCODE_FRAGMENT);
  }
}
Program: 14369
Project: 14369
Buggy source:
@Override public void onStart(){
  super.onStart();
  mPasscodePreferenceFragment.setPreferences(mSettingsFragment.findPreference(getString(R.string.pref_key_passcode_toggle)),mSettingsFragment.findPreference(getString(R.string.pref_key_change_passcode)));
}

Fixed version (ground truth):
@Override public void onStart(){
  super.onStart();
  Preference togglePref=mSettingsFragment.findPreference(getString(R.string.pref_key_passcode_toggle));
  Preference changePref=mSettingsFragment.findPreference(getString(R.string.pref_key_change_passcode));
  if (togglePref != null && changePref != null) {
    mPasscodePreferenceFragment.setPreferences(togglePref,changePref);
  }
}
Program: 14372
Project: 14372
Buggy source:
public InsightsPopularModel(String blogID,JSONObject response) throws JSONException {
  this.setBlogID(blogID);
  this.mHighestDayOfWeek=response.getInt(("String_Node_Str"));
  this.mHighestHour=response.getInt(("String_Node_Str"));
  this.mHighestDayPercent=response.getDouble("String_Node_Str");
}

Fixed version (ground truth):
public InsightsPopularModel(String blogID,JSONObject response) throws JSONException {
  this.setBlogID(blogID);
  this.mHighestDayOfWeek=response.getInt(("String_Node_Str"));
  this.mHighestHour=response.getInt(("String_Node_Str"));
  this.mHighestDayPercent=response.getDouble("String_Node_Str");
  this.mHighestHourPercent=response.getDouble("String_Node_Str");
}
Program: 14373
Project: 14373
Buggy source:
private void saveAndFinish(){
  savePost(true);
  if (mEditorFragment != null && mPost.hasEmptyContentFields()) {
    if (mIsNewPost) {
      WordPress.wpDB.deletePost(mPost);
    }
  }
 else   if (mOriginalPost != null && !mPost.hasChanges(mOriginalPost)) {
    WordPress.wpDB.updatePost(mOriginalPost);
    WordPress.currentPost=mOriginalPost;
  }
 else {
    savePost(false);
    WordPress.currentPost=mPost;
    Intent i=new Intent();
    i.putExtra(EXTRA_SHOULD_REFRESH,true);
    i.putExtra(EXTRA_SAVED_AS_LOCAL_DRAFT,true);
    i.putExtra(EXTRA_IS_PAGE,mIsPage);
    setResult(RESULT_OK,i);
    ToastUtils.showToast(this,R.string.editor_toast_changes_saved);
  }
  finish();
}

Fixed version (ground truth):
private void saveAndFinish(){
  savePost(true);
  if (mEditorFragment != null && mPost.hasEmptyContentFields()) {
    if (mIsNewPost) {
      WordPress.wpDB.deletePost(mPost);
      finish();
      return;
    }
  }
 else   if (mOriginalPost != null && !mPost.hasChanges(mOriginalPost)) {
    WordPress.wpDB.updatePost(mOriginalPost);
    WordPress.currentPost=mOriginalPost;
    finish();
    return;
  }
 else {
    savePost(false);
  }
  WordPress.currentPost=mPost;
  Intent i=new Intent();
  i.putExtra(EXTRA_SHOULD_REFRESH,true);
  i.putExtra(EXTRA_SAVED_AS_LOCAL_DRAFT,true);
  i.putExtra(EXTRA_IS_PAGE,mIsPage);
  setResult(RESULT_OK,i);
  ToastUtils.showToast(this,R.string.editor_toast_changes_saved);
  finish();
}
Program: 14374
Project: 14374
Buggy source:
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  String text=isMarkValid(mMark) ? String.valueOf(mMark) + "String_Node_Str" : "String_Node_Str";
  if (!TextUtils.isEmpty(text)) {
    float textHeight=mTextPaint.descent() + mTextPaint.ascent();
    float yPositionOfText=(getWidth() - textHeight) / 2.0f;
    canvas.drawText(text,(getWidth() - mTextPaint.measureText(text)) / 2.0f,yPositionOfText,mTextPaint);
    String viewsText=getResources().getString(R.string.stats_views);
    float paddingBetweenTextRows=-10f;
    canvas.drawText(viewsText,(getWidth() - mSecondLineTextPaint.measureText(viewsText)) / 2.0f,yPositionOfText - (textHeight + paddingBetweenTextRows),mSecondLineTextPaint);
  }
  float delta=mStrokeWidth / 2f;
  canvas.translate(0f,2 * delta);
  mOuterRect.set(delta,delta,getWidth() - delta,getHeight() - delta);
  float innerCircleRadius=(getWidth() - mStrokeWidth) / 2f;
  canvas.drawCircle(getWidth() / 2f,getHeight() / 2f,innerCircleRadius,mInnerCirclePaint);
  canvas.drawArc(mOuterRect,150,240f,false,mBgRingPaint);
  canvas.drawArc(mOuterRect,150,getMarkAngle(),false,mPaint);
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  String text=(isMarkValid(mMark) ? String.valueOf(mMark) : "String_Node_Str") + "String_Node_Str";
  if (!TextUtils.isEmpty(text)) {
    float textHeight=mTextPaint.descent() + mTextPaint.ascent();
    float yPositionOfText=(getWidth() - textHeight) / 2.0f;
    canvas.drawText(text,(getWidth() - mTextPaint.measureText(text)) / 2.0f,yPositionOfText,mTextPaint);
    String viewsText=getResources().getString(R.string.stats_views);
    float paddingBetweenTextRows=-10f;
    canvas.drawText(viewsText,(getWidth() - mSecondLineTextPaint.measureText(viewsText)) / 2.0f,yPositionOfText - (textHeight + paddingBetweenTextRows),mSecondLineTextPaint);
  }
  float delta=mStrokeWidth / 2f;
  canvas.translate(0f,2 * delta);
  mOuterRect.set(delta,delta,getWidth() - delta,getHeight() - delta);
  float innerCircleRadius=(getWidth() - mStrokeWidth) / 2f;
  canvas.drawCircle(getWidth() / 2f,getHeight() / 2f,innerCircleRadius,mInnerCirclePaint);
  canvas.drawArc(mOuterRect,150,240f,false,mBgRingPaint);
  canvas.drawArc(mOuterRect,150,getMarkAngle(),false,mPaint);
}
Program: 14375
Project: 14375
Buggy source:
public static void viewBlogStats(Context context,int blogLocalTableId){
  Intent intent=new Intent(context,StatsActivity.class);
  intent.putExtra(StatsActivity.ARG_LOCAL_TABLE_BLOG_ID,blogLocalTableId);
  context.startActivity(intent);
}

Fixed version (ground truth):
public static void viewBlogStats(Context context,int blogLocalTableId){
  if (blogLocalTableId == 0)   return;
  Intent intent=new Intent(context,StatsActivity.class);
  intent.putExtra(StatsActivity.ARG_LOCAL_TABLE_BLOG_ID,blogLocalTableId);
  context.startActivity(intent);
}
Program: 14377
Project: 14377
Buggy source:
public NoteViewHolder(View view){
  super(view);
  headerView=view.findViewById(R.id.time_header);
  contentView=view.findViewById(R.id.note_content_container);
  headerText=(TextView)view.findViewById(R.id.header_date_text);
  txtSubject=(TextView)view.findViewById(R.id.note_subject);
  txtSubjectNoticon=(TextView)view.findViewById(R.id.note_subject_noticon);
  txtDetail=(TextView)view.findViewById(R.id.note_detail);
  imgAvatar=(WPNetworkImageView)view.findViewById(R.id.note_avatar);
  noteIcon=(NoticonTextView)view.findViewById(R.id.note_icon);
  progressBar=view.findViewById(R.id.moderate_progress);
  itemView.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (mOnNoteClickListener != null && noteId != null) {
        mOnNoteClickListener.onClickNote(noteId);
      }
    }
  }
);
}

Fixed version (ground truth):
public NoteViewHolder(View view){
  super(view);
  headerView=view.findViewById(R.id.time_header);
  contentView=view.findViewById(R.id.note_content_container);
  headerText=(TextView)view.findViewById(R.id.header_date_text);
  txtSubject=(TextView)view.findViewById(R.id.note_subject);
  txtSubjectNoticon=(TextView)view.findViewById(R.id.note_subject_noticon);
  txtDetail=(TextView)view.findViewById(R.id.note_detail);
  imgAvatar=(WPNetworkImageView)view.findViewById(R.id.note_avatar);
  noteIcon=(NoticonTextView)view.findViewById(R.id.note_icon);
  progressBar=view.findViewById(R.id.moderate_progress);
}
Program: 14379
Project: 14379
Buggy source:
public HtmlToSpannedConverter(String source,WPHtml.ImageGetter imageGetter,WPHtml.TagHandler tagHandler,Parser parser,Context context,Post p,int maxImageWidth){
  mSource=source;
  mSpannableStringBuilder=new SpannableStringBuilder();
  mImageGetter=imageGetter;
  mReader=parser;
  mysteryTagContent="String_Node_Str";
  mysteryTagName=null;
  ctx=context;
  post=p;
  mMaxImageWidth=maxImageWidth;
}

Fixed version (ground truth):
public HtmlToSpannedConverter(String source,WPHtml.ImageGetter imageGetter,WPHtml.TagHandler tagHandler,Parser parser,Context context,Post p,int maxImageWidth){
  mSource=source;
  mSpannableStringBuilder=new SpannableStringBuilder();
  mImageGetter=imageGetter;
  mReader=parser;
  mysteryTagContent="String_Node_Str";
  mysteryTagName=null;
  mContext=context;
  mPost=p;
  mMaxImageWidth=maxImageWidth;
}
Program: 14384
Project: 14384
Buggy source:
public static void handleNoteBlockSpanClick(NotificationsDetailActivity activity,NoteBlockClickableSpan clickedSpan){
switch (clickedSpan.getRangeType()) {
case SITE:
    activity.showBlogPreviewActivity(clickedSpan.getId());
  break;
case USER:
activity.showBlogPreviewActivity(clickedSpan.getSiteId());
break;
case POST:
activity.showPostActivity(clickedSpan.getSiteId(),clickedSpan.getId());
break;
case COMMENT:
activity.showPostActivity(clickedSpan.getSiteId(),clickedSpan.getPostId());
break;
case STAT:
case FOLLOW:
int localTableSiteId=WordPress.wpDB.getLocalTableBlogIdForRemoteBlogId((int)clickedSpan.getSiteId());
if (localTableSiteId > 0) {
activity.showStatsActivityForSite(localTableSiteId,clickedSpan.getRangeType());
}
 else if (!TextUtils.isEmpty(clickedSpan.getUrl())) {
activity.showWebViewActivityForUrl(clickedSpan.getUrl());
}
break;
case LIKE:
if (ReaderPostTable.postExists(clickedSpan.getSiteId(),clickedSpan.getId())) {
activity.showReaderPostLikeUsers(clickedSpan.getSiteId(),clickedSpan.getId());
}
 else {
activity.showPostActivity(clickedSpan.getSiteId(),clickedSpan.getId());
}
break;
default :
if (!TextUtils.isEmpty(clickedSpan.getUrl())) {
activity.showWebViewActivityForUrl(clickedSpan.getUrl());
}
}
}

Fixed version (ground truth):
public static void handleNoteBlockSpanClick(NotificationsDetailActivity activity,NoteBlockClickableSpan clickedSpan){
switch (clickedSpan.getRangeType()) {
case SITE:
    activity.showBlogPreviewActivity(clickedSpan.getId());
  break;
case USER:
activity.showBlogPreviewActivity(clickedSpan.getSiteId());
break;
case POST:
activity.showPostActivity(clickedSpan.getSiteId(),clickedSpan.getId());
break;
case COMMENT:
activity.showWebViewActivityForUrl(clickedSpan.getUrl());
break;
case STAT:
case FOLLOW:
int localTableSiteId=WordPress.wpDB.getLocalTableBlogIdForRemoteBlogId((int)clickedSpan.getSiteId());
if (localTableSiteId > 0) {
activity.showStatsActivityForSite(localTableSiteId,clickedSpan.getRangeType());
}
 else if (!TextUtils.isEmpty(clickedSpan.getUrl())) {
activity.showWebViewActivityForUrl(clickedSpan.getUrl());
}
break;
case LIKE:
if (ReaderPostTable.postExists(clickedSpan.getSiteId(),clickedSpan.getId())) {
activity.showReaderPostLikeUsers(clickedSpan.getSiteId(),clickedSpan.getId());
}
 else {
activity.showPostActivity(clickedSpan.getSiteId(),clickedSpan.getId());
}
break;
default :
if (!TextUtils.isEmpty(clickedSpan.getUrl())) {
activity.showWebViewActivityForUrl(clickedSpan.getUrl());
}
}
}
Program: 14386
Project: 14386
Buggy source:
public static void handleNoteBlockSpanClick(NotificationsDetailActivity activity,NoteBlockClickableSpan clickedSpan){
switch (clickedSpan.getRangeType()) {
case SITE:
    activity.showBlogPreviewActivity(clickedSpan.getId());
  break;
case USER:
activity.showBlogPreviewActivity(clickedSpan.getSiteId());
break;
case POST:
activity.showPostActivity(clickedSpan.getSiteId(),clickedSpan.getId());
break;
case COMMENT:
activity.showPostActivity(clickedSpan.getSiteId(),clickedSpan.getPostId());
break;
case STAT:
case FOLLOW:
int localTableSiteId=WordPress.wpDB.getLocalTableBlogIdForRemoteBlogId((int)clickedSpan.getSiteId());
if (localTableSiteId > 0) {
activity.showStatsActivityForSite(localTableSiteId,clickedSpan.getRangeType());
}
 else if (!TextUtils.isEmpty(clickedSpan.getUrl())) {
activity.showWebViewActivityForUrl(clickedSpan.getUrl());
}
break;
case LIKE:
activity.showReaderPostLikeUsers(clickedSpan.getSiteId(),clickedSpan.getId());
break;
default :
if (!TextUtils.isEmpty(clickedSpan.getUrl())) {
activity.showWebViewActivityForUrl(clickedSpan.getUrl());
}
}
}

Fixed version (ground truth):
public static void handleNoteBlockSpanClick(NotificationsDetailActivity activity,NoteBlockClickableSpan clickedSpan){
switch (clickedSpan.getRangeType()) {
case SITE:
    activity.showBlogPreviewActivity(clickedSpan.getId());
  break;
case USER:
activity.showBlogPreviewActivity(clickedSpan.getSiteId());
break;
case POST:
activity.showPostActivity(clickedSpan.getSiteId(),clickedSpan.getId());
break;
case COMMENT:
activity.showPostActivity(clickedSpan.getSiteId(),clickedSpan.getPostId());
break;
case STAT:
case FOLLOW:
int localTableSiteId=WordPress.wpDB.getLocalTableBlogIdForRemoteBlogId((int)clickedSpan.getSiteId());
if (localTableSiteId > 0) {
activity.showStatsActivityForSite(localTableSiteId,clickedSpan.getRangeType());
}
 else if (!TextUtils.isEmpty(clickedSpan.getUrl())) {
activity.showWebViewActivityForUrl(clickedSpan.getUrl());
}
break;
case LIKE:
if (ReaderPostTable.postExists(clickedSpan.getSiteId(),clickedSpan.getId())) {
activity.showReaderPostLikeUsers(clickedSpan.getSiteId(),clickedSpan.getId());
}
 else {
activity.showPostActivity(clickedSpan.getSiteId(),clickedSpan.getId());
}
break;
default :
if (!TextUtils.isEmpty(clickedSpan.getUrl())) {
activity.showWebViewActivityForUrl(clickedSpan.getUrl());
}
}
}
Program: 14387
Project: 14387
Buggy source:
public NoticonTextView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  this.setTypeface(TypefaceCache.getTypefaceForTypefaceName(context,NotificationsUtils.NOTICON_FONT_NAME));
}

Fixed version (ground truth):
public NoticonTextView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  this.setTypeface(TypefaceCache.getTypefaceForTypefaceName(context,NOTICON_FONT_NAME));
}
Program: 14388
Project: 14388
Buggy source:
@Override public void run(){
  AppLog.e(T.STATS,this.getClass().getName() + "String_Node_Str");
  StatsUtils.logVolleyErrorDetails(volleyError);
  mResponseObjectModel=volleyError;
  EventBus.getDefault().post(new StatsEvents.SectionUpdated(mEndpointName,mRequestBlogId,mTimeframe,mDate,mResponseObjectModel));
  checkAllRequestsFinished();
}

Fixed version (ground truth):
@Override public void run(){
  AppLog.e(T.STATS,this.getClass().getName() + "String_Node_Str");
  StatsUtils.logVolleyErrorDetails(volleyError);
  mResponseObjectModel=volleyError;
  EventBus.getDefault().post(new StatsEvents.SectionUpdated(mEndpointName,mRequestBlogId,mTimeframe,mDate,mResponseObjectModel));
  checkAllRequestsFinished(currentRequest);
}
Program: 14389
Project: 14389
Buggy source:
void checkAllRequestsFinished(){
synchronized (mStatsNetworkRequests) {
    Iterator<Request<JSONObject>> it=mStatsNetworkRequests.iterator();
    while (it.hasNext()) {
      Request<JSONObject> req=it.next();
      if (req.hasHadResponseDelivered() || req.isCanceled()) {
        it.remove();
      }
    }
    boolean isStillWorking=mStatsNetworkRequests.size() > 0;
    EventBus.getDefault().post(new StatsEvents.UpdateStatusChanged(isStillWorking));
  }
}

Fixed version (ground truth):
void checkAllRequestsFinished(Request<JSONObject> req){
synchronized (mStatsNetworkRequests) {
    if (req != null) {
      mStatsNetworkRequests.remove(req);
    }
    boolean isStillWorking=mStatsNetworkRequests.size() > 0;
    EventBus.getDefault().post(new StatsEvents.UpdateStatusChanged(isStillWorking));
  }
}
Program: 14390
Project: 14390
Buggy source:
@Override public void onResponse(final JSONObject response){
  singleThreadNetworkHandler.submit(new Thread(){
    @Override public void run(){
      if (response != null) {
        try {
          mResponseObjectModel=StatsUtils.parseResponse(mEndpointName,mRequestBlogId,response);
        }
 catch (        JSONException e) {
          AppLog.e(AppLog.T.STATS,e);
        }
      }
      EventBus.getDefault().post(new StatsEvents.SectionUpdated(mEndpointName,mRequestBlogId,mTimeframe,mDate,mResponseObjectModel));
      checkAllRequestsFinished();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onResponse(final JSONObject response){
  singleThreadNetworkHandler.submit(new Thread(){
    @Override public void run(){
      if (response != null) {
        try {
          mResponseObjectModel=StatsUtils.parseResponse(mEndpointName,mRequestBlogId,response);
        }
 catch (        JSONException e) {
          AppLog.e(AppLog.T.STATS,e);
        }
      }
      EventBus.getDefault().post(new StatsEvents.SectionUpdated(mEndpointName,mRequestBlogId,mTimeframe,mDate,mResponseObjectModel));
      checkAllRequestsFinished(currentRequest);
    }
  }
);
}