nus-yam/ex-repair huggingface dataset:
Program: 38101
Project: 38101
Buggy source:
public String execute() throws IOException, InterruptedException {
  Debug.log("String_Node_Str" + outfileName);
  File profileFilesDir=new File(infile1).getParentFile();
  Debug.log("String_Node_Str" + profileFilesDir.getAbsolutePath());
  File workingDir=new File("String_Node_Str" + infile1.replaceAll("String_Node_Str","String_Node_Str"));
  File resultsDir=new File(workingDir.getAbsolutePath() + "String_Node_Str");
  File ratioWrapper=new File("String_Node_Str");
  String output;
  try {
    output=executeCommand(new String[]{"String_Node_Str",ratioWrapper.getAbsolutePath(),workingDir.getAbsolutePath() + "String_Node_Str",infile1,infile2,outfileName,mean.meanParam,"String_Node_Str" + readsCutOff,chromosomes});
  }
 catch (  RuntimeException rte) {
    rte.printStackTrace();
    throw rte;
  }
  for (  File outFile : resultsDir.listFiles()) {
    if (outFile.getName().contains("String_Node_Str")) {
      File movedFile=new File(outfileName);
      Debug.log("String_Node_Str" + outFile.getAbsolutePath() + "String_Node_Str"+ movedFile.getAbsolutePath());
      outFile.renameTo(movedFile);
    }
  }
  Debug.log("String_Node_Str" + workingDir.getAbsolutePath());
  FileUtils.deleteDirectory(workingDir);
  return output;
}

Fixed version (ground truth):
public String execute() throws IOException, InterruptedException {
  Debug.log("String_Node_Str" + outfileName);
  File profileFilesDir=new File(infile1).getParentFile();
  Debug.log("String_Node_Str" + profileFilesDir.getAbsolutePath());
  File workingDir=new File("String_Node_Str" + infile1.replaceAll("String_Node_Str","String_Node_Str"));
  File resultsDir=new File(workingDir.getAbsolutePath() + "String_Node_Str");
  File ratioWrapper=new File("String_Node_Str");
  String output;
  try {
    output=executeCommand(new String[]{"String_Node_Str",ratioWrapper.getAbsolutePath(),workingDir.getAbsolutePath() + "String_Node_Str",infile1,infile2,outfileName,mean.meanParam,"String_Node_Str" + readsCutOff,chromosomes});
  }
 catch (  RuntimeException rte) {
    rte.printStackTrace();
    throw rte;
  }
  for (  File outFile : resultsDir.listFiles()) {
    if (outFile.getName().contains("String_Node_Str")) {
      File movedFile=new File(outfileName);
      Debug.log("String_Node_Str" + outFile.getAbsolutePath() + "String_Node_Str"+ movedFile.getAbsolutePath());
      FileUtils.moveFile(outFile,movedFile);
    }
  }
  Debug.log("String_Node_Str" + workingDir.getAbsolutePath());
  FileUtils.deleteDirectory(workingDir);
  return output;
}
Program: 38102
Project: 38102
Buggy source:
@Override public void execute(){
  try {
    CommandTester.conn.sendRequest(new GetGenomeSpecieReleasesRequest(specie),CommandTester.token,Constants.TEXT_PLAIN);
    if (CommandTester.conn.getResponseCode() == 200) {
      String respBody=CommandTester.conn.getResponseBody();
      for (      String expectedStr : expected)       super.finalResult=respBody.contains(expectedStr);
    }
  }
 catch (  RequestException e) {
    if (super.expectedResult)     ErrorLogger.log(e);
  }
}

Fixed version (ground truth):
@Override public void execute(){
  try {
    CommandTester.conn.sendRequest(new GetGenomeSpecieReleasesRequest(specie),CommandTester.token,Constants.TEXT_PLAIN);
    if (CommandTester.conn.getResponseCode() == 200) {
      String respBody=CommandTester.conn.getResponseBody();
      super.finalResult=true;
      for (      String expectedStr : expected)       super.finalResult=(super.finalResult && respBody.contains(expectedStr));
    }
  }
 catch (  RequestException e) {
    if (super.expectedResult)     ErrorLogger.log(e);
  }
}
Program: 38103
Project: 38103
Buggy source:
@Ignore @Test @Ignore public void shouldProduceNewSamFile() throws ProcessException {
  String inFolder="String_Node_Str";
  String outFilePath="String_Node_Str";
  rtp.procedure(parameters,inFolder,outFilePath);
}

Fixed version (ground truth):
@Test @Ignore public void shouldProduceNewSamFile() throws ProcessException {
  String inFolder="String_Node_Str";
  String outFilePath="String_Node_Str";
  rtp.procedure(parameters,inFolder,outFilePath);
}
Program: 38104
Project: 38104
Buggy source:
@Override public Response execute(){
  Response response;
  try (DatabaseAccessor db=initDB()){
    if (!buildAnnotationList().containsAll(db.getAllForcedAnnotationLabels())) {
      response=new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + name + "String_Node_Str"+ "String_Node_Str");
    }
 else {
      db.addExperiment(name);
      for (      Annotation annotation : annotations) {
        db.annotateExperiment(name,annotation.getName(),annotation.getValue());
      }
      response=new MinimalResponse(HttpStatusCode.OK);
    }
  }
 catch (  SQLException e) {
    response=new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + name + "String_Node_Str"+ "String_Node_Str");
    Debug.log("String_Node_Str" + e.getMessage());
  }
