nus-yam/ex-repair huggingface dataset:
Program: 98868
Project: 98868
Buggy source:
public String execute() throws Exception {
  if (bUOC.getUserInformation() != null) {
    this.rutaFile();
    this.menuTop();
    imageURL=bUOC.getUserInformation().getUserPhoto();
    if (imageURL == null)     imageURL="String_Node_Str";
    fullName=bUOC.getUserInformation().getUserFullName();
  }
 else {
    imageURL=null;
    fullName=null;
  }
  this.fileupload();
  this.crearDeliverFile();
  this.listFile();
  return SUCCESS;
}

Fixed version (ground truth):
public String execute() throws Exception {
  if (bUOC.getUserInformation() != null) {
    listSubjects=bUOC.getUserSubjects();
    if (s_assign != null && s_assign.length() > 0) {
      String[] infoAssing=s_assign.split("String_Node_Str");
      teacher=bUOC.isTeacher(new UOCSubject(infoAssing[0],infoAssing[2]));
      listClassroms=bUOC.getUserClassrooms(new UOCSubject(infoAssing[0],infoAssing[2]));
    }
    if (s_aula != null && s_aula.length() > 0 && s_assign != null) {
      String[] infoAssing=s_assign.split("String_Node_Str");
      listActivity=bUOC.getSubjectActivities(new UOCSubject(infoAssing[0],infoAssing[2]));
    }
    imageURL=bUOC.getUserInformation().getUserPhoto();
    if (imageURL == null)     imageURL="String_Node_Str";
    fullName=bUOC.getUserInformation().getUserFullName();
  }
 else {
    imageURL=null;
    fullName=null;
  }
  this.fileupload();
  this.crearDeliverFile();
  this.listFile();
  return SUCCESS;
}
Program: 98869
Project: 98869
Buggy source:
public String auth() throws Exception, OsidException {
  LocalCampusConnection _campusConnection=new LocalCampusConnection();
  _campusConnection.setProfile(username);
  bUOC.setCampusConnection(_campusConnection);
  String toReturn='r' + SUCCESS;
  if (TAB_PROGRAMMING_ENVIROMENT.equals(activeTab)) {
    toReturn='r' + TAB_PROGRAMMING_ENVIROMENT;
  }
  return toReturn;
}

Fixed version (ground truth):
public String auth() throws Exception {
  LocalCampusConnection _campusConnection=new LocalCampusConnection();
  _campusConnection.setProfile(username);
  bUOC.setCampusConnection(_campusConnection);
  String toReturn='r' + SUCCESS;
  if (TAB_PROGRAMMING_ENVIROMENT.equals(activeTab)) {
    toReturn='r' + TAB_PROGRAMMING_ENVIROMENT;
  }
  return toReturn;
}
Program: 98871
Project: 98871
Buggy source:
/** 
 * Remove all the information of inputs and outputs for private tests
 * @param results Deliver results to be modified
 */
private void removePrivateResultInformation(DeliverResults results){
  for (  TestID testID : _activityManager.getActivityTests(results.getDeliverID().activity)) {
    ActivityTest test=_activityManager.getTest(testID);
    if (!test.isPublic()) {
      results.removePrivateInformation(testID);
    }
  }
}

Fixed version (ground truth):
/** 
 * Remove all the information of inputs and outputs for private tests
 * @param results Deliver results to be modified
 */
private void removePrivateResultInformation(DeliverResults results){
  if (results != null) {
    for (    TestID testID : _activityManager.getActivityTests(results.getDeliverID().activity)) {
      ActivityTest test=_activityManager.getTest(testID);
      if (!test.isPublic()) {
        results.removePrivateInformation(testID);
      }
    }
  }
}
Program: 98872
Project: 98872
Buggy source:
@Override public List<ActivityTest> findAll(ActivityID activity){
  if (activity == null) {
    return null;
  }
  ActivityPK key=ObjectFactory.getActivityPK(activity);
  Query query=getSession().getNamedQuery("String_Node_Str");
  query.setParameter("String_Node_Str",key.getSemester());
  query.setParameter("String_Node_Str",key.getSubject());
  query.setParameter("String_Node_Str",key.getActivityIndex());
  List<edu.uoc.pelp.model.vo.ActivityTest> list=query.list();
  return getActivityTestList(list);
}

Fixed version (ground truth):
@Override public List<ActivityTest> findAll(ActivityID activity){
  if (activity == null) {
    return null;
  }
  getSession().beginTransaction();
  ActivityPK key=ObjectFactory.getActivityPK(activity);
  Query query=getSession().getNamedQuery("String_Node_Str");
  query.setParameter("String_Node_Str",key.getSemester());
  query.setParameter("String_Node_Str",key.getSubject());
  query.setParameter("String_Node_Str",key.getActivityIndex());
  List<edu.uoc.pelp.model.vo.ActivityTest> list=query.list();
  List<ActivityTest> listActivity=null;
  listActivity=getActivityTestList(list);
  getSession().close();
  return listActivity;
}
Program: 98873
Project: 98873
Buggy source:
public String auth() throws Exception {
}

