nus-yam/ex-repair huggingface dataset:
Program: 33772
Project: 33772
Buggy source:
private void switchToModeForId(int id){
  Fragment fragment;
switch (id) {
default :
case R.id.nav_item_events:
    fragment=EventsByWeekFragment.newInstance(mCurrentSelectedYear);
  break;
case R.id.nav_item_teams:
fragment=new AllTeamsListFragment();
break;
case R.id.nav_item_insights:
fragment=new InsightsFragment();
break;
case R.id.nav_item_settings:
startActivity(new Intent(this,SettingsActivity.class));
return;
}
fragment.setRetainInstance(true);
getSupportFragmentManager().beginTransaction().setCustomAnimations(R.anim.fade_in_support,R.anim.fade_out_support).replace(R.id.container,fragment,MAIN_FRAGMENT_TAG).commit();
mCurrentSelectedNavigationItemId=id;
}

Fixed version (ground truth):
private void switchToModeForId(int id){
  Fragment fragment;
switch (id) {
default :
case R.id.nav_item_events:
    fragment=EventsByWeekFragment.newInstance(Constants.MAX_COMP_YEAR - mCurrentSelectedYearPosition);
  break;
case R.id.nav_item_teams:
fragment=new AllTeamsListFragment();
break;
case R.id.nav_item_insights:
fragment=new InsightsFragment();
break;
case R.id.nav_item_settings:
startActivity(new Intent(this,SettingsActivity.class));
return;
}
fragment.setRetainInstance(true);
getSupportFragmentManager().beginTransaction().setCustomAnimations(R.anim.fade_in_support,R.anim.fade_out_support).replace(R.id.container,fragment,MAIN_FRAGMENT_TAG).commit();
mCurrentSelectedNavigationItemId=id;
}
Program: 33773
Project: 33773
Buggy source:
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putInt(STATE_SELECTED_YEAR_SPINNER_POSITION,getActionBar().getSelectedNavigationIndex());
  outState.putInt(STATE_SELECTED_NAV_ID,mCurrentSelectedNavigationItemId);
}

Fixed version (ground truth):
@Override public void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putInt(STATE_SELECTED_YEAR_SPINNER_POSITION,mCurrentSelectedYearPosition);
  outState.putInt(STATE_SELECTED_NAV_ID,mCurrentSelectedNavigationItemId);
}
Program: 33774
Project: 33774
Buggy source:
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putInt(SELECTED_YEAR,getActionBar().getSelectedNavigationIndex());
  outState.putInt(SELECTED_TAB,mSelectedTab);
}

Fixed version (ground truth):
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putInt(SELECTED_YEAR,mYear);
  outState.putInt(SELECTED_TAB,mSelectedTab);
}
Program: 33775
Project: 33775
Buggy source:
@Override public void onRefreshStart(){
  Log.i(Constants.REFRESH_LOG,"String_Node_Str" + mEventKey + "String_Node_Str");
  mTask=new PopulateEventStats(this,true);
  mTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,mEventKey);
}

Fixed version (ground truth):
@Override public void onRefreshStart(){
  Log.i(Constants.REFRESH_LOG,"String_Node_Str" + mEventKey + "String_Node_Str");
  mTask=new PopulateEventStats(this,true,statSortCategory);
  mTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,mEventKey);
}
Program: 33776
Project: 33776
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  int id=item.getItemId();
switch (id) {
case R.id.action_sort_opr:
    mTask=new PopulateEventStats(this,true,"String_Node_Str");
  mTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,mEventKey);
