Program: 38215
Project: 38215
Buggy source:
@Override public Response execute(){
  ArrayList<AnnotationInformation> annotations=new ArrayList<AnnotationInformation>();
  DatabaseAccessor accessor=null;
  Map<String,Integer> a=null;
  try {
    accessor=new DatabaseAccessor(DatabaseSettings.username,DatabaseSettings.password,DatabaseSettings.host,DatabaseSettings.database);
    a=accessor.getAnnotations();
    System.out.println("String_Node_Str");
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
  Iterator<String> keys=a.keySet().iterator();
  ArrayList<String> annotation_names=new ArrayList<String>();
  while (keys.hasNext()) {
    annotation_names.add(keys.next());
  }
  for (int i=0; i < annotation_names.size(); i++) {
    ArrayList<String> values=null;
    try {
      if (accessor.getAnnotationType(annotation_names.get(i)) == DatabaseAccessor.FREETEXT) {
        values=new ArrayList<String>();
        values.add("String_Node_Str");
      }
 else       if (accessor.getAnnotationType(annotation_names.get(i)) == DatabaseAccessor.DROPDOWN) {
        values=(ArrayList<String>)accessor.getChoices(annotation_names.get(i));
      }
 else {
      }
    }
 catch (    SQLException e1) {
      e1.printStackTrace();
    }
    AnnotationInformation annotation=new AnnotationInformation(0,annotation_names.get(i),values,true);
    annotations.add(annotation);
  }
  ArrayList<String> vals=new ArrayList<String>();
  vals.add("String_Node_Str");
  AnnotationInformation expId=new AnnotationInformation(0,"String_Node_Str",vals,false);
  annotations.add(expId);
  Collections.sort(annotations,new compareAnnotations());
  for (int i=0; i < annotations.size(); i++) {
    annotations.get(i).setId(i);
  }
  for (int i=0; i < annotations.size(); i++) {
    System.out.println("String_Node_Str" + annotations.get(i));
  }
  return new GetAnnotationInformationResponse(200,annotations);
}

Fixed version (ground truth):
@Override public Response execute(){
  ArrayList<AnnotationInformation> annotations=new ArrayList<AnnotationInformation>();
  DatabaseAccessor accessor=null;
  Map<String,Integer> a=null;
  try {
    accessor=new DatabaseAccessor(DatabaseSettings.username,DatabaseSettings.password,DatabaseSettings.host,DatabaseSettings.database);
    a=accessor.getAnnotations();
    System.out.println("String_Node_Str");
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
  Iterator<String> keys=a.keySet().iterator();
  ArrayList<String> annotation_names=new ArrayList<String>();
  while (keys.hasNext()) {
    annotation_names.add(keys.next());
  }
  for (int i=0; i < annotation_names.size(); i++) {
    ArrayList<String> values=null;
    try {
      if (accessor.getAnnotationType(annotation_names.get(i)) == DatabaseAccessor.FREETEXT) {
        values=new ArrayList<String>();
        values.add("String_Node_Str");
      }
 else       if (accessor.getAnnotationType(annotation_names.get(i)) == DatabaseAccessor.DROPDOWN) {
        values=(ArrayList<String>)accessor.getChoices(annotation_names.get(i));
      }
 else {
      }
    }
 catch (    SQLException e1) {
      e1.printStackTrace();
    }
    AnnotationInformation annotation=new AnnotationInformation(0,annotation_names.get(i),values,true);
    annotations.add(annotation);
  }
  ArrayList<String> vals=new ArrayList<String>();
  vals.add("String_Node_Str");
  AnnotationInformation expId=new AnnotationInformation(0,"String_Node_Str",vals,false);
  annotations.add(expId);
  Collections.sort(annotations,new compareAnnotations());
  for (int i=0; i < annotations.size(); i++) {
    annotations.get(i).setId(i);
  }
  return new GetAnnotationInformationResponse(200,annotations);
}