nus-yam/ex-repair huggingface dataset:
Program: 38172
Project: 38172
Buggy source:
@Test public void shouldValidateToTrue(){
  String username="String_Node_Str";
  String expid="String_Node_Str";
  String processtype="String_Node_Str";
  String parameters="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String metadata="String_Node_Str";
  String genomeRelease="String_Node_Str";
  String author="String_Node_Str";
  CommandFactory cmdf=new CommandFactory();
  String json="String_Node_Str" + "String_Node_Str" + expid + "String_Node_Str"+ "String_Node_Str"+ processtype+ "String_Node_Str"+ "String_Node_Str"+ parameters+ "String_Node_Str"+ "String_Node_Str"+ metadata+ "String_Node_Str"+ "String_Node_Str"+ genomeRelease+ "String_Node_Str"+ "String_Node_Str"+ author+ "String_Node_Str";
  ProcessCommand processCommand=(ProcessCommand)cmdf.createProcessCommand(json,username);
  assertTrue(processCommand.validate());
}

Fixed version (ground truth):
@Test public void shouldValidateToTrue(){
  String username="String_Node_Str";
  String expid="String_Node_Str";
  String processtype="String_Node_Str";
  String parameters="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String metadata="String_Node_Str";
  String genomeRelease="String_Node_Str";
  String author="String_Node_Str";
  CommandFactory cmdf=new CommandFactory();
  String json="String_Node_Str" + "String_Node_Str" + expid + "String_Node_Str"+ "String_Node_Str"+ processtype+ "String_Node_Str"+ "String_Node_Str"+ parameters+ "String_Node_Str"+ "String_Node_Str"+ metadata+ "String_Node_Str"+ "String_Node_Str"+ genomeRelease+ "String_Node_Str"+ "String_Node_Str"+ author+ "String_Node_Str";
  ProcessCommand processCommand=(ProcessCommand)cmdf.createProcessCommand(json,username,"String_Node_Str");
  assertTrue(processCommand.validate());
}
Program: 38173
Project: 38173
Buggy source:
@Test public void shouldValidateFalseWithoutExpid(){
  String username="String_Node_Str";
  String expid="String_Node_Str";
  String processtype="String_Node_Str";
  String parameters="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String metadata="String_Node_Str";
  String genomeRelease="String_Node_Str";
  String author="String_Node_Str";
  CommandFactory cmdf=new CommandFactory();
  String json="String_Node_Str" + "String_Node_Str" + processtype + "String_Node_Str"+ "String_Node_Str"+ parameters+ "String_Node_Str"+ "String_Node_Str"+ metadata+ "String_Node_Str"+ "String_Node_Str"+ genomeRelease+ "String_Node_Str"+ "String_Node_Str"+ author+ "String_Node_Str";
  ProcessCommand processCommand=(ProcessCommand)cmdf.createProcessCommand(json,username);
  assertFalse(processCommand.validate());
}

