nus-yam/ex-repair huggingface dataset:
Program: 14436
Project: 14436
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ProfilingUtils.split("String_Node_Str");
  ProfilingUtils.dump();
  createMenuDrawer(R.layout.posts);
  setSupportActionBar(getToolbar());
  ActionBar actionBar=getSupportActionBar();
  if (actionBar != null) {
    actionBar.setDisplayShowTitleEnabled(true);
  }
  FragmentManager fm=getFragmentManager();
  fm.addOnBackStackChangedListener(mOnBackStackChangedListener);
  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);
  ProfilingUtils.split("String_Node_Str");
  ProfilingUtils.dump();
  createMenuDrawer(R.layout.posts);
  ActionBar actionBar=getSupportActionBar();
  if (actionBar != null) {
    actionBar.setDisplayShowTitleEnabled(true);
  }
  FragmentManager fm=getFragmentManager();
  fm.addOnBackStackChangedListener(mOnBackStackChangedListener);
  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: 14438
Project: 14438
Buggy source:
@Override public boolean onOptionsItemSelected(final MenuItem item){
switch (item.getItemId()) {
case android.R.id.home:
    onBackPressed();
  return true;
case R.id.menu_tags:
ReaderActivityLauncher.showReaderSubsForResult(this);
return true;
default :
return super.onOptionsItemSelected(item);
}
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(final MenuItem item){
switch (item.getItemId()) {
case R.id.menu_tags:
    ReaderActivityLauncher.showReaderSubsForResult(this);
  return true;
default :
return super.onOptionsItemSelected(item);
}
}
Program: 14439
Project: 14439
Buggy source:
private void readIntent(Intent intent,Bundle savedInstanceState){
  if (intent == null) {
    return;
  }
  if (intent.hasExtra(ReaderConstants.ARG_POST_LIST_TYPE)) {
    mPostListType=(ReaderTypes.ReaderPostListType)intent.getSerializableExtra(ReaderConstants.ARG_POST_LIST_TYPE);
  }
 else {
    mPostListType=ReaderTypes.DEFAULT_POST_LIST_TYPE;
  }
  if (mPostListType.isPreviewType() && getDrawerToggle() != null) {
    getDrawerToggle().setDrawerIndicatorEnabled(false);
    getDrawerToggle().setToolbarNavigationClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        onBackPressed();
      }
    }
);
  }
switch (mPostListType) {
case TAG_PREVIEW:
    setTitle(R.string.reader_title_tag_preview);
  break;
case BLOG_PREVIEW:
setTitle(R.string.reader_title_blog_preview);
break;
default :
break;
}
if (savedInstanceState == null) {
AnalyticsTracker.track(AnalyticsTracker.Stat.READER_ACCESSED);
if (mPostListType == ReaderTypes.ReaderPostListType.BLOG_PREVIEW) {
long blogId=intent.getLongExtra(ReaderConstants.ARG_BLOG_ID,0);
String blogUrl=intent.getStringExtra(ReaderConstants.ARG_BLOG_URL);
showListFragmentForBlog(blogId,blogUrl);
}
 else {
ReaderTag tag;
if (intent.hasExtra(ReaderConstants.ARG_TAG)) {
tag=(ReaderTag)intent.getSerializableExtra(ReaderConstants.ARG_TAG);
}
 else {
tag=AppPrefs.getReaderTag();
}
if (mPostListType == ReaderTypes.ReaderPostListType.TAG_FOLLOWED && !ReaderTagTable.tagExists(tag)) {
tag=ReaderTag.getDefaultTag();
}
showListFragmentForTag(tag,mPostListType);
}
}
}

Fixed version (ground truth):
private void readIntent(Intent intent,Bundle savedInstanceState){
  if (intent == null) {
    return;
  }
  if (intent.hasExtra(ReaderConstants.ARG_POST_LIST_TYPE)) {
    mPostListType=(ReaderTypes.ReaderPostListType)intent.getSerializableExtra(ReaderConstants.ARG_POST_LIST_TYPE);
  }
 else {
    mPostListType=ReaderTypes.DEFAULT_POST_LIST_TYPE;
  }
  if (mPostListType.isPreviewType() && getDrawerToggle() != null) {
    getDrawerToggle().setDrawerIndicatorEnabled(false);
    getToolbar().setNavigationOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View v){
        onBackPressed();
      }
    }
);
  }
switch (mPostListType) {
case TAG_PREVIEW:
    setTitle(R.string.reader_title_tag_preview);
  break;
case BLOG_PREVIEW:
setTitle(R.string.reader_title_blog_preview);
break;
default :
break;
}
if (savedInstanceState == null) {
AnalyticsTracker.track(AnalyticsTracker.Stat.READER_ACCESSED);
if (mPostListType == ReaderTypes.ReaderPostListType.BLOG_PREVIEW) {
long blogId=intent.getLongExtra(ReaderConstants.ARG_BLOG_ID,0);
String blogUrl=intent.getStringExtra(ReaderConstants.ARG_BLOG_URL);
showListFragmentForBlog(blogId,blogUrl);
}
 else {
ReaderTag tag;
if (intent.hasExtra(ReaderConstants.ARG_TAG)) {
tag=(ReaderTag)intent.getSerializableExtra(ReaderConstants.ARG_TAG);
}
 else {
tag=AppPrefs.getReaderTag();
}
if (mPostListType == ReaderTypes.ReaderPostListType.TAG_FOLLOWED && !ReaderTagTable.tagExists(tag)) {
tag=ReaderTag.getDefaultTag();
}
showListFragmentForTag(tag,mPostListType);
}
}
}
Program: 14440
Project: 14440
Buggy source:
@Override public void onBackPressed(){
  ReaderPostListFragment fragment=getListFragment();
  if (fragment == null || !fragment.goBackInTagHistory()) {
    super.onBackPressed();
  }
}