catch (  IOException e) {
    removeExperiment();
    response=new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + name + "String_Node_Str"+ e.getMessage());
  }
  return response;
}

Fixed version (ground truth):
@Override public Response execute(){
  Response response;
  try (DatabaseAccessor db=initDB()){
    if (!buildAnnotationList().containsAll(db.getAllForcedAnnotationLabels())) {
      response=new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + name + "String_Node_Str"+ "String_Node_Str");
    }
 else {
      db.addExperiment(name);
      try {
        for (        Annotation annotation : annotations) {
          db.annotateExperiment(name,annotation.getName(),annotation.getValue());
        }
      }
 catch (      IOException ie) {
        removeExperiment();
        throw ie;
      }
      response=new MinimalResponse(HttpStatusCode.OK);
    }
  }
 catch (  SQLException e) {
    response=new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + name + "String_Node_Str"+ "String_Node_Str");
    Debug.log("String_Node_Str" + e.getMessage());
  }
catch (  IOException e) {
    response=new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + name + "String_Node_Str"+ e.getMessage());
  }
  return response;
}
Program: 38105
Project: 38105
Buggy source:
private String fetchRawFilesDirFromDB(String expId) throws IOException, SQLException {
  return initDB().getFilePathGenerator().getProfileFolderPath(expId);
}

Fixed version (ground truth):
private String fetchRawFilesDirFromDB(String expId) throws IOException, SQLException {
  return initDB().getFilePathGenerator().getRawFolderPath(expId);
}
Program: 38106
Project: 38106
Buggy source:
/** 
 * Updates values of multiple annotations of a unique experiment.
 * @param expID the name of the experiment to annotate.
 * @param annotations the list of annotations to set. Should consist of objects of type Entry<String1, String2> where String1 is the label and key of the entry, and String2 is the value to assign to that label as well as the value of the entry.
 * @return the number of tuples updated in the database.
 * @throws SQLException if the query does not succeed
 * @throws IOException if the value is invalid for the annotation type.
 */
public int updateExperiment(String expID,HashMap<String,String> annotations) throws SQLException, IOException {
  for (  Entry<String,String> e : annotations.entrySet()) {
    String key=e.getKey();
    String value=e.getValue();
    validateAnnotation(key,value);
  }
  String query="String_Node_Str" + "String_Node_Str";
  int rs=0;
  try (PreparedStatement stmt=conn.prepareStatement(query)){
    conn.setAutoCommit(false);
    for (    Entry<String,String> e : annotations.entrySet()) {
      String key=e.getKey();
      String value=e.getValue();
      stmt.setString(1,value);
      stmt.setString(2,key);
      stmt.setString(3,expID);
      stmt.addBatch();
    }
    int arr[]=stmt.executeBatch();
    for (int i=0; i < arr.length; i++) {
      rs+=arr[i];
    }
    conn.commit();
  }
 catch (  SQLException e) {
    conn.rollback();
    throw e;
  }
 finally {
    conn.setAutoCommit(true);
  }
  return rs;
}

Fixed version (ground truth):
/** 
 * Updates values of multiple annotations of a unique experiment.
 * @param expID the name of the experiment to annotate.
 * @param annotations the list of annotations to set. Should consist of objects of type Entry<String1, String2> where String1 is the label and key of the entry, and String2 is the value to assign to that label as well as the value of the entry.
 * @return the number of tuples updated in the database.
 * @throws SQLException if the query does not succeed
 * @throws IOException if the value is invalid for the annotation type.
 */
public int updateExperiment(String expID,HashMap<String,String> annotations) throws SQLException, IOException {
  for (  Entry<String,String> e : annotations.entrySet()) {
    String key=e.getKey();
    String value=e.getValue();
    e.setValue(validateAnnotation(key,value));
  }
  String query="String_Node_Str" + "String_Node_Str";
  int rs=0;
  try (PreparedStatement stmt=conn.prepareStatement(query)){
    conn.setAutoCommit(false);
    for (    Entry<String,String> e : annotations.entrySet()) {
      String key=e.getKey();
      String value=e.getValue();
      stmt.setString(1,value);
      stmt.setString(2,key);
      stmt.setString(3,expID);
      stmt.addBatch();
    }
    int arr[]=stmt.executeBatch();
    for (int i=0; i < arr.length; i++) {
      rs+=arr[i];
    }
    conn.commit();
  }
 catch (  SQLException e) {
    conn.rollback();
    throw e;
  }
 finally {
    conn.setAutoCommit(true);
  }
  return rs;
}
Program: 38107
Project: 38107
Buggy source:
/** 
 * Updates values of multiple annotations of a unique experiment.
 * @param expID the name of the experiment to annotate.
 * @param annotations the list of annotations to set. Should consist of objects of type Entry<String1, String2> where String1 is the label and key of the entry, and String2 is the value to assign to that label as well as the value of the entry.
 * @return the number of tuples updated in the database.
 * @throws SQLException if the query does not succeed
 * @throws IOException if the value is invalid for the annotation type.
 */