Fixed version (ground truth):
@Test public void shouldValidateFalseWithoutExpid(){
  String username="String_Node_Str";
  String expid="String_Node_Str";
  String processtype="String_Node_Str";
  String parameters="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String metadata="String_Node_Str";
  String genomeRelease="String_Node_Str";
  String author="String_Node_Str";
  CommandFactory cmdf=new CommandFactory();
  String json="String_Node_Str" + "String_Node_Str" + processtype + "String_Node_Str"+ "String_Node_Str"+ parameters+ "String_Node_Str"+ "String_Node_Str"+ metadata+ "String_Node_Str"+ "String_Node_Str"+ genomeRelease+ "String_Node_Str"+ "String_Node_Str"+ author+ "String_Node_Str";
  ProcessCommand processCommand=(ProcessCommand)cmdf.createProcessCommand(json,username,"String_Node_Str");
  assertFalse(processCommand.validate());
}
Program: 38174
Project: 38174
Buggy source:
/** 
 * Adds all attributes to an arraylist and pass that and the experimentID to the database. A filepath is returned and sent to the client as a 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.addNewFile(experimentID,filetype,fileName,"String_Node_Str",metaData,author,uploader,isPrivate,grVersion);
    return new AddFileToExperimentResponse(StatusCode.OK,ft.getUploadURL());
  }
 catch (  SQLException e) {
    e.printStackTrace();
    return new ErrorResponse(StatusCode.BAD_REQUEST,e.getMessage());
  }
catch (  IOException e) {
    e.printStackTrace();
    return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,e.getMessage());
  }
 finally {
    db.close();
  }
}

Fixed version (ground truth):
/** 
 * Adds all attributes to an arraylist and pass that and the experimentID to the database. A filepath is returned and sent to the client as a 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.addNewFile(experimentID,filetype,fileName,null,metaData,author,uploader,isPrivate,grVersion);
    return new AddFileToExperimentResponse(StatusCode.OK,ft.getUploadURL());
  }
 catch (  SQLException e) {
    e.printStackTrace();
    return new ErrorResponse(StatusCode.BAD_REQUEST,e.getMessage());
  }
catch (  IOException e) {
    e.printStackTrace();
    return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,e.getMessage());
  }
 finally {
    db.close();
  }
}
Program: 38175
Project: 38175
Buggy source:
public void setFilePaths(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    filepaths=db.processRawToProfile(expid);
  }
 catch (  SQLException|IOException e) {
    e.printStackTrace();
  }
 finally {
    db.close();
  }
}

Fixed version (ground truth):
public void setFilePaths() throws SQLException, IOException {
  DatabaseAccessor db=null;
  db=initDB();
  filepaths=db.processRawToProfile(expid);
  if (db.isConnected()) {
    db.close();
  }
}
Program: 38176
Project: 38176
Buggy source:
@Override public void run(){
  Debug.log(Thread.currentThread().getName());
  while (true) {
    if (!workQueue.isEmpty()) {
      ProcessCommand work=workQueue.poll();
      Debug.log("String_Node_Str");
      ProcessStatus stat=processStatus.get(work);
      stat.status="String_Node_Str";
      work.setFilePaths();
      stat.outputFiles=work.getFilePaths();
      stat.timeStarted=System.currentTimeMillis();
      try {
        Response resp=work.execute();
        Debug.log("String_Node_Str");
        if (resp.getCode() == StatusCode.CREATED) {
          stat.status="String_Node_Str";
        }
 else {
          stat.status="String_Node_Str";
        }
      }
 catch (      NullPointerException e) {
        stat.status="String_Node_Str";
      }
      stat.timeFinished=System.currentTimeMillis();
      ResponseLogger.printLog();
    }
 else {
      try {
        Thread.sleep(1000);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  Debug.log(Thread.currentThread().getName());
  while (true) {
    if (!workQueue.isEmpty()) {
      ProcessCommand work=workQueue.poll();
      Debug.log("String_Node_Str");
      ProcessStatus stat=processStatus.get(work);
      stat.status="String_Node_Str";
      try {
        work.setFilePaths();
      }
 catch (      SQLException|IOException e) {
        Debug.log(e.getMessage());
        ResponseLogger.log(stat.author,e.getMessage());
        stat.status="String_Node_Str";
        continue;
      }
      stat.outputFiles=work.getFilePaths();
      stat.timeStarted=System.currentTimeMillis();
      try {
        Response resp=work.execute();
        Debug.log("String_Node_Str");
        if (resp.getCode() == StatusCode.CREATED) {
          stat.status="String_Node_Str";
        }
 else {
          stat.status="String_Node_Str";
        }
      }
 catch (      NullPointerException e) {
        stat.status="String_Node_Str";
      }
      stat.timeFinished=System.currentTimeMillis();
    }
 else {
      try {
        Thread.sleep(1000);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
        Debug.log("String_Node_Str");
        ResponseLogger.log("String_Node_Str","String_Node_Str");
      }
    }
  }
}
Program: 38177
Project: 38177
Buggy source:
/** 
 * Method used to execute the command and add the annotation field.
 */
@Override public Response execute(){
  int addedAnnotations=0;
  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(StatusCode.CREATED);
    }
 else {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
    if (e.getErrorCode() == 0) {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + name + "String_Node_Str");
    }
 else {
      return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str");
    }
  }
catch (  IOException e) {
    e.printStackTrace();
    return new MinimalResponse(StatusCode.BAD_REQUEST);
  }
 finally {
    db.close();
  }
}

Fixed version (ground truth):
/** 
 * Method used to execute the command and add the annotation field.
 */
@Override public Response execute(){
  int addedAnnotations=0;
  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(StatusCode.CREATED);
    }
 else {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
    if (e.getErrorCode() == 0) {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + name + "String_Node_Str");
    }
 else {
      return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str");
    }
  }
catch (  IOException e) {
    e.printStackTrace();
    return new ErrorResponse(StatusCode.BAD_REQUEST,e.getMessage());
  }
 finally {
    db.close();
  }
}
Program: 38178
Project: 38178
Buggy source:
@Override public Response execute(){
  ArrayList<AnnotationInformation> annotations=new ArrayList<AnnotationInformation>();
  DatabaseAccessor db=null;
  Map<String,Integer> a=null;
  try {
    db=initDB();
    a=db.getAnnotations();
    List<String> list=new ArrayList<String>(a.keySet());
    System.out.println("String_Node_Str" + list.toString());
    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++) {
      database.containers.Annotation annotationObject=null;
      ArrayList<String> values=new ArrayList<String>();
      annotationObject=db.getAnnotationObject(annotation_names.get(i));
      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);
    }
    db.close();
    return new GetAnnotationInformationResponse(StatusCode.OK,annotations);
  }
 catch (  SQLException|IOException e) {
    return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
@Override public Response execute(){
  ArrayList<AnnotationInformation> annotations=new ArrayList<AnnotationInformation>();
  DatabaseAccessor db=null;
  Map<String,Integer> a=null;
  try {
    db=initDB();
    a=db.getAnnotations();
    List<String> list=new ArrayList<String>(a.keySet());
    Iterator<String> keys=a.keySet().iterator();
    ArrayList<String> annotation_names=new ArrayList<String>();
    while (keys.hasNext()) {
      annotation_names.add(keys.next());
    }
    for (    String label : list) {
      database.containers.Annotation annotationObject=null;
      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);
    }
    db.close();
    return new GetAnnotationInformationResponse(StatusCode.OK,annotations);
  }
 catch (  SQLException|IOException e) {
    return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + e.getMessage());
  }
}
Program: 38179
Project: 38179
Buggy source:
public static void main(String args[]) throws Exception {
  Login.login("String_Node_Str","String_Node_Str");
  GenomeRelease.sendGetGenomeRelease();
  Login.logout();
}

