Program: 33592
Project: 33592
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_search_results);
  toolbar=(Toolbar)findViewById(R.id.toolbar);
  ViewCompat.setElevation(toolbar,getResources().getDimension(R.dimen.toolbar_elevation));
  setSupportActionBar(toolbar);
  new AnalyticsActions.ReportActivityStart(this).run();
  resultsList=(ListView)findViewById(R.id.results);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setTitle("String_Node_Str");
  query=getIntent().getStringExtra(QUERY);
  resultsType=getIntent().getIntExtra(RESULTS_TYPE,-1);
  if (query == null || resultsType == -1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String preparedQuery=Utilities.getPreparedQueryForSearch(query);
  Bundle loaderBundle=new Bundle();
  loaderBundle.putString(PREPARED_QUERY,preparedQuery);
  getSupportLoaderManager().restartLoader(resultsType,loaderBundle,this);
switch (resultsType) {
case TEAM_RESULTS:
    getSupportActionBar().setTitle(String.format(getString(R.string.teams_matching),query));
  break;
case EVENT_RESULTS:
getSupportActionBar().setTitle(String.format(getString(R.string.events_matching),query));
break;
}
resultsList.setOnItemClickListener(new AdapterView.OnItemClickListener(){
@Override public void onItemClick(AdapterView<?> adapterView,View view,int position,long id){
switch (resultsType) {
case TEAM_RESULTS:
TeamCursorAdapter teamAdapter=(TeamCursorAdapter)adapterView.getAdapter();
String teamKey=teamAdapter.getKey(position);
startActivity(ViewTeamActivity.newInstance(MoreSearchResultsActivity.this,teamKey));
break;
case EVENT_RESULTS:
EventCursorAdapter eventAdapter=(EventCursorAdapter)adapterView.getAdapter();
String eventKey=eventAdapter.getKey(position);
startActivity(ViewEventActivity.newInstance(MoreSearchResultsActivity.this,eventKey));
break;
}
}
}
);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_search_results);
  toolbar=(Toolbar)findViewById(R.id.toolbar);
  ViewCompat.setElevation(toolbar,getResources().getDimension(R.dimen.toolbar_elevation));
  setSupportActionBar(toolbar);
  new AnalyticsActions.ReportActivityStart(this).run();
  resultsList=(ListView)findViewById(R.id.results);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setTitle("String_Node_Str");
  query=getIntent().getStringExtra(QUERY);
  resultsType=getIntent().getIntExtra(RESULTS_TYPE,-1);
  if (query == null || resultsType == -1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String preparedQuery=Utilities.getPreparedQueryForSearch(query);
  Bundle loaderBundle=new Bundle();
  loaderBundle.putString(PREPARED_QUERY,preparedQuery);
  getSupportLoaderManager().restartLoader(resultsType,loaderBundle,this);
switch (resultsType) {
case TEAM_RESULTS:
    getSupportActionBar().setTitle(String.format(getString(R.string.teams_matching),query));
  break;
case EVENT_RESULTS:
getSupportActionBar().setTitle(String.format(getString(R.string.events_matching),query));
break;
}
resultsList.setOnItemClickListener((adapterView,view,position,id) -> {
switch (resultsType) {
case TEAM_RESULTS:
TeamCursorAdapter teamAdapter=(TeamCursorAdapter)adapterView.getAdapter();
String teamKey=teamAdapter.getKey(position);
startActivity(ViewTeamActivity.newInstance(MoreSearchResultsActivity.this,teamKey));
break;
case EVENT_RESULTS:
EventCursorAdapter eventAdapter=(EventCursorAdapter)adapterView.getAdapter();
String eventKey=eventAdapter.getKey(position);
startActivity(ViewEventActivity.newInstance(MoreSearchResultsActivity.this,eventKey));
break;
}
}
);
}