return true;
case R.id.action_sort_dpr:
mTask=new PopulateEventStats(this,true,"String_Node_Str");
mTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,mEventKey);
return true;
case R.id.action_sort_ccwm:
mTask=new PopulateEventStats(this,true,"String_Node_Str");
mTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,mEventKey);
return true;
default :
return super.onOptionsItemSelected(item);
}
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  int id=item.getItemId();
  if (id == R.id.action_sort_opr)   statSortCategory="String_Node_Str";
 else   if (id == R.id.action_sort_dpr)   statSortCategory="String_Node_Str";
 else   if (id == R.id.action_sort_ccwm)   statSortCategory="String_Node_Str";
 else   return super.onOptionsItemSelected(item);
  mTask=new PopulateEventStats(this,true,statSortCategory);
  mTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,mEventKey);
  return true;
}
Program: 33777
Project: 33777
Buggy source:
@Override public View getView(final Context c,LayoutInflater inflater,View convertView){
  ViewHolder holder;
  if (convertView == null || !(convertView.getTag() instanceof ViewHolder)) {
    convertView=inflater.inflate(R.layout.list_item_image,null);
    holder=new ViewHolder();
    holder.image_container=(FrameLayout)convertView.findViewById(R.id.image_container);
    holder.image=(ImageView)convertView.findViewById(R.id.image);
    holder.youtube_play_icon=(ImageView)convertView.findViewById(R.id.youtube_play_icon);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  Picasso picasso=Picasso.with(c);
  picasso.load(imageUrl).into(holder.image);
  if (isVideo) {
    holder.youtube_play_icon.setVisibility(View.VISIBLE);
  }
  holder.image_container.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      c.startActivity(new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(linkUrl)));
    }
  }
);
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(final Context c,LayoutInflater inflater,View convertView){
  ViewHolder holder;
  if (convertView == null || !(convertView.getTag() instanceof ViewHolder)) {
    convertView=inflater.inflate(R.layout.list_item_image,null);
    holder=new ViewHolder();
    holder.image_container=(FrameLayout)convertView.findViewById(R.id.image_container);
    holder.image=(ImageView)convertView.findViewById(R.id.image);
    holder.youtube_play_icon=(ImageView)convertView.findViewById(R.id.youtube_play_icon);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  Picasso picasso=Picasso.with(c);
  picasso.load(imageUrl).into(holder.image);
  if (isVideo) {
    holder.youtube_play_icon.setVisibility(View.VISIBLE);
  }
 else {
    holder.youtube_play_icon.setVisibility(View.GONE);
  }
  holder.image_container.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      c.startActivity(new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(linkUrl)));
    }
  }
);
  return convertView;
}
Program: 33778
Project: 33778
Buggy source:
@Override public View getView(final Context context,LayoutInflater inflater,View convertView){
  ViewHolder holder;
  if (convertView == null || !(convertView.getTag() instanceof ViewHolder)) {
    convertView=inflater.inflate(R.layout.list_item_team,null);
    holder=new ViewHolder();
    holder.teamNumber=(TextView)convertView.findViewById(R.id.team_number);
    holder.teamName=(TextView)convertView.findViewById(R.id.team_name);
    holder.teamLocation=(TextView)convertView.findViewById(R.id.team_location);
    holder.teamInfoDivider=convertView.findViewById(R.id.team_info_divider);
    holder.teamInfo=(ImageView)convertView.findViewById(R.id.team_info);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  holder.teamNumber.setText("String_Node_Str" + mTeamNumber);
  if (mTeamName.isEmpty()) {
    holder.teamName.setText("String_Node_Str" + mTeamNumber);
  }
 else {
    holder.teamName.setText(mTeamName);
  }
  holder.teamLocation.setText(mTeamLocation);
  if (mShowLinkToTeamDetails) {
    holder.teamInfo.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        Intent intent=ViewTeamActivity.newInstance(context,"String_Node_Str" + mTeamNumber);
        context.startActivity(intent);
      }
    }
);
  }
 else {
    holder.teamInfoDivider.setVisibility(View.GONE);
    holder.teamInfo.setVisibility(View.GONE);
  }
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(final Context context,LayoutInflater inflater,View convertView){
  ViewHolder holder;
  if (convertView == null || !(convertView.getTag() instanceof ViewHolder)) {
    convertView=inflater.inflate(R.layout.list_item_team,null);
    holder=new ViewHolder();
    holder.teamNumber=(TextView)convertView.findViewById(R.id.team_number);
    holder.teamName=(TextView)convertView.findViewById(R.id.team_name);
    holder.teamLocation=(TextView)convertView.findViewById(R.id.team_location);
    holder.teamInfoDivider=convertView.findViewById(R.id.team_info_divider);
    holder.teamInfo=(ImageView)convertView.findViewById(R.id.team_info);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolder)convertView.getTag();
  }
  holder.teamNumber.setText("String_Node_Str" + mTeamNumber);
  if (mTeamName.isEmpty()) {
    holder.teamName.setText("String_Node_Str" + mTeamNumber);
  }
 else {
    holder.teamName.setText(mTeamName);
  }
  holder.teamLocation.setText(mTeamLocation);
  if (mShowLinkToTeamDetails) {
    holder.teamInfoDivider.setVisibility(View.VISIBLE);
    holder.teamInfo.setVisibility(View.VISIBLE);
    holder.teamInfo.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        Intent intent=ViewTeamActivity.newInstance(context,"String_Node_Str" + mTeamNumber);
        context.startActivity(intent);
      }
    }
);
  }
 else {
    holder.teamInfoDivider.setVisibility(View.GONE);
    holder.teamInfo.setVisibility(View.GONE);
  }
  return convertView;
}
Program: 33779
Project: 33779
Buggy source:
@Override public boolean onNavigationItemSelected(int position,long id){
  if (position == mCurrentSelectedYearPosition) {
    return true;
  }
  Log.d(Constants.LOG_TAG,"String_Node_Str" + Integer.parseInt(dropdownItems[position]));
  getSupportFragmentManager().beginTransaction().setCustomAnimations(R.anim.fade_in_support,R.anim.fade_out_support).replace(R.id.content,EventsByWeekFragment.newInstance(Integer.parseInt(dropdownItems[position])),MAIN_FRAGMENT_TAG).commit();
  mCurrentSelectedYearPosition=position;
  getActionBar().setSelectedNavigationItem(mCurrentSelectedYearPosition);
  return true;
}

Fixed version (ground truth):
@Override public boolean onNavigationItemSelected(int position,long id){
  if (position == mCurrentSelectedYearPosition) {
    return true;
  }
  Log.d(Constants.LOG_TAG,"String_Node_Str" + Integer.parseInt(dropdownItems[position]));
  getSupportFragmentManager().beginTransaction().setCustomAnimations(R.anim.fade_in_support,R.anim.fade_out_support).replace(R.id.container,EventsByWeekFragment.newInstance(Integer.parseInt(dropdownItems[position])),MAIN_FRAGMENT_TAG).commit();
  mCurrentSelectedYearPosition=position;
  getActionBar().setSelectedNavigationItem(mCurrentSelectedYearPosition);
  return true;
}
Program: 33780
Project: 33780
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.action_view_event:
    startActivity(ViewEventActivity.newInstance(this,eventKey));
  break;
case R.id.action_view_team:
int year=Integer.parseInt(eventKey.substring(0,4));
startActivity(ViewTeamActivity.newInstance(this,teamKey,year));
case android.R.id.home:
if (isDrawerOpen()) {
closeDrawer();
return true;
}
Intent upIntent=NavUtils.getParentActivityIntent(this);
if (NavUtils.shouldUpRecreateTask(this,upIntent)) {
TaskStackBuilder.create(this).addNextIntent(HomeActivity.newInstance(this,R.id.nav_item_teams)).addNextIntent(ViewEventActivity.newInstance(this,eventKey)).startActivities();
}
 else {
Log.d(Constants.LOG_TAG,"String_Node_Str");
NavUtils.navigateUpTo(this,upIntent);
}
return true;
default :
return super.onOptionsItemSelected(item);
}
return super.onOptionsItemSelected(item);
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.action_view_event:
    startActivity(ViewEventActivity.newInstance(this,eventKey));
  return true;