Fixed version (ground truth):
@Override public void onBackPressed(){
  ReaderPostListFragment fragment=getListFragment();
  if (fragment == null || !fragment.goBackInTagHistory()) {
    setToolbarClickListener();
    super.onBackPressed();
  }
}
Program: 14442
Project: 14442
Buggy source:
@Override public boolean onOptionsItemSelected(final MenuItem item){
switch (item.getItemId()) {
case android.R.id.home:
    onBackPressed();
  return true;
case R.id.menu_publish:
submitReblog();
return true;
default :
return super.onOptionsItemSelected(item);
}
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(final MenuItem item){
switch (item.getItemId()) {
case R.id.menu_publish:
    submitReblog();
  return true;
default :
return super.onOptionsItemSelected(item);
}
}
Program: 14443
Project: 14443
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.reader_activity_reblog);
  Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  getSupportActionBar().setDisplayShowTitleEnabled(false);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  View view=View.inflate(this,R.layout.reader_spinner,toolbar);
  mSpinner=(Spinner)view.findViewById(R.id.action_bar_spinner);
  mSpinner.setAdapter(getReblogAdapter());
  mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){
    @Override public void onItemSelected(    AdapterView<?> parent,    View view,    int position,    long id){
      mDestinationBlogId=id;
    }
    @Override public void onNothingSelected(    AdapterView<?> parent){
      mDestinationBlogId=0;
    }
  }
);
  mBlogId=getIntent().getLongExtra(ReaderConstants.ARG_BLOG_ID,0);
  mPostId=getIntent().getLongExtra(ReaderConstants.ARG_POST_ID,0);
  mEditComment=(EditText)findViewById(R.id.edit_comment);
  mLayoutExcerpt=(ViewGroup)findViewById(R.id.layout_post_excerpt);
  if (savedInstanceState == null) {
    mEditComment.setVisibility(View.INVISIBLE);
    new Handler().postDelayed(new Runnable(){
      @Override public void run(){
        if (!isFinishing()) {
          animateCommentView();
        }
      }
    }
,300);
  }
  loadPost();
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.reader_activity_reblog);
  Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  toolbar.setNavigationOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      onBackPressed();
    }
  }
);
  getSupportActionBar().setDisplayShowTitleEnabled(false);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  View view=View.inflate(this,R.layout.reader_spinner,toolbar);
  mSpinner=(Spinner)view.findViewById(R.id.action_bar_spinner);
  mSpinner.setAdapter(getReblogAdapter());
  mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){
    @Override public void onItemSelected(    AdapterView<?> parent,    View view,    int position,    long id){
      mDestinationBlogId=id;
    }
    @Override public void onNothingSelected(    AdapterView<?> parent){
      mDestinationBlogId=0;
    }
  }
);
  mBlogId=getIntent().getLongExtra(ReaderConstants.ARG_BLOG_ID,0);
  mPostId=getIntent().getLongExtra(ReaderConstants.ARG_POST_ID,0);
  mEditComment=(EditText)findViewById(R.id.edit_comment);
  mLayoutExcerpt=(ViewGroup)findViewById(R.id.layout_post_excerpt);
  if (savedInstanceState == null) {
    mEditComment.setVisibility(View.INVISIBLE);
    new Handler().postDelayed(new Runnable(){
      @Override public void run(){
        if (!isFinishing()) {
          animateCommentView();
        }
      }
    }
,300);
  }
  loadPost();
}
Program: 14445
Project: 14445
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.reader_activity_userlist);
  setTitle(null);
  Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  getSupportActionBar().setDisplayShowTitleEnabled(true);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  if (savedInstanceState != null) {
    mRestorePosition=savedInstanceState.getInt(ReaderConstants.KEY_RESTORE_POSITION);
  }
  int spacingHorizontal=0;
  int spacingVertical=DisplayUtils.dpToPx(this,1);
  mRecyclerView=(ReaderRecyclerView)findViewById(R.id.recycler_view);
  mRecyclerView.addItemDecoration(new ReaderRecyclerView.ReaderItemDecoration(spacingHorizontal,spacingVertical));
  long blogId=getIntent().getLongExtra(ReaderConstants.ARG_BLOG_ID,0);
  long postId=getIntent().getLongExtra(ReaderConstants.ARG_POST_ID,0);
  long commentId=getIntent().getLongExtra(ReaderConstants.ARG_COMMENT_ID,0);
  loadUsers(blogId,postId,commentId);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.reader_activity_userlist);
  setTitle(null);
  Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  toolbar.setNavigationOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      onBackPressed();
    }
  }
);
  getSupportActionBar().setDisplayShowTitleEnabled(true);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  if (savedInstanceState != null) {
    mRestorePosition=savedInstanceState.getInt(ReaderConstants.KEY_RESTORE_POSITION);
  }
  int spacingHorizontal=0;
  int spacingVertical=DisplayUtils.dpToPx(this,1);
  mRecyclerView=(ReaderRecyclerView)findViewById(R.id.recycler_view);
  mRecyclerView.addItemDecoration(new ReaderRecyclerView.ReaderItemDecoration(spacingHorizontal,spacingVertical));
  long blogId=getIntent().getLongExtra(ReaderConstants.ARG_BLOG_ID,0);
  long postId=getIntent().getLongExtra(ReaderConstants.ARG_POST_ID,0);
  long commentId=getIntent().getLongExtra(ReaderConstants.ARG_COMMENT_ID,0);
  loadUsers(blogId,postId,commentId);
}
Program: 14446
Project: 14446
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  int itemId=item.getItemId();
  if (itemId == android.R.id.home) {
    FragmentManager fm=getFragmentManager();
    if (fm.getBackStackEntryCount() > 0) {
      fm.popBackStack();
      setupBaseLayout();
      return true;
    }
  }
 else   if (itemId == R.id.menu_search) {
    FragmentTransaction ft=getFragmentManager().beginTransaction();
    if (mSearchFragment == null) {
      mSearchFragment=ThemeSearchFragment.newInstance();
    }
    ft.add(R.id.theme_browser_container,mSearchFragment,ThemeSearchFragment.TAG);
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    ft.addToBackStack(null);
    ft.commit();
    return true;
  }
  return super.onOptionsItemSelected(item);
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  int itemId=item.getItemId();
  if (itemId == R.id.menu_search) {
    FragmentTransaction ft=getFragmentManager().beginTransaction();
    if (mSearchFragment == null) {
      mSearchFragment=ThemeSearchFragment.newInstance();
    }
    ft.add(R.id.theme_browser_container,mSearchFragment,ThemeSearchFragment.TAG);
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    ft.addToBackStack(null);
    ft.commit();
    return true;
  }
  return super.onOptionsItemSelected(item);
}
Program: 14447
Project: 14447
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;
  }
  if (savedInstanceState == null) {
    AnalyticsTracker.track(AnalyticsTracker.Stat.THEMES_ACCESSED_THEMES_BROWSER);
  }
  setTitle(R.string.themes);
  createMenuDrawer(R.layout.theme_browser_activity);
  setSupportActionBar(getToolbar());
  mThemePagerAdapter=new ThemePagerAdapter(getFragmentManager());
  final ActionBar actionBar=getSupportActionBar();
  if (actionBar != null) {
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setHomeButtonEnabled(true);
  }
  mViewPager=(ViewPager)findViewById(R.id.theme_browser_pager);
  mViewPager.setAdapter(mThemePagerAdapter);
  mTabLayout=(SlidingTabLayout)findViewById(R.id.sliding_tabs);
  mTabLayout.setCustomTabView(R.layout.tab_text,R.id.text_tab);
  mTabLayout.setSelectedIndicatorColors(getResources().getColor(R.color.tab_indicator));
  mTabLayout.setDistributeEvenly(true);
  mTabLayout.setViewPager(mViewPager);
  FragmentManager fm=getFragmentManager();
  fm.addOnBackStackChangedListener(mOnBackStackChangedListener);
  setupBaseLayout();
  mPreviewFragment=(ThemePreviewFragment)fm.findFragmentByTag(ThemePreviewFragment.TAG);
  mDetailsFragment=(ThemeDetailsFragment)fm.findFragmentByTag(ThemeDetailsFragment.TAG);
  mSearchFragment=(ThemeSearchFragment)fm.findFragmentByTag(ThemeSearchFragment.TAG);
}

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;
  }
  if (savedInstanceState == null) {
    AnalyticsTracker.track(AnalyticsTracker.Stat.THEMES_ACCESSED_THEMES_BROWSER);
  }
  setTitle(R.string.themes);
  createMenuDrawer(R.layout.theme_browser_activity);
  mThemePagerAdapter=new ThemePagerAdapter(getFragmentManager());
  final ActionBar actionBar=getSupportActionBar();
  if (actionBar != null) {
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setHomeButtonEnabled(true);
  }
  mViewPager=(ViewPager)findViewById(R.id.theme_browser_pager);
  mViewPager.setAdapter(mThemePagerAdapter);
  mTabLayout=(SlidingTabLayout)findViewById(R.id.sliding_tabs);
  mTabLayout.setCustomTabView(R.layout.tab_text,R.id.text_tab);
  mTabLayout.setSelectedIndicatorColors(getResources().getColor(R.color.tab_indicator));
  mTabLayout.setDistributeEvenly(true);
  mTabLayout.setViewPager(mViewPager);
  FragmentManager fm=getFragmentManager();
  fm.addOnBackStackChangedListener(mOnBackStackChangedListener);
  setupBaseLayout();
  mPreviewFragment=(ThemePreviewFragment)fm.findFragmentByTag(ThemePreviewFragment.TAG);
  mDetailsFragment=(ThemeDetailsFragment)fm.findFragmentByTag(ThemeDetailsFragment.TAG);
  mSearchFragment=(ThemeSearchFragment)fm.findFragmentByTag(ThemeSearchFragment.TAG);
}
Program: 14448
Project: 14448
Buggy source:
private void setMainViewsLabel(String dateFormatted,int totals){
  mStatsViewsLabel.setText(getString(R.string.stats_views) + "String_Node_Str" + dateFormatted);
  mStatsViewsTotals.setText(String.valueOf(totals));
}

