Program: 33835
Project: 33835
Buggy source:
@Override protected void onPostExecute(APIResponse.CODE code){
  super.onPostExecute(code);
  if (activity != null && code != APIResponse.CODE.NODATA) {
    if (activity.getActionBar() != null && eventShort != null && !eventShort.isEmpty()) {
      activity.getActionBar().setTitle(teamKey.substring(3) + "String_Node_Str" + eventShort);
    }
    MatchListAdapter adapter=new MatchListAdapter(activity,matchGroups,teamKey);
    ExpandableListView listView=(ExpandableListView)activity.findViewById(R.id.results);
    listView.setAdapter(adapter);
    MatchHelper.EventPerformance performance=MatchHelper.evaluatePerformanceForTeam(event,eventMatches,teamKey);
    String summary=generateTeamSummary(teamKey,rank,recordString,allianceNumber,alliancePick,performance);
    ((TextView)activity.findViewById(R.id.team_record)).setText(Html.fromHtml(summary));
    if (!stats.children.isEmpty()) {
      adapter.addGroup(0,stats);
    }
    if (!awards.children.isEmpty()) {
      adapter.addGroup(0,awards);
    }
    if (activeEvent && nextMatch != null) {
      ListGroup nextMatches=new ListGroup(activity.getString(R.string.title_next_match));
      nextMatches.children.add(nextMatch);
      adapter.addGroup(0,nextMatches);
    }
    if (activeEvent && lastMatch != null) {
      ListGroup lastMatches=new ListGroup(activity.getString(R.string.title_last_match));
      lastMatches.children.add(lastMatch);
      adapter.addGroup(0,lastMatches);
    }
    activity.findViewById(R.id.team_at_event_progress).setVisibility(View.GONE);
    activity.findViewById(R.id.content_view).setVisibility(View.VISIBLE);
    if (code == APIResponse.CODE.OFFLINECACHE) {
      activity.showWarningMessage(activity.getString(R.string.warning_using_cached_data));
    }
  }
  if (code == APIResponse.CODE.LOCAL && !isCancelled()) {
    new PopulateTeamAtEvent(activity,false).execute(teamKey,eventKey);
  }
 else {
    if (activity instanceof RefreshableHostActivity) {
      ((RefreshableHostActivity)activity).notifyRefreshComplete((RefreshListener)activity);
    }
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(APIResponse.CODE code){
  super.onPostExecute(code);
  if (activity != null && code != APIResponse.CODE.NODATA) {
    if (activity.getActionBar() != null && eventShort != null && !eventShort.isEmpty()) {
      activity.getActionBar().setTitle(teamKey.substring(3) + "String_Node_Str" + eventShort);
    }
    MatchListAdapter adapter=new MatchListAdapter(activity,matchGroups,teamKey);
    MatchHelper.EventPerformance performance=MatchHelper.evaluatePerformanceForTeam(event,eventMatches,teamKey);
    String summary=generateTeamSummary(teamKey,rank,recordString,allianceNumber,alliancePick,performance);
    ((TextView)activity.findViewById(R.id.team_record)).setText(Html.fromHtml(summary));
    if (!stats.children.isEmpty()) {
      adapter.addGroup(0,stats);
    }
    if (!awards.children.isEmpty()) {
      adapter.addGroup(0,awards);
    }
    if (activeEvent && nextMatch != null) {
      ListGroup nextMatches=new ListGroup(activity.getString(R.string.title_next_match));
      nextMatches.children.add(nextMatch);
      adapter.addGroup(0,nextMatches);
    }
    if (activeEvent && lastMatch != null) {
      ListGroup lastMatches=new ListGroup(activity.getString(R.string.title_last_match));
      lastMatches.children.add(lastMatch);
      adapter.addGroup(0,lastMatches);
    }
    ExpandableListView listView=(ExpandableListView)activity.findViewById(R.id.results);
    Parcelable state=listView.onSaveInstanceState();
    int firstVisiblePosition=listView.getFirstVisiblePosition();
    listView.setAdapter(adapter);
    listView.onRestoreInstanceState(state);
    listView.setSelection(firstVisiblePosition);
    activity.findViewById(R.id.team_at_event_progress).setVisibility(View.GONE);
    activity.findViewById(R.id.content_view).setVisibility(View.VISIBLE);
    if (code == APIResponse.CODE.OFFLINECACHE) {
      activity.showWarningMessage(activity.getString(R.string.warning_using_cached_data));
    }
  }
  if (code == APIResponse.CODE.LOCAL && !isCancelled()) {
    new PopulateTeamAtEvent(activity,false).execute(teamKey,eventKey);
  }
 else {
    if (activity instanceof RefreshableHostActivity) {
      activity.notifyRefreshComplete((RefreshListener)activity);
    }
  }
}