case R.id.action_view_team:
int year=Integer.parseInt(eventKey.substring(0,4));
startActivity(ViewTeamActivity.newInstance(this,teamKey,year));
return true;
case android.R.id.home:
if (isDrawerOpen()) {
closeDrawer();
return true;
}
Intent upIntent=NavUtils.getParentActivityIntent(this);
if (NavUtils.shouldUpRecreateTask(this,upIntent)) {
TaskStackBuilder.create(this).addNextIntent(HomeActivity.newInstance(this,R.id.nav_item_teams)).addNextIntent(ViewEventActivity.newInstance(this,eventKey)).startActivities();
}
 else {
Log.d(Constants.LOG_TAG,"String_Node_Str");
NavUtils.navigateUpTo(this,upIntent);
}
return true;
default :
return super.onOptionsItemSelected(item);
}
}
Program: 33781
Project: 33781
Buggy source:
@Override public boolean onNavigationItemSelected(int position,long id){
  if (position == mCurrentSelectedYearPosition) {
    return true;
  }
  Log.d(Constants.LOG_TAG,"String_Node_Str" + Integer.parseInt(dropdownItems[position]));
  getSupportFragmentManager().beginTransaction().setCustomAnimations(R.anim.fade_in_support,R.anim.fade_out_support).replace(R.id.container,EventsByWeekFragment.newInstance(Integer.parseInt(dropdownItems[position])),MAIN_FRAGMENT_TAG).commit();
  mCurrentSelectedYearPosition=position;
  getActionBar().setSelectedNavigationItem(mCurrentSelectedYearPosition);
  return true;
}