public int updateExperiment(String expID,HashMap<String,String> annotations) throws SQLException, IOException {
  for (  Entry<String,String> e : annotations.entrySet()) {
    String key=e.getKey();
    String value=e.getValue();
    validateAnnotation(key,value);
  }
  String query="String_Node_Str" + "String_Node_Str";
  int rs=0;
  try (PreparedStatement stmt=conn.prepareStatement(query)){
    conn.setAutoCommit(false);
    for (    Entry<String,String> e : annotations.entrySet()) {
      String key=e.getKey();
      String value=e.getValue();
      stmt.setString(1,value);
      stmt.setString(2,key);
      stmt.setString(3,expID);
      stmt.addBatch();
    }
    int arr[]=stmt.executeBatch();
    for (int i=0; i < arr.length; i++) {
      rs+=arr[i];
    }
    conn.commit();
  }
 catch (  SQLException e) {
    conn.rollback();
    throw e;
  }
 finally {
    conn.setAutoCommit(true);
  }
  return rs;
}

Fixed version (ground truth):
/** 
 * Updates values of multiple annotations of a unique experiment.
 * @param expID the name of the experiment to annotate.
 * @param annotations the list of annotations to set. Should consist of objects of type Entry<String1, String2> where String1 is the label and key of the entry, and String2 is the value to assign to that label as well as the value of the entry.
 * @return the number of tuples updated in the database.
 * @throws SQLException if the query does not succeed
 * @throws IOException if the value is invalid for the annotation type.
 */
public int updateExperiment(String expID,HashMap<String,String> annotations) throws SQLException, IOException {
  for (  Entry<String,String> e : annotations.entrySet()) {
    String key=e.getKey();
    String value=e.getValue();
    e.setValue(validateAnnotation(key,value));
  }
  String query="String_Node_Str" + "String_Node_Str";
  int rs=0;
  try (PreparedStatement stmt=conn.prepareStatement(query)){
    conn.setAutoCommit(false);
    for (    Entry<String,String> e : annotations.entrySet()) {
      String key=e.getKey();
      String value=e.getValue();
      stmt.setString(1,value);
      stmt.setString(2,key);
      stmt.setString(3,expID);
      stmt.addBatch();
    }
    int arr[]=stmt.executeBatch();
    for (int i=0; i < arr.length; i++) {
      rs+=arr[i];
    }
    conn.commit();
  }
 catch (  SQLException e) {
    conn.rollback();
    throw e;
  }
 finally {
    conn.setAutoCommit(true);
  }
  return rs;
}
Program: 38110
Project: 38110
Buggy source:
/** 
 * Checks that bowtie created the files it should create and that the size is bigger then zero.
 * @param dir The directory where the files bowtie creates should be placed
 * @param fileName The name of the file bowtie should create.
 * @throws ProcessException
 */
private void checkBowTieFile(String dir,String fileName) throws ProcessException {
  File bowTie=new File(dir);
  if (!bowTie.exists() || bowTie.length() == 0) {
    throw new ProcessException("String_Node_Str" + fileName + bowTie.exists()+ bowTie.length());
  }
}

Fixed version (ground truth):
/** 
 * Checks that bowtie created the files it should create and that the size is bigger then zero.
 * @param dir The directory where the files bowtie creates should be placed
 * @param fileName The name of the file bowtie should create.
 * @throws ProcessException
 */
private void checkBowTieFile(String dir,String fileName) throws ProcessException {
  File bowTie=new File(dir);
  if (!bowTie.exists() || bowTie.length() == 0) {
    throw new ProcessException("String_Node_Str" + fileName + bowTie.exists()+ bowTie.length()+ "String_Node_Str"+ dir);
  }
}
Program: 38111
Project: 38111
Buggy source:
@Override public Response execute(){
  return new MinimalResponse(HttpStatusCode.METHOD_NOT_YET_IMPLEMENTED);
}

Fixed version (ground truth):
@Override public Response execute(){
  return new MinimalResponse(HttpStatusCode.NOT_IMPLEMENTED);
}
Program: 38113
Project: 38113
Buggy source:
private String formatTimeDifference(long diffMillis){
  long seconds=diffMillis / 1000;
  long minutes=seconds / 60;
  long hours=minutes / 60;
  long days=hours / 24;
  if (days > 0) {
    return new String(days + "String_Node_Str" + hours+ "String_Node_Str"+ minutes+ "String_Node_Str"+ seconds+ "String_Node_Str");
  }
  if (hours > 0) {
    return new String(hours + "String_Node_Str" + minutes+ "String_Node_Str"+ seconds+ "String_Node_Str");
  }
  if (minutes > 0) {
    return new String(minutes + "String_Node_Str" + seconds+ "String_Node_Str");
  }
  return new String(seconds + "String_Node_Str");
}