Fixed version (ground truth):
private void setMainViewsLabel(String dateFormatted,int totals){
  mStatsViewsLabel.setText(getString(R.string.stats_views) + "String_Node_Str" + dateFormatted);
  mStatsViewsTotals.setText(FormatUtils.formatDecimal(totals));
}
Program: 14449
Project: 14449
Buggy source:
void updatePostsInCurrentBlog(final RequestDataAction updateAction){
  if (!NetworkUtils.isNetworkAvailable(getActivity())) {
    AppLog.i(T.READER,"String_Node_Str");
    return;
  }
  setIsUpdating(true,updateAction);
  ReaderActions.UpdateResultListener resultListener=new ReaderActions.UpdateResultListener(){
    @Override public void onUpdateResult(    ReaderActions.UpdateResult result){
      if (!isAdded()) {
        return;
      }
      setIsUpdating(false,updateAction);
      if (result.isNewOrChanged()) {
        refreshPosts();
      }
    }
  }
;
  ReaderPostActions.requestPostsForBlog(mCurrentBlogId,mCurrentBlogUrl,updateAction,resultListener);
}

Fixed version (ground truth):
void updatePostsInCurrentBlog(final RequestDataAction updateAction){
  if (!NetworkUtils.isNetworkAvailable(getActivity())) {
    AppLog.i(T.READER,"String_Node_Str");
    return;
  }
  setIsUpdating(true,updateAction);
  ReaderActions.UpdateResultListener resultListener=new ReaderActions.UpdateResultListener(){
    @Override public void onUpdateResult(    ReaderActions.UpdateResult result){
      if (!isAdded()) {
        return;
      }
      setIsUpdating(false,updateAction);
      if (result.isNewOrChanged()) {
        refreshPosts(false);
      }
    }
  }
;
  ReaderPostActions.requestPostsForBlog(mCurrentBlogId,mCurrentBlogUrl,updateAction,resultListener);
}
Program: 14450
Project: 14450
Buggy source:
void updatePostsWithTag(final ReaderTag tag,final RequestDataAction updateAction,final RefreshType refreshType){
  if (tag == null) {
    return;
  }
  if (!NetworkUtils.isNetworkAvailable(getActivity())) {
    AppLog.i(T.READER,"String_Node_Str");
    return;
  }
  setIsUpdating(true,updateAction);
  setEmptyTitleAndDescriptionForCurrentTag();
  if (getPostListType() == ReaderPostListType.TAG_FOLLOWED && ReaderTagTable.isEmpty()) {
    AppLog.d(T.READER,"String_Node_Str");
    return;
  }
  if (refreshType == RefreshType.MANUAL && isCurrentTag(tag)) {
    if (tag.getTagName().equals(ReaderTag.TAG_NAME_LIKED) || tag.getTagName().equals(ReaderTag.TAG_NAME_FOLLOWING))     refreshPosts();
  }
  ReaderActions.UpdateResultListener resultListener=new ReaderActions.UpdateResultListener(){
    @Override public void onUpdateResult(    ReaderActions.UpdateResult result){
      if (!isAdded()) {
        AppLog.w(T.READER,"String_Node_Str");
        return;
      }
      setIsUpdating(false,updateAction);
      if (!isCurrentTag(tag)) {
        return;
      }
      if (result.isNewOrChanged()) {
        if (!isPostAdapterEmpty() && updateAction == RequestDataAction.LOAD_NEWER) {
          showNewPostsBar();
        }
        refreshPosts();
      }
 else {
        setEmptyTitleAndDescriptionForCurrentTag();
      }
    }
  }
;
  ReaderPostActions.updatePostsInTag(tag,updateAction,resultListener);
}