Fixed version (ground truth):
@Override public boolean onNavigationItemSelected(int position,long id){
  if (position == mCurrentSelectedYearPosition) {
    return true;
  }
  Log.d(Constants.LOG_TAG,"String_Node_Str" + Integer.parseInt(dropdownItems[position]));
  getSupportFragmentManager().beginTransaction().setCustomAnimations(R.anim.fade_in_support,R.anim.fade_out_support).replace(R.id.content,EventsByWeekFragment.newInstance(Integer.parseInt(dropdownItems[position])),MAIN_FRAGMENT_TAG).commit();
  mCurrentSelectedYearPosition=position;
  getActionBar().setSelectedNavigationItem(mCurrentSelectedYearPosition);
  return true;
}
Program: 33782
Project: 33782
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  super.setContentView(R.layout.activity_navigation_drawer);
  mDrawerLayout=(DrawerLayout)findViewById(R.id.nav_drawer_layout);
  onCreateNavigationDrawer();
  mNavDrawerFragment=(NavigationDrawerFragment)getSupportFragmentManager().findFragmentById(R.id.navigation_drawer_fragment);
  mNavDrawerFragment.setUp(R.id.navigation_drawer_fragment,(DrawerLayout)findViewById(R.id.nav_drawer_layout),mEncourageLearning,mUseActionBarToggle);
  mContentView=(FrameLayout)findViewById(R.id.container);
  if (savedInstanceState != null) {
    if (savedInstanceState.containsKey(IS_DRAWER_OPEN)) {
      if (savedInstanceState.getBoolean(IS_DRAWER_OPEN)) {
        mDrawerLayout.openDrawer(Gravity.LEFT);
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  super.setContentView(R.layout.activity_navigation_drawer);
  mDrawerLayout=(DrawerLayout)findViewById(R.id.nav_drawer_layout);
  onCreateNavigationDrawer();
  mNavDrawerFragment=(NavigationDrawerFragment)getSupportFragmentManager().findFragmentById(R.id.navigation_drawer_fragment);
  mNavDrawerFragment.setUp(R.id.navigation_drawer_fragment,(DrawerLayout)findViewById(R.id.nav_drawer_layout),mEncourageLearning,mUseActionBarToggle);
  mContentView=(FrameLayout)findViewById(R.id.content);
  if (savedInstanceState != null) {
    if (savedInstanceState.containsKey(IS_DRAWER_OPEN)) {
      if (savedInstanceState.getBoolean(IS_DRAWER_OPEN)) {
        mDrawerLayout.openDrawer(Gravity.LEFT);
      }
    }
  }
}
Program: 33784
Project: 33784
Buggy source:
private void beginLoading(){
  new LoadAllData(this).execute();
}

Fixed version (ground truth):
private void beginLoading(){
  Fragment f=new LoadAllDataTaskFragment();
  f.setRetainInstance(true);
  getFragmentManager().beginTransaction().add(f,LOAD_FRAGMENT_TAG).commit();
}
Program: 33785
Project: 33785
Buggy source:
/** 
 * Inflates the specified view into the "content container" of the activity. This allows the resuse of a single layout containing a navigation drawer and said container across all instances of this activity. Subclassing activities that call setContentView(...) will have their requested layout inserted into the content container.
 * @param layoutResID id of the view to be inflated into the content container
 */
@Override public void setContentView(int layoutResID){
  getLayoutInflater().inflate(layoutResID,mContentView);
}

Fixed version (ground truth):
/** 
 * Inflates the specified view into the "content container" of the activity. This allows the resuse of a single layout containing a navigation drawer and said container across all instances of this activity. Subclassing activities that call setContentView(...) will have their requested layout inserted into the content container.
 * @param layoutResID id of the view to be inflated into the content container
 */
@Override public void setContentView(int layoutResID){
  mContentView.removeAllViews();
  getLayoutInflater().inflate(layoutResID,mContentView);
}
Program: 33786
Project: 33786
Buggy source:
@Override protected void onProgressUpdate(LoadProgressInfo... values){
  activity.onLoadingProgressUpdate(values[0]);
}

Fixed version (ground truth):
public void onProgressUpdate(LoadProgressInfo info);
Program: 33787
Project: 33787
Buggy source:
public LoadAllData(LaunchActivity activity){
  this.activity=activity;
}

Fixed version (ground truth):
public LoadAllData(LoadAllDataCallbacks callbacks,Context c){
  this.callbacks=callbacks;
  this.context=c.getApplicationContext();
}
Program: 33789
Project: 33789
Buggy source:
public void storeTeams(ArrayList<Team> teams){
  Semaphore dbSemaphore=null;
  try {
    dbSemaphore=getSemaphore();
    dbSemaphore.tryAcquire(10,TimeUnit.SECONDS);
    db.beginTransaction();
    for (    Team team : teams) {
      db.insert(TABLE_TEAMS,null,team.getParams());
      insertSearchItemTeam(team,false);
    }
    db.setTransactionSuccessful();
    db.endTransaction();
  }
 catch (  InterruptedException e) {
    Log.w("String_Node_Str","String_Node_Str");
  }
 finally {
    if (dbSemaphore != null) {
      dbSemaphore.release();
    }
  }
}

Fixed version (ground truth):
public void storeTeams(ArrayList<Team> teams){
  Semaphore dbSemaphore=null;
  try {
    dbSemaphore=getSemaphore();
    dbSemaphore.tryAcquire(10,TimeUnit.SECONDS);
    db.beginTransaction();
    for (    Team team : teams) {
      try {
        if (!unsafeExists(team.getTeamKey())) {
          db.insert(TABLE_TEAMS,null,team.getParams());
          insertSearchItemTeam(team,false);
        }
      }
 catch (      BasicModel.FieldNotDefinedException e) {
        Log.w(Constants.LOG_TAG,"String_Node_Str");
      }
    }
    db.setTransactionSuccessful();
    db.endTransaction();
  }
 catch (  InterruptedException e) {
    Log.w("String_Node_Str","String_Node_Str");
  }
 finally {
    if (dbSemaphore != null) {
      dbSemaphore.release();
    }
  }
}
Program: 33790
Project: 33790
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_view_event);
  if (getIntent().getExtras() != null && getIntent().getExtras().containsKey(EVENTKEY)) {
    mEventKey=getIntent().getExtras().getString(EVENTKEY,"String_Node_Str");
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
  warningMessage=(TextView)findViewById(R.id.warning_container);
  hideWarningMessage();
  pager=(ViewPager)findViewById(R.id.view_pager);
  pager.setAdapter(new ViewEventFragmentPagerAdapter(getSupportFragmentManager(),mEventKey));
  pager.setOffscreenPageLimit(5);
  PagerSlidingTabStrip tabs=(PagerSlidingTabStrip)findViewById(R.id.tabs);
  tabs.setViewPager(pager);
  setupActionBar();
  if (!ConnectionDetector.isConnectedToInternet(this)) {
    showWarningMessage(getString(R.string.warning_unable_to_load));
  }
  setBeamUri(String.format(NfcUris.URI_EVENT,mEventKey));
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_view_event);
  if (getIntent().getExtras() != null && getIntent().getExtras().containsKey(EVENTKEY)) {
    mEventKey=getIntent().getExtras().getString(EVENTKEY,"String_Node_Str");
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
  warningMessage=(TextView)findViewById(R.id.warning_container);
  hideWarningMessage();
  pager=(ViewPager)findViewById(R.id.view_pager);
  pager.setAdapter(new ViewEventFragmentPagerAdapter(getSupportFragmentManager(),mEventKey));
  pager.setOffscreenPageLimit(5);
  pager.setPageMargin(Utilities.getPixelsFromDp(this,16));
  PagerSlidingTabStrip tabs=(PagerSlidingTabStrip)findViewById(R.id.tabs);
  tabs.setViewPager(pager);
  setupActionBar();
  if (!ConnectionDetector.isConnectedToInternet(this)) {
    showWarningMessage(getString(R.string.warning_unable_to_load));
  }
  setBeamUri(String.format(NfcUris.URI_EVENT,mEventKey));
}
Program: 33791
Project: 33791
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  int id=item.getItemId();
  if (id == android.R.id.home) {
    if (isDrawerOpen()) {
      closeDrawer();
      return true;
    }
    Intent upIntent=NavUtils.getParentActivityIntent(this);
    if (NavUtils.shouldUpRecreateTask(this,upIntent)) {
      TaskStackBuilder.create(this).addNextIntent(HomeActivity.newInstance(this,R.id.nav_item_events)).startActivities();
    }
 else {
      Log.d(Constants.LOG_TAG,"String_Node_Str");
      NavUtils.navigateUpTo(this,upIntent);
    }
    return true;
  }
  return super.onOptionsItemSelected(item);
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  int id=item.getItemId();
  if (id == android.R.id.home) {
    if (isDrawerOpen()) {
      closeDrawer();
      return true;
    }
    TaskStackBuilder.create(this).addNextIntent(HomeActivity.newInstance(this,R.id.nav_item_events)).startActivities();
    return true;
  }
  return super.onOptionsItemSelected(item);
}
Program: 33793
Project: 33793
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  int id=item.getItemId();
  if (id == android.R.id.home) {
    if (isDrawerOpen()) {
      closeDrawer();
      return true;
    }
    Intent upIntent=NavUtils.getParentActivityIntent(this);
    if (NavUtils.shouldUpRecreateTask(this,upIntent)) {
      TaskStackBuilder.create(this).addNextIntent(HomeActivity.newInstance(this,R.id.nav_item_teams)).startActivities();
    }
 else {
      Log.d(Constants.LOG_TAG,"String_Node_Str");
      NavUtils.navigateUpTo(this,upIntent);
    }
    return true;
  }
  return super.onOptionsItemSelected(item);
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  int id=item.getItemId();
  if (id == android.R.id.home) {
    if (isDrawerOpen()) {
      closeDrawer();
      return true;
    }
    TaskStackBuilder.create(this).addNextIntent(HomeActivity.newInstance(this,R.id.nav_item_teams)).startActivities();
    return true;
  }
  return super.onOptionsItemSelected(item);
}
Program: 33794
Project: 33794
Buggy source:
@Override public View getGroupView(int groupPosition,boolean isExpanded,View convertView,ViewGroup parent){
  if (convertView == null) {
    convertView=inflater.inflate(R.layout.expandable_list_group,null);
  }
  ListGroup group=(ListGroup)getGroup(groupPosition);
  ((CheckedTextView)convertView.findViewById(R.id.matchlist_group)).setText(group.string);
  ((CheckedTextView)convertView.findViewById(R.id.matchlist_group)).setChecked(isExpanded);
  return convertView;
}