Fixed version (ground truth):
private String formatTimeDifference(long diffMillis){
  long seconds=diffMillis / 1000;
  long minutes=seconds / 60;
  long hours=minutes / 60;
  long days=hours / 24;
  if (days > 0) {
    return (days + "String_Node_Str" + hours+ "String_Node_Str"+ minutes+ "String_Node_Str"+ seconds+ "String_Node_Str");
  }
  if (hours > 0) {
    return (hours + "String_Node_Str" + minutes+ "String_Node_Str"+ seconds+ "String_Node_Str");
  }
  if (minutes > 0) {
    return (minutes + "String_Node_Str" + seconds+ "String_Node_Str");
  }
  return (seconds + "String_Node_Str");
}
Program: 38114
Project: 38114
Buggy source:
public Response execute(){
  try {
    Thread.sleep(1000);
    if (this.getUsername().equals("String_Node_Str")) {
      return new ErrorResponse(HttpStatusCode.METHOD_NOT_YET_IMPLEMENTED,"String_Node_Str");
    }
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  return new MinimalResponse(HttpStatusCode.OK);
}

Fixed version (ground truth):
public Response execute(){
  try {
    Thread.sleep(1000);
    if (this.getUsername().equals("String_Node_Str")) {
      return new ErrorResponse(HttpStatusCode.NOT_IMPLEMENTED,"String_Node_Str");
    }
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  return new MinimalResponse(HttpStatusCode.OK);
}
Program: 38116
Project: 38116
Buggy source:
@Override public void validate() throws ValidateException {
  hasRights(UserRights.getRights(this.getClass()));
  validateName(name,MaxLength.ANNOTATION_LABEL,"String_Node_Str");
  defaults="String_Node_Str";
  if (forced == null) {
    throw new ValidateException(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str");
  }
  if (type == null || type.size() < 1) {
    throw new ValidateException(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str");
  }
  for (int i=0; i < type.size(); i++) {
    validateName(type.get(i),MaxLength.ANNOTATION_VALUE,"String_Node_Str");
    if (type.get(i).equals("String_Node_Str")) {
      type.remove(i);
      i--;
    }
  }
  type.add(0,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void validate() throws ValidateException {
  hasRights(UserRights.getRights(this.getClass()));
  validateName(name,MaxLength.ANNOTATION_LABEL,"String_Node_Str");
  defaults="String_Node_Str";
  if (forced == null) {
    throw new ValidateException(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str");
  }
  if (type == null || type.size() < 1) {
    throw new ValidateException(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str");
  }
  for (int i=0; i < type.size(); i++) {
    validateName(type.get(i),MaxLength.ANNOTATION_VALUE,"String_Node_Str");
    if (type.get(i).equals("String_Node_Str")) {
      type.remove(i);
      i--;
    }
  }
  if (!(type.size() == 1 && type.get(0).equals("String_Node_Str"))) {
    type.add(0,"String_Node_Str");
  }
}
Program: 38118
Project: 38118
Buggy source:
/** 
 * Used to execute the actual password change of the user.
 */
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + username + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + username + "String_Node_Str"+ e.getMessage());
  }
  String hash=BCrypt.hashpw(password,BCrypt.gensalt());
  try {
    db.resetPassword(username,hash);
  }
 catch (  SQLException|IOException e) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + e.getMessage());
  }
  return new MinimalResponse(HttpStatusCode.OK);
}

Fixed version (ground truth):
/** 
 * Used to execute the actual password change of the user.
 */
@Override public Response execute(){
  DatabaseAccessor db;
  try {
    db=initDB();
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + username + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + username + "String_Node_Str"+ e.getMessage());
  }
  String hash=BCrypt.hashpw(password,BCrypt.gensalt());
  try {
    db.resetPassword(username,hash);
  }
 catch (  SQLException|IOException e) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + e.getMessage());
  }
  return new MinimalResponse(HttpStatusCode.OK);
}
Program: 38120
Project: 38120
Buggy source:
/** 
 * Constructs a HTTP server (but doesn't start it) which listens on the given port.
 * @throws IOException
 */
public Doorman(ProcessPool processPool,int port) throws IOException {
  Doorman.processPool=processPool;
  httpServer=HttpServer.create(new InetSocketAddress(ServerSettings.genomizerPort),0);
  createContextsAndSetExecutor(httpServer);
}

Fixed version (ground truth):
/** 
 * Constructs a HTTP server (but doesn't start it) which listens on the given port.
 * @throws IOException
 */
public Doorman(ProcessPool processPool) throws IOException {
  Doorman.processPool=processPool;
  httpServer=HttpServer.create(new InetSocketAddress(ServerSettings.genomizerPort),0);
  createContextsAndSetExecutor(httpServer);
}
Program: 38122
Project: 38122
Buggy source:
/** 
 * Creates a Json representation of the body
 * @return The response body as a String
 */
@Override public String getBody(){
  if (getProcessStatuses.size() > 0) {
    ErrorLogger.log("String_Node_Str","String_Node_Str" + "String_Node_Str");
    return "String_Node_Str";
  }
  Collections.sort(getProcessStatuses);
  Gson gson=new GsonBuilder().setPrettyPrinting().create();
  JsonArray arr=new JsonArray();
  for (  Process p : getProcessStatuses) {
    JsonElement elem=gson.toJsonTree(p,Process.class);
    arr.add(elem);
  }
  return toPrettyFormat(arr.toString());
}

Fixed version (ground truth):
/** 
 * Creates a Json representation of the body
 * @return The response body as a String
 */
@Override public String getBody(){
  if (getProcessStatuses.size() == 0) {
    ErrorLogger.log("String_Node_Str","String_Node_Str" + "String_Node_Str");
    return "String_Node_Str";
  }
  Collections.sort(getProcessStatuses);
  Gson gson=new GsonBuilder().setPrettyPrinting().create();
  JsonArray arr=new JsonArray();
  for (  Process p : getProcessStatuses) {
    JsonElement elem=gson.toJsonTree(p,Process.class);
    arr.add(elem);
  }
  return toPrettyFormat(arr.toString());
}
Program: 38123
Project: 38123
Buggy source:
@Override public void setFields(String uri,String uuid,UserType userType){
  super.setFields(uri,uuid,userType);
  username=uri.split("String_Node_Str")[2];
}

