Program: 153332
Project: 153332
Buggy source:
/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  data=com.android.interview.utilities.Data.getInstance();
  data.SetRoot(Environment.getExternalStorageDirectory());
  setContentView(R.layout.dashboard);
  this.flipper=(ViewFlipper)findViewById(R.id.subject_views);
  Button subjectCreateButton=(Button)findViewById(R.id.subject_create_button);
  subjectCreateButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      flipper.setDisplayedChild(Interview.SUBJECT_CREATE_VIEW);
    }
  }
);
  Button subjectListButton=(Button)findViewById(R.id.subject_list_button);
  subjectListButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      flipper.setDisplayedChild(Interview.SUBJECT_LIST_VIEW);
    }
  }
);
  Button subjectCreateSaveButton=(Button)findViewById(R.id.subject_create_save_button);
  subjectCreateSaveButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      EditText newSubjectField=(EditText)findViewById(R.id.subject_create_name);
      String currentSubjectName=newSubjectField.getText().toString();
      createSubject(currentSubjectName);
      Spinner spinner=(Spinner)findViewById(R.id.subject_list_dropdown);
      populateSpinner(spinner);
      TextView subjectview=(TextView)findViewById(R.id.subjectname);
      subjectview.setText(currentSubjectName);
      Interview.data.SetSubject(currentSubjectName);
      flipper.setDisplayedChild(Interview.SUBJECT_DETAILS_VIEW);
    }
  }
);
  Button subjectCreateBackButton=(Button)findViewById(R.id.subject_create_back_button);
  subjectCreateBackButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      flipper.setDisplayedChild(Interview.SUBJECT_DASHBOARD_VIEW);
    }
  }
);
  Spinner spinner=(Spinner)findViewById(R.id.subject_list_dropdown);
  populateSpinner(spinner);
  spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){
    public void onItemSelected(    AdapterView<?> parent,    View view,    int position,    long id){
      String subjectName=parent.getItemAtPosition(position).toString();
      data.SetSubject(subjectName);
      TextView subjectview=(TextView)findViewById(R.id.subjectname);
      subjectview.setText(subjectName);
      Interview.data.SetSubject(subjectName);
    }
    public void onNothingSelected(    AdapterView parent){
    }
  }
);
  Button subjectListViewButton=(Button)findViewById(R.id.subject_list_view_button);
  subjectListViewButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      flipper.setDisplayedChild(Interview.SUBJECT_DETAILS_VIEW);
    }
  }
);
  Button subjectListBackButton=(Button)findViewById(R.id.subject_list_back_button);
  subjectListBackButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      flipper.setDisplayedChild(Interview.SUBJECT_DASHBOARD_VIEW);
    }
  }
);
  Button subjectViewBackButton=(Button)findViewById(R.id.subject_dashboard_button);
  subjectViewBackButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      flipper.setDisplayedChild(Interview.SUBJECT_DASHBOARD_VIEW);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.dashboard);
  this.flipper=(ViewFlipper)findViewById(R.id.subject_views);
  Button subjectCreateButton=(Button)findViewById(R.id.subject_create_button);
  subjectCreateButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      flipper.setDisplayedChild(Interview.SUBJECT_CREATE_VIEW);
    }
  }
);
  Button subjectListButton=(Button)findViewById(R.id.subject_list_button);
  subjectListButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      flipper.setDisplayedChild(Interview.SUBJECT_LIST_VIEW);
    }
  }
);
  Button subjectCreateSaveButton=(Button)findViewById(R.id.subject_create_save_button);
  subjectCreateSaveButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      EditText newSubjectField=(EditText)findViewById(R.id.subject_create_name);
      String currentSubjectName=newSubjectField.getText().toString();
      createSubject(currentSubjectName);
      Spinner spinner=(Spinner)findViewById(R.id.subject_list_dropdown);
      populateSpinner(spinner);
      TextView subjectview=(TextView)findViewById(R.id.subjectname);
      subjectview.setText(currentSubjectName);
      data.SetSubject(currentSubjectName);
      flipper.setDisplayedChild(Interview.SUBJECT_DETAILS_VIEW);
    }
  }
);
  Button subjectCreateBackButton=(Button)findViewById(R.id.subject_create_back_button);
  subjectCreateBackButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      flipper.setDisplayedChild(Interview.SUBJECT_DASHBOARD_VIEW);
    }
  }
);
  Spinner spinner=(Spinner)findViewById(R.id.subject_list_dropdown);
  populateSpinner(spinner);
  spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){
    public void onItemSelected(    AdapterView<?> parent,    View view,    int position,    long id){
      String subjectName=parent.getItemAtPosition(position).toString();
      data.SetSubject(subjectName);
      TextView subjectview=(TextView)findViewById(R.id.subjectname);
      subjectview.setText(subjectName);
      data.SetSubject(subjectName);
    }
    public void onNothingSelected(    AdapterView parent){
    }
  }
);
  Button subjectListViewButton=(Button)findViewById(R.id.subject_list_view_button);
  subjectListViewButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      flipper.setDisplayedChild(Interview.SUBJECT_DETAILS_VIEW);
    }
  }
);
  Button subjectListBackButton=(Button)findViewById(R.id.subject_list_back_button);
  subjectListBackButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      flipper.setDisplayedChild(Interview.SUBJECT_DASHBOARD_VIEW);
    }
  }
);
  Button subjectViewBackButton=(Button)findViewById(R.id.subject_dashboard_button);
  subjectViewBackButton.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View view){
      flipper.setDisplayedChild(Interview.SUBJECT_DASHBOARD_VIEW);
    }
  }
);
}