Fixed version (ground truth):
@Override public View getGroupView(int groupPosition,boolean isExpanded,View convertView,ViewGroup parent){
  if (convertView == null) {
    convertView=inflater.inflate(R.layout.expandable_list_group,null);
  }
  ListGroup group=(ListGroup)getGroup(groupPosition);
  ((TextView)convertView.findViewById(R.id.group_name)).setText(group.string);
  return convertView;
}
Program: 33795
Project: 33795
Buggy source:
@Override protected void onPreExecute(){
  super.onPreExecute();
  showLastMatch=showNextMatch=showRanks=showStats=false;
  activity.showMenuProgressBar();
}

Fixed version (ground truth):
@Override protected void onPreExecute(){
  super.onPreExecute();
  showLastMatch=showNextMatch=showRanks=showStats=false;
  activity.showMenuProgressBar();
  View view=mFragment.getView();
  eventName=(TextView)view.findViewById(R.id.event_name);
  eventDate=(TextView)view.findViewById(R.id.event_date);
  eventLoc=(TextView)view.findViewById(R.id.event_location);
  eventVenue=(TextView)view.findViewById(R.id.event_venue);
  nextLayout=(LinearLayout)view.findViewById(R.id.event_next_match_container);
  lastLayout=(LinearLayout)view.findViewById(R.id.event_last_match_container);
  topTeams=(LinearLayout)view.findViewById(R.id.event_top_teams_container);
  topOpr=(LinearLayout)view.findViewById(R.id.event_top_opr_container);
}
Program: 33798
Project: 33798
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.fragmet_team_list_fragment_pager,container,false);
  mViewPager=(ViewPager)v.findViewById(R.id.team_pager);
  mViewPager.setAdapter(new TeamListFragmentPagerAdapter(getChildFragmentManager()));
  PagerSlidingTabStrip tabs=(PagerSlidingTabStrip)v.findViewById(R.id.team_pager_tabs);
  tabs.setViewPager(mViewPager);
  return v;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.fragmet_team_list_fragment_pager,container,false);
  mViewPager=(ViewPager)v.findViewById(R.id.team_pager);
  mViewPager.setAdapter(new TeamListFragmentPagerAdapter(getChildFragmentManager()));
  mViewPager.setPageMargin(Utilities.getPixelsFromDp(getActivity(),16));
  PagerSlidingTabStrip tabs=(PagerSlidingTabStrip)v.findViewById(R.id.team_pager_tabs);
  tabs.setViewPager(mViewPager);
  return v;
}
Program: 33799
Project: 33799
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  final View view=inflater.inflate(R.layout.fragment_event_list_fragment_pager,container,false);
  mViewPager=(ViewPager)view.findViewById(R.id.event_pager);
  mViewPager.setOffscreenPageLimit(50);
  final PagerSlidingTabStrip tabs=(PagerSlidingTabStrip)view.findViewById(R.id.event_pager_tabs);
  final Context c=getActivity();
  mViewPager.setAdapter(new EventsByWeekFragmentPagerAdapter(c,getChildFragmentManager(),mYear));
  tabs.setViewPager(mViewPager);
  int currentWeek=EventHelper.competitionWeek(new Date());
  int currentYear=Calendar.getInstance().get(Calendar.YEAR);
  int week1Index=((EventsByWeekFragmentPagerAdapter)mViewPager.getAdapter()).getLabels().indexOf(String.format(EventHelper.REGIONAL_LABEL,1));
  if (currentYear != mYear) {
    mViewPager.setCurrentItem(week1Index);
  }
 else {
    mViewPager.setCurrentItem((currentWeek > Utilities.getCmpWeek(mYear) + 1) ? Math.min(mViewPager.getAdapter().getCount(),week1Index) : currentWeek);
  }
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  final View view=inflater.inflate(R.layout.fragment_event_list_fragment_pager,container,false);
  mViewPager=(ViewPager)view.findViewById(R.id.event_pager);
  mViewPager.setOffscreenPageLimit(50);
  final PagerSlidingTabStrip tabs=(PagerSlidingTabStrip)view.findViewById(R.id.event_pager_tabs);
  final Context c=getActivity();
  mViewPager.setAdapter(new EventsByWeekFragmentPagerAdapter(c,getChildFragmentManager(),mYear));
  mViewPager.setPageMargin(Utilities.getPixelsFromDp(getActivity(),16));
  tabs.setViewPager(mViewPager);
  int currentWeek=EventHelper.competitionWeek(new Date());
  int currentYear=Calendar.getInstance().get(Calendar.YEAR);
  int week1Index=((EventsByWeekFragmentPagerAdapter)mViewPager.getAdapter()).getLabels().indexOf(String.format(EventHelper.REGIONAL_LABEL,1));
  if (currentYear != mYear) {
    mViewPager.setCurrentItem(week1Index);
  }
 else {
    mViewPager.setCurrentItem((currentWeek > Utilities.getCmpWeek(mYear) + 1) ? Math.min(mViewPager.getAdapter().getCount(),week1Index) : currentWeek);
  }
  return view;
}
Program: 33800
Project: 33800
Buggy source:
@Override public void onClick(View v){
  int id=v.getId();
  if (id == R.id.event_top_teams_container) {
    ((ViewEventActivity)getActivity()).getPager().setCurrentItem(2);
    return;
  }
 else   if (id == R.id.event_top_opr_container) {
    ((ViewEventActivity)getActivity()).getPager().setCurrentItem(4);
    return;
  }
  if (v.getTag() != null) {
    PackageManager manager=getActivity().getPackageManager();
    String uri=v.getTag().toString();
    Intent i=new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(uri));
    List<ResolveInfo> handlers=manager.queryIntentActivities(i,0);
    if (!handlers.isEmpty()) {
      startActivity(i);
    }
 else {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
  }
}