Fixed version (ground truth):
/** 
 * Set the UserType Uri and Uuid. Username also set from uri.
 * @param uri the URI from the http request.
 * @param uuid the uuid from the http request.
 * @param userType the userType
 */
@Override public void setFields(String uri,String uuid,UserType userType){
  super.setFields(uri,uuid,userType);
  username=uri.split("String_Node_Str")[2];
}
Program: 38124
Project: 38124
Buggy source:
@Override public Response execute(){
  DatabaseAccessor db;
  System.out.println("String_Node_Str" + username);
  try {
    db=initDB();
  }
 catch (  SQLException e) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str" + e.getMessage());
  }
catch (  IOException e) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,e.getMessage());
  }
  try {
    db.deleteUser(username);
  }
 catch (  SQLException e) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str" + e.getMessage());
  }
  return new MinimalResponse(HttpStatusCode.OK);
}

Fixed version (ground truth):
@Override public Response execute(){
  DatabaseAccessor db;
  try {
    db=initDB();
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + username + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + username + "String_Node_Str");
  }
  try {
    db.deleteUser(username);
  }
 catch (  SQLException e) {
    Debug.log("String_Node_Str" + username + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str");
  }
 finally {
    db.close();
  }
  return new MinimalResponse(HttpStatusCode.OK);
}
Program: 38125
Project: 38125
Buggy source:
/** 
 * Runs the command. The user gets added to the database.
 * @return a MinimalResponse or ErrorResponse
 */
@Override public Response execute(){
  DatabaseAccessor db;
  try {
    db=initDB();
  }
 catch (  SQLException e) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str" + e.getMessage());
  }
catch (  IOException e) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,e.getMessage());
  }
  try {
    String hash=BCrypt.hashpw(password,BCrypt.gensalt());
    db.addUser(username,hash,"String_Node_Str",privileges,name,email);
  }
 catch (  SQLException|IOException e) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str" + e.getMessage());
  }
  return new MinimalResponse(HttpStatusCode.CREATED);
}

Fixed version (ground truth):
/** 
 * Runs the command. The user gets added to the database.
 * @return a MinimalResponse or ErrorResponse
 */
@Override public Response execute(){
  DatabaseAccessor db;
  try {
    db=initDB();
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + username + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + username + "String_Node_Str");
  }
  try {
    String hash=BCrypt.hashpw(password,BCrypt.gensalt());
    db.addUser(username,hash,"String_Node_Str",privileges,name,email);
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + username + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + username + "String_Node_Str");
  }
 finally {
    db.close();
  }
  return new MinimalResponse(HttpStatusCode.CREATED);
}
Program: 38126
Project: 38126
Buggy source:
/** 
 * Set the UserType. Uri and Uuid not used in this command.
 * @param uri the URI from the http request.
 * @param uuid
 * @param userType
 */
@Override public void setFields(String uri,String uuid,UserMethods.UserType userType){
  this.userType=userType;
}

Fixed version (ground truth):
/** 
 * Set the UserType. Uri and Uuid not used in this command.
 * @param uri the URI from the http request.
 * @param uuid the uuid from the http request.
 * @param userType the userType
 */
@Override public void setFields(String uri,String uuid,UserMethods.UserType userType){
  this.userType=userType;
}
Program: 38127
Project: 38127
Buggy source:
/** 
 * Perform the action of the command and return a response. A connection to the database is established and the user is updated with the information given.
 * @return a response of the result of the command.
 */
@Override public Response execute(){
  DatabaseAccessor db;
  try {
    db=initDB();
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + username + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str" + e.getMessage());
  }
  try {
    String hash=BCrypt.hashpw(password,BCrypt.gensalt());
    db.updateUser(username,hash,privileges,name,email);
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + username + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str" + username + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ e.getMessage());
  }
  return new MinimalResponse(HttpStatusCode.OK);
}

Fixed version (ground truth):
/** 
 * Perform the action of the command and return a response. A connection to the database is established and the user is updated with the information given.
 * @return a response of the result of the command.
 */
@Override public Response execute(){
  DatabaseAccessor db;
  try {
    db=initDB();
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + username + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + username + "String_Node_Str");
  }
  try {
    String hash=BCrypt.hashpw(password,BCrypt.gensalt());
    db.updateUser(username,hash,privileges,name,email);
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + username + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + "String_Node_Str" + username + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  }
 finally {
    db.close();
  }
  return new MinimalResponse(HttpStatusCode.OK);
}
Program: 38128
Project: 38128
Buggy source:
/** 
 * Used to make sure the strings of the command are correct
 * @throws command.ValidateException
 */