Fixed version (ground truth):
public static void main(String args[]) throws Exception {
  Login.login("String_Node_Str","String_Node_Str");
  Login.logout();
}
Program: 38180
Project: 38180
Buggy source:
public boolean validateRatioCalculation(String string) throws ProcessException {
  String[] ratio=parse(string);
  String firstParam=ratio[0];
  float[] ratioFloat=new float[2];
  int[] ratioInt=new int[2];
  for (int i=0; i < ratio.length - 1; i++) {
    try {
      ratioFloat[i]=Float.parseFloat(ratio[i + 1]);
    }
 catch (    NumberFormatException e) {
      throw new ProcessException("String_Node_Str" + (i + 1) + "String_Node_Str");
    }
  }
  for (int i=0; i < ratioFloat.length; i++) {
    if (ratioFloat[i] % 1 == 0) {
      ratioInt[i]=(int)ratioFloat[i];
    }
 else {
      throw new ProcessException("String_Node_Str" + (i + 1) + "String_Node_Str");
    }
    if (ratioFloat[i] < 0) {
      throw new ProcessException("String_Node_Str" + i + 1+ "String_Node_Str");
    }
  }
  if ((!firstParam.equals("String_Node_Str")) && (!firstParam.equals("String_Node_Str"))) {
    throw new ProcessException("String_Node_Str");
  }
  return true;
}

Fixed version (ground truth):
public boolean validateRatioCalculation(String string) throws ProcessException {
  String[] ratio=parse(string);
  System.out.println("String_Node_Str" + ratio.length);
  String firstParam=ratio[0];
  float[] ratioFloat=new float[2];
  int[] ratioInt=new int[2];
  for (int i=0; i < ratio.length - 1; i++) {
    try {
      ratioFloat[i]=Float.parseFloat(ratio[i + 1]);
    }
 catch (    NumberFormatException e) {
      throw new ProcessException("String_Node_Str" + (i + 1) + "String_Node_Str");
    }
  }
  for (int i=0; i < ratioFloat.length; i++) {
    if (ratioFloat[i] % 1 == 0) {
      ratioInt[i]=(int)ratioFloat[i];
    }
 else {
      throw new ProcessException("String_Node_Str" + (i + 1) + "String_Node_Str");
    }
    if (ratioFloat[i] < 0) {
      throw new ProcessException("String_Node_Str" + i + 1+ "String_Node_Str");
    }
  }
  if ((!firstParam.equals("String_Node_Str")) && (!firstParam.equals("String_Node_Str"))) {
    throw new ProcessException("String_Node_Str");
  }
  return true;
}
Program: 38181
Project: 38181
Buggy source:
private boolean ValidateParameters(String[] parameters) throws ProcessException {
  boolean isOk=true;
  if (!validator.validateSmoothing(parameters[4])) {
    isOk=false;
  }
 else   if (!validator.validateStep(parameters[5])) {
    isOk=false;
  }
 else   if (!validator.validateRatioCalculation(parameters[6])) {
    isOk=false;
  }
 else   if (!validator.validateSmoothing(parameters[7])) {
    isOk=false;
  }
  return isOk;
}