Fixed version (ground truth):
public String auth() throws Exception {
  return "String_Node_Str";
}
Program: 98875
Project: 98875
Buggy source:
private void listFile(){
  try {
    if (((s_aula != null && s_aula.length() > 0) && (s_assign != null && s_assign.length() > 0) && (s_activ != null && s_activ.length() > 0)) || (finalDeliver != null && finalDeliver != true)) {
      String ruta=PelpConfiguracionBO.getSingletonConfiguration().get(PelpConfiguracionBO.TEMP_PATH);
      File directorioPracticas=new File(ruta);
      File[] ficheros=directorioPracticas.listFiles();
      if (ficheros != null && ficheros.length > 0) {
        log.info("String_Node_Str" + ficheros.length);
        fileDim=ficheros.length;
        matrizFile=new String[fileDim][5];
        for (int i=0; i < ficheros.length; i++) {
          File file=ficheros[i];
          log.info("String_Node_Str" + file.getName());
          matrizFile[i][0]=file.getName();
          matrizFile[i][1]="String_Node_Str";
          matrizFile[i][2]="String_Node_Str";
          matrizFile[i][3]="String_Node_Str";
          matrizFile[i][4]=String.valueOf(file.getName().hashCode());
        }
      }
 else {
        matrizFile=null;
        fileDim=0;
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void listFile(){
  try {
    if (((s_aula != null && s_aula.length() > 0) && (s_assign != null && s_assign.length() > 0) && (s_activ != null && s_activ.length() > 0)) || (finalDeliver != null && finalDeliver != true)) {
      String ruta=this.rutaFile();
      File directorioPracticas=new File(ruta);
      File[] ficheros=directorioPracticas.listFiles();
      if (ficheros != null && ficheros.length > 0) {
        log.info("String_Node_Str" + ficheros.length);
        fileDim=ficheros.length;
        matrizFile=new String[fileDim][5];
        for (int i=0; i < ficheros.length; i++) {
          File file=ficheros[i];
          log.info("String_Node_Str" + file.getName());
          matrizFile[i][0]=file.getName();
          matrizFile[i][1]="String_Node_Str";
          matrizFile[i][2]="String_Node_Str";
          matrizFile[i][3]="String_Node_Str";
          matrizFile[i][4]=String.valueOf(file.getName().hashCode());
        }
      }
 else {
        matrizFile=null;
        fileDim=0;
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 98876
Project: 98876
Buggy source:
public String execute() throws Exception {
  if (bUOC.getUserInformation() != null) {
    this.menuTop();
    imageURL=bUOC.getUserInformation().getUserPhoto();
    fullName=bUOC.getUserInformation().getUserFullName();
  }
 else {
    imageURL=null;
  }
  this.fileupload();
  this.crearDeliverFile();
  this.listFile();
  return SUCCESS;
}

Fixed version (ground truth):
public String execute() throws Exception {
  if (bUOC.getUserInformation() != null) {
    this.rutaFile();
    this.menuTop();
    imageURL=bUOC.getUserInformation().getUserPhoto();
    fullName=bUOC.getUserInformation().getUserFullName();
  }
 else {
    imageURL=null;
  }
  this.fileupload();
  this.crearDeliverFile();
  this.listFile();
  return SUCCESS;
}
Program: 98877
Project: 98877
Buggy source:
public void delete() throws Exception {
  if (auxInfo != null) {
    String ruta=PelpConfiguracionBO.getSingletonConfiguration().get(PelpConfiguracionBO.TEMP_PATH);
    File directorioPracticas=new File(ruta);
    File[] ficheros=directorioPracticas.listFiles();
    if (ficheros != null && ficheros.length > 0) {
      fileDim=ficheros.length;
      for (int i=0; i < ficheros.length; i++) {
        File file=ficheros[i];
        String nameFileHas=auxInfo.replaceAll("String_Node_Str","String_Node_Str");
        String nameFileFolder=String.valueOf(file.getName().hashCode()).replaceFirst("String_Node_Str","String_Node_Str");
        if (nameFileHas.equals(nameFileFolder)) {
          log.info("String_Node_Str" + file.getName() + "String_Node_Str"+ nameFileHas);
          file.delete();
        }
      }
    }
  }
}

Fixed version (ground truth):
public void delete() throws Exception {
  if (auxInfo != null) {
    String ruta=this.rutaFile();
    File directorioPracticas=new File(ruta);
    File[] ficheros=directorioPracticas.listFiles();
    if (ficheros != null && ficheros.length > 0) {
      fileDim=ficheros.length;
      for (int i=0; i < ficheros.length; i++) {
        File file=ficheros[i];
        String nameFileHas=auxInfo.replaceAll("String_Node_Str","String_Node_Str");
        String nameFileFolder=String.valueOf(file.getName().hashCode()).replaceFirst("String_Node_Str","String_Node_Str");
        if (nameFileHas.equals(nameFileFolder)) {
          log.info("String_Node_Str" + file.getName() + "String_Node_Str"+ nameFileHas);
          file.delete();
        }
      }
    }
  }
}
Program: 98878
Project: 98878
Buggy source:
private void fileupload() throws Exception {
  String ruta=PelpConfiguracionBO.getSingletonConfiguration().get(PelpConfiguracionBO.TEMP_PATH);
  if (uploads != null && !uploads.isEmpty()) {
    try {
      File destFile=new File(ruta,uploadFileNames.get(0));
      FileUtils.copyFile(uploads.get(0),destFile);
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
  this.cleanFile();
}

Fixed version (ground truth):
private void fileupload() throws Exception {
  String ruta=this.rutaFile();
  if (uploads != null && !uploads.isEmpty()) {
    try {
      File destFile=new File(ruta,uploadFileNames.get(0));
      FileUtils.copyFile(uploads.get(0),destFile);
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
  this.cleanFile();
}
Program: 98879
Project: 98879
Buggy source:
private void cleanFile(){
  try {
synchronized (this) {
      String ruta=PelpConfiguracionBO.getSingletonConfiguration().get(PelpConfiguracionBO.TEMP_PATH);
      File directorioPracticas=new File(ruta);
      File[] ficheros=directorioPracticas.listFiles();
      if (ficheros != null && ficheros.length > 0) {
        log.info("String_Node_Str" + ficheros.length);
        long tiempoActual=new Date().getTime();
        long unDiaEnMilSecs=90000000;
        int eliminados=0;
        for (int i=0; i < ficheros.length; i++) {
          File file=ficheros[i];
          if ((tiempoActual - file.lastModified()) > unDiaEnMilSecs) {
            if (!file.delete()) {
              file.deleteOnExit();
            }
            eliminados++;
          }
        }
        log.info("String_Node_Str" + eliminados);
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void cleanFile(){
  try {
synchronized (this) {
      String ruta=this.rutaFile();
      File directorioPracticas=new File(ruta);
      File[] ficheros=directorioPracticas.listFiles();
      if (ficheros != null && ficheros.length > 0) {
        log.info("String_Node_Str" + ficheros.length);
        long tiempoActual=new Date().getTime();
        long unDiaEnMilSecs=90000000;
        int eliminados=0;
        for (int i=0; i < ficheros.length; i++) {
          File file=ficheros[i];
          if ((tiempoActual - file.lastModified()) > unDiaEnMilSecs) {
            if (!file.delete()) {
              file.deleteOnExit();
            }
            eliminados++;
          }
        }
        log.info("String_Node_Str" + eliminados);
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 98880
Project: 98880
Buggy source:
@Override public String execute() throws Exception {
  if (bUOC.getUserInformation() != null) {
    listSubjects=bUOC.getUserSubjects();
    if (s_assign != null) {
      String[] infoAssing=s_assign.split("String_Node_Str");
      if (bUOC.isTeacher(new UOCSubject(infoAssing[0],infoAssing[2]))) {
        System.out.println("String_Node_Str");
      }
 else {
        System.out.println("String_Node_Str");
      }
      listClassroms=bUOC.getUserClassrooms(new UOCSubject(infoAssing[0],infoAssing[2]));
    }
    if (s_aula != null && s_aula.length() > 0 && s_assign != null) {
      String[] infoAssing=s_assign.split("String_Node_Str");
      listActivity=bUOC.getSubjectActivities(new UOCSubject(infoAssing[0],infoAssing[2]));
    }
    if (s_aula != null && s_aula.length() > 0 && s_assign != null && s_activ != null && s_activ.length() > 0) {
      Activity objActivity=new Activity();
      for (int j=0; j < listActivity.length; j++) {
        if (listActivity[j].getIndex() == Integer.parseInt(s_activ)) {
          objActivity=listActivity[j];
        }
      }
      String[] infoAssing=s_assign.split("String_Node_Str");
      listDelivers=bUOC.getUserDeliverDetails(new UOCSubject(infoAssing[0],infoAssing[2]),objActivity.getIndex());
    }
    imageURL=bUOC.getUserInformation().getUserPhoto();
    fullName=bUOC.getUserInformation().getUserFullName();
  }
 else {
    imageURL=null;
  }
  return SUCCESS;
}

Fixed version (ground truth):
@Override public String execute() throws Exception {
  if (bUOC.getUserInformation() != null) {
    listSubjects=bUOC.getUserSubjects();
    if (s_assign != null) {
      String[] infoAssing=s_assign.split("String_Node_Str");
      if (bUOC.isTeacher(new UOCSubject(infoAssing[0],infoAssing[2]))) {
        return "String_Node_Str";
      }
      listClassroms=bUOC.getUserClassrooms(new UOCSubject(infoAssing[0],infoAssing[2]));
    }
    if (s_aula != null && s_aula.length() > 0 && s_assign != null) {
      String[] infoAssing=s_assign.split("String_Node_Str");
      listActivity=bUOC.getSubjectActivities(new UOCSubject(infoAssing[0],infoAssing[2]));
    }
    if (s_aula != null && s_aula.length() > 0 && s_assign != null && s_activ != null && s_activ.length() > 0) {
      Activity objActivity=new Activity();
      for (int j=0; j < listActivity.length; j++) {
        if (listActivity[j].getIndex() == Integer.parseInt(s_activ)) {
          objActivity=listActivity[j];
        }
      }
      String[] infoAssing=s_assign.split("String_Node_Str");
      listDelivers=bUOC.getUserDeliverDetails(new UOCSubject(infoAssing[0],infoAssing[2]),objActivity.getIndex());
    }
    imageURL=bUOC.getUserInformation().getUserPhoto();
    fullName=bUOC.getUserInformation().getUserFullName();
  }
 else {
    imageURL=null;
  }
  return SUCCESS;
}
Program: 98881
Project: 98881
Buggy source:
@Override public String execute() throws Exception {
  listSubjects=bUOC.getUserSubjects();
  if (s_assign != null) {
    String[] infoAssing=s_assign.split("String_Node_Str");
    listClassroms=bUOC.getUserClassrooms(new UOCSubject(infoAssing[0],infoAssing[2]));
  }
  if (s_aula != null && s_aula.length() > 0 && s_assign != null) {
    String[] infoAssing=s_assign.split("String_Node_Str");
    listActivity=bUOC.getSubjectActivities(new UOCSubject(infoAssing[0],infoAssing[2]));
  }
  if (s_aula != null && s_aula.length() > 0 && s_assign != null && s_activ != null && s_activ.length() > 0) {
    Activity objActivity=new Activity();
    for (int j=0; j < listActivity.length; j++) {
      if (listActivity[j].getIndex() == Integer.parseInt(s_activ)) {
        objActivity=listActivity[j];
      }
    }
    String[] infoAssing=s_assign.split("String_Node_Str");
    bUOC.getLastClassroomDeliverSummary(objActivity,new UOCSubject(infoAssing[0],infoAssing[2]),objActivity.getIndex());
  }
  return SUCCESS;
}

Fixed version (ground truth):
@Override public String execute() throws Exception {
  if (bUOC.getUserInformation() != null) {
    listSubjects=bUOC.getUserSubjects();
    if (s_assign != null) {
      String[] infoAssing=s_assign.split("String_Node_Str");
      listClassroms=bUOC.getUserClassrooms(new UOCSubject(infoAssing[0],infoAssing[2]));
    }
    if (s_aula != null && s_aula.length() > 0 && s_assign != null) {
      String[] infoAssing=s_assign.split("String_Node_Str");
      listActivity=bUOC.getSubjectActivities(new UOCSubject(infoAssing[0],infoAssing[2]));
    }
    if (s_aula != null && s_aula.length() > 0 && s_assign != null && s_activ != null && s_activ.length() > 0) {
      Activity objActivity=new Activity();
      for (int j=0; j < listActivity.length; j++) {
        if (listActivity[j].getIndex() == Integer.parseInt(s_activ)) {
          objActivity=listActivity[j];
        }
      }
      String[] infoAssing=s_assign.split("String_Node_Str");
      bUOC.getLastClassroomDeliverSummary(objActivity,new UOCSubject(infoAssing[0],infoAssing[2]),objActivity.getIndex());
    }
    imageURL=bUOC.getUserInformation().getUserPhoto();
    fullName=bUOC.getUserInformation().getUserFullName();
  }
 else {
    imageURL=null;
  }
  return SUCCESS;
}
Program: 98884
Project: 98884
Buggy source:
@Override public IUserID getUserID() throws AuthPelpException {
  if (userID == null) {
    try {
      Auth authService=WsLibBO.getAuthServiceInstance();
      final SessionContext sessionContext=authService.getContextBySessionId(sesion);
      if (sessionContext == null) {
        log.error("String_Node_Str" + sesion);
        throw new Exception("String_Node_Str" + sesion);
      }
      userID=new UserID(String.valueOf(sessionContext.getIdp()));
      appId=UserUtils.getAppId(sessionContext);
      aplicacioTren=UserUtils.getAplicacioTren(appId);
      appIdTREN=UserUtils.getAplicacioTren(appId);
    }
 catch (    Exception e) {
      throw new AuthPelpException("String_Node_Str");
    }
  }
  return userID;
}

Fixed version (ground truth):
@Override public IUserID getUserID() throws AuthPelpException {
  if (userID == null) {
    try {
      Auth authService=WsLibBO.getAuthServiceInstance();
      final SessionContext sessionContext=authService.getContextBySessionId(sesion);
      if (sessionContext == null) {
        log.error("String_Node_Str" + sesion);
        throw new Exception("String_Node_Str" + sesion);
      }
      userID=new UserID(String.valueOf(sessionContext.getIdp()));
      username=sessionContext.getUserLogin();
      appId=UserUtils.getAppId(sessionContext);
      aplicacioTren=UserUtils.getAplicacioTren(appId);
      appIdTREN=UserUtils.getAplicacioTren(appId);
    }
 catch (    Exception e) {
      throw new AuthPelpException("String_Node_Str");
    }
  }
  return userID;
}
Program: 98886
Project: 98886
Buggy source:
protected edu.uoc.pelp.engine.deliver.DeliverFile getDeliverFile(DeliverFile file) throws ExecPelpException {
  if (file == null) {
    return null;
  }
  FileType type=null;
  if (file.isIsCode()) {
    type=FileType.Code;
  }
 else   if (file.isIsReport()) {
    type=FileType.Report;
  }
  if (type == null) {
    throw new ExecPelpException("String_Node_Str");
  }
  edu.uoc.pelp.engine.deliver.DeliverFile newObj=new edu.uoc.pelp.engine.deliver.DeliverFile(new File(file.getRelativePath()),type);
  newObj.setMainProperty(file.isIsMain());
  return newObj;
}

Fixed version (ground truth):
protected DeliverFile getDeliverFile(File rootPath,edu.uoc.pelp.engine.deliver.DeliverFile object){
  DeliverFile newFile=new DeliverFile(rootPath,object.getRelativePath());
  newFile.setIndex((int)object.getID().index);
switch (object.getType()) {
case Code:
    newFile.setIsCode(true);
  newFile.setIsMain(object.isMainFile());
break;
case Report:
newFile.setIsReport(true);
break;
}
return newFile;
}
Program: 98887
Project: 98887
Buggy source:
protected DeliverDetail getDeliverDetailObject(Deliver deliver,DeliverResults deliverResult) throws AuthPelpException, InvalidActivityPelpException, InvalidSubjectPelpException, ExecPelpException, InvalidEngineException {
  DeliverSummary deliverSummary=getDeliverSummaryObject(deliver,deliverResult);
  if (deliverSummary == null) {
    return null;
  }
  DeliverDetail deliverDetail=new DeliverDetail(deliverSummary);
  return deliverDetail;
}

Fixed version (ground truth):
protected DeliverDetail getDeliverDetailObject(Deliver deliver,DeliverResults deliverResult) throws AuthPelpException, InvalidActivityPelpException, InvalidSubjectPelpException, ExecPelpException, InvalidEngineException {
  DeliverSummary deliverSummary=getDeliverSummaryObject(deliver,deliverResult);
  if (deliverSummary == null) {
    return null;
  }
  DeliverDetail deliverDetail=new DeliverDetail(deliverSummary);
  edu.uoc.pelp.engine.deliver.DeliverFile[] files=deliver.getFiles();
  if (files != null) {
    deliverDetail.setDeliverFiles(getDeliverFileList(deliver.getRootPath(),files));
  }
  ActivityTestResult[] tests=deliverResult.getResults();
  if (tests != null) {
    deliverDetail.setTestResults(getTestResultList(tests));
  }
  return deliverDetail;
}
Program: 98888
Project: 98888
Buggy source:
/** 
 * Obain the test information. Only teachers can access to private tests information.
 * @param testID Identifier for the test
 * @return Object with the test information
 * @throws AuthPelpException If no user is authenticated or does not have enough rights to obtain this information.
 */
@Override public ActivityTest getTestInformation(TestID testID) throws AuthPelpException {
  if (!isUserAuthenticated()) {
    throw new AuthPelpException("String_Node_Str");
  }
  if (!isStudent(testID.activity.subjectID) && !isTeacher(testID.activity.subjectID) && !isLabTeacher(testID.activity.subjectID)) {
    throw new AuthPelpException("String_Node_Str");
  }
  ActivityTest test=_activityManager.getTest(testID);
  if (!test.isPublic() && !isTeacher(testID.activity.subjectID)) {
    test=new ActivityTest(testID);
    test.setPublic(false);
    test.setTestID(testID);
  }
  return test;
}

Fixed version (ground truth):
/** 
 * Obain the test information. Only teachers can access to private tests information.
 * @param testID Identifier for the test
 * @return Object with the test information
 * @throws AuthPelpException If no user is authenticated or does not have enough rights to obtain this information.
 */
@Override public ActivityTest getTestInformation(TestID testID) throws AuthPelpException {
  if (!isUserAuthenticated()) {
    throw new AuthPelpException("String_Node_Str");
  }
  boolean userIsTeacher=false;
  if (!isStudent(testID.activity.subjectID)) {
    userIsTeacher=true;
    if (!isTeacher(testID.activity.subjectID) && !isLabTeacher(testID.activity.subjectID)) {
      throw new AuthPelpException("String_Node_Str");
    }
  }
  ActivityTest test=_activityManager.getTest(testID);
  if (!test.isPublic() && !userIsTeacher) {
    test=new ActivityTest(testID);
    test.setPublic(false);
    test.setTestID(testID);
  }
  return test;
}
Program: 98890
Project: 98890
Buggy source:
@Test public void testCorrectWorkflow(){
  _campusConnection.setProfile("String_Node_Str");
  prepareSubject();
  _campusConnection.setProfile("String_Node_Str");
  addActivities();
  _campusConnection.setProfile("String_Node_Str");
  addDeliversStudent1();
  _campusConnection.setProfile("String_Node_Str");
  addDeliversStudent2();
  _campusConnection.setProfile("String_Node_Str");
  addDeliversStudent3();
  _campusConnection.setProfile("String_Node_Str");
  checkDelivers2();
}

Fixed version (ground truth):
@Test public void testCorrectWorkflow(){
  _campusConnection.setProfile("String_Node_Str");
  prepareSubject();
  _campusConnection.setProfile("String_Node_Str");
  addActivities();
  _campusConnection.setProfile("String_Node_Str");
  addDeliversStudent1();
  _campusConnection.setProfile("String_Node_Str");
  addDeliversStudent2();
  _campusConnection.setProfile("String_Node_Str");
  addDeliversStudent3();
  _campusConnection.setProfile("String_Node_Str");
  checkDelivers1();
  _campusConnection.setProfile("String_Node_Str");
  checkDelivers2();
}
Program: 98891
Project: 98891
Buggy source:
@Test public void testGetOtherUserInfo() throws AuthPelpException {
  Person person=_campusConnection.getUserData(new UserID("String_Node_Str"));
  Assert.assertNull(person);
}

Fixed version (ground truth):
@Test(expected=AuthPelpException.class) public void testGetOtherUserInfo() throws AuthPelpException {
  Person person=_campusConnection.getUserData(new UserID("String_Node_Str"));
}
Program: 98892
Project: 98892
Buggy source:
@Test public void testGetSubjectClassroomsStudent() throws AuthPelpException {
  Subject s=TestPeLP.getLocal(_campusConnection).getTestSubjectByPos(0);
  IClassroomID[] classrooms=_campusConnection.getSubjectClassrooms(s.getID(),UserRoles.Student);
  Assert.assertNotNull(classrooms);
  Assert.assertTrue("String_Node_Str",classrooms.length == 1);
  IClassroomID id=TestPeLP.getClassroom(s,0).getClassroomID();
  Assert.assertEquals(TestPeLP.getClassroom(s,0).getClassroomID(),classrooms[0]);
}

Fixed version (ground truth):
@Test public void testGetSubjectClassroomsStudent() throws AuthPelpException {
  Subject s=TestPeLP.getLocal(_campusConnection).getTestSubjectByPos(0);
  IClassroomID[] classrooms=_campusConnection.getSubjectClassrooms(s.getID(),UserRoles.Student);
  Assert.assertNotNull(classrooms);
  Assert.assertTrue("String_Node_Str",classrooms.length == 1);
  Assert.assertEquals(TestPeLP.getClassroom(s,1).getClassroomID(),classrooms[0]);
}
Program: 98893
Project: 98893
Buggy source:
@Test public void testAuthUserIDAccess() throws AuthPelpException {
  IUserID id=_campusConnection.getUserID();
  Assert.assertNotNull(id);
  Assert.assertEquals(((UserID)id).idp,TestPeLP.getUser(_campusConnection,3));
}

Fixed version (ground truth):
@Test public void testAuthUserIDAccess() throws AuthPelpException {
  IUserID id=_campusConnection.getUserID();
  Assert.assertNotNull(id);
  Assert.assertEquals(((UserID)id),TestPeLP.getUser(_campusConnection,3).getUserID());
}
Program: 98894
Project: 98894
Buggy source:
@Test public void testAuthStudentClassroomAccess() throws AuthPelpException {
  IClassroomID[] classroomsList=_campusConnection.getUserClassrooms(UserRoles.Student);
  Assert.assertNotNull(classroomsList);
  Assert.assertEquals("String_Node_Str",classroomsList.length == 1);
  Assert.assertEquals(TestPeLP.getClassroom(_campusConnection,0,0).getClassroomID(),classroomsList[0]);
}

Fixed version (ground truth):
@Test public void testAuthStudentClassroomAccess() throws AuthPelpException {
  IClassroomID[] classroomsList=_campusConnection.getUserClassrooms(UserRoles.Student);
  Assert.assertNotNull(classroomsList);
  Assert.assertTrue("String_Node_Str",classroomsList.length == 1);
  Assert.assertEquals(TestPeLP.getClassroom(_campusConnection,0,1).getClassroomID(),classroomsList[0]);
}
Program: 98895
Project: 98895
Buggy source:
@Test public void testAuthAllUserClassroomsAccess() throws AuthPelpException {
  IClassroomID[] classroomsList=_campusConnection.getUserClassrooms();
  Assert.assertNotNull(classroomsList);
  Assert.assertTrue("String_Node_Str",classroomsList.length == 1);
  Assert.assertEquals(TestPeLP.getClassroom(_campusConnection,0,0).getClassroomID(),classroomsList[0]);
}

Fixed version (ground truth):
@Test public void testAuthAllUserClassroomsAccess() throws AuthPelpException {
  IClassroomID[] classroomsList=_campusConnection.getUserClassrooms();
  Assert.assertNotNull(classroomsList);
  Assert.assertTrue("String_Node_Str",classroomsList.length == 1);
  Assert.assertEquals(TestPeLP.getClassroom(_campusConnection,0,1).getClassroomID(),classroomsList[0]);
}
Program: 98897
Project: 98897
Buggy source:
public Person getUserData(IUserID userID) throws AuthPelpException {
  assert(userID != null);
  if (userID.equals(getUserID())) {
    return _dummyUsers.get((UserID)userID);
  }
  if (_dummySubjects != null) {
    for (    Subject s : _dummySubjects.values()) {
      if ((isRole(UserRoles.Teacher,s.getID()) && isRole(UserRoles.Student,s.getID(),userID)) || (isRole(UserRoles.MainTeacher,s.getID()) && isRole(UserRoles.Student,s.getID(),userID)) || (isRole(UserRoles.Student,s.getID()) && isRole(UserRoles.Teacher,s.getID(),userID))|| (isRole(UserRoles.Student,s.getID()) && isRole(UserRoles.MainTeacher,s.getID(),userID))) {
        return _dummyUsers.get((UserID)userID);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public Person getUserData(IUserID userID) throws AuthPelpException {
  assert(userID != null);
  if (userID.equals(getUserID())) {
    return _dummyUsers.get((UserID)userID);
  }
  if (_dummySubjects != null) {
    for (    Subject s : _dummySubjects.values()) {
      if ((isRole(UserRoles.MainTeacher,s.getID()) && isRole(UserRoles.Student,s.getID(),userID)) || (isRole(UserRoles.Student,s.getID()) && isRole(UserRoles.MainTeacher,s.getID(),userID))) {
        return _dummyUsers.get((UserID)userID);
      }
      if ((isRole(UserRoles.Teacher,s.getID()) && isRole(UserRoles.Student,s.getID(),userID)) || (isRole(UserRoles.Student,s.getID()) && isRole(UserRoles.Teacher,s.getID(),userID))) {
        if (s.getClassrooms() != null) {
          for (          Classroom c : s.getClassrooms().values()) {
            if ((isRole(UserRoles.Teacher,c.getClassroomID()) && isRole(UserRoles.Student,c.getClassroomID(),userID)) || (isRole(UserRoles.Student,c.getClassroomID()) && isRole(UserRoles.Teacher,c.getClassroomID(),userID))) {
              return _dummyUsers.get((UserID)userID);
            }
          }
        }
      }
    }
  }
  throw new AuthPelpException("String_Node_Str");
}
Program: 98898
Project: 98898
Buggy source:
/** 
 * Warps a player.
 * @param player      the player to port.
 * @param currentPort the current port to warp from.
 * @throws WarpException thrown if the player couldn't get warped.
 */
public void teleportPlayer(Player player,TravelPort currentPort){
  TravelPort targetPort=travelPortContainer.get(currentPort.getTargetId());
  if (targetPort != null) {
    Location currentPlayer=player.getLocation();
    Location currentEdge1=currentPort.getEdge1();
    Location targetEdge1=targetPort.getEdge1();
    double playerOffsetX=currentEdge1.getX() - currentPlayer.getX();
    double playerOffsetY=currentEdge1.getY() - currentPlayer.getY();
    double playerOffsetZ=currentEdge1.getZ() - currentPlayer.getZ();
    Location targetPlayer=new Location(targetEdge1.getWorld(),targetEdge1.getX() - playerOffsetX,targetEdge1.getY() - playerOffsetY,targetEdge1.getZ() - playerOffsetZ);
    player.teleport(targetPlayer);
    playerListener.onPlayerTraveled(player,currentPort,targetPort);
  }
 else {
    String exceptionMessage=String.format("String_Node_Str",currentPort.getName(),currentPort.getId(),currentPort.getTargetId());
    throw new WarpException(exceptionMessage);
  }
}

Fixed version (ground truth):
/** 
 * Warps a player.
 * @param player      the player to port.
 * @param currentPort the current port to warp from.
 * @throws WarpException thrown if the player couldn't get warped.
 */
public void teleportPlayer(Player player,TravelPort currentPort){
  Integer targetId=currentPort.getTargetId();
  if (targetId != null) {
    TravelPort targetPort=travelPortContainer.get(targetId);
    Location currentPlayer=player.getLocation();
    Location currentEdge1=currentPort.getEdge1();
    Location targetEdge1=targetPort.getEdge1();
    double playerOffsetX=currentEdge1.getX() - currentPlayer.getX();
    double playerOffsetY=currentEdge1.getY() - currentPlayer.getY();
    double playerOffsetZ=currentEdge1.getZ() - currentPlayer.getZ();
    Location targetPlayer=new Location(targetEdge1.getWorld(),targetEdge1.getX() - playerOffsetX,targetEdge1.getY() - playerOffsetY,targetEdge1.getZ() - playerOffsetZ);
    player.teleport(targetPlayer);
    playerListener.onPlayerTraveled(player,currentPort,targetPort);
  }
 else {
    String exceptionMessage=String.format("String_Node_Str",currentPort.getName(),currentPort.getId(),currentPort.getTargetId());
    throw new WarpException(exceptionMessage);
  }
}
Program: 98899
Project: 98899
Buggy source:
/** 
 * Setups the WorldEdit client. 
 */
private void setupWorldEdit(){
  Plugin plugin=getServer().getPluginManager().getPlugin("String_Node_Str");
  if (plugin != null) {
    worldEditPlugin=(WorldEditPlugin)plugin;
  }
 else {
    logger.severe(String.format("String_Node_Str",getDescription().getName()));
    this.setEnabled(false);
  }
}

Fixed version (ground truth):
/** 
 * Setups the WorldEdit client. 
 */
private void setupWorldEdit(){
  Plugin plugin=getServer().getPluginManager().getPlugin("String_Node_Str");
  if (plugin != null) {
    worldEditPlugin=(WorldEditPlugin)plugin;
    logger.info(String.format("String_Node_Str",getDescription().getName()));
  }
 else {
    logger.severe(String.format("String_Node_Str",getDescription().getName()));
    this.setEnabled(false);
  }
}
Program: 98901
Project: 98901
Buggy source:
/** 
 * Creates a new instance of the PortCommandExecutor.
 * @param plugin the plugin which holds the instance.
 */
public PortCommandExecutor(TravelPlugin plugin){
  this.plugin=plugin;
  subCommands=new HashMap<String,SubCommandExecutor>();
  subCommands.put("String_Node_Str",new PortHelpCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortCreateCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortRemoveCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortLinkCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortUnlinkCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortDestinationCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortInfoCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortListCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortSearchCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortCompassCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortPriceCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortOwnerCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortSaveCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortReloadCommandExecutor(plugin,this));
}

Fixed version (ground truth):
/** 
 * Creates a new instance of the PortCommandExecutor.
 * @param plugin the plugin which holds the instance.
 */
public PortCommandExecutor(TravelPlugin plugin){
  this.plugin=plugin;
  subCommands=new HashMap<String,SubCommandExecutor>();
  subCommands.put("String_Node_Str",new PortHelpCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortCreateCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortRemoveCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortLinkCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortUnlinkCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortDestinationCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortInfoCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortListCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortSearchCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortCompassCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortWarpCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortPriceCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortOwnerCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortSaveCommandExecutor(plugin,this));
  subCommands.put("String_Node_Str",new PortReloadCommandExecutor(plugin,this));
}
Program: 98902
Project: 98902
Buggy source:
/** 
 * Called when the player uses the parentCommand.
 * @param sender        the sender of the command.
 * @param parentCommand the parent command.
 * @param label         the label of the parent command.
 * @param args          the arguments passed to the parentCommand. (Index 0 = the label of the sub parentCommanditself!)
 * @return true, if the SubCommandExecutor could handle the parentCommand.
 */
@Override public boolean onCommand(CommandSender sender,Command parentCommand,String label,String[] args){
  PermissionsHandler permissionsHandler=plugin.getPermissionsHandler();
  sender.sendMessage(ChatColor.GREEN + String.format("String_Node_Str",plugin.getDescription().getName(),plugin.getDescription().getVersion()));
  Collection<SubCommandExecutor> commands=((PortCommandExecutor)this.parent).getSubCommands().values();
  for (  SubCommandExecutor command : commands) {
    Permission permission=command.getRequiredPermission();
    if (permission == null || permissionsHandler.hasPermission(sender,permission)) {
      String helpLine=String.format("String_Node_Str",ChatColor.GRAY,command.getUsage().replace("String_Node_Str",label),ChatColor.WHITE,command.getDescription());
      sender.sendMessage(helpLine);
    }
  }
  sender.sendMessage("String_Node_Str");
  sender.sendMessage(ChatColor.WHITE + "String_Node_Str");
  return true;
}

Fixed version (ground truth):
/** 
 * Called when the player uses the parentCommand.
 * @param sender        the sender of the command.
 * @param parentCommand the parent command.
 * @param label         the label of the parent command.
 * @param args          the arguments passed to the parentCommand. (Index 0 = the label of the sub parentCommanditself!)
 * @return true, if the SubCommandExecutor could handle the parentCommand.
 */
@Override public boolean onCommand(CommandSender sender,Command parentCommand,String label,String[] args){
  PermissionsHandler permissionsHandler=plugin.getPermissionsHandler();
  sender.sendMessage(ChatColor.GREEN + String.format("String_Node_Str",plugin.getDescription().getName(),plugin.getDescription().getVersion()));
  Map<String,SubCommandExecutor> commandMap=((PortCommandExecutor)this.parent).getSubCommands();
  List<String> commands=new LinkedList<String>(commandMap.keySet());
  Collections.sort(commands);
  for (  String command : commands) {
    SubCommandExecutor commandExecutor=commandMap.get(command);
    Permission permission=commandExecutor.getRequiredPermission();
    if (permission == null || permissionsHandler.hasPermission(sender,permission)) {
      String helpLine=String.format("String_Node_Str",ChatColor.GRAY,commandExecutor.getUsage().replace("String_Node_Str",label),ChatColor.WHITE,commandExecutor.getDescription());
      sender.sendMessage(helpLine);
    }
  }
  sender.sendMessage("String_Node_Str");
  sender.sendMessage(ChatColor.WHITE + "String_Node_Str");
  return true;
}
Program: 98905
Project: 98905
Buggy source:
public void animObject(String animid,String objectid,String data,String delaydata,String callback){
  if (mAnimations.containsKey(animid) == false) {
    return;
  }
  LayoutItem item=mApp.objects().get(objectid);
  GameonModelRef ref=item.mModelRef;
  int[] intdata=new int[2];
  int count=ServerkoParse.parseIntArray(intdata,delaydata);
  AnimType atype=mAnimations.get(animid);
  int repeat=atype.repeat;
  int delay=atype.delay;
  if (count >= 1)   delay=intdata[0];
  if (count == 2)   repeat=intdata[1];
  buildObjectAdata(ref,atype,delay,repeat,data,callback);
}

Fixed version (ground truth):
public void animObject(String animid,String objectid,String data,String delaydata,String callback){
  if (mAnimations.containsKey(animid) == false) {
    return;
  }
  GameonModelRef ref=mApp.objects().getRef(objectid);
  int[] intdata=new int[2];
  int count=ServerkoParse.parseIntArray(intdata,delaydata);
  AnimType atype=mAnimations.get(animid);
  int repeat=atype.repeat;
  int delay=atype.delay;
  if (count >= 1)   delay=intdata[0];
  if (count == 2)   repeat=intdata[1];
  buildObjectAdata(ref,atype,delay,repeat,data,callback);
}
Program: 98906
Project: 98906
Buggy source:
public void setTextureOffset(int w,int h){
  mTextureW=w;
  mTextureH=h;
  mTextureOffset=0;
}

Fixed version (ground truth):
public void setTextureOffset(int w,int h){
  if (w > 0)   mTextureW=w;
  if (h > 0)   mTextureH=h;
  mTextureOffset=0;
}
Program: 98907
Project: 98907
Buggy source:
public boolean drawRef(GL2 gl,GameonModelRef ref,boolean initRef){
  if (!mEnabled || mIndexCount == 0) {
    return true;
  }
  if (ref.animating()) {
    ref.animate(mApp.frameDelta());
  }
  if (!ref.getVisible() || !ref.mEnabled) {
    return true;
  }
  if (initRef) {
    setupRef(gl);
  }
  if (ref.mTransformOwner) {
    if (ref.mOwner >= 0 && ref.mOwner < ref.mOwnerMax)     mTextureOffset=mTextureBuffer.capacity() * ref.mOwner / ref.mOwnerMax;
 else     System.out.println("String_Node_Str" + ref.mOwner);
  }
  mColorBuffer.position(0);
  mVertexBuffer.position(mVertexOffset);
  mTextureBuffer.position(mTextureOffset);
  mIndexBuffer.position(0);
  if (mColorBuffer.remaining() == 0) {
    System.out.println("String_Node_Str" + mName);
    return false;
  }
  gl.glVertexPointer(3,GL.GL_FLOAT,0,mVertexBuffer);
  gl.glColorPointer(4,GL.GL_UNSIGNED_BYTE,0,mColorBuffer);
  gl.glTexCoordPointer(2,GL.GL_FLOAT,0,mTextureBuffer);
  gl.glPushMatrix();
  gl.glMultMatrixf(ref.matrix(),0);
  if (mIndexCount > 0) {
    gl.glDrawElements(GL.GL_TRIANGLES,mIndexCount,GL.GL_UNSIGNED_SHORT,mIndexBuffer);
  }
  gl.glPopMatrix();
  return false;
}

Fixed version (ground truth):
public boolean drawRef(GL2 gl,GameonModelRef ref,boolean initRef){
  if (!mEnabled || mIndexCount == 0) {
    return true;
  }
  if (ref.animating()) {
    ref.animate(mApp.frameDelta());
  }
  if (!ref.getVisible() || !ref.mEnabled) {
    return true;
  }
  if (initRef) {
    setupRef(gl);
  }
  if (ref.mTransformOwner) {
    if (ref.mOwner >= 0 && ref.mOwner < ref.mOwnerMax)     mTextureOffset=mTextureBuffer.capacity() * ref.mOwner / ref.mOwnerMax;
 else     System.out.println("String_Node_Str" + ref.mOwner);
  }
 else {
    mTextureOffset=0;
  }
  mColorBuffer.position(0);
  mVertexBuffer.position(mVertexOffset);
  mTextureBuffer.position(mTextureOffset);
  mIndexBuffer.position(0);
  if (mColorBuffer.remaining() == 0) {
    System.out.println("String_Node_Str" + mName);
    return false;
  }
  gl.glVertexPointer(3,GL.GL_FLOAT,0,mVertexBuffer);
  gl.glColorPointer(4,GL.GL_UNSIGNED_BYTE,0,mColorBuffer);
  gl.glTexCoordPointer(2,GL.GL_FLOAT,0,mTextureBuffer);
  gl.glPushMatrix();
  gl.glMultMatrixf(ref.matrix(),0);
  if (mIndexCount > 0) {
    gl.glDrawElements(GL.GL_TRIANGLES,mIndexCount,GL.GL_UNSIGNED_SHORT,mIndexBuffer);
  }
  gl.glPopMatrix();
  return false;
}
Program: 98909
Project: 98909
Buggy source:
public void createAnimTrans(String type,int delay,boolean away,int no){
  GameonModelRef to=new GameonModelRef(null,-1);
  to.copy(mRefs.get(no));
  to.copyMat(mRefs.get(no));
  GameonModelRef from=new GameonModelRef(null,-1);
  from.copy(to);
  float w, h, x, y;
  RenderDomain domain=mApp.world().getDomain(to.loc());
  w=domain.mCS.worldWidth();
  h=domain.mCS.worldHeight();
  x=domain.mCS.worldCenterX();
  y=domain.mCS.worldCenterY();
  if (type.equals("String_Node_Str")) {
    from.addAreaPosition(-w,0,0);
  }
 else   if (type.equals("String_Node_Str")) {
    from.addAreaPosition(w,0,0);
  }
 else   if (type.equals("String_Node_Str")) {
    from.addAreaPosition(0,+h,0);
  }
 else   if (type.equals("String_Node_Str")) {
    from.addAreaPosition(0,+h + h,0);
  }
 else   if (type.equals("String_Node_Str")) {
    from.addAreaPosition(0,-h,0);
  }
 else   if (type.equals("String_Node_Str")) {
    from.mulScale(30,30,30);
  }
 else   if (type.equals("String_Node_Str")) {
    from.mulScale(30,30,30);
  }
 else   if (type.equals("String_Node_Str")) {
    from.mulScale(30,30,30);
    from.addAreaRotation(0,0,720);
  }
 else   if (type.equals("String_Node_Str")) {
    from.mulScale(30,30,30);
    from.addAreaRotation(0,0,720);
  }
  if (away) {
    mApp.anims().createAnim(to,from,mRefs.get(no),delay,2,null,1,true,false);
  }
 else {
    mApp.anims().createAnim(from,to,mRefs.get(no),delay,2,null,1,false,false);
  }
}

Fixed version (ground truth):
public void createAnimTrans(String type,int delay,boolean away,int no){
  GameonModelRef to=new GameonModelRef(null,-1);
  to.copy(mRefs.get(no));
  to.copyMat(mRefs.get(no));
  GameonModelRef from=new GameonModelRef(null,-1);
  from.copy(to);
  float w, h, x, y;
  RenderDomain domain=mApp.world().getDomain(to.loc());
  w=domain.mCS.worldWidth();
  h=domain.mCS.worldHeight();
  x=domain.mCS.worldCenterX();
  y=domain.mCS.worldCenterY();
  if (type.equals("String_Node_Str")) {
    from.addAreaPosition(-w,0,0);
  }
 else   if (type.equals("String_Node_Str")) {
    from.addAreaPosition(w,0,0);
  }
 else   if (type.equals("String_Node_Str")) {
    from.addAreaPosition(0,+h,0);
  }
 else   if (type.equals("String_Node_Str")) {
    from.addAreaPosition(0,+h + h,0);
  }
 else   if (type.equals("String_Node_Str")) {
    from.addAreaPosition(0,-h,0);
  }
 else   if (type.equals("String_Node_Str")) {
    from.mulScale(30,30,30);
  }
 else   if (type.equals("String_Node_Str")) {
    from.mulScale(30,30,30);
  }
 else   if (type.equals("String_Node_Str")) {
    from.mulScale(30,30,30);
    from.addAreaRotation(0,0,720);
  }
 else   if (type.equals("String_Node_Str")) {
    from.mulScale(30,30,30);
    from.addAreaRotation(0,0,720);
  }
  if (away) {
    mApp.anims().createAnim(to,from,mRefs.get(no),delay,2,null,1,true,true);
  }
 else {
    mApp.anims().createAnim(from,to,mRefs.get(no),delay,2,null,1,false,true);
  }
}
Program: 98910
Project: 98910
Buggy source:
public static Connection getConnection(){
  if (conn == null)   conn=initialize();
  return conn;
}

Fixed version (ground truth):
public static Connection getConnection(){
  if (conn == null)   conn=initialize();
  if (WarpSettings.usemySQL) {
    try {
      if (!conn.isValid(10))       conn=initialize();
    }
 catch (    SQLException ex) {
      WarpLogger.severe("String_Node_Str",ex);
    }
  }
  return conn;
}
Program: 98911
Project: 98911
Buggy source:
public static void closeConnection(){
  if (conn != null) {
    try {
      conn.close();
      conn=null;
    }
 catch (    SQLException ex) {
      WarpLogger.severe("String_Node_Str",ex);
    }
  }
}

Fixed version (ground truth):
public static void closeConnection(){
  if (conn != null) {
    try {
      if (WarpSettings.usemySQL) {
        if (conn.isValid(10)) {
          conn.close();
        }
        conn=null;
      }
 else {
        conn.close();
        conn=null;
      }
    }
 catch (    SQLException ex) {
      WarpLogger.severe("String_Node_Str",ex);
    }
  }
}
Program: 98912
Project: 98912
Buggy source:
public MatchList getMatches(String name,Player player){
  ArrayList<Warp> exactMatches=new ArrayList<Warp>();
  ArrayList<Warp> matches=new ArrayList<Warp>();
  List<String> names=new ArrayList<String>(warpList.keySet());
  Collator collator=Collator.getInstance();
  collator.setStrength(Collator.SECONDARY);
  Collections.sort(names,collator);
  for (int i=0; i < names.size(); i++) {
    String currName=names.get(i);
    Warp warp=warpList.get(currName);
    if (warp.playerCanWarp(player)) {
      if (warp.name.equalsIgnoreCase(name)) {
        exactMatches.add(warp);
      }
 else       if (warp.name.toLowerCase().contains(name.toLowerCase())) {
        matches.add(warp);
      }
    }
  }
  if (exactMatches.size() > 1) {
    for (    Warp warp : exactMatches) {
      if (!warp.name.equals(name)) {
        exactMatches.remove(warp);
        matches.add(0,warp);
      }
    }
  }
  return new MatchList(exactMatches,matches);
}

Fixed version (ground truth):
public MatchList getMatches(String name,Player player){
  ArrayList<Warp> exactMatches=new ArrayList<Warp>();
  ArrayList<Warp> matches=new ArrayList<Warp>();
  List<String> names=new ArrayList<String>(warpList.keySet());
  Collator collator=Collator.getInstance();
  collator.setStrength(Collator.SECONDARY);
  Collections.sort(names,collator);
  for (int i=0; i < names.size(); i++) {
    String currName=names.get(i);
    Warp warp=warpList.get(currName);
    if (warp.playerCanWarp(player)) {
      if (warp.name.equalsIgnoreCase(name)) {
        exactMatches.add(warp);
      }
 else       if (warp.name.toLowerCase().contains(name.toLowerCase())) {
        matches.add(warp);
      }
    }
  }
  if (exactMatches.size() > 1) {
    for (int i=0; i < exactMatches.size(); i++) {
      Warp warp=exactMatches.get(i);
      if (!warp.name.equals(name)) {
        exactMatches.remove(warp);
        matches.add(0,warp);
        i--;
      }
    }
  }
  return new MatchList(exactMatches,matches);
}
Program: 98914
Project: 98914
Buggy source:
public void onDisable(){
}

Fixed version (ground truth):
public void onDisable(){
  ConnectionManager.freeConnection();
}