Program: 26236
Project: 26236
Buggy source:
/** 
 * Called when the activity is first created.
 * @param savedInstanceState If the activity is being re-initialized afterpreviously being shut down then this Bundle contains the data it most recently supplied in onSaveInstanceState(Bundle). <b>Note: Otherwise it is null.</b>
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  locationComparator=new ChapterComparator(PrefUtils.getHomeChapterIdNotNull(this),App.getInstance().getLastLocation());
  setupChapterSwitcher();
  if (savedInstanceState != null) {
    chapters=savedInstanceState.getParcelableArrayList(ARG_CHAPTERS);
    selectedChapterId=savedInstanceState.getString(ARG_SELECTED_CHAPTER);
  }
 else {
    Intent intent=getIntent();
    if (FirstStartActivity.ACTION_FIRST_START.equals(intent.getAction())) {
      Timber.d("String_Node_Str");
      if (PrefUtils.isSignedIn(this)) {
        mFirstStart=true;
      }
    }
    selectedChapterId=getChapterIdFromIntent(intent);
  }
  if (selectedChapterId == null) {
    selectedChapterId=PrefUtils.getHomeChapterIdNotNull(this);
  }
  if (chapters != null) {
    initUI();
  }
 else {
    App.getInstance().getModelCache().getAsync(ModelCache.KEY_CHAPTER_LIST_HUB,new ModelCache.CacheListener(){
      @Override public void onGet(      Object item){
        onDirectoryLoaded((Directory)item);
      }
      @Override public void onNotFound(      String key){
        if (Utils.isOnline(MainActivity.this)) {
          fetchChapters();
        }
 else {
          showError(R.string.offline_alert);
        }
      }
    }
);
  }
  if (PrefUtils.shouldShowSeasonsGreetings(this)) {
    SeasonsGreetingsFragment seasonsGreetings=new SeasonsGreetingsFragment();
    seasonsGreetings.show(getSupportFragmentManager(),"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Called when the activity is first created.
 * @param savedInstanceState If the activity is being re-initialized afterpreviously being shut down then this Bundle contains the data it most recently supplied in onSaveInstanceState(Bundle). <b>Note: Otherwise it is null.</b>
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  locationComparator=new ChapterComparator(PrefUtils.getHomeChapterIdNotNull(this),App.getInstance().getLastLocation());
  setupChapterSwitcher();
  if (savedInstanceState != null) {
    chapters=savedInstanceState.getParcelableArrayList(ARG_CHAPTERS);
    selectedChapterId=savedInstanceState.getString(ARG_SELECTED_CHAPTER);
  }
 else {
    Intent intent=getIntent();
    if (FirstStartActivity.ACTION_FIRST_START.equals(intent.getAction())) {
      Timber.d("String_Node_Str");
      if (PrefUtils.isSignedIn(this)) {
        mFirstStart=true;
      }
    }
    selectedChapterId=getChapterIdFromIntent(intent);
  }
  if (selectedChapterId == null) {
    selectedChapterId=PrefUtils.getHomeChapterIdNotNull(this);
  }
  if (!chapters.isEmpty()) {
    initUI();
  }
 else {
    App.getInstance().getModelCache().getAsync(ModelCache.KEY_CHAPTER_LIST_HUB,new ModelCache.CacheListener(){
      @Override public void onGet(      Object item){
        onDirectoryLoaded((Directory)item);
      }
      @Override public void onNotFound(      String key){
        if (Utils.isOnline(MainActivity.this)) {
          fetchChapters();
        }
 else {
          showError(R.string.offline_alert);
        }
      }
    }
);
  }
  if (PrefUtils.shouldShowSeasonsGreetings(this)) {
    SeasonsGreetingsFragment seasonsGreetings=new SeasonsGreetingsFragment();
    seasonsGreetings.show(getSupportFragmentManager(),"String_Node_Str");
  }
}