Fixed version (ground truth):
private boolean ValidateParameters(String[] parameters) throws ProcessException {
  boolean isOk=true;
  if (checker.shouldRunSmoothing() && !validator.validateSmoothing(parameters[4])) {
    isOk=false;
  }
  if (checker.shouldRunStep() && !validator.validateStep(parameters[5])) {
    isOk=false;
  }
  if (checker.shouldRunRatioCalc() && !validator.validateRatioCalculation(parameters[6])) {
    isOk=false;
  }
  if (checker.shouldRunRatioCalc() && !validator.validateSmoothing(parameters[7])) {
    isOk=false;
  }
  return isOk;
}
Program: 38184
Project: 38184
Buggy source:
private void isValidArgument(String arg) throws IOException {
  if (arg.contentEquals("String_Node_Str") || arg == null) {
    throw new IOException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void isValidArgument(String arg) throws IOException {
  if (arg == null || arg.contentEquals("String_Node_Str")) {
    throw new IOException("String_Node_Str");
  }
}
Program: 38185
Project: 38185
Buggy source:
public String toString(){
  if ((newSignal == Math.floor(newSignal))) {
    return chromosome + "String_Node_Str" + position+ "String_Node_Str"+ (int)newSignal+ "String_Node_Str";
  }
 else {
    return chromosome + "String_Node_Str" + position+ "String_Node_Str"+ ((double)Math.round(newSignal * 100000) / 100000)+ "String_Node_Str";
  }
}

Fixed version (ground truth):
public String toString(){
  if (chromosome == null) {
    return "String_Node_Str";
  }
  if ((newSignal == Math.floor(newSignal))) {
    return chromosome + "String_Node_Str" + position+ "String_Node_Str"+ (int)newSignal+ "String_Node_Str";
  }
 else {
    return chromosome + "String_Node_Str" + position+ "String_Node_Str"+ ((double)Math.round(newSignal * 100000) / 100000)+ "String_Node_Str";
  }
}
Program: 38186
Project: 38186
Buggy source:
public Tuple(String strLine) throws NumberFormatException {
  String[] tokens=strLine.split("String_Node_Str");
  chromosome=tokens[0];
  position=Integer.parseInt(tokens[1]);
  signal=Double.parseDouble(tokens[2]);
  newSignal=signal;
}

Fixed version (ground truth):
public Tuple(String strLine) throws NumberFormatException {
  String[] tokens=strLine.split("String_Node_Str");
  if (tokens.length == 3) {
    chromosome=tokens[0];
    position=Integer.parseInt(tokens[1]);
    signal=Double.parseDouble(tokens[2]);
    newSignal=signal;
  }
}
Program: 38187
Project: 38187
Buggy source:
/** 
 * method used to execute the actual command.
 */
@Override public Response execute(){
  Response rsp=null;
  DatabaseAccessor db=null;
  try {
    db=initDB();
    boolean result=db.removeGenomeRelease(genomeVersion);
    if (result) {
      rsp=new DeleteGenomeReleaseResponse(StatusCode.OK);
    }
 else {
      rsp=new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
    }
  }
 catch (  SQLException e) {
    return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
  }
catch (  IOException e) {
    return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
  }
 finally {
    try {
      if (db.isConnected()) {
        db.close();
      }
    }
 catch (    SQLException e) {
      return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str");
    }
  }
  return rsp;
}

Fixed version (ground truth):
/** 
 * method used to execute the actual command.
 */
@Override public Response execute(){
  Response rsp=null;
  DatabaseAccessor db=null;
  try {
    db=initDB();
    boolean result=db.removeGenomeRelease(genomeVersion);
    if (result) {
      rsp=new DeleteGenomeReleaseResponse(StatusCode.OK);
    }
 else {
      rsp=new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
    }
  }
 catch (  SQLException e) {
    return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
  }
catch (  IOException e) {
    return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
  }
 finally {
    if (db.isConnected()) {
      db.close();
    }
  }
  return rsp;
}
Program: 38188
Project: 38188
Buggy source:
/** 
 * method used to execute the actual command.
 */
@Override public Response execute(){
  Response rsp=null;
  DatabaseAccessor db=null;
  try {
    db=initDB();
    String filePath=db.addGenomeRelease(genomeVersion,specie,fileName);
    rsp=new AddGenomeReleaseResponse(StatusCode.CREATED,filePath);
  }
 catch (  SQLException e) {
    if (e.getErrorCode() == 0) {
      rsp=new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
    }
 else {
      rsp=new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str");
    }
  }
catch (  IOException e) {
    rsp=new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
  }
 finally {
    try {
      if (db.isConnected()) {
        db.close();
      }
    }
 catch (    SQLException e) {
      rsp=new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str");
    }
  }
  return rsp;
}

Fixed version (ground truth):
/** 
 * method used to execute the actual command.
 */
@Override public Response execute(){
  Response rsp=null;
  DatabaseAccessor db=null;
  try {
    db=initDB();
    String filePath=db.addGenomeRelease(genomeVersion,specie,fileName);
    rsp=new AddGenomeReleaseResponse(StatusCode.CREATED,filePath);
  }
 catch (  SQLException e) {
    if (e.getErrorCode() == 0) {
      rsp=new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
    }
 else {
      rsp=new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str");
    }
  }
catch (  IOException e) {
    rsp=new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
  }
 finally {
    if (db.isConnected()) {
      db.close();
    }
  }
  return rsp;
}
Program: 38189
Project: 38189
Buggy source:
@Override public void run(){
  System.out.println(Thread.currentThread().getName());
  while (true) {
    try {
      Thread.sleep(1000);
    }
 catch (    InterruptedException e1) {
      e1.printStackTrace();
    }
    if (!workQueue.isEmpty()) {
      ProcessCommand work=workQueue.poll();
      System.out.println("String_Node_Str");
      ProcessStatus stat=processStatus.get(work);
      try {
        stat.status="String_Node_Str";
        work.setFilePaths();
        stat.outputFiles=work.getFilePaths();
        stat.timeStarted=System.currentTimeMillis();
        Response resp=work.execute();
        System.err.println("String_Node_Str");
        if (resp.getCode() == StatusCode.CREATED) {
          stat.status="String_Node_Str";
        }
 else {
          stat.status="String_Node_Str";
        }
        stat.timeFinished=System.currentTimeMillis();
      }
 catch (      NullPointerException e) {
        e.printStackTrace();
      }
      ResponseLogger.printLog();
    }
 else {
      try {
        Thread.sleep(500);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  System.out.println(Thread.currentThread().getName());
  while (true) {
    try {
      Thread.sleep(1000);
    }
 catch (    InterruptedException e1) {
      e1.printStackTrace();
    }
    if (!workQueue.isEmpty()) {
      ProcessCommand work=workQueue.poll();
      System.out.println("String_Node_Str");
      ProcessStatus stat=processStatus.get(work);
      stat.status="String_Node_Str";
      work.setFilePaths();
      stat.outputFiles=work.getFilePaths();
      stat.timeStarted=System.currentTimeMillis();
      try {
        Response resp=work.execute();
        System.err.println("String_Node_Str");
        if (resp.getCode() == StatusCode.CREATED) {
          stat.status="String_Node_Str";
        }
 else {
          stat.status="String_Node_Str";
        }
      }
 catch (      NullPointerException e) {
        stat.status="String_Node_Str";
      }
      stat.timeFinished=System.currentTimeMillis();
      ResponseLogger.printLog();
    }
 else {
      try {
        Thread.sleep(500);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
}
Program: 38190
Project: 38190
Buggy source:
/** 
 * Changes the label of annotation oldName to newName. All database entries will be affected by the change. Will return a bad request response if either parameter is invalid, and an OK response if the modification succeeded.
 */
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    Map<String,Integer> anno=db.getAnnotations();
    if (!anno.containsKey(oldName)) {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + oldName + "String_Node_Str");
    }
 else     if (anno.containsKey(newName)) {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + newName + "String_Node_Str");
    }
    db.changeAnnotationLabel(oldName,newName);
  }
 catch (  IOException|SQLException e) {
    return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,e.getMessage());
  }
 finally {
    try {
      db.close();
    }
 catch (    SQLException e) {
      return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,e.getMessage());
    }
  }
  return new MinimalResponse(StatusCode.OK);
}

Fixed version (ground truth):
/** 
 * Changes the label of annotation oldName to newName. All database entries will be affected by the change. Will return a bad request response if either parameter is invalid, and an OK response if the modification succeeded.
 */
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
  }
 catch (  SQLException|IOException e) {
    return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + e.getMessage());
  }
  try {
    Map<String,Integer> anno=db.getAnnotations();
    if (!anno.containsKey(oldName)) {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + oldName + "String_Node_Str");
    }
 else     if (anno.containsKey(newName)) {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + newName + "String_Node_Str");
    }
    try {
      db.changeAnnotationLabel(oldName,newName);
    }
 catch (    IOException|SQLException e) {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + e.getMessage());
    }
  }
 catch (  SQLException e) {
    return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + e.getMessage());
  }
 finally {
    db.close();
  }
  return new MinimalResponse(StatusCode.OK);
}
Program: 38192
Project: 38192
Buggy source:
@Override public Response execute(){
  Experiment exp;
  DatabaseAccessor db=null;
  try {
    db=initDB();
    exp=db.getExperiment(header);
  }
 catch (  SQLException|IOException e) {
    return new ErrorResponse(StatusCode.BAD_REQUEST,e.getMessage());
  }
 finally {
    try {
      db.close();
    }
 catch (    SQLException e) {
      e.printStackTrace();
      return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str");
    }
  }
  if (exp == null) {
    return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
  }
  return new GetExperimentResponse(getInfo(exp),exp.getAnnotations(),exp.getFiles(),StatusCode.OK);
}