@Override public void validate() throws ValidateException {
  validateName(username,MaxLength.USERNAME,"String_Node_Str");
  validateName(password,MaxLength.PASSWORD,"String_Node_Str");
  validateName(privileges,MaxLength.ROLE,"String_Node_Str");
  validateExists(name,MaxLength.FULLNAME,"String_Node_Str");
  validateExists(email,MaxLength.EMAIL,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Used to make sure the strings of the command are correct
 * @throws command.ValidateException
 */
@Override public void validate() throws ValidateException {
  hasRights(UserRights.getRights(this.getClass()));
  validateName(username,MaxLength.USERNAME,"String_Node_Str");
  validateName(password,MaxLength.PASSWORD,"String_Node_Str");
  validateName(privileges,MaxLength.ROLE,"String_Node_Str");
  validateExists(name,MaxLength.FULLNAME,"String_Node_Str");
  validateExists(email,MaxLength.EMAIL,"String_Node_Str");
}
Program: 38129
Project: 38129
Buggy source:
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    ArrayList<String> annotations=db.getAllAnnotationLabels();
    if (annotations.contains(name)) {
      db.deleteAnnotation(name);
      return new MinimalResponse(200);
    }
 else {
      return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + name + "String_Node_Str"+ "String_Node_Str");
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,e.getMessage());
  }
catch (  IOException e) {
    e.printStackTrace();
    return new ErrorResponse(HttpStatusCode.SERVICE_UNAVAILABLE,e.getMessage());
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
}

Fixed version (ground truth):
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    ArrayList<String> annotations=db.getAllAnnotationLabels();
    if (annotations.contains(name)) {
      db.deleteAnnotation(name);
      return new MinimalResponse(200);
    }
 else {
      return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + name + "String_Node_Str"+ "String_Node_Str");
    }
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + name + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + name + "String_Node_Str");
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
}
Program: 38130
Project: 38130
Buggy source:
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    List<String> values=db.getChoices(name);
    if (values.contains(value)) {
      db.removeDropDownAnnotationValue(name,value);
    }
 else {
      return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + value + "String_Node_Str"+ name+ "String_Node_Str"+ "String_Node_Str");
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
    return new ErrorResponse(HttpStatusCode.NO_CONTENT,e.getMessage());
  }
catch (  IOException e) {
    e.printStackTrace();
    return new ErrorResponse(HttpStatusCode.SERVICE_UNAVAILABLE,e.getMessage());
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
  return new MinimalResponse(HttpStatusCode.OK);
}

Fixed version (ground truth):
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    List<String> values=db.getChoices(name);
    if (values.contains(value)) {
      db.removeDropDownAnnotationValue(name,value);
    }
 else {
      return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + value + "String_Node_Str"+ name+ "String_Node_Str"+ "String_Node_Str");
    }
  }
 catch (  IOException|SQLException e) {
    Debug.log("String_Node_Str" + value + "String_Node_Str"+ name+ "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + value + "String_Node_Str"+ name+ "String_Node_Str");
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
  return new MinimalResponse(HttpStatusCode.OK);
}
Program: 38131
Project: 38131
Buggy source:
@Override public Response execute(){
  ArrayList<AnnotationInformation> annotations=new ArrayList<AnnotationInformation>();
  DatabaseAccessor db=null;
  Map<String,Integer> a;
  try {
    db=initDB();
    a=db.getAnnotations();
    List<String> list=new ArrayList<String>(a.keySet());
    for (    String label : list) {
      database.containers.Annotation annotationObject;
      ArrayList<String> values=new ArrayList<String>();
      annotationObject=db.getAnnotationObject(label);
      if (annotationObject.dataType == database.containers.Annotation.FREETEXT) {
        values.add("String_Node_Str");
      }
 else       if (annotationObject.dataType == database.containers.Annotation.DROPDOWN) {
        values=(ArrayList<String>)annotationObject.getPossibleValues();
      }
      AnnotationInformation annotation=new AnnotationInformation(annotationObject.label,values,annotationObject.isRequired);
      annotations.add(annotation);
    }
    return new GetAnnotationInformationResponse(HttpStatusCode.OK,annotations);
  }
 catch (  SQLException|IOException e) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + e.getMessage());
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
}

