Program: 14513
Project: 14513
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.stats_activity_view_all);
  if (savedInstanceState == null) {
  }
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  outerContainer=(LinearLayout)findViewById(R.id.stats_fragment_container);
  mPullToRefreshHelper=new PullToRefreshHelper(this,(PullToRefreshLayout)findViewById(R.id.ptr_layout),new PullToRefreshHelper.RefreshListener(){
    @Override public void onRefreshStarted(    View view){
      if (!NetworkUtils.checkConnection(getBaseContext())) {
        mPullToRefreshHelper.setRefreshing(false);
        return;
      }
      refreshStats();
    }
  }
);
  setTitle(getString(R.string.stats));
  if (savedInstanceState != null) {
    mLocalBlogID=savedInstanceState.getInt(StatsActivity.ARG_LOCAL_TABLE_BLOG_ID,-1);
    mRestResponse=(Serializable[])savedInstanceState.getSerializable(StatsAbstractFragment.ARG_REST_RESPONSE);
    mTimeframe=(StatsTimeframe)savedInstanceState.getSerializable(StatsAbstractFragment.ARGS_TIMEFRAME);
    mDate=savedInstanceState.getString(StatsAbstractFragment.ARGS_START_DATE);
    int ordinal=savedInstanceState.getInt(StatsAbstractFragment.ARGS_VIEW_TYPE,-1);
    mStatsViewType=StatsViewType.values()[ordinal];
    mOuterPagerSelectedButtonIndex=savedInstanceState.getInt(StatsAbstractListFragment.ARGS_OUTER_PAGER_SELECTED_BUTTON_INDEX,-1);
  }
 else   if (getIntent() != null) {
    Bundle extras=getIntent().getExtras();
    mLocalBlogID=extras.getInt(StatsActivity.ARG_LOCAL_TABLE_BLOG_ID,-1);
    mTimeframe=(StatsTimeframe)extras.getSerializable(StatsAbstractFragment.ARGS_TIMEFRAME);
    mDate=extras.getString(StatsAbstractFragment.ARGS_START_DATE);
    int ordinal=extras.getInt(StatsAbstractFragment.ARGS_VIEW_TYPE,-1);
    mStatsViewType=StatsViewType.values()[ordinal];
    mOuterPagerSelectedButtonIndex=extras.getInt(StatsAbstractListFragment.ARGS_OUTER_PAGER_SELECTED_BUTTON_INDEX,-1);
    refreshStats();
  }
  TextView dateTextView=(TextView)findViewById(R.id.stats_summary_date);
  dateTextView.setText(StatsUIHelper.getDateForDisplayInLabels(mDate,mTimeframe));
  FragmentManager fm=getFragmentManager();
  FragmentTransaction ft=fm.beginTransaction();
  if (fm.findFragmentByTag("String_Node_Str" + getInnerFragmentTAG()) == null) {
    fragment=getInnerFragment();
    ft.replace(R.id.stats_single_view_fragment,fragment,"String_Node_Str" + getInnerFragmentTAG());
    ft.commit();
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.stats_activity_view_all);
  if (savedInstanceState == null) {
  }
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  outerContainer=(LinearLayout)findViewById(R.id.stats_fragment_container);
  mPullToRefreshHelper=new PullToRefreshHelper(this,(PullToRefreshLayout)findViewById(R.id.ptr_layout),new PullToRefreshHelper.RefreshListener(){
    @Override public void onRefreshStarted(    View view){
      if (!NetworkUtils.checkConnection(getBaseContext())) {
        mPullToRefreshHelper.setRefreshing(false);
        return;
      }
      refreshStats();
    }
  }
);
  setTitle(getString(R.string.stats));
  if (savedInstanceState != null) {
    mLocalBlogID=savedInstanceState.getInt(StatsActivity.ARG_LOCAL_TABLE_BLOG_ID,-1);
    mRestResponse=(Serializable[])savedInstanceState.getSerializable(StatsAbstractFragment.ARG_REST_RESPONSE);
    mTimeframe=(StatsTimeframe)savedInstanceState.getSerializable(StatsAbstractFragment.ARGS_TIMEFRAME);
    mDate=savedInstanceState.getString(StatsAbstractFragment.ARGS_START_DATE);
    int ordinal=savedInstanceState.getInt(StatsAbstractFragment.ARGS_VIEW_TYPE,-1);
    mStatsViewType=StatsViewType.values()[ordinal];
    mOuterPagerSelectedButtonIndex=savedInstanceState.getInt(StatsAbstractListFragment.ARGS_OUTER_PAGER_SELECTED_BUTTON_INDEX,-1);
  }
 else   if (getIntent() != null) {
    Bundle extras=getIntent().getExtras();
    mLocalBlogID=extras.getInt(StatsActivity.ARG_LOCAL_TABLE_BLOG_ID,-1);
    mTimeframe=(StatsTimeframe)extras.getSerializable(StatsAbstractFragment.ARGS_TIMEFRAME);
    mDate=extras.getString(StatsAbstractFragment.ARGS_START_DATE);
    int ordinal=extras.getInt(StatsAbstractFragment.ARGS_VIEW_TYPE,-1);
    mStatsViewType=StatsViewType.values()[ordinal];
    mOuterPagerSelectedButtonIndex=extras.getInt(StatsAbstractListFragment.ARGS_OUTER_PAGER_SELECTED_BUTTON_INDEX,-1);
    refreshStats();
  }
  TextView dateTextView=(TextView)findViewById(R.id.stats_summary_date);
  dateTextView.setText(getDateForDisplayInLabels(mDate,mTimeframe));
  FragmentManager fm=getFragmentManager();
  FragmentTransaction ft=fm.beginTransaction();
  if (fm.findFragmentByTag("String_Node_Str" + getInnerFragmentTAG()) == null) {
    fragment=getInnerFragment();
    ft.replace(R.id.stats_single_view_fragment,fragment,"String_Node_Str" + getInnerFragmentTAG());
    ft.commit();
  }
}