Fixed version (ground truth):
@Override public void onClick(View v){
  int id=v.getId();
  if (id == R.id.event_top_teams_container) {
    ((ViewEventActivity)getActivity()).getPager().setCurrentItem(2);
    return;
  }
 else   if (id == R.id.event_top_opr_container) {
    ((ViewEventActivity)getActivity()).getPager().setCurrentItem(4);
    return;
  }
  if (v.getTag() != null || !v.getTag().toString().isEmpty()) {
    PackageManager manager=getActivity().getPackageManager();
    String uri=v.getTag().toString();
    Intent i=new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(uri));
    List<ResolveInfo> handlers=manager.queryIntentActivities(i,0);
    if (!handlers.isEmpty()) {
      startActivity(i);
    }
 else {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
  }
}
Program: 33801
Project: 33801
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View info=inflater.inflate(R.layout.fragment_event_info,null);
  info.findViewById(R.id.event_venue_container).setOnClickListener(this);
  info.findViewById(R.id.event_location_container).setOnClickListener(this);
  info.findViewById(R.id.event_website_button).setOnClickListener(this);
  info.findViewById(R.id.event_twitter_button).setOnClickListener(this);
  info.findViewById(R.id.event_youtube_button).setOnClickListener(this);
  info.findViewById(R.id.event_cd_button).setOnClickListener(this);
  info.findViewById(R.id.event_top_teams_container).setOnClickListener(this);
  info.findViewById(R.id.event_top_opr_container).setOnClickListener(this);
  return info;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View info=inflater.inflate(R.layout.fragment_event_info,null);
  info.findViewById(R.id.event_venue_container).setOnClickListener(this);
  info.findViewById(R.id.event_website_button).setOnClickListener(this);
  info.findViewById(R.id.event_twitter_button).setOnClickListener(this);
  info.findViewById(R.id.event_youtube_button).setOnClickListener(this);
  info.findViewById(R.id.event_cd_button).setOnClickListener(this);
  info.findViewById(R.id.event_top_teams_container).setOnClickListener(this);
  info.findViewById(R.id.event_top_opr_container).setOnClickListener(this);
  return info;
}
Program: 33802
Project: 33802
Buggy source:
@Override protected void onPreExecute(){
  super.onPreExecute();
  showLastMatch=showNextMatch=showRanks=showStats=false;
  activity.showMenuProgressBar();
  View view=mFragment.getView();
  eventName=(TextView)view.findViewById(R.id.event_name);
  eventDate=(TextView)view.findViewById(R.id.event_date);
  eventLoc=(TextView)view.findViewById(R.id.event_location);
  eventVenue=(TextView)view.findViewById(R.id.event_venue);
  nextLayout=(LinearLayout)view.findViewById(R.id.event_next_match_container);
  lastLayout=(LinearLayout)view.findViewById(R.id.event_last_match_container);
  topTeams=(LinearLayout)view.findViewById(R.id.event_top_teams_container);
  topOpr=(LinearLayout)view.findViewById(R.id.event_top_opr_container);
}