Fixed version (ground truth):
@Override public Response execute(){
  Experiment exp;
  DatabaseAccessor db=null;
  try {
    db=initDB();
  }
 catch (  SQLException|IOException e) {
    return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + e.getMessage());
  }
  try {
    exp=db.getExperiment(header);
  }
 catch (  SQLException e) {
    return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + e.getMessage());
  }
  db.close();
  if (exp == null) {
    return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
  }
  return new GetExperimentResponse(StatusCode.OK,getInfo(exp),exp.getAnnotations(),exp.getFiles());
}
Program: 38193
Project: 38193
Buggy source:
/** 
 * Connects to the database, retrieves all the genomeReleases and creates a response depending on the database return value.
 * @return Object of the response class depending on result.
 */
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=new DatabaseAccessor(DatabaseSettings.username,DatabaseSettings.password,DatabaseSettings.host,DatabaseSettings.database);
    ArrayList<Genome> genomeReleases=db.getAllGenomReleases();
    return new GetGenomeReleaseRespons(StatusCode.OK,genomeReleases);
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    try {
      db.close();
    }
 catch (    SQLException e) {
      e.printStackTrace();
    }
  }
  return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Connects to the database, retrieves all the genomeReleases and creates a response depending on the database return value.
 * @return Object of the response class depending on result.
 */
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=new DatabaseAccessor(DatabaseSettings.username,DatabaseSettings.password,DatabaseSettings.host,DatabaseSettings.database);
    try {
      ArrayList<Genome> genomeReleases=(ArrayList<Genome>)db.getAllGenomReleases();
      return new GetGenomeReleaseRespons(StatusCode.OK,genomeReleases);
    }
 catch (    SQLException e) {
      return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str" + e.getMessage());
    }
  }
 catch (  SQLException e) {
    return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str" + e.getMessage());
  }