Fixed version (ground truth):
@Override public Response execute(){
  ArrayList<AnnotationInformation> annotations=new ArrayList<>();
  DatabaseAccessor db=null;
  Map<String,Integer> a;
  try {
    db=initDB();
    a=db.getAnnotations();
    List<String> list=new ArrayList<>(a.keySet());
    for (    String label : list) {
      database.containers.Annotation annotationObject;
      ArrayList<String> values=new ArrayList<>();
      annotationObject=db.getAnnotationObject(label);
      if (annotationObject.dataType == database.containers.Annotation.FREETEXT) {
        values.add("String_Node_Str");
      }
 else       if (annotationObject.dataType == database.containers.Annotation.DROPDOWN) {
        values=(ArrayList<String>)annotationObject.getPossibleValues();
      }
      AnnotationInformation annotation=new AnnotationInformation(annotationObject.label,values,annotationObject.isRequired);
      annotations.add(annotation);
    }
    return new GetAnnotationInformationResponse(HttpStatusCode.OK,annotations);
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + "String_Node_Str");
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
}
Program: 38132
Project: 38132
Buggy source:
@Override public Response execute(){
  int addedAnnotations;
  int defaultValueIndex=0;
  DatabaseAccessor db=null;
  try {
    db=initDB();
    for (int i=0; i < type.size(); i++) {
      if (type.get(i).equals(defaults)) {
        defaultValueIndex=i;
        break;
      }
    }
    if (type.size() == 1 && type.get(0).equals("String_Node_Str")) {
      addedAnnotations=db.addFreeTextAnnotation(name,defaults,forced);
    }
 else {
      addedAnnotations=db.addDropDownAnnotation(name,type,defaultValueIndex,forced);
    }
    if (addedAnnotations != 0) {
      return new AddAnnotationFieldResponse(HttpStatusCode.CREATED);
    }
 else {
      return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str");
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
    if (e.getErrorCode() == 0) {
      return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str" + name + "String_Node_Str");
    }
 else {
      return new ErrorResponse(HttpStatusCode.SERVICE_UNAVAILABLE,e.getMessage());
    }
  }
catch (  IOException e) {
    e.printStackTrace();
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,e.getMessage());
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
}

Fixed version (ground truth):
@Override public Response execute(){
  int addedAnnotations;
  int defaultValueIndex=0;
  DatabaseAccessor db=null;
  try {
    db=initDB();
    for (int i=0; i < type.size(); i++) {
      if (type.get(i).equals(defaults)) {
        defaultValueIndex=i;
        break;
      }
    }
    if (type.size() == 1 && type.get(0).equals("String_Node_Str")) {
      addedAnnotations=db.addFreeTextAnnotation(name,defaults,forced);
    }
 else {
      addedAnnotations=db.addDropDownAnnotation(name,type,defaultValueIndex,forced);
    }
    if (addedAnnotations != 0) {
      return new AddAnnotationFieldResponse(HttpStatusCode.CREATED);
    }
 else {
      return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + name + "String_Node_Str");
    }
  }
 catch (  SQLException e) {
    if (e.getErrorCode() == 0) {
      Debug.log("String_Node_Str" + name + "String_Node_Str"+ e.getMessage());
      return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str" + name + "String_Node_Str");
    }
 else {
      Debug.log("String_Node_Str" + name + "String_Node_Str"+ e.getMessage());
      return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + name + "String_Node_Str");
    }
  }
catch (  IOException e) {
    Debug.log("String_Node_Str" + name + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + "String_Node_Str" + name + "String_Node_Str");
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
}
Program: 38133
Project: 38133
Buggy source:
@Override public Response execute(){
  DatabaseAccessor db;
  String dbHash;
  try {
    db=initDB();
    dbHash=db.getPasswordHash(username);
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + username + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + username + "String_Node_Str"+ e.getMessage());
  }
  if (dbHash == null || dbHash.isEmpty()) {
    return new ErrorResponse(HttpStatusCode.UNAUTHORIZED,"String_Node_Str");
  }
  LoginAttempt login=Authenticate.login(username,password,dbHash);
  if (login.wasSuccessful()) {
    Debug.log("String_Node_Str" + username + "String_Node_Str"+ Authenticate.getID(username));
    return new LoginResponse(200,login.getUUID());
  }
  Debug.log("String_Node_Str" + username + "String_Node_Str"+ login.getErrorMessage());
  return new ErrorResponse(HttpStatusCode.UNAUTHORIZED,login.getErrorMessage());
}

Fixed version (ground truth):
@Override public Response execute(){
  DatabaseAccessor db=null;
  String dbHash;
  try {
    db=initDB();
    dbHash=db.getPasswordHash(username);
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + username + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + username + "String_Node_Str");
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
  if (dbHash == null || dbHash.isEmpty()) {
    return new ErrorResponse(HttpStatusCode.UNAUTHORIZED,"String_Node_Str");
  }
  LoginAttempt login=Authenticate.login(username,password,dbHash);
  if (login.wasSuccessful()) {
    Debug.log("String_Node_Str" + username + "String_Node_Str"+ Authenticate.getID(username));
    return new LoginResponse(200,login.getUUID());
  }
  Debug.log("String_Node_Str" + username + "String_Node_Str"+ login.getErrorMessage());
  return new ErrorResponse(HttpStatusCode.UNAUTHORIZED,login.getErrorMessage());
}
Program: 38134
Project: 38134
Buggy source:
public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    int tuples=db.deleteExperiment(expID);
    if (tuples == 0) {
      return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + expID + "String_Node_Str"+ "String_Node_Str");
    }
  }
 catch (  SQLException e) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,Integer.toString(e.getErrorCode()));
  }
catch (  IOException e) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,e.getMessage());
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
  return new MinimalResponse(HttpStatusCode.OK);
}

Fixed version (ground truth):
public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    int tuples=db.deleteExperiment(expID);
    if (tuples == 0) {
      return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + expID + "String_Node_Str"+ "String_Node_Str");
    }
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + expID + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + expID + "String_Node_Str");
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
  return new MinimalResponse(HttpStatusCode.OK);
}
Program: 38135
Project: 38135
Buggy source:
@Override public Response execute(){
  Experiment exp;
  DatabaseAccessor db;
  try {
    db=initDB();
  }
 catch (  SQLException|IOException e) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str" + e.getMessage());
  }
  try {
    exp=db.getExperiment(expID);
  }
 catch (  SQLException e) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str" + e.getMessage());
  }
  db.close();
  if (exp == null) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  return new GetExperimentResponse(HttpStatusCode.OK,getInfo(exp),exp.getAnnotations(),exp.getFiles());
}