Fixed version (ground truth):
@Override protected void onPreExecute(){
  super.onPreExecute();
  showLastMatch=showNextMatch=showRanks=showStats=false;
  activity.showMenuProgressBar();
  View view=mFragment.getView();
  eventName=(TextView)view.findViewById(R.id.event_name);
  eventDate=(TextView)view.findViewById(R.id.event_date);
  eventLoc=(TextView)view.findViewById(R.id.event_location);
  eventVenue=(TextView)view.findViewById(R.id.event_venue);
  nextLayout=(LinearLayout)view.findViewById(R.id.event_next_match_container);
  lastLayout=(LinearLayout)view.findViewById(R.id.event_last_match_container);
  topTeamsContainer=view.findViewById(R.id.event_top_teams_container);
  topOprsContainer=view.findViewById(R.id.event_top_oprs_container);
  topTeams=(TextView)view.findViewById(R.id.event_top_teams);
  topOprs=(TextView)view.findViewById(R.id.event_top_oprs);
}
Program: 33805
Project: 33805
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.list_fragment_with_spinner,null);
  mListView=(ListView)v.findViewById(R.id.list);
  mProgressBar=(ProgressBar)v.findViewById(R.id.progress);
  if (mAdapter != null) {
    mListView.setAdapter(mAdapter);
    mListView.onRestoreInstanceState(mListState);
    mProgressBar.setVisibility(View.GONE);
  }
  mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      if (!(parent.getAdapter() instanceof ListViewAdapter)) {
        Log.w(Constants.LOG_TAG,"String_Node_Str");
        return;
      }
      Object item=((ListViewAdapter)parent.getAdapter()).getItem(position);
      if (item != null && item instanceof ListElement) {
        Intent intent;
        String eventKey=((ListElement)item).getKey();
        if (mTeamKey == null || mTeamKey.isEmpty()) {
          intent=ViewEventActivity.newInstance(getActivity(),eventKey);
        }
 else {
          intent=TeamAtEventActivity.newInstance(getActivity(),eventKey,mTeamKey);
        }
        startActivity(intent);
      }
 else {
        Log.d(Constants.LOG_TAG,"String_Node_Str");
      }
    }
  }
);
  return v;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.list_view_with_spinner,null);
  mListView=(ListView)v.findViewById(R.id.list);
  mProgressBar=(ProgressBar)v.findViewById(R.id.progress);
  if (mAdapter != null) {
    mListView.setAdapter(mAdapter);
    mListView.onRestoreInstanceState(mListState);
    mProgressBar.setVisibility(View.GONE);
  }
  mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
      if (!(parent.getAdapter() instanceof ListViewAdapter)) {
        Log.w(Constants.LOG_TAG,"String_Node_Str");
        return;
      }
      Object item=((ListViewAdapter)parent.getAdapter()).getItem(position);
      if (item != null && item instanceof ListElement) {
        Intent intent;
        String eventKey=((ListElement)item).getKey();
        if (mTeamKey == null || mTeamKey.isEmpty()) {
          intent=ViewEventActivity.newInstance(getActivity(),eventKey);
        }
 else {
          intent=TeamAtEventActivity.newInstance(getActivity(),eventKey,mTeamKey);
        }
        startActivity(intent);
      }
 else {
        Log.d(Constants.LOG_TAG,"String_Node_Str");
      }
    }
  }
);
  return v;
}
Program: 33806
Project: 33806
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.list_fragment_with_spinner,null);
  mListView=(ListView)view.findViewById(R.id.list);
  mListView.setFastScrollAlwaysVisible(true);
  mProgressBar=(ProgressBar)view.findViewById(R.id.progress);
  mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int position,    long id){
      String teamKey=((TeamCursorAdapter)adapterView.getAdapter()).getKey(position);
      Intent i=new Intent(getActivity(),ViewTeamActivity.class);
      i.putExtra(ViewTeamActivity.TEAM_KEY,teamKey);
      startActivity(i);
    }
  }
);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.list_view_with_spinner,null);
  mListView=(ListView)view.findViewById(R.id.list);
  mListView.setFastScrollAlwaysVisible(true);
  mProgressBar=(ProgressBar)view.findViewById(R.id.progress);
  mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int position,    long id){
      String teamKey=((TeamCursorAdapter)adapterView.getAdapter()).getKey(position);
      Intent i=new Intent(getActivity(),ViewTeamActivity.class);
      i.putExtra(ViewTeamActivity.TEAM_KEY,teamKey);
      startActivity(i);
    }
  }
);
  return view;
}
Program: 33807
Project: 33807
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.list_fragment_with_spinner,null);
  mListView=(ListView)view.findViewById(R.id.list);
  mProgressBar=(ProgressBar)view.findViewById(R.id.progress);
  if (mAdapter != null) {
    mListView.setAdapter(mAdapter);
    mListView.onRestoreInstanceState(mListState);
    mProgressBar.setVisibility(View.GONE);
  }
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.list_view_with_spinner,null);
  mListView=(ListView)view.findViewById(R.id.list);
  mProgressBar=(ProgressBar)view.findViewById(R.id.progress);
  if (mAdapter != null) {
    mListView.setAdapter(mAdapter);
    mListView.onRestoreInstanceState(mListState);
    mProgressBar.setVisibility(View.GONE);
  }
  return view;
}
Program: 33808
Project: 33808
Buggy source:
@Override public void onClick(View v){
  int id=v.getId();
  if (id == R.id.event_top_teams_container) {
    ((ViewEventActivity)getActivity()).getPager().setCurrentItem(2);
    return;
  }
 else   if (id == R.id.event_top_opr_container) {
    ((ViewEventActivity)getActivity()).getPager().setCurrentItem(4);
    return;
  }
  if (v.getTag() != null || !v.getTag().toString().isEmpty()) {
    PackageManager manager=getActivity().getPackageManager();
    String uri=v.getTag().toString();
    Intent i=new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(uri));
    List<ResolveInfo> handlers=manager.queryIntentActivities(i,0);
    if (!handlers.isEmpty()) {
      startActivity(i);
    }
 else {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
  }
}