catch (  IOException e) {
    return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str" + e.getMessage());
  }
 finally {
    db.close();
  }
}
Program: 38194
Project: 38194
Buggy source:
/** 
 * Connects to the database, retrieves all the genomeReleases for a specific species from the db and creates a response depending on the return value from the database If the species asked for doesn't exist in the database, a bad request respons is returned
 */
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=new DatabaseAccessor(DatabaseSettings.username,DatabaseSettings.password,DatabaseSettings.host,DatabaseSettings.database);
    if (db.getChoices("String_Node_Str").contains(species)) {
      ArrayList<Genome> genomeReleases=db.getAllGenomReleasesForSpecies(species);
      return new GetGenomeReleaseRespons(StatusCode.OK,genomeReleases);
    }
 else {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
 finally {
    try {
      db.close();
    }
 catch (    SQLException e) {
      e.printStackTrace();
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Connects to the database, retrieves all the genomeReleases for a specific species from the db and creates a response depending on the return value from the database If the species asked for doesn't exist in the database, a bad request respons is returned
 */
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=new DatabaseAccessor(DatabaseSettings.username,DatabaseSettings.password,DatabaseSettings.host,DatabaseSettings.database);
    try {
      if (db.getChoices("String_Node_Str").contains(species)) {
        ArrayList<Genome> genomeReleases=db.getAllGenomReleasesForSpecies(species);
        return new GetGenomeReleaseRespons(StatusCode.OK,genomeReleases);
      }
 else {
        return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
      }
    }
 catch (    SQLException e) {
      return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str" + e.getMessage());
    }
  }
 catch (  SQLException e) {
    return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str" + e.getMessage());
  }
catch (  IOException e) {
    return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str");
  }
 finally {
    db.close();
  }
}
Program: 38195
Project: 38195
Buggy source:
public void setFilePaths(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    filepaths=db.processRawToProfile(expid);
  }
 catch (  SQLException|IOException e) {
    e.printStackTrace();
  }
 finally {
    try {
      db.close();
    }
 catch (    SQLException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void setFilePaths(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    filepaths=db.processRawToProfile(expid);
  }
 catch (  SQLException|IOException e) {
    e.printStackTrace();
  }
 finally {
    db.close();
  }
}
Program: 38197
Project: 38197
Buggy source:
/** 
 * Runs the actual code needed to search the database.
 */
@Override public Response execute(){
  DatabaseAccessor db=null;
  List<Experiment> searchResult=null;
  System.out.println(annotations);
  if (annotations.equals("String_Node_Str")) {
    return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
  }
  try {
    annotations=URLDecoder.decode(annotations,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
    return new ErrorResponse(StatusCode.BAD_REQUEST,e.getMessage());
  }
  try {
    db=initDB();
    searchResult=db.search(annotations);
  }
 catch (  SQLException|IOException e) {
    return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,e.getMessage());
  }
 finally {
    try {
      db.close();
    }
 catch (    SQLException e) {
      e.printStackTrace();
      return new MinimalResponse(StatusCode.SERVICE_UNAVAILABLE);
    }
  }
  SearchResponse response=new SearchResponse(searchResult);
  return response;
}

Fixed version (ground truth):
/** 
 * Runs the actual code needed to search the database.
 */
@Override public Response execute(){
  DatabaseAccessor db=null;
  List<Experiment> searchResult=null;
  System.out.println(annotations);
  if (annotations.equals("String_Node_Str")) {
    return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
  }
  try {
    annotations=URLDecoder.decode(annotations,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
    return new ErrorResponse(StatusCode.BAD_REQUEST,e.getMessage());
  }
  try {
    db=initDB();
    searchResult=db.search(annotations);
  }
 catch (  SQLException|IOException e) {
    return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,e.getMessage());
  }
catch (  ParseException e) {
    return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,e.getMessage());
  }
 finally {
    db.close();
  }
  SearchResponse response=new SearchResponse(searchResult);
  return response;
}
Program: 38198
Project: 38198
Buggy source:
public GetExperimentResponse(ArrayList<String> info,Map<String,String> annotations,List<FileTuple> list,int code){
  this.code=code;
  obj=new JsonObject();
  obj.addProperty("String_Node_Str",info.get(0));
  obj.addProperty("String_Node_Str","String_Node_Str");
  JsonArray fileArray=new JsonArray();
  for (  FileTuple ft : list) {
    GsonBuilder gsonBuilder=new GsonBuilder();
    Gson gson=gsonBuilder.setPrettyPrinting().create();
    FileInformation fileInfo=new FileInformation(ft);
    JsonElement fileJson=gson.toJsonTree(fileInfo);
    fileArray.add(fileJson);
  }
  obj.add("String_Node_Str",fileArray);
  JsonArray annotationArray=new JsonArray();
  for (  String key : annotations.keySet()) {
    JsonObject anno=new JsonObject();
    anno.addProperty("String_Node_Str",key);
    anno.addProperty("String_Node_Str",annotations.get(key));
    annotationArray.add(anno);
  }
  obj.add("String_Node_Str",annotationArray);
}

Fixed version (ground truth):
public GetExperimentResponse(int code,ArrayList<String> info,Map<String,String> annotations,List<FileTuple> list){
  this.code=code;
  obj=new JsonObject();
  obj.addProperty("String_Node_Str",info.get(0));
  obj.addProperty("String_Node_Str","String_Node_Str");
  JsonArray fileArray=new JsonArray();
  for (  FileTuple ft : list) {
    GsonBuilder gsonBuilder=new GsonBuilder();
    Gson gson=gsonBuilder.setPrettyPrinting().create();
    FileInformation fileInfo=new FileInformation(ft);
    JsonElement fileJson=gson.toJsonTree(fileInfo);
    fileArray.add(fileJson);
  }
  obj.add("String_Node_Str",fileArray);
  JsonArray annotationArray=new JsonArray();
  for (  String key : annotations.keySet()) {
    JsonObject anno=new JsonObject();
    anno.addProperty("String_Node_Str",key);
    anno.addProperty("String_Node_Str",annotations.get(key));
    annotationArray.add(anno);
  }
  obj.add("String_Node_Str",annotationArray);
}
Program: 38199
Project: 38199
Buggy source:
private void validateInput(int[] params,int stepSize) throws ProcessException {
  if (!(params[1] == 0 || params[1] == 1)) {
    throw new ProcessException("String_Node_Str");
  }
  if (params == null) {
    throw new ProcessException("String_Node_Str");
  }
  if (params[0] <= params[2]) {
    throw new ProcessException("String_Node_Str");
  }
  if (stepSize < 1) {
    throw new ProcessException("String_Node_Str");
  }
  if (params[0] < 1) {
    throw new ProcessException("String_Node_Str");
  }
  if (params[2] < 0) {
    throw new ProcessException("String_Node_Str");
  }
  if (!(params[3] == 0 || params[1] == 1)) {
    throw new ProcessException("String_Node_Str");
  }
  if (!(params[4] == 0 || params[1] == 1)) {
    throw new ProcessException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void validateInput(int[] params,int stepSize) throws ProcessException {
  if (!(params[1] == 0 || params[1] == 1)) {
    throw new ProcessException("String_Node_Str");
  }
  if (params == null) {
    throw new ProcessException("String_Node_Str");
  }
  if (params[0] <= params[2]) {
    throw new ProcessException("String_Node_Str");
  }
  if (stepSize < 1) {
    throw new ProcessException("String_Node_Str");
  }
  if (params[0] < 1) {
    throw new ProcessException("String_Node_Str");
  }
  if (params[2] < 0) {
    throw new ProcessException("String_Node_Str");
  }
  if (!(params[3] == 0 || params[3] == 1)) {
    throw new ProcessException("String_Node_Str");
  }
  if (!(params[4] == 0 || params[4] == 1)) {
    throw new ProcessException("String_Node_Str");
  }
}
Program: 38200
Project: 38200
Buggy source:
/** 
 * Used to execute the logout command.
 */
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    ArrayList<String> annotations=db.getAllAnnotationLabels();
    if (annotations.contains(header)) {
      db.deleteAnnotation(header);
      return new MinimalResponse(200);
    }
 else {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + header + "String_Node_Str");
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
    return new ErrorResponse(StatusCode.BAD_REQUEST,e.getMessage());
  }
catch (  IOException e) {
    e.printStackTrace();
    return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,e.getMessage());
  }
 finally {
    try {
      db.close();
    }
 catch (    SQLException e) {
      e.printStackTrace();
      return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Used to execute the logout command.
 */
@Override public Response execute(){
  DatabaseAccessor db=null;
  try {
    db=initDB();
    ArrayList<String> annotations=db.getAllAnnotationLabels();
    if (annotations.contains(header)) {
      db.deleteAnnotation(header);
      return new MinimalResponse(200);
    }
 else {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + header + "String_Node_Str");
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
    return new ErrorResponse(StatusCode.BAD_REQUEST,e.getMessage());
  }
catch (  IOException e) {
    e.printStackTrace();
    return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,e.getMessage());
  }
 finally {
    db.close();
  }
}
Program: 38201
Project: 38201
Buggy source:
private void validateInput(int[] params,int stepSize) throws ProcessException {
  if (!(params[1] == 0 || params[1] == 1)) {
    throw new ProcessException("String_Node_Str");
  }
  if (params == null) {
    throw new ProcessException("String_Node_Str");
  }
  if (params[0] <= params[2]) {
    throw new ProcessException("String_Node_Str");
  }
  if (stepSize < 1) {
    throw new ProcessException("String_Node_Str");
  }
  if (params[0] < 1) {
    throw new ProcessException("String_Node_Str");
  }
  if (params[2] < 0) {
    throw new ProcessException("String_Node_Str");
  }
  if (!(params[3] == 0 || params[1] == 1)) {
    throw new ProcessException("String_Node_Str");
  }
  if (!(params[4] == 0 || params[1] == 1)) {
    throw new ProcessException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void validateInput(int[] params,int stepSize) throws ProcessException {
  if (!(params[1] == 0 || params[1] == 1)) {
    throw new ProcessException("String_Node_Str");
  }
  if (params == null) {
    throw new ProcessException("String_Node_Str");
  }
  if (params[0] <= params[2]) {
    throw new ProcessException("String_Node_Str");
  }
  if (stepSize < 1) {
    throw new ProcessException("String_Node_Str");
  }
  if (params[0] < 1) {
    throw new ProcessException("String_Node_Str");
  }
  if (params[2] < 0) {
    throw new ProcessException("String_Node_Str");
  }
  if (!(params[3] == 0 || params[3] == 1)) {
    throw new ProcessException("String_Node_Str");
  }
  if (!(params[4] == 0 || params[4] == 1)) {
    throw new ProcessException("String_Node_Str");
  }
}
Program: 38202
Project: 38202
Buggy source:
/** 
 * Method used to execute the command and add the annotation field.
 */
@Override public Response execute(){
  int addedAnnotations=0;
  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(StatusCode.CREATED);
    }
 else {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
    if (e.getErrorCode() == 0) {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + name + "String_Node_Str");
    }
 else {
      return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str");
    }
  }
catch (  IOException e) {
    e.printStackTrace();
    return new MinimalResponse(StatusCode.BAD_REQUEST);
  }
 finally {
    try {
      db.close();
    }
 catch (    SQLException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * Method used to execute the command and add the annotation field.
 */
@Override public Response execute(){
  int addedAnnotations=0;
  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(StatusCode.CREATED);
    }
 else {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str");
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
    if (e.getErrorCode() == 0) {
      return new ErrorResponse(StatusCode.BAD_REQUEST,"String_Node_Str" + name + "String_Node_Str");
    }
 else {
      return new ErrorResponse(StatusCode.SERVICE_UNAVAILABLE,"String_Node_Str");
    }
  }
catch (  IOException e) {
    e.printStackTrace();
    return new MinimalResponse(StatusCode.BAD_REQUEST);
  }
 finally {
    db.close();
  }
}
Program: 38203
Project: 38203
Buggy source:
private String moveNegatedConstraint(String s,StringBuilder sb) throws IOException {
  SimpleEntry<String,String> labelValue=getLabelValuePair(s);
  String label=labelValue.getKey();
  String value=labelValue.getValue();
  if (fileAttributes.contains(label)) {
    sb.append(sqlFragmentForFileAttr);
    sb.append(label);
    sb.append("String_Node_Str");
    parametersResult.add(value);
  }
 else {
    sb.append(sqlFragmentForExpAttrInFileSearchNegated);
    parametersResult.add(label);
    parametersResult.add(value);
  }
  return removeLeadingConstraint(s);
}

Fixed version (ground truth):
private String moveNegatedConstraint(String s,StringBuilder sb) throws IOException {
  SimpleEntry<String,String> labelValue=getLabelValuePair(s);
  String label=labelValue.getKey();
  String value=labelValue.getValue();
  if (fileAttributes.contains(label.toLowerCase())) {
    sb.append(sqlFragmentForFileAttr);
    sb.append(label);
    sb.append("String_Node_Str");
    parametersResult.add(value);
  }
 else {
    sb.append(sqlFragmentForExpAttrInFileSearchNegated);
    parametersResult.add(label);
    parametersResult.add(value);
  }
  return removeLeadingConstraint(s);
}
Program: 38204
Project: 38204
Buggy source:
public boolean hasFileConstraint(String pubMedString){
  while (pubMedString.indexOf('[') != -1) {
    pubMedString=pubMedString.substring(pubMedString.indexOf('[') + 1);
    String label=pubMedString.substring(0,pubMedString.indexOf(']'));
    if (fileAttributes.contains(label)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean hasFileConstraint(String pubMedString){
  while (pubMedString.indexOf('[') != -1) {
    pubMedString=pubMedString.substring(pubMedString.indexOf('[') + 1);
    String label=pubMedString.substring(0,pubMedString.indexOf(']'));
    if (fileAttributes.contains(label.toLowerCase())) {
      return true;
    }
  }
  return false;
}
Program: 38205
Project: 38205
Buggy source:
private String moveConstraint(String s,StringBuilder sb) throws IOException {
  SimpleEntry<String,String> labelValue=getLabelValuePair(s);
  String label=labelValue.getKey();
  String value=labelValue.getValue();
  if (fileAttributes.contains(label)) {
    sb.append(sqlFragmentForFileAttr);
    sb.append(label);
    sb.append("String_Node_Str");
    parametersResult.add(value);
  }
 else {
    sb.append(sqlFragmentForExpAttrInFileSearch);
    parametersResult.add(label);
    parametersResult.add(value);
  }
  return removeLeadingConstraint(s);
}

Fixed version (ground truth):
private String moveConstraint(String s,StringBuilder sb) throws IOException {
  SimpleEntry<String,String> labelValue=getLabelValuePair(s);
  String label=labelValue.getKey();
  String value=labelValue.getValue();
  if (fileAttributes.contains(label.toLowerCase())) {
    sb.append(sqlFragmentForFileAttr);
    sb.append(label);
    sb.append("String_Node_Str");
    parametersResult.add(value);
  }
 else {
    sb.append(sqlFragmentForExpAttrInFileSearch);
    parametersResult.add(label);
    parametersResult.add(value);
  }
  return removeLeadingConstraint(s);
}