Fixed version (ground truth):
@Override public Response execute(){
  Experiment exp;
  DatabaseAccessor db;
  try {
    db=initDB();
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + expID + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + "String_Node_Str");
  }
  try {
    exp=db.getExperiment(expID);
  }
 catch (  SQLException e) {
    Debug.log("String_Node_Str" + expID + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + "String_Node_Str" + expID + "String_Node_Str");
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
  if (exp == null) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  }
  return new GetExperimentResponse(HttpStatusCode.OK,getInfo(exp),exp.getAnnotations(),exp.getFiles());
}
Program: 38136
Project: 38136
Buggy source:
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    db.addExperiment(name);
    for (    Annotation annotation : annotations) {
      db.annotateExperiment(name,annotation.getName(),annotation.getValue());
    }
    return new MinimalResponse(HttpStatusCode.CREATED);
  }
 catch (  IOException|SQLException e) {
    e.printStackTrace();
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,e.getMessage());
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
}

Fixed version (ground truth):
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    db.addExperiment(name);
    for (    Annotation annotation : annotations) {
      db.annotateExperiment(name,annotation.getName(),annotation.getValue());
    }
    return new MinimalResponse(HttpStatusCode.CREATED);
  }
 catch (  IOException|SQLException e) {
    e.printStackTrace();
    Debug.log("String_Node_Str" + name + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + name + "String_Node_Str");
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
}
Program: 38137
Project: 38137
Buggy source:
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    try {
      if (db.deleteFile(Integer.parseInt(fileID)) == 1) {
        return new MinimalResponse(HttpStatusCode.OK);
      }
 else {
        return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + fileID + "String_Node_Str"+ "String_Node_Str");
      }
    }
 catch (    NumberFormatException e) {
      if (db.deleteFile(fileID) > 0) {
        return new MinimalResponse(HttpStatusCode.OK);
      }
 else {
        return new ErrorResponse(HttpStatusCode.BAD_REQUEST,"String_Node_Str" + fileID + "String_Node_Str"+ "String_Node_Str");
      }
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
    return new ErrorResponse(HttpStatusCode.SERVICE_UNAVAILABLE,e.getMessage());
  }
catch (  IOException e) {
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,e.getMessage());
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
}

Fixed version (ground truth):
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    try {
      if (db.deleteFile(Integer.parseInt(fileID)) == 1) {
        return new MinimalResponse(HttpStatusCode.OK);
      }
 else {
        return new ErrorResponse(HttpStatusCode.NOT_FOUND,"String_Node_Str" + fileID + "String_Node_Str"+ "String_Node_Str");
      }
    }
 catch (    NumberFormatException e) {
      if (db.deleteFile(fileID) > 0) {
        return new MinimalResponse(HttpStatusCode.OK);
      }
 else {
        return new ErrorResponse(HttpStatusCode.NOT_FOUND,"String_Node_Str" + fileID + "String_Node_Str"+ "String_Node_Str");
      }
    }
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + fileID + "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + fileID + "String_Node_Str");
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
}
Program: 38138
Project: 38138
Buggy source:
/** 
 * Adds all attributes to an ArrayList and passes that and the experimentID to the database. A file path is returned and sent to the client as an URL.
 */
@Override public Response execute(){
  DatabaseAccessor db=null;
  int fileType;
  if (type.equalsIgnoreCase("String_Node_Str")) {
    fileType=FileTuple.RAW;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    fileType=FileTuple.PROFILE;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    fileType=FileTuple.REGION;
  }
 else {
    fileType=FileTuple.OTHER;
  }
  try {
    db=initDB();
    FileTuple ft=db.addNewInProgressFile(experimentID,fileType,fileName,null,metaData,author,uploader,false,grVersion,checkSumMD5);
    return new AddFileToExperimentResponse(HttpStatusCode.OK,ft.getUploadURL());
  }
 catch (  SQLException e) {
    e.printStackTrace();
    return new ErrorResponse(HttpStatusCode.BAD_REQUEST,e.getMessage());
  }
catch (  IOException e) {
    e.printStackTrace();
    return new ErrorResponse(HttpStatusCode.SERVICE_UNAVAILABLE,e.getMessage());
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds all attributes to an ArrayList and passes that and the experimentID to the database. A file path is returned and sent to the client as an URL.
 */
@Override public Response execute(){
  DatabaseAccessor db=null;
  int fileType;
  if (type.equalsIgnoreCase("String_Node_Str")) {
    fileType=FileTuple.RAW;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    fileType=FileTuple.PROFILE;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    fileType=FileTuple.REGION;
  }
 else {
    fileType=FileTuple.OTHER;
  }
  try {
    db=initDB();
    FileTuple ft=db.addNewInProgressFile(experimentID,fileType,fileName,null,metaData,author,uploader,false,grVersion,checkSumMD5);
    return new AddFileToExperimentResponse(HttpStatusCode.OK,ft.getUploadURL());
  }
 catch (  SQLException|IOException e) {
    Debug.log("String_Node_Str" + fileName + "String_Node_Str"+ experimentID+ "String_Node_Str"+ e.getMessage());
    return new ErrorResponse(HttpStatusCode.INTERNAL_SERVER_ERROR,"String_Node_Str" + fileName + "String_Node_Str"+ experimentID+ "String_Node_Str");
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
}