Fixed version (ground truth):
@Override public void onClick(View v){
  int id=v.getId();
  if (id == R.id.event_top_teams_container) {
    ((ViewEventActivity)getActivity()).getPager().setCurrentItem(2);
    return;
  }
 else   if (id == R.id.event_top_oprs_container) {
    ((ViewEventActivity)getActivity()).getPager().setCurrentItem(4);
    return;
  }
  if (v.getTag() != null || !v.getTag().toString().isEmpty()) {
    PackageManager manager=getActivity().getPackageManager();
    String uri=v.getTag().toString();
    Intent i=new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(uri));
    List<ResolveInfo> handlers=manager.queryIntentActivities(i,0);
    if (!handlers.isEmpty()) {
      startActivity(i);
    }
 else {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
    }
  }
}
Program: 33809
Project: 33809
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View info=inflater.inflate(R.layout.fragment_event_info,null);
  info.findViewById(R.id.event_venue_container).setOnClickListener(this);
  info.findViewById(R.id.event_website_button).setOnClickListener(this);
  info.findViewById(R.id.event_twitter_button).setOnClickListener(this);
  info.findViewById(R.id.event_youtube_button).setOnClickListener(this);
  info.findViewById(R.id.event_cd_button).setOnClickListener(this);
  info.findViewById(R.id.event_top_teams_container).setOnClickListener(this);
  info.findViewById(R.id.event_top_opr_container).setOnClickListener(this);
  return info;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View info=inflater.inflate(R.layout.fragment_event_info,null);
  info.findViewById(R.id.event_venue_container).setOnClickListener(this);
  info.findViewById(R.id.event_website_button).setOnClickListener(this);
  info.findViewById(R.id.event_twitter_button).setOnClickListener(this);
  info.findViewById(R.id.event_youtube_button).setOnClickListener(this);
  info.findViewById(R.id.event_cd_button).setOnClickListener(this);
  info.findViewById(R.id.event_top_teams_container).setOnClickListener(this);
  info.findViewById(R.id.event_top_oprs_container).setOnClickListener(this);
  return info;
}
Program: 33810
Project: 33810
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.list_fragment_with_spinner,null);
  mListView=(ListView)v.findViewById(R.id.list);
  mProgressBar=(ProgressBar)v.findViewById(R.id.progress);
  if (mAdapter != null) {
    mListView.setAdapter(mAdapter);
    mListView.onRestoreInstanceState(mListState);
    mProgressBar.setVisibility(View.GONE);
  }
  mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int position,    long id){
      String teamKey=((ListElement)((ListViewAdapter)adapterView.getAdapter()).getItem(position)).getKey();
      startActivity(TeamAtEventActivity.newInstance(getActivity(),eventKey,teamKey));
    }
  }
);
  return v;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View v=inflater.inflate(R.layout.list_view_with_spinner,null);
  mListView=(ListView)v.findViewById(R.id.list);
  mProgressBar=(ProgressBar)v.findViewById(R.id.progress);
  if (mAdapter != null) {
    mListView.setAdapter(mAdapter);
    mListView.onRestoreInstanceState(mListState);
    mProgressBar.setVisibility(View.GONE);
  }
  mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int position,    long id){
      String teamKey=((ListElement)((ListViewAdapter)adapterView.getAdapter()).getItem(position)).getKey();
      startActivity(TeamAtEventActivity.newInstance(getActivity(),eventKey,teamKey));
    }
  }
);
  return v;
}
Program: 33811
Project: 33811
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.list_fragment_with_spinner,null);
  mListView=(ListView)view.findViewById(R.id.list);
  mProgressBar=(ProgressBar)view.findViewById(R.id.progress);
  if (mAdapter != null) {
    mListView.setAdapter(mAdapter);
    mListView.onRestoreInstanceState(mListState);
    mProgressBar.setVisibility(View.GONE);
  }
  mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int position,    long id){
      String teamKey=((ListElement)((ListViewAdapter)adapterView.getAdapter()).getItem(position)).getKey();
      if (TeamHelper.validateTeamKey(teamKey) ^ TeamHelper.validateMultiTeamKey(teamKey)) {
        if (TeamHelper.validateMultiTeamKey(teamKey)) {
          teamKey=teamKey.substring(0,teamKey.length() - 1);
        }
        startActivity(TeamAtEventActivity.newInstance(getActivity(),mEventKey,teamKey));
      }
 else {
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
  }
);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.list_view_with_spinner,null);
  mListView=(ListView)view.findViewById(R.id.list);
  mProgressBar=(ProgressBar)view.findViewById(R.id.progress);
  if (mAdapter != null) {
    mListView.setAdapter(mAdapter);
    mListView.onRestoreInstanceState(mListState);
    mProgressBar.setVisibility(View.GONE);
  }
  mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int position,    long id){
      String teamKey=((ListElement)((ListViewAdapter)adapterView.getAdapter()).getItem(position)).getKey();
      if (TeamHelper.validateTeamKey(teamKey) ^ TeamHelper.validateMultiTeamKey(teamKey)) {
        if (TeamHelper.validateMultiTeamKey(teamKey)) {
          teamKey=teamKey.substring(0,teamKey.length() - 1);
        }
        startActivity(TeamAtEventActivity.newInstance(getActivity(),mEventKey,teamKey));
      }
 else {
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
  }
);
  return view;
}
Program: 33812
Project: 33812
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.list_fragment_with_spinner,null);
  mListView=(ListView)view.findViewById(R.id.list);
  ProgressBar progressBar=(ProgressBar)view.findViewById(R.id.progress);
  if (mAdapter != null) {
    mListView.setAdapter(mAdapter);
    mListView.onRestoreInstanceState(mListState);
    progressBar.setVisibility(View.GONE);
  }
  mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int position,    long id){
      String teamKey=((ListElement)((ListViewAdapter)adapterView.getAdapter()).getItem(position)).getKey();
      startActivity(TeamAtEventActivity.newInstance(getActivity(),mEventKey,teamKey));
    }
  }
);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.list_view_with_spinner,null);
  mListView=(ListView)view.findViewById(R.id.list);
  ProgressBar progressBar=(ProgressBar)view.findViewById(R.id.progress);
  if (mAdapter != null) {
    mListView.setAdapter(mAdapter);
    mListView.onRestoreInstanceState(mListState);
    progressBar.setVisibility(View.GONE);
  }
  mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int position,    long id){
      String teamKey=((ListElement)((ListViewAdapter)adapterView.getAdapter()).getItem(position)).getKey();
      startActivity(TeamAtEventActivity.newInstance(getActivity(),mEventKey,teamKey));
    }
  }
);
  return view;
}