Fixed version (ground truth):
void updatePostsWithTag(final ReaderTag tag,final RequestDataAction updateAction,final RefreshType refreshType){
  if (tag == null) {
    return;
  }
  if (!NetworkUtils.isNetworkAvailable(getActivity())) {
    AppLog.i(T.READER,"String_Node_Str");
    return;
  }
  setIsUpdating(true,updateAction);
  setEmptyTitleAndDescriptionForCurrentTag();
  if (getPostListType() == ReaderPostListType.TAG_FOLLOWED && ReaderTagTable.isEmpty()) {
    AppLog.d(T.READER,"String_Node_Str");
    return;
  }
  if (refreshType == RefreshType.MANUAL && isCurrentTag(tag)) {
    if (tag.getTagName().equals(ReaderTag.TAG_NAME_LIKED) || tag.getTagName().equals(ReaderTag.TAG_NAME_FOLLOWING))     refreshPosts(false);
  }
  ReaderActions.UpdateResultListener resultListener=new ReaderActions.UpdateResultListener(){
    @Override public void onUpdateResult(    ReaderActions.UpdateResult result){
      if (!isAdded()) {
        AppLog.w(T.READER,"String_Node_Str");
        return;
      }
      setIsUpdating(false,updateAction);
      if (!isCurrentTag(tag)) {
        return;
      }
      if (result.isNewOrChanged()) {
        if (!isPostAdapterEmpty() && updateAction == RequestDataAction.LOAD_NEWER) {
          showNewPostsBar();
        }
        boolean isLoadingOlderPosts=(updateAction == RequestDataAction.LOAD_OLDER);
        refreshPosts(isLoadingOlderPosts);
      }
 else {
        setEmptyTitleAndDescriptionForCurrentTag();
      }
    }
  }
;
  ReaderPostActions.updatePostsInTag(tag,updateAction,resultListener);
}
Program: 14451
Project: 14451
Buggy source:
@Override public void onResume(){
  super.onResume();
  if (mWasPaused) {
    AppLog.d(T.READER,"String_Node_Str");
    mWasPaused=false;
    refreshPosts();
    refreshTags();
    if (!isUpdating() && getPostListType() == ReaderPostListType.TAG_FOLLOWED && ReaderTagTable.shouldAutoUpdateTag(mCurrentTag)) {
      AppLog.i(T.READER,"String_Node_Str");
      updatePostsWithTag(getCurrentTag(),RequestDataAction.LOAD_NEWER,RefreshType.AUTOMATIC);
    }
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  if (mWasPaused) {
    AppLog.d(T.READER,"String_Node_Str");
    mWasPaused=false;
    refreshPosts(false);
    refreshTags();
    if (!isUpdating() && getPostListType() == ReaderPostListType.TAG_FOLLOWED && ReaderTagTable.shouldAutoUpdateTag(mCurrentTag)) {
      AppLog.i(T.READER,"String_Node_Str");
      updatePostsWithTag(getCurrentTag(),RequestDataAction.LOAD_NEWER,RefreshType.AUTOMATIC);
    }
  }
}
Program: 14452
Project: 14452
Buggy source:
@Override public void onUndo(Parcelable parcelable){
  ReaderBlogActions.undoBlockBlogFromReader(blockResult);
  refreshPosts();
}

Fixed version (ground truth):
@Override public void onUndo(Parcelable parcelable){
  ReaderBlogActions.undoBlockBlogFromReader(blockResult);
  refreshPosts(false);
}
Program: 14453
Project: 14453
Buggy source:
private void blockBlogForPost(final ReaderPost post){
  if (post == null || !hasPostAdapter()) {
    return;
  }
  if (!NetworkUtils.checkConnection(getActivity())) {
    return;
  }
  ReaderActions.ActionListener actionListener=new ReaderActions.ActionListener(){
    @Override public void onActionResult(    boolean succeeded){
      if (!succeeded && isAdded()) {
        hideUndoBar();
        ToastUtils.showToast(getActivity(),R.string.reader_toast_err_block_blog,ToastUtils.Duration.LONG);
      }
    }
  }
;
  final ReaderBlogActions.BlockedBlogResult blockResult=ReaderBlogActions.blockBlogFromReader(post.blogId,actionListener);
  AnalyticsTracker.track(AnalyticsTracker.Stat.READER_BLOCKED_BLOG);
  getPostAdapter().removePostsInBlog(post.blogId);
  UndoBarController.UndoListener undoListener=new UndoBarController.UndoListener(){
    @Override public void onUndo(    Parcelable parcelable){
      ReaderBlogActions.undoBlockBlogFromReader(blockResult);
      refreshPosts();
    }
  }
;
  new UndoBarController.UndoBar(getActivity()).message(getString(R.string.reader_toast_blog_blocked)).listener(undoListener).translucent(true).show();
}

Fixed version (ground truth):
private void blockBlogForPost(final ReaderPost post){
  if (post == null || !hasPostAdapter()) {
    return;
  }
  if (!NetworkUtils.checkConnection(getActivity())) {
    return;
  }
  ReaderActions.ActionListener actionListener=new ReaderActions.ActionListener(){
    @Override public void onActionResult(    boolean succeeded){
      if (!succeeded && isAdded()) {
        hideUndoBar();
        ToastUtils.showToast(getActivity(),R.string.reader_toast_err_block_blog,ToastUtils.Duration.LONG);
      }
    }
  }
;
  final ReaderBlogActions.BlockedBlogResult blockResult=ReaderBlogActions.blockBlogFromReader(post.blogId,actionListener);
  AnalyticsTracker.track(AnalyticsTracker.Stat.READER_BLOCKED_BLOG);
  getPostAdapter().removePostsInBlog(post.blogId);
  UndoBarController.UndoListener undoListener=new UndoBarController.UndoListener(){
    @Override public void onUndo(    Parcelable parcelable){
      ReaderBlogActions.undoBlockBlogFromReader(blockResult);
      refreshPosts(false);
    }
  }
;
  new UndoBarController.UndoBar(getActivity()).message(getString(R.string.reader_toast_blog_blocked)).listener(undoListener).translucent(true).show();
}
Program: 14454
Project: 14454
Buggy source:
void refreshPosts(){
  if (hasPostAdapter()) {
    getPostAdapter().refresh();
  }
}

Fixed version (ground truth):
void refreshPosts(boolean isLoadingOlderPosts){
  if (hasPostAdapter()) {
    getPostAdapter().refresh(isLoadingOlderPosts);
  }
}
Program: 14455
Project: 14455
Buggy source:
@Override public void onUpdateResult(ReaderActions.UpdateResult result){
  if (!isAdded()) {
    AppLog.w(T.READER,"String_Node_Str");
    return;
  }
  setIsUpdating(false,updateAction);
  if (!isCurrentTag(tag)) {
    return;
  }
  if (result.isNewOrChanged()) {
    if (!isPostAdapterEmpty() && updateAction == RequestDataAction.LOAD_NEWER) {
      showNewPostsBar();
    }
    refreshPosts();
  }
 else {
    setEmptyTitleAndDescriptionForCurrentTag();
  }
}

Fixed version (ground truth):
@Override public void onUpdateResult(ReaderActions.UpdateResult result){
  if (!isAdded()) {
    AppLog.w(T.READER,"String_Node_Str");
    return;
  }
  setIsUpdating(false,updateAction);
  if (!isCurrentTag(tag)) {
    return;
  }
  if (result.isNewOrChanged()) {
    if (!isPostAdapterEmpty() && updateAction == RequestDataAction.LOAD_NEWER) {
      showNewPostsBar();
    }
    boolean isLoadingOlderPosts=(updateAction == RequestDataAction.LOAD_OLDER);
    refreshPosts(isLoadingOlderPosts);
  }
 else {
    setEmptyTitleAndDescriptionForCurrentTag();
  }
}
Program: 14456
Project: 14456
Buggy source:
void reload(){
  clear();
  loadPosts();
}

Fixed version (ground truth):
void reload(){
  clear();
  loadPosts(false);
}
Program: 14457
Project: 14457
Buggy source:
@Override protected void onPostExecute(Boolean result){
  if (result) {
    if (mPosts.size() == 0) {
      mPosts.addAll(allPosts);
      notifyDataSetChanged();
    }
 else {
      ReaderPostList newPosts=new ReaderPostList();
      for (      ReaderPost post : allPosts) {
        int index=mPosts.indexOfPost(post);
        if (index == -1) {
          newPosts.add(post);
        }
 else         if (!post.isSamePost(mPosts.get(index))) {
          mPosts.set(index,post);
          notifyItemChanged(index);
        }
      }
      if (newPosts.size() > 0) {
        mPosts.addAll(0,newPosts);
        notifyItemRangeInserted(0,newPosts.size());
      }
    }
  }
  if (mDataLoadedListener != null) {
    mDataLoadedListener.onDataLoaded(isEmpty());
  }
  mIsTaskRunning=false;
}

Fixed version (ground truth):
@Override protected void onPostExecute(Boolean result){
  if (result) {
    if (mPosts.size() == 0) {
      mPosts.addAll(allPosts);
      notifyDataSetChanged();
    }
 else {
      ReaderPostList newPosts=new ReaderPostList();
      for (      ReaderPost post : allPosts) {
        int index=mPosts.indexOfPost(post);
        if (index == -1) {
          newPosts.add(post);
        }
 else         if (!post.isSamePost(mPosts.get(index))) {
          mPosts.set(index,post);
          notifyItemChanged(index);
        }
      }
      if (newPosts.size() > 0) {
        int firstIndex=(isLoadingOlderPosts ? mPosts.size() : 0);
        mPosts.addAll(firstIndex,newPosts);
        notifyItemRangeInserted(firstIndex,newPosts.size());
      }
    }
  }
  if (mDataLoadedListener != null) {
    mDataLoadedListener.onDataLoaded(isEmpty());
  }
  mIsTaskRunning=false;
}
Program: 14458
Project: 14458
Buggy source:
public void refresh(){
  loadPosts();
}

Fixed version (ground truth):
public void refresh(boolean isLoadingOlderPosts){
  loadPosts(isLoadingOlderPosts);
}
Program: 14459
Project: 14459
Buggy source:
private void loadPosts(){
  if (mIsTaskRunning) {
    AppLog.w(AppLog.T.READER,"String_Node_Str");
    return;
  }
  new LoadPostsTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}

Fixed version (ground truth):
private void loadPosts(boolean isLoadingOlderPosts){
  if (mIsTaskRunning) {
    AppLog.w(AppLog.T.READER,"String_Node_Str");
    return;
  }
  new LoadPostsTask(isLoadingOlderPosts).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Program: 14462
Project: 14462
Buggy source:
private int getNumOfPoints(){
  return 7;
}

Fixed version (ground truth):
private int getNumOfPoints(){
  if (!isAdded()) {
    return 0;
  }
  if (StatsUIHelper.shouldLoadMoreBars(getActivity())) {
    return 10;
  }
 else {
    return 7;
  }
}
Program: 14463
Project: 14463
Buggy source:
public FollowHelper(Activity activity){
  mActivityRef=new WeakReference<Activity>(activity);
}

Fixed version (ground truth):
public FollowHelper(Activity activity){
  mActivityRef=new WeakReference<>(activity);
}
Program: 14464
Project: 14464
Buggy source:
public FollowRestListener(Activity activity,final FollowDataModel followData){
  this.mActivityRef=new WeakReference<Activity>(activity);
  this.mFollowData=followData;
}

Fixed version (ground truth):
public FollowRestListener(Activity activity,final FollowDataModel followData){
  this.mActivityRef=new WeakReference<>(activity);
  this.mFollowData=followData;
}
Program: 14466
Project: 14466
Buggy source:
public RestListener(Activity activity,StatsService.StatsEndpointsEnum endpointName,String blogId,StatsTimeframe timeframe){
  mActivityRef=new WeakReference<Activity>(activity);
  mRequestBlogId=blogId;
  mTimeframe=timeframe;
  mEndpointName=endpointName;
}

Fixed version (ground truth):
public RestListener(Activity activity,StatsService.StatsEndpointsEnum endpointName,String blogId,StatsTimeframe timeframe){
  mActivityRef=new WeakReference<>(activity);
  mRequestBlogId=blogId;
  mTimeframe=timeframe;
  mEndpointName=endpointName;
}
Program: 14467
Project: 14467
Buggy source:
public void setEntryTextOrLink(String linkUrl,String linkName){
  if (entryTextView == null) {
    return;
  }
  boolean isLink=false;
  if (TextUtils.isEmpty(linkUrl)) {
    entryTextView.setText(linkName);
    isLink=(linkName != null && linkName.startsWith("String_Node_Str"));
  }
 else   if (TextUtils.isEmpty(linkName)) {
    entryTextView.setText(linkUrl);
    isLink=(linkUrl != null && linkUrl.startsWith("String_Node_Str"));
  }
 else {
    entryTextView.setText(Html.fromHtml("String_Node_Str" + linkUrl + "String_Node_Str"+ linkName+ "String_Node_Str"));
  }
  if (isLink) {
    entryTextView.setMovementMethod(StatsWPLinkMovementMethod.getInstance());
    Linkify.addLinks(entryTextView,Linkify.WEB_URLS);
  }
  StatsUIHelper.removeUnderlines((Spannable)entryTextView.getText());
}

Fixed version (ground truth):
public void setEntryTextOrLink(String linkUrl,String linkName){
  if (entryTextView == null) {
    return;
  }
  boolean isLink=false;
  if (TextUtils.isEmpty(linkUrl)) {
    entryTextView.setText(linkName);
    isLink=(linkName != null && linkName.startsWith("String_Node_Str"));
  }
 else   if (TextUtils.isEmpty(linkName)) {
    entryTextView.setText(linkUrl);
    isLink=(linkUrl != null && linkUrl.startsWith("String_Node_Str"));
  }
 else {
    entryTextView.setText(Html.fromHtml("String_Node_Str" + linkUrl + "String_Node_Str"+ linkName+ "String_Node_Str"));
  }
  if (isLink) {
    entryTextView.setMovementMethod(StatsWPLinkMovementMethod.getInstance());
    Linkify.addLinks(entryTextView,Linkify.WEB_URLS);
  }
  entryTextView.setHighlightColor(entryTextView.getResources().getColor(R.color.transparent));
  StatsUIHelper.removeUnderlines((Spannable)entryTextView.getText());
}
Program: 14468
Project: 14468
Buggy source:
public AuthorModel(String blogId,String date,JSONObject authorJSON) throws JSONException {
  setBlogId(blogId);
  setDate(StatsUtils.toMs(date));
  setGroupId(authorJSON.getString("String_Node_Str"));
  setName(authorJSON.getString("String_Node_Str"));
  setViews(authorJSON.getInt("String_Node_Str"));
  setAvatar(JSONUtil.getString(authorJSON,"String_Node_Str"));
  JSONObject followData=authorJSON.optJSONObject("String_Node_Str");
  if (followData != null) {
    this.mFollowData=new FollowDataModel(followData);
  }
  JSONArray postsJSON=authorJSON.getJSONArray("String_Node_Str");
  mPosts=new ArrayList<SingleItemModel>(authorJSON.length());
  for (int i=0; i < postsJSON.length(); i++) {
    JSONObject currentPostJSON=postsJSON.getJSONObject(i);
    String postId=String.valueOf(currentPostJSON.getInt("String_Node_Str"));
    String title=currentPostJSON.getString("String_Node_Str");
    int views=currentPostJSON.getInt("String_Node_Str");
    String url=currentPostJSON.getString("String_Node_Str");
    SingleItemModel currentPost=new SingleItemModel(mBlogId,mDate,postId,title,views,url,null);
    mPosts.add(currentPost);
  }
}

Fixed version (ground truth):
public AuthorModel(String blogId,String date,JSONObject authorJSON) throws JSONException {
  setBlogId(blogId);
  setDate(StatsUtils.toMs(date));
  setGroupId(authorJSON.getString("String_Node_Str"));
  setName(authorJSON.getString("String_Node_Str"));
  setViews(authorJSON.getInt("String_Node_Str"));
  setAvatar(JSONUtil.getString(authorJSON,"String_Node_Str"));
  JSONObject followData=authorJSON.optJSONObject("String_Node_Str");
  if (followData != null) {
    this.mFollowData=new FollowDataModel(followData);
  }
  JSONArray postsJSON=authorJSON.getJSONArray("String_Node_Str");
  mPosts=new ArrayList<>(authorJSON.length());
  for (int i=0; i < postsJSON.length(); i++) {
    JSONObject currentPostJSON=postsJSON.getJSONObject(i);
    String postId=String.valueOf(currentPostJSON.getInt("String_Node_Str"));
    String title=currentPostJSON.getString("String_Node_Str");
    int views=currentPostJSON.getInt("String_Node_Str");
    String url=currentPostJSON.getString("String_Node_Str");
    SingleItemModel currentPost=new SingleItemModel(mBlogId,mDate,postId,title,views,url,null);
    mPosts.add(currentPost);
  }
}
Program: 14469
Project: 14469
Buggy source:
public AuthorsModel(String blogID,JSONObject response) throws JSONException {
  this.mBlogID=blogID;
  this.mPeriod=response.getString("String_Node_Str");
  this.mDate=response.getString("String_Node_Str");
  JSONObject jDaysObject=response.getJSONObject("String_Node_Str");
  if (jDaysObject.length() == 0) {
    throw new JSONException("String_Node_Str");
  }
  JSONArray authorsJSONArray;
  Iterator<String> keys=jDaysObject.keys();
  String key=keys.next();
  JSONObject firstDayObject=jDaysObject.getJSONObject(key);
  this.mOtherViews=firstDayObject.optInt("String_Node_Str");
  authorsJSONArray=firstDayObject.optJSONArray("String_Node_Str");
  if (authorsJSONArray != null) {
    mAuthors=new ArrayList<AuthorModel>(authorsJSONArray.length());
    for (int i=0; i < authorsJSONArray.length(); i++) {
      try {
        JSONObject currentAuthorJSON=authorsJSONArray.getJSONObject(i);
        AuthorModel currentAuthor=new AuthorModel(blogID,mDate,currentAuthorJSON);
        mAuthors.add(currentAuthor);
      }
 catch (      JSONException e) {
        AppLog.e(AppLog.T.STATS,"String_Node_Str" + "String_Node_Str" + i + "String_Node_Str"+ response.toString(),e);
      }
    }
  }
}

Fixed version (ground truth):
public AuthorsModel(String blogID,JSONObject response) throws JSONException {
  this.mBlogID=blogID;
  this.mPeriod=response.getString("String_Node_Str");
  this.mDate=response.getString("String_Node_Str");
  JSONObject jDaysObject=response.getJSONObject("String_Node_Str");
  if (jDaysObject.length() == 0) {
    throw new JSONException("String_Node_Str");
  }
  JSONArray authorsJSONArray;
  Iterator<String> keys=jDaysObject.keys();
  String key=keys.next();
  JSONObject firstDayObject=jDaysObject.getJSONObject(key);
  this.mOtherViews=firstDayObject.optInt("String_Node_Str");
  authorsJSONArray=firstDayObject.optJSONArray("String_Node_Str");
  if (authorsJSONArray != null) {
    mAuthors=new ArrayList<>(authorsJSONArray.length());
    for (int i=0; i < authorsJSONArray.length(); i++) {
      try {
        JSONObject currentAuthorJSON=authorsJSONArray.getJSONObject(i);
        AuthorModel currentAuthor=new AuthorModel(blogID,mDate,currentAuthorJSON);
        mAuthors.add(currentAuthor);
      }
 catch (      JSONException e) {
        AppLog.e(AppLog.T.STATS,"String_Node_Str" + "String_Node_Str" + i + "String_Node_Str"+ response.toString(),e);
      }
    }
  }
}
Program: 14470
Project: 14470
Buggy source:
public ClickGroupModel(String blogId,String date,JSONObject clickGroupJSON) throws JSONException {
  setBlogId(blogId);
  setDate(StatsUtils.toMs(date));
  setGroupId(clickGroupJSON.getString("String_Node_Str"));
  setName(clickGroupJSON.getString("String_Node_Str"));
  setViews(clickGroupJSON.getInt("String_Node_Str"));
  setIcon(JSONUtil.getString(clickGroupJSON,"String_Node_Str"));
  if (!TextUtils.isEmpty(JSONUtil.getString(clickGroupJSON,"String_Node_Str"))) {
    setUrl(JSONUtil.getString(clickGroupJSON,"String_Node_Str"));
  }
 else {
    JSONArray childrenJSON=clickGroupJSON.getJSONArray("String_Node_Str");
    mClicks=new ArrayList<SingleItemModel>(childrenJSON.length());
    for (int i=0; i < childrenJSON.length(); i++) {
      JSONObject currentResultJSON=childrenJSON.getJSONObject(i);
      String name=currentResultJSON.getString("String_Node_Str");
      int totals=currentResultJSON.getInt("String_Node_Str");
      String icon=currentResultJSON.optString("String_Node_Str");
      String url=currentResultJSON.optString("String_Node_Str");
      SingleItemModel rm=new SingleItemModel(blogId,date,null,name,totals,url,icon);
      mClicks.add(rm);
    }
  }
}

Fixed version (ground truth):
public ClickGroupModel(String blogId,String date,JSONObject clickGroupJSON) throws JSONException {
  setBlogId(blogId);
  setDate(StatsUtils.toMs(date));
  setGroupId(clickGroupJSON.getString("String_Node_Str"));
  setName(clickGroupJSON.getString("String_Node_Str"));
  setViews(clickGroupJSON.getInt("String_Node_Str"));
  setIcon(JSONUtil.getString(clickGroupJSON,"String_Node_Str"));
  if (!TextUtils.isEmpty(JSONUtil.getString(clickGroupJSON,"String_Node_Str"))) {
    setUrl(JSONUtil.getString(clickGroupJSON,"String_Node_Str"));
  }
 else {
    JSONArray childrenJSON=clickGroupJSON.getJSONArray("String_Node_Str");
    mClicks=new ArrayList<>(childrenJSON.length());
    for (int i=0; i < childrenJSON.length(); i++) {
      JSONObject currentResultJSON=childrenJSON.getJSONObject(i);
      String name=currentResultJSON.getString("String_Node_Str");
      int totals=currentResultJSON.getInt("String_Node_Str");
      String icon=currentResultJSON.optString("String_Node_Str");
      String url=currentResultJSON.optString("String_Node_Str");
      SingleItemModel rm=new SingleItemModel(blogId,date,null,name,totals,url,icon);
      mClicks.add(rm);
    }
  }
}
Program: 14471
Project: 14471
Buggy source:
public ClicksModel(String blogID,JSONObject response) throws JSONException {
  this.mBlogID=blogID;
  this.mPeriod=response.getString("String_Node_Str");
  this.mDate=response.getString("String_Node_Str");
  JSONObject jDaysObject=response.getJSONObject("String_Node_Str");
  if (jDaysObject.length() == 0) {
    throw new JSONException("String_Node_Str");
  }
  JSONArray jClickGroupsArray;
  Iterator<String> keys=jDaysObject.keys();
  String key=keys.next();
  JSONObject firstDayObject=jDaysObject.getJSONObject(key);
  this.mOtherClicks=firstDayObject.getInt("String_Node_Str");
  this.mTotalClicks=firstDayObject.getInt("String_Node_Str");
  jClickGroupsArray=firstDayObject.optJSONArray("String_Node_Str");
  if (jClickGroupsArray != null) {
    mClickGroups=new ArrayList<ClickGroupModel>(jClickGroupsArray.length());
    for (int i=0; i < jClickGroupsArray.length(); i++) {
      try {
        JSONObject currentGroupJSON=jClickGroupsArray.getJSONObject(i);
        ClickGroupModel currentGroupModel=new ClickGroupModel(blogID,mDate,currentGroupJSON);
        mClickGroups.add(currentGroupModel);
      }
 catch (      JSONException e) {
        AppLog.e(AppLog.T.STATS,"String_Node_Str" + "String_Node_Str" + i + "String_Node_Str"+ response.toString(),e);
      }
    }
  }
}

Fixed version (ground truth):
public ClicksModel(String blogID,JSONObject response) throws JSONException {
  this.mBlogID=blogID;
  this.mPeriod=response.getString("String_Node_Str");
  this.mDate=response.getString("String_Node_Str");
  JSONObject jDaysObject=response.getJSONObject("String_Node_Str");
  if (jDaysObject.length() == 0) {
    throw new JSONException("String_Node_Str");
  }
  JSONArray jClickGroupsArray;
  Iterator<String> keys=jDaysObject.keys();
  String key=keys.next();
  JSONObject firstDayObject=jDaysObject.getJSONObject(key);
  this.mOtherClicks=firstDayObject.getInt("String_Node_Str");
  this.mTotalClicks=firstDayObject.getInt("String_Node_Str");
  jClickGroupsArray=firstDayObject.optJSONArray("String_Node_Str");
  if (jClickGroupsArray != null) {
    mClickGroups=new ArrayList<>(jClickGroupsArray.length());
    for (int i=0; i < jClickGroupsArray.length(); i++) {
      try {
        JSONObject currentGroupJSON=jClickGroupsArray.getJSONObject(i);
        ClickGroupModel currentGroupModel=new ClickGroupModel(blogID,mDate,currentGroupJSON);
        mClickGroups.add(currentGroupModel);
      }
 catch (      JSONException e) {
        AppLog.e(AppLog.T.STATS,"String_Node_Str" + "String_Node_Str" + i + "String_Node_Str"+ response.toString(),e);
      }
    }
  }
}
Program: 14472
Project: 14472
Buggy source:
public CommentFollowersModel(String blogID,JSONObject response) throws JSONException {
  this.mBlogID=blogID;
  this.mPage=response.getInt("String_Node_Str");
  this.mPages=response.getInt("String_Node_Str");
  this.mTotal=response.getInt("String_Node_Str");
  JSONArray postsJSONArray=response.optJSONArray("String_Node_Str");
  if (postsJSONArray != null) {
    mPosts=new ArrayList<SingleItemModel>(postsJSONArray.length());
    for (int i=0; i < postsJSONArray.length(); i++) {
      JSONObject currentPostJSON=postsJSONArray.getJSONObject(i);
      String postId=String.valueOf(currentPostJSON.getInt("String_Node_Str"));
      String title=currentPostJSON.getString("String_Node_Str");
      int followers=currentPostJSON.getInt("String_Node_Str");
      String url=currentPostJSON.getString("String_Node_Str");
      SingleItemModel currentPost=new SingleItemModel(blogID,null,postId,title,followers,url,null);
      mPosts.add(currentPost);
    }
  }
}

Fixed version (ground truth):
public CommentFollowersModel(String blogID,JSONObject response) throws JSONException {
  this.mBlogID=blogID;
  this.mPage=response.getInt("String_Node_Str");
  this.mPages=response.getInt("String_Node_Str");
  this.mTotal=response.getInt("String_Node_Str");
  JSONArray postsJSONArray=response.optJSONArray("String_Node_Str");
  if (postsJSONArray != null) {
    mPosts=new ArrayList<>(postsJSONArray.length());
    for (int i=0; i < postsJSONArray.length(); i++) {
      JSONObject currentPostJSON=postsJSONArray.getJSONObject(i);
      String postId=String.valueOf(currentPostJSON.getInt("String_Node_Str"));
      String title=currentPostJSON.getString("String_Node_Str");
      int followers=currentPostJSON.getInt("String_Node_Str");
      String url=currentPostJSON.getString("String_Node_Str");
      SingleItemModel currentPost=new SingleItemModel(blogID,null,postId,title,followers,url,null);
      mPosts.add(currentPost);
    }
  }
}
Program: 14474
Project: 14474
Buggy source:
public FollowersModel(String blogID,JSONObject response) throws JSONException {
  this.mBlogID=blogID;
  this.mPage=response.getInt("String_Node_Str");
  this.mPages=response.getInt("String_Node_Str");
  this.mTotal=response.getInt("String_Node_Str");
  this.mTotalEmail=response.getInt("String_Node_Str");
  this.mTotalWPCom=response.getInt("String_Node_Str");
  JSONArray subscribersJSONArray=response.optJSONArray("String_Node_Str");
  if (subscribersJSONArray != null) {
    mSubscribers=new ArrayList<FollowerModel>(subscribersJSONArray.length());
    for (int i=0; i < subscribersJSONArray.length(); i++) {
      JSONObject currentAuthorJSON=subscribersJSONArray.getJSONObject(i);
      try {
        FollowerModel currentFollower=new FollowerModel(mBlogID,currentAuthorJSON);
        mSubscribers.add(currentFollower);
      }
 catch (      JSONException e) {
        AppLog.e(AppLog.T.STATS,"String_Node_Str" + "String_Node_Str" + i + "String_Node_Str"+ response.toString(),e);
      }
    }
  }
}

Fixed version (ground truth):
public FollowersModel(String blogID,JSONObject response) throws JSONException {
  this.mBlogID=blogID;
  this.mPage=response.getInt("String_Node_Str");
  this.mPages=response.getInt("String_Node_Str");
  this.mTotal=response.getInt("String_Node_Str");
  this.mTotalEmail=response.getInt("String_Node_Str");
  this.mTotalWPCom=response.getInt("String_Node_Str");
  JSONArray subscribersJSONArray=response.optJSONArray("String_Node_Str");
  if (subscribersJSONArray != null) {
    mSubscribers=new ArrayList<>(subscribersJSONArray.length());
    for (int i=0; i < subscribersJSONArray.length(); i++) {
      JSONObject currentAuthorJSON=subscribersJSONArray.getJSONObject(i);
      try {
        FollowerModel currentFollower=new FollowerModel(mBlogID,currentAuthorJSON);
        mSubscribers.add(currentFollower);
      }
 catch (      JSONException e) {
        AppLog.e(AppLog.T.STATS,"String_Node_Str" + "String_Node_Str" + i + "String_Node_Str"+ response.toString(),e);
      }
    }
  }
}
Program: 14477
Project: 14477
Buggy source:
public PublicizeModel(String blogID,JSONObject response) throws JSONException {
  this.mBlogID=blogID;
  this.mDate=null;
  JSONArray services=response.getJSONArray("String_Node_Str");
  if (services.length() > 0) {
    mServices=new ArrayList<SingleItemModel>(services.length());
    for (int i=0; i < services.length(); i++) {
      JSONObject current=services.getJSONObject(i);
      String serviceName=current.getString("String_Node_Str");
      int followers=current.getInt("String_Node_Str");
      SingleItemModel currentItem=new SingleItemModel(blogID,mDate,null,serviceName,followers,null,null);
      mServices.add(currentItem);
    }
  }
}

Fixed version (ground truth):
public PublicizeModel(String blogID,JSONObject response) throws JSONException {
  this.mBlogID=blogID;
  this.mDate=null;
  JSONArray services=response.getJSONArray("String_Node_Str");
  if (services.length() > 0) {
    mServices=new ArrayList<>(services.length());
    for (int i=0; i < services.length(); i++) {
      JSONObject current=services.getJSONObject(i);
      String serviceName=current.getString("String_Node_Str");
      int followers=current.getInt("String_Node_Str");
      SingleItemModel currentItem=new SingleItemModel(blogID,mDate,null,serviceName,followers,null,null);
      mServices.add(currentItem);
    }
  }
}