nus-yam/ex-repair huggingface dataset:
Program: 6439
Project: 6439
Buggy source:
public int findRasterHorizontal(int x){
  int xCT=x / RASTER_HORIZONTAL_WIDTH;
  int xRaster1=(xCT * RASTER_HORIZONTAL_WIDTH) + (RASTER_HORIZONTAL_WIDTH / 2) - RASTER_HORIZONTAL_WIDTH + (xGlobalOffset % RASTER_HORIZONTAL_WIDTH);
  int xRaster2=((xCT + 1) * RASTER_HORIZONTAL_WIDTH) + (RASTER_HORIZONTAL_WIDTH / 2) - RASTER_HORIZONTAL_WIDTH + (xGlobalOffset % RASTER_HORIZONTAL_WIDTH);
  if (Math.abs(x - xRaster1) < Math.abs(x - xRaster2))   return xRaster1;
 else   return xRaster2;
}

Fixed version (ground truth):
public int findRasterHorizontal(int x){
  ArrayList<Integer> gridLines=createRasterLines();
  for (int i=0; i < gridLines.size() - 1; i++) {
    if (x > gridLines.get(i) && x < gridLines.get(i + 1)) {
      if ((x - gridLines.get(i)) < (gridLines.get(i + 1) - x)) {
        return gridLines.get(i);
      }
 else {
        return gridLines.get(i + 1);
      }
    }
  }
  return -111;
}
Program: 6440
Project: 6440
Buggy source:
/** 
 * Converts an .ics dateTime string into a QDateTime object The format of the input dateTimeString is yyyyMMddThhmmss, where yyyy denotes the year, MM the month, dd the day, 'T' a delimiter, hh the hour, mm the minutes, ss the seconds. Failing to pass the dateTimeString in this format will result in undesirable DateTime Objects or a @throws IndexOutOfBoundsException may be thrown in case the dateTimeString is too short. <p> Example dateTimeString: 20110221T124714Z <p> Date: 20110221 (2010-02-21) Time: 124714 (12:47:14)
 * @param dateTimeString string containing a date and a time.
 * @return QDateTime Instance (a Qt DateTime Object, which Combines QDateand QTime).
 */
static QDateTime stringToQDateTime(final String dateTimeString){
  String[] dateTime=splitTimeDateString(dateTimeString);
  int year=new Integer(dateTime[0].substring(0,4));
  int month=new Integer(dateTime[0].substring(4,6));
  int day=new Integer(dateTime[0].substring(6,8));
  int hours=new Integer(dateTime[1].substring(0,2));
  int minutes=new Integer(dateTime[1].substring(2,4));
  int seconds=new Integer(dateTime[1].substring(4,6));
  return new QDateTime(new QDate(year,month,day),new QTime(hours,minutes,seconds));
}

Fixed version (ground truth):
/** 
 * Converts an .ics dateTime string into a QDateTime object The format of the input dateTimeString is yyyyMMddThhmmss, where yyyy denotes the year, MM the month, dd the day, 'T' a delimiter, hh the hour, mm the minutes, ss the seconds. Failing to pass the dateTimeString in this format will result in undesirable DateTime Objects or a @throws IndexOutOfBoundsException may be thrown in case the dateTimeString is too short. <p> Example dateTimeString: 20110221T124714Z <p> Date: 20110221 (2010-02-21) Time: 124714 (12:47:14)
 * @param dateTimeString string containing a date and a time.
 * @return QDateTime Instance (a Qt DateTime Object, which Combines QDateand QTime).
 */
static QDateTime stringToQDateTime(final String dateTimeString){
  return QDateTime.fromString(dateTimeString.replace("String_Node_Str","String_Node_Str"),"String_Node_Str");
}
Program: 6441
Project: 6441
Buggy source:
private void assertCalendarValidity(final ArrayList<WorkSession> testCalendar,final int noOfValidEntries){
  for (int i=0; i < noOfValidEntries; i++) {
    assertEquals(calendar.get(i).getDescription(),testCalendar.get(i).getDescription());
  }
  for (int i=0; i < noOfValidEntries; i++) {
    assertEquals(calendar.get(i).getStart(),testCalendar.get(i).getStart());
  }
  for (int i=0; i < noOfValidEntries; i++) {
    assertEquals(calendar.get(i).getEnd(),testCalendar.get(i).getEnd());
  }
  assertEquals(noOfValidEntries,testCalendar.size());
}

Fixed version (ground truth):
private void assertCalendarValidity(final ArrayList<WorkSession> testCalendar,final int noOfValidEntries){
  for (int i=0; i < noOfValidEntries; i++) {
    assertEquals(calendar.get(i).getDescription(),testCalendar.get(i).getDescription());
  }
  for (int i=0; i < noOfValidEntries; i++) {
    assertEquals(calendar.get(i).getStart(),testCalendar.get(i).getStart());
  }
  for (int i=0; i < noOfValidEntries; i++) {
    assertEquals(calendar.get(i).getEnd(),testCalendar.get(i).getEnd());
  }
}
Program: 6443
Project: 6443
Buggy source:
public static double getPlannedTime(Usr user,QDate fromDate,QDate toDate){
  return fromDate.daysTo(toDate) * getNumberOfWorkdays(user,fromDate,toDate) * HOURS_PER_WORKDAY;
}

Fixed version (ground truth):
public static double getPlannedTime(Usr user,QDate fromDate,QDate toDate){
  return getNumberOfWorkdays(user,fromDate,toDate) * HOURS_PER_WORKDAY * user.getPensum() / 100;
}
Program: 6444
Project: 6444
Buggy source:
public static double getPlannedTime(Usr user,QDate fromDate,QDate toDate){
  return getNumberOfWorkdays(user,fromDate,toDate) * HOURS_PER_WORKDAY * user.getPensum() / 100;
}

Fixed version (ground truth):
public static double getPlannedTime(Usr user,QDate fromDate,QDate toDate){
  return roundToTenth(getNumberOfWorkdays(user,fromDate,toDate) * HOURS_PER_WORKDAY);
}
Program: 6445
Project: 6445
Buggy source:
public static double calculateWorktime(Usr usr,Project project,WorkPackage workPackage,QDate start,QDate end) throws WaktuException {
  double worktime=0;
  List<WorkSession> workSessions=null;
  if (project != null && usr == null && workPackage == null) {
    workSessions=WorkSessionController.getInstance().getWorkSessions(project);
  }
 else   if (project != null && usr != null && workPackage == null) {
    workSessions=WorkSessionController.getInstance().getWorkSessions(project,usr);
  }
 else   if (project == null && usr != null && workPackage == null) {
    workSessions=WorkSessionController.getInstance().getWorkSessions(usr);
  }
 else   if (usr == null && workPackage != null) {
    workSessions=WorkSessionController.getInstance().getWorkSessions(workPackage);
  }
 else   if (usr != null && workPackage != null) {
    workSessions=WorkSessionController.getInstance().getWorkSessions(workPackage,usr);
  }
  try {
    for (    WorkSession ws : workSessions) {
      if ((start == null || start.compareTo(TimeUtil.convertGregorianToQDateTime(ws.getStart()).date()) <= 0) && (end == null || end.compareTo(TimeUtil.convertGregorianToQDateTime(ws.getEnd()).date()) >= 0)) {
        worktime+=TimeUtil.calculateTimespanInSeconds(ws.getStart(),ws.getEnd());
      }
    }
  }
 catch (  NullPointerException e) {
    return 0;
  }
  return roundToTenth(worktime / 3600);
}

Fixed version (ground truth):
public static double calculateWorktime(Usr usr,Project project,WorkPackage workPackage,QDate start,QDate end) throws WaktuException {
  double worktime=0;
  List<WorkSession> workSessions=null;
  if (project != null && usr == null && workPackage == null) {
    workSessions=WorkSessionController.getInstance().getWorkSessions(project);
  }
 else   if (project != null && usr != null && workPackage == null) {
    workSessions=WorkSessionController.getInstance().getWorkSessions(project,usr);
  }
 else   if (project == null && usr != null && workPackage == null) {
    workSessions=WorkSessionController.getInstance().getWorkSessions(usr);
  }
 else   if (usr == null && workPackage != null) {
    workSessions=WorkSessionController.getInstance().getWorkSessions(workPackage);
  }
 else   if (usr != null && workPackage != null) {
    workSessions=WorkSessionController.getInstance().getWorkSessions(workPackage,usr);
  }
  if (workSessions == null) {
    return worktime;
  }
  try {
    for (    WorkSession ws : workSessions) {
      if ((start == null || start.compareTo(TimeUtil.convertGregorianToQDateTime(ws.getStart()).date()) <= 0) && (end == null || end.compareTo(TimeUtil.convertGregorianToQDateTime(ws.getEnd()).date()) >= 0)) {
        worktime+=TimeUtil.calculateTimespanInSeconds(ws.getStart(),ws.getEnd());
      }
    }
  }
 catch (  NullPointerException e) {
    return 0;
  }
  return roundToTenth(worktime / 3600);
}
Program: 6446
Project: 6446
Buggy source:
private void saveProject(){
  project.setDescription(ui.lblDescription.text());
  project.setPlannedTime(ui.txtPlannedTime.value());
  project.setProjectManager((Usr)ui.cmbProjectManager.itemData(ui.cmbProjectManager.currentIndex()));
  project.setActiveState(!ui.checkBox.isChecked());
  try {
    ProjectController.getInstance().updateProject(project);
  }
 catch (  WaktuException e) {
    errorMessage.emit(e.getMessage());
  }
}

Fixed version (ground truth):
private void saveProject(){
  project.setDescription(ui.txtDescription.text());
  project.setPlannedTime(ui.txtPlannedTime.value());
  project.setProjectManager((Usr)ui.cmbProjectManager.itemData(ui.cmbProjectManager.currentIndex()));
  project.setActiveState(!ui.checkBox.isChecked());
  try {
    ProjectController.getInstance().updateProject(project);
  }
 catch (  WaktuException e) {
    errorMessage.emit(e.getMessage());
  }
}
Program: 6447
Project: 6447
Buggy source:
@SuppressWarnings("String_Node_Str") public List<WorkSession> getWorkSessions(Project project) throws WaktuException {
  EntityManager em=PersistenceController.getInstance().getEMF().createEntityManager();
  List<WorkSession> workSessionsByProject;
  if (!PermissionController.checkPermission()) {
    throw new WaktuException("String_Node_Str");
  }
  try {
    workSessionsByProject=em.createQuery("String_Node_Str" + project.getId() + "String_Node_Str").getResultList();
  }
 catch (  IllegalStateException e) {
    throw new WaktuException("String_Node_Str");
  }
catch (  IllegalArgumentException e) {
    throw new WaktuException("String_Node_Str");
  }
catch (  Exception e) {
    throw new WaktuException("String_Node_Str");
  }
 finally {
    em.close();
  }
  return workSessionsByProject;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public List<WorkSession> getWorkSessions(Project project) throws WaktuException {
  EntityManager em=PersistenceController.getInstance().getEMF().createEntityManager();
  List<WorkSession> workSessionsByProject=null;
  if (!PermissionController.checkPermission()) {
    throw new WaktuException("String_Node_Str");
  }
  try {
    workSessionsByProject=em.createQuery("String_Node_Str" + project.getId() + "String_Node_Str").getResultList();
  }
 catch (  IllegalStateException e) {
    logger.error(e.getMessage());
    throw new WaktuException("String_Node_Str");
  }
catch (  IllegalArgumentException e) {
    logger.error(e.getMessage());
    throw new WaktuException("String_Node_Str");
  }
catch (  Exception e) {
    logger.error(e.getMessage());
    throw new WaktuException("String_Node_Str");
  }
 finally {
    em.close();
  }
  return workSessionsByProject;
}
Program: 6448
Project: 6448
Buggy source:
public static QDate[] getWeekBoundaries(QDate date){
  QDate[] startDayEndDay={new QDate(date.year(),date.month(),getFirstDayOfWeek(date)),new QDate(date.year(),date.month(),getFirstDayOfWeek(date) + 6)};
  return startDayEndDay;
}

Fixed version (ground truth):
public static QDate[] getWeekBoundaries(QDate date){
  QDate[] startDayEndDay={new QDate(date.year(),getFirstDayOfWeek(date).month(),getFirstDayOfWeek(date).day()),new QDate(date.year(),getLastDayOfWeek(date).month(),getLastDayOfWeek(date).day())};
  return startDayEndDay;
}
Program: 6449
Project: 6449
Buggy source:
static int getFirstDayOfWeek(QDate date){
  QDate adjustedDate=date.clone();
  return adjustedDate.addDays(-date.dayOfWeek() + 1).day();
}

Fixed version (ground truth):
static QDate getFirstDayOfWeek(QDate date){
  QDate firstDay=date.clone();
  return firstDay.addDays(-date.dayOfWeek() + 1);
}
Program: 6450
Project: 6450
Buggy source:
@Test public void parseIcsFile_invalidTimeDelimiter_onlyValidEventsProcessed() throws WaktuException {
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarValidity(testCalendar,2);
}

Fixed version (ground truth):
@Test public void parseIcsFile_invalidTimeDelimiter_onlyValidEventsProcessed() throws WaktuException {
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  assertCalendarValidity(testCalendar,2);
}
Program: 6451
Project: 6451
Buggy source:
@Test public void parseIcsFile_summaryMissing_onlyValidEventsProcessed() throws WaktuException {
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarValidity(testCalendar,2);
}

Fixed version (ground truth):
@Test public void parseIcsFile_summaryMissing_onlyValidEventsProcessed() throws WaktuException {
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  assertCalendarValidity(testCalendar,2);
}
Program: 6452
Project: 6452
Buggy source:
@Test public void parseIcsFile_Normal() throws WaktuException {
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarValidity(testCalendar,3);
}

Fixed version (ground truth):
@Test public void parseIcsFile_Normal() throws WaktuException {
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  assertCalendarValidity(testCalendar,3);
}
Program: 6453
Project: 6453
Buggy source:
@Test public void parseIcsFile_startTimeEndTimeMissing_onlyValidEventsProcessed() throws WaktuException {
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarValidity(testCalendar,1);
}

Fixed version (ground truth):
@Test public void parseIcsFile_startTimeEndTimeMissing_onlyValidEventsProcessed() throws WaktuException {
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  assertCalendarValidity(testCalendar,1);
}
Program: 6454
Project: 6454
Buggy source:
@Test public void parseIcsFile_endVCalendarMissing_allEventsProcessedNoException() throws WaktuException {
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarValidity(testCalendar,3);
}

Fixed version (ground truth):
@Test public void parseIcsFile_endVCalendarMissing_allEventsProcessedNoException() throws WaktuException {
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  assertCalendarValidity(testCalendar,3);
}
Program: 6455
Project: 6455
Buggy source:
@Test public void parseIcsFile_invalidTimeFormat_onlyValidEventsProcessed() throws WaktuException {
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarValidity(testCalendar,1);
}

Fixed version (ground truth):
@Test public void parseIcsFile_invalidTimeFormat_onlyValidEventsProcessed() throws WaktuException {
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  assertCalendarValidity(testCalendar,1);
}
Program: 6456
Project: 6456
Buggy source:
@Test public void getFirstDayOfWeek_Saturday(){
  int refFirstDayOfWeek=new QDate(2011,5,9).day();
  assertEquals(refFirstDayOfWeek,TimeUtil.getFirstDayOfWeek(new QDate(2011,5,14)));
}

Fixed version (ground truth):
@Test public void getFirstDayOfWeek_Saturday(){
  QDate refFirstDayOfWeek=new QDate(2011,5,9);
  assertEquals(refFirstDayOfWeek,TimeUtil.getFirstDayOfWeek(new QDate(2011,5,14)));
}
Program: 6457
Project: 6457
Buggy source:
@Test public void getFirstDayOfWeek_Sunday(){
  int refFirstDayOfWeek=new QDate(2011,5,9).day();
  assertEquals(refFirstDayOfWeek,TimeUtil.getFirstDayOfWeek(new QDate(2011,5,15)));
}

Fixed version (ground truth):
@Test public void getFirstDayOfWeek_Sunday(){
  QDate refFirstDayOfWeek=new QDate(2011,5,9);
  assertEquals(refFirstDayOfWeek,TimeUtil.getFirstDayOfWeek(new QDate(2011,5,15)));
}
Program: 6458
Project: 6458
Buggy source:
@Test public void getFirstDayOfWeek_Monday(){
  int refFirstDayOfWeek=new QDate(2011,5,9).day();
  assertEquals(refFirstDayOfWeek,TimeUtil.getFirstDayOfWeek(new QDate(2011,5,9)));
}

Fixed version (ground truth):
@Test public void getFirstDayOfWeek_Monday(){
  QDate refFirstDayOfWeek=new QDate(2011,5,9);
  assertEquals(refFirstDayOfWeek,TimeUtil.getFirstDayOfWeek(new QDate(2011,5,9)));
}
Program: 6459
Project: 6459
Buggy source:
/** 
 * @param username
 * @param name
 * @param firstname
 * @param pensum
 * @param role
 */
public Usr addUser(String firstname,String lastname,String password,int pensum,SystemRole role,double holiday) throws WaktuGeneralException {
  EntityManager em=PersistenceController.getInstance().getEMF().createEntityManager();
  Usr newUsr=new Usr(UsernameController.generateUsername(firstname,lastname),firstname,lastname,Md5.hash(password),pensum,role,holiday);
  try {
    em.getTransaction().begin();
    em.persist(newUsr);
    em.getTransaction().commit();
  }
 catch (  IllegalStateException e) {
    throw new WaktuGeneralException("String_Node_Str");
  }
catch (  IllegalArgumentException e) {
    throw new WaktuGeneralException("String_Node_Str");
  }
catch (  Exception e) {
    throw new WaktuGeneralException("String_Node_Str");
  }
 finally {
    em.close();
  }
  add.emit(newUsr);
  logger.info("String_Node_Str" + newUsr + "String_Node_Str");
  return newUsr;
}

Fixed version (ground truth):
/** 
 * @param username
 * @param name
 * @param firstname
 * @param pensum
 * @param role
 */
public Usr addUser(String firstname,String lastname,String password,int pensum,SystemRole role,double holiday) throws WaktuGeneralException {
  EntityManager em=PersistenceController.getInstance().getEMF().createEntityManager();
  Usr newUsr=new Usr(generateUsername(firstname,lastname),firstname,lastname,Md5.hash(password),pensum,role,holiday);
  try {
    em.getTransaction().begin();
    em.persist(newUsr);
    em.getTransaction().commit();
  }
 catch (  IllegalStateException e) {
    throw new WaktuGeneralException("String_Node_Str");
  }
catch (  IllegalArgumentException e) {
    throw new WaktuGeneralException("String_Node_Str");
  }
catch (  Exception e) {
    throw new WaktuGeneralException("String_Node_Str");
  }
 finally {
    em.close();
  }
  add.emit(newUsr);
  logger.info("String_Node_Str" + newUsr + "String_Node_Str");
  return newUsr;
}
Program: 6460
Project: 6460
Buggy source:
public static GregorianCalendar convertQDateTimeToGregorian(QDateTime dateTime){
  QDate date=dateTime.date();
  QTime time=dateTime.time();
  GregorianCalendar gregCal=new GregorianCalendar(date.year(),date.month() - 1,date.day(),time.hour(),time.minute(),time.second());
  logger.info(gregCal.get(Calendar.DAY_OF_MONTH) + "String_Node_Str" + gregCal.get(Calendar.MONTH)+ "String_Node_Str"+ gregCal.get(Calendar.YEAR));
  logger.info(gregCal.get(Calendar.HOUR) + "String_Node_Str" + gregCal.get(Calendar.MINUTE));
  return gregCal;
}

Fixed version (ground truth):
public static GregorianCalendar convertQDateTimeToGregorian(QDateTime dateTime){
  QDate date=dateTime.date();
  QTime time=dateTime.time();
  GregorianCalendar gregCal=new GregorianCalendar(date.year(),date.month(),date.day(),time.hour(),time.minute(),time.second());
  logger.info(gregCal.get(Calendar.DAY_OF_MONTH) + "String_Node_Str" + gregCal.get(Calendar.MONTH)+ "String_Node_Str"+ gregCal.get(Calendar.YEAR));
  logger.info(gregCal.get(Calendar.HOUR) + "String_Node_Str" + gregCal.get(Calendar.MINUTE));
  return gregCal;
}
Program: 6461
Project: 6461
Buggy source:
public static QDateTime convertGregorianToQDateTime(GregorianCalendar dateTime){
  QDate date=new QDate(dateTime.get(GregorianCalendar.YEAR),dateTime.get(GregorianCalendar.MONTH) + 1,dateTime.get(GregorianCalendar.DAY_OF_MONTH));
  QTime time=new QTime(dateTime.get(GregorianCalendar.HOUR_OF_DAY),dateTime.get(GregorianCalendar.MINUTE),dateTime.get(GregorianCalendar.SECOND));
  return new QDateTime(date,time);
}

Fixed version (ground truth):
public static QDateTime convertGregorianToQDateTime(GregorianCalendar dateTime){
  QDate date=new QDate(dateTime.get(GregorianCalendar.YEAR),dateTime.get(GregorianCalendar.MONTH),dateTime.get(GregorianCalendar.DAY_OF_MONTH));
  QTime time=new QTime(dateTime.get(GregorianCalendar.HOUR_OF_DAY),dateTime.get(GregorianCalendar.MINUTE),dateTime.get(GregorianCalendar.SECOND));
  return new QDateTime(date,time);
}
Program: 6462
Project: 6462
Buggy source:
@Override public Usr addUser(String firstname,String lastname,String password,int pensum,SystemRole role,double holiday) throws WaktuGeneralException {
  LinkedList<Usr> allUsers=getAllUsers();
  Usr newUser=new Usr(UsernameController.generateUsername(firstname,lastname),firstname,lastname,password,pensum,role,holiday);
  allUsers.add(newUser);
  XmlUtil.saveUsersToXml(userFilePath,allUsers);
  return newUser;
}

Fixed version (ground truth):
@Override public Usr addUser(String firstname,String lastname,String password,int pensum,SystemRole role,double holiday) throws WaktuGeneralException {
  LinkedList<Usr> allUsers=getAllUsers();
  Usr newUser=new Usr(UsernameUtil.generateUsername(getAllUsers(),firstname,lastname),firstname,lastname,password,pensum,role,holiday);
  allUsers.add(newUser);
  XmlUtil.saveUsersToXml(userFilePath,allUsers);
  return newUser;
}
Program: 6463
Project: 6463
Buggy source:
@SuppressWarnings("String_Node_Str") private void addFilter(){
  filterModel.setProject((Project)ui.cmbProject.itemData(ui.cmbProject.currentIndex()));
  filterModel.setWorkPackage((WorkPackage)ui.cmbWorkpackage.itemData(ui.cmbWorkpackage.currentIndex()));
  QDate start=null;
  QDate end=null;
  if (ui.txtStart.date().toString("String_Node_Str").equals("String_Node_Str") == false) {
    start=ui.txtStart.date();
  }
  if (ui.txtEnd.date().toString("String_Node_Str").equals("String_Node_Str") == false) {
    end=ui.txtEnd.date();
  }
  filterModel.setStart(start);
  filterModel.setEnd(end);
  ui.lblTotalTime.setText("String_Node_Str" + TimeController.calculateWorktime(usr,start,end));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void addFilter(){
  filterModel.setProject((Project)ui.cmbProject.itemData(ui.cmbProject.currentIndex()));
  filterModel.setWorkPackage((WorkPackage)ui.cmbWorkpackage.itemData(ui.cmbWorkpackage.currentIndex()));
  QDate start=null;
  QDate end=null;
  if (ui.txtStart.date().toString("String_Node_Str").equals("String_Node_Str") == false) {
    start=ui.txtStart.date();
  }
  if (ui.txtEnd.date().toString("String_Node_Str").equals("String_Node_Str") == false) {
    end=ui.txtEnd.date();
  }
  filterModel.setStart(start);
  filterModel.setEnd(end);
  try {
    ui.lblTotalTime.setText("String_Node_Str" + TimeController.calculateWorktime(usr,start,end));
  }
 catch (  WaktuException e) {
    e.printStackTrace();
  }
}
Program: 6464
Project: 6464
Buggy source:
private static int getFirstDayOfWeek(QDate date){
  return date.day() - date.dayOfWeek();
}

Fixed version (ground truth):
static int getFirstDayOfWeek(QDate date){
  QDate adjustedDate=date.clone();
  return adjustedDate.addDays(-date.dayOfWeek() + 1).day();
}
Program: 6465
Project: 6465
Buggy source:
public static GregorianCalendar convertQDateTimeToGregorian(QDateTime dateTime){
  QDate date=dateTime.date();
  QTime time=dateTime.time();
  GregorianCalendar gregCal=new GregorianCalendar(date.year(),date.month(),date.day(),time.hour(),time.minute(),time.second());
  logger.info(gregCal.get(Calendar.DAY_OF_MONTH) + "String_Node_Str" + gregCal.get(Calendar.MONTH)+ "String_Node_Str"+ gregCal.get(Calendar.YEAR));
  logger.info(gregCal.get(Calendar.HOUR) + "String_Node_Str" + gregCal.get(Calendar.MINUTE));
  return gregCal;
}

Fixed version (ground truth):
public static GregorianCalendar convertQDateTimeToGregorian(QDateTime dateTime){
  QDate date=dateTime.date();
  QTime time=dateTime.time();
  GregorianCalendar gregCal=new GregorianCalendar(date.year(),date.month() - 1,date.day(),time.hour(),time.minute(),time.second());
  logger.info(gregCal.get(Calendar.DAY_OF_MONTH) + "String_Node_Str" + gregCal.get(Calendar.MONTH)+ "String_Node_Str"+ gregCal.get(Calendar.YEAR));
  logger.info(gregCal.get(Calendar.HOUR) + "String_Node_Str" + gregCal.get(Calendar.MINUTE));
  return gregCal;
}
Program: 6466
Project: 6466
Buggy source:
public static QDateTime convertGregorianToQDateTime(GregorianCalendar dateTime){
  QDate date=new QDate(dateTime.get(GregorianCalendar.YEAR),dateTime.get(GregorianCalendar.MONTH),dateTime.get(GregorianCalendar.DAY_OF_MONTH));
  QTime time=new QTime(dateTime.get(GregorianCalendar.HOUR_OF_DAY),dateTime.get(GregorianCalendar.MINUTE),dateTime.get(GregorianCalendar.SECOND));
  return new QDateTime(date,time);
}

Fixed version (ground truth):
public static QDateTime convertGregorianToQDateTime(GregorianCalendar dateTime){
  QDate date=new QDate(dateTime.get(GregorianCalendar.YEAR),dateTime.get(GregorianCalendar.MONTH) + 1,dateTime.get(GregorianCalendar.DAY_OF_MONTH));
  QTime time=new QTime(dateTime.get(GregorianCalendar.HOUR_OF_DAY),dateTime.get(GregorianCalendar.MINUTE),dateTime.get(GregorianCalendar.SECOND));
  return new QDateTime(date,time);
}
Program: 6467
Project: 6467
Buggy source:
/** 
 * @param user
 */
public void logout(){
  loggedInUser=null;
}

Fixed version (ground truth):
/** 
 * @param user
 */
public void logout(){
  setLoggedInUser(null);
}
Program: 6468
Project: 6468
Buggy source:
/** 
 * @param username
 */
public boolean login(String username,String password){
  if (canLogin(username)) {
    Usr user=UserController.getInstance().getUser(username);
    String passwordHash=Md5.hash(password);
    if (user.getPasswordHash().equals(passwordHash)) {
      loggedInUser=user;
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param username
 */
public boolean login(String username,String password){
  if (canLogin(username)) {
    Usr user=UserController.getInstance().getUser(username);
    String passwordHash=Md5.hash(password);
    if (user.getPasswordHash().equals(passwordHash)) {
      setLoggedInUser(user);
      return true;
    }
  }
  return false;
}
Program: 6469
Project: 6469
Buggy source:
@Override public LinkedList<Usr> getProjectManagers(){
  LinkedList<Usr> projectManagers=getAllUsers();
  for (  Usr u : projectManagers) {
    if (u.isActive()) {
      projectManagers.remove(u);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public LinkedList<Usr> getProjectManagers(){
  LinkedList<Usr> projectManagers=new LinkedList<Usr>();
  for (  Usr u : getAllUsers()) {
    if (u.getSystemRole().equals(SystemRole.PROJECTMANAGER)) {
      projectManagers.add(u);
    }
  }
  return projectManagers;
}
Program: 6470
Project: 6470
Buggy source:
@Override public LinkedList<Usr> getActiveUsers(){
  LinkedList<Usr> activeUsers=getAllUsers();
  for (  Usr u : activeUsers) {
    if (!u.isActive()) {
      activeUsers.remove(u);
    }
  }
  return activeUsers;
}

Fixed version (ground truth):
@Override public LinkedList<Usr> getActiveUsers(){
  LinkedList<Usr> activeUsers=new LinkedList<Usr>();
  for (  Usr u : getAllUsers()) {
    if (u.isActive()) {
      activeUsers.add(u);
    }
  }
  return activeUsers;
}
Program: 6471
Project: 6471
Buggy source:
@Override public Usr getUser(String username){
  LinkedList<Usr> allUsers=getAllUsers();
  for (  Usr u : allUsers) {
    if (u.getUsername().equals(username)) {
      return u;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Usr getUser(String username){
  for (  Usr u : getAllUsers()) {
    if (u.getUsername().equals(username)) {
      return u;
    }
  }
  return null;
}
Program: 6472
Project: 6472
Buggy source:
@Override public boolean updateUser(Usr user){
  LinkedList<Usr> allUsers=getAllUsers();
  for (  Usr u : allUsers) {
    if (u.equals(user)) {
      u.setActiveState(user.isActive());
      u.setFirstname(user.getFirstname());
      u.setHoliday(user.getHoliday());
      u.setName(user.getName());
      u.setPassword(user.getPasswordHash());
      u.setPensum(user.getPensum());
      u.setRole(user.getSystemRole());
      u.setUsername(user.getUsername());
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean updateUser(Usr user){
  for (  Usr u : getAllUsers()) {
    if (u.equals(user)) {
      u.setActiveState(user.isActive());
      u.setFirstname(user.getFirstname());
      u.setHoliday(user.getHoliday());
      u.setName(user.getName());
      u.setPassword(user.getPasswordHash());
      u.setPensum(user.getPensum());
      u.setRole(user.getSystemRole());
      u.setUsername(user.getUsername());
      return true;
    }
  }
  return false;
}
Program: 6473
Project: 6473
Buggy source:
@Override public LinkedList<Usr> getInactiveUsers(){
  LinkedList<Usr> inactiveUsers=getAllUsers();
  for (  Usr u : inactiveUsers) {
    if (u.isActive()) {
      inactiveUsers.remove(u);
    }
  }
  return inactiveUsers;
}

Fixed version (ground truth):
@Override public LinkedList<Usr> getInactiveUsers(){
  LinkedList<Usr> inactiveUsers=new LinkedList<Usr>();
  for (  Usr u : getAllUsers()) {
    if (!u.isActive()) {
      inactiveUsers.add(u);
    }
  }
  return inactiveUsers;
}
Program: 6474
Project: 6474
Buggy source:
private static SystemRole getSystemRoleContentOf(Node element,String name){
  for (  SystemRole sr : SystemRole.values()) {
    if (sr.equals(getTextContentOf(element,name))) {
      return sr;
    }
  }
  return null;
}

Fixed version (ground truth):
private static SystemRole getSystemRoleContentOf(Node element,String name){
  for (  SystemRole sr : SystemRole.values()) {
    if (sr.toString().equalsIgnoreCase(getTextContentOf(element,name))) {
      return sr;
    }
  }
  return null;
}
Program: 6475
Project: 6475
Buggy source:
@Override public boolean equals(Object obj){
  if (obj instanceof Usr) {
    Usr usr=(Usr)obj;
    if (usr.username.equals(username) && usr.id == id) {
      return true;
    }
  }
  return super.equals(obj);
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj instanceof Usr) {
    Usr usr=(Usr)obj;
    if (usr.username.equals(username) && usr.id == id && usr.firstname.equals(firstname) && usr.name.equals(name) && usr.holiday == holiday && usr.active == active && usr.passwordHash.equals(passwordHash) && usr.pensum == pensum && usr.systemRole.equals(systemRole)) {
      return true;
    }
  }
  return super.equals(obj);
}
Program: 6476
Project: 6476
Buggy source:
@SuppressWarnings("String_Node_Str") private void closeClicked(){
  System.exit(0);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void closeClicked(){
  QApplication.exit();
}
Program: 6477
Project: 6477
Buggy source:
@SuppressWarnings("String_Node_Str") private void cancelClicked(){
  System.exit(0);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void cancelClicked(){
  QApplication.exit();
}
Program: 6478
Project: 6478
Buggy source:
@SuppressWarnings("String_Node_Str") private void closeApp(){
  System.exit(0);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void closeApp(){
  QApplication.exit();
}
Program: 6479
Project: 6479
Buggy source:
public static QDateTime convertGregorianToQDateTime(GregorianCalendar dateTime){
  QDate date=new QDate(dateTime.get(GregorianCalendar.YEAR),dateTime.get(GregorianCalendar.MONTH),dateTime.get(GregorianCalendar.DAY_OF_MONTH));
  QTime time=new QTime(dateTime.get(GregorianCalendar.HOUR),dateTime.get(GregorianCalendar.MINUTE),dateTime.get(GregorianCalendar.SECOND));
  return new QDateTime(date,time);
}

Fixed version (ground truth):
public static QDateTime convertGregorianToQDateTime(GregorianCalendar dateTime){
  QDate date=new QDate(dateTime.get(GregorianCalendar.YEAR),dateTime.get(GregorianCalendar.MONTH),dateTime.get(GregorianCalendar.DAY_OF_MONTH));
  QTime time=new QTime(dateTime.get(GregorianCalendar.HOUR_OF_DAY),dateTime.get(GregorianCalendar.MINUTE),dateTime.get(GregorianCalendar.SECOND));
  return new QDateTime(date,time);
}
Program: 6480
Project: 6480
Buggy source:
@Override public int hashCode(){
  return projectid << description.hashCode() << plannedTime<< projectIdentifier.hashCode();
}

Fixed version (ground truth):
@Override public int hashCode(){
  int hashCode=23;
  hashCode=31 * projectid;
  hashCode=31 * projectIdentifier.hashCode();
  hashCode=31 * description.hashCode();
  hashCode=31 * projectManager.hashCode();
  hashCode=31 * plannedTime;
  return hashCode;
}
Program: 6481
Project: 6481
Buggy source:
public WorkSession(Usr user,WorkPackage workPackage,GregorianCalendar startTime,GregorianCalendar endTime){
  this.userRef=user;
  this.workPackageRef=workPackage;
  this.start=startTime;
  this.end=endTime;
}

Fixed version (ground truth):
public WorkSession(Usr user,WorkPackage workPackage,GregorianCalendar startTime,GregorianCalendar endTime){
  this.userRef=user;
  this.workPackageRef=workPackage;
  this.startTime=startTime;
  this.endTime=endTime;
}
Program: 6482
Project: 6482
Buggy source:
public GregorianCalendar getStart(){
  return start;
}

Fixed version (ground truth):
public GregorianCalendar getStart(){
  return startTime;
}
Program: 6483
Project: 6483
Buggy source:
public void setStart(GregorianCalendar start){
  this.start=start;
}

Fixed version (ground truth):
public void setStart(GregorianCalendar start){
  this.startTime=start;
}
Program: 6484
Project: 6484
Buggy source:
public void setEnd(GregorianCalendar end){
  this.end=end;
}

Fixed version (ground truth):
public void setEnd(GregorianCalendar end){
  this.endTime=end;
}
Program: 6485
Project: 6485
Buggy source:
public GregorianCalendar getEnd(){
  return end;
}

Fixed version (ground truth):
public GregorianCalendar getEnd(){
  return endTime;
}
Program: 6487
Project: 6487
Buggy source:
@Test public void parseIcsFile_invalidTimeDelimiter_onlyValidEventsProcessed(){
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarEquality(testCalendar,2);
  assert(testCalendar.size() == 2);
}

Fixed version (ground truth):
@Test public void parseIcsFile_invalidTimeDelimiter_onlyValidEventsProcessed(){
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarValidity(testCalendar,2);
}
Program: 6488
Project: 6488
Buggy source:
@Test public void parseIcsFile_summaryMissing_onlyValidEventsProcessed(){
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarEquality(testCalendar,2);
  assert(testCalendar.size() == 2);
}

Fixed version (ground truth):
@Test public void parseIcsFile_summaryMissing_onlyValidEventsProcessed(){
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarValidity(testCalendar,2);
}
Program: 6489
Project: 6489
Buggy source:
@Test public void parseIcsFile_allBeginVeventMissing_noEventsProcessed(){
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  assert(testCalendar.size() == 0);
}

Fixed version (ground truth):
@Test public void parseIcsFile_allBeginVeventMissing_noEventsProcessed(){
  testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  assertEquals(0,testCalendar.size());
}
Program: 6490
Project: 6490
Buggy source:
@Test public void parseIcsFile_Normal(){
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarEquality(testCalendar,3);
}

Fixed version (ground truth):
@Test public void parseIcsFile_Normal(){
  testCalendar.clear();
  testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarValidity(testCalendar,3);
}
Program: 6491
Project: 6491
Buggy source:
@Test public void parseIcsFile_startTimeEndTimeMissing_onlyValidEventsProcessed(){
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarEquality(testCalendar,1);
  assert(testCalendar.size() == 1);
}

Fixed version (ground truth):
@Test public void parseIcsFile_startTimeEndTimeMissing_onlyValidEventsProcessed(){
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarValidity(testCalendar,1);
}
Program: 6492
Project: 6492
Buggy source:
@Test public void parseIcsFile_endVCalendarMissing_allEventsProcessedNoException(){
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarEquality(testCalendar,3);
}

Fixed version (ground truth):
@Test public void parseIcsFile_endVCalendarMissing_allEventsProcessedNoException(){
  testCalendar.clear();
  testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarValidity(testCalendar,3);
}
Program: 6493
Project: 6493
Buggy source:
@Test public void parseIcsFile_invalidTimeFormat_onlyValidEventsProcessed(){
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarEquality(testCalendar,2);
  assert(testCalendar.size() == 2);
}

Fixed version (ground truth):
@Test public void parseIcsFile_invalidTimeFormat_onlyValidEventsProcessed(){
  LinkedList<WorkSession> testCalendar=IcsParser.parseIcsFile("String_Node_Str");
  calendarValidity(testCalendar,2);
}
Program: 6494
Project: 6494
Buggy source:
public static String hash(String input){
  MessageDigest digest=null;
  try {
    digest=java.security.MessageDigest.getInstance("String_Node_Str");
  }
 catch (  NoSuchAlgorithmException e) {
    e.printStackTrace();
  }
  try {
    digest.update(input.getBytes("String_Node_Str"));
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
  byte[] hash=digest.digest();
  return byteArrayToString(hash);
}

Fixed version (ground truth):
public static String hash(String input){
  MessageDigest digest=null;
  byte[] hash=null;
  try {
    digest=java.security.MessageDigest.getInstance("String_Node_Str");
  }
 catch (  NoSuchAlgorithmException e) {
    e.printStackTrace();
  }
  try {
    digest.update(input.getBytes("String_Node_Str"));
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
  if (digest != null) {
    hash=digest.digest();
  }
  return byteArrayToString(hash);
}
Program: 6495
Project: 6495
Buggy source:
public List<Project> getInactiveProjects(){
  ArrayList<Project> inactiveProjects=new ArrayList<Project>();
  for (  Project p : projectList) {
    if (!p.isInactive()) {
      inactiveProjects.add(p);
    }
  }
  return inactiveProjects;
}

Fixed version (ground truth):
public List<Project> getInactiveProjects(){
  ArrayList<Project> inactiveProjects=new ArrayList<Project>();
  for (  Project p : projectList) {
    if (p.isInactive()) {
      inactiveProjects.add(p);
    }
  }
  return inactiveProjects;
}
Program: 6499
Project: 6499
Buggy source:
/** 
 * Generates the member variables strm and bit_masks in the class.
 * @throws CppCodeValidationException
 * @throws CppDuplicateException
 */
private static void createVariables() throws CppCodeValidationException, CppDuplicateException {
  CppVar var_strm=CppVar.factory.create(Cpp.PRIVATE,"String_Node_Str","String_Node_Str");
  var_strm.setComment(new CCommentImpl("String_Node_Str"));
  clazz.add(var_strm);
  CppVar var_masks=CppVar.factory.create(Cpp.PRIVATE | Cpp.CONST,"String_Node_Str","String_Node_Str");
  var_masks.setComment(new CCommentImpl("String_Node_Str"));
  clazz.add(var_masks);
}

Fixed version (ground truth):
/** 
 * Generates the member variables strm and bit_masks in the class.
 * @throws CppCodeValidationException
 * @throws CppDuplicateException
 */
private static void createVariables() throws CppCodeValidationException, CppDuplicateException {
  CppVar var_strm=CppVar.factory.create(Cpp.PRIVATE,"String_Node_Str","String_Node_Str");
  var_strm.setComment(new CCommentImpl("String_Node_Str"));
  clazz.add(var_strm);
  CppVar var_masks=CppVar.factory.create(Cpp.PRIVATE,Cpp.UNSIGNED | Cpp.INT,"String_Node_Str");
  var_masks.setComment(new CCommentImpl("String_Node_Str"));
  clazz.add(var_masks);
  CppConstructor constr=CppConstructor.factory.create();
  constr.appendCode("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_Node_Str");
  clazz.add(Cpp.PUBLIC,constr);
}
Program: 6501
Project: 6501
Buggy source:
/** 
 * Generates the C++ class EXIStream.
 */
private static void createClass() throws CppDuplicateException, CppCodeValidationException {
  clazz=CppClass.factory.create("String_Node_Str");
  CppEXIStreamGenerator.createStreamVariable();
  CppEXIStreamGenerator.createInitStream();
  CppEXIStreamGenerator.createCloseStream();
  CppEXIStreamGenerator.createWriteNextBit();
  CppEXIStreamGenerator.createWriteNBits();
  CppEXIStreamGenerator.createLog2Int();
  CppEXIStreamGenerator.createGetBitsNumber();
  CppEXIStreamGenerator.createMoveBitPointer();
}

Fixed version (ground truth):
/** 
 * Generates the C++ class EXIStream.
 */
private static void createClass() throws CppDuplicateException, CppCodeValidationException {
  clazz=CppClass.factory.create("String_Node_Str");
  CppEXIStreamGenerator.createVariables();
  CppEXIStreamGenerator.createInitStream();
  CppEXIStreamGenerator.createCloseStream();
  CppEXIStreamGenerator.createWriteNextBit();
  CppEXIStreamGenerator.createWriteNBits();
  CppEXIStreamGenerator.createLog2Int();
  CppEXIStreamGenerator.createGetBitsNumber();
  CppEXIStreamGenerator.createMoveBitPointer();
}
Program: 6502
Project: 6502
Buggy source:
/** 
 * Private helper method to check, whether a member variable is a local enum within the CppClass object or not. This function is being used, to determine necessary includes in writeSourceFiles().
 * @param classObject Class object with possible local enums
 * @param member Member variable to check
 * @return True if member variable is a local enum,false otherwise
 */
private boolean isLocalEnum(final CppClass classObject,final CppVar member){
  boolean result=false;
  for (  CEnum enumElement : classObject.getEnums(Cpp.PUBLIC)) {
    if (enumElement.getName().equals(member.getName())) {
      result=true;
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Private helper method to check, whether a type names a local enum within the CppClass object or not. This function is being used, to determine necessary includes in writeSourceFiles().
 * @param classObject Class object with possible local enums
 * @param typeName Type name to check
 * @return True if type names a local enum, false otherwise
 */
private boolean isLocalEnum(final CppClass classObject,final String typeName){
  boolean result=false;
  for (  CEnum enumElement : classObject.getEnums(Cpp.PUBLIC)) {
    if (enumElement.getName().equals(typeName)) {
      result=true;
    }
  }
  return result;
}
Program: 6503
Project: 6503
Buggy source:
/** 
 * Private helper method to extract the plain type name from typed collections (e.g. vector<T>). If the type definition is not a typed collection, it will be returned unchanged. For example 'vector<FooType>' will return 'FooType', whereas 'BarType' will remain unchanged.
 * @param typeDefinition Type definition that may or maynot contain a typed collection (e.g. a vector)
 * @return Plain type name
 */
private static String extractPlainType(final String typeDefinition){
  String result=typeDefinition;
  Pattern pattern=Pattern.compile("String_Node_Str");
  Matcher matcher=pattern.matcher(typeDefinition);
  if (matcher.find()) {
    result=matcher.group(1);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Private helper method to extract the plain type name from typed collections (e.g. vector<T>). If the type definition is not a typed collection, it will be returned unchanged. For example 'vector<FooType*>' will return 'FooType*', whereas 'BarType' will remain unchanged.
 * @param typeDefinition Type definition that may or maynot contain a typed collection (e.g. a vector)
 * @return Plain type name
 */
private static String extractPlainType(final String typeDefinition){
  String result=typeDefinition;
  Pattern pattern=Pattern.compile("String_Node_Str");
  Matcher matcher=pattern.matcher(typeDefinition);
  if (matcher.find()) {
    result=matcher.group(1);
  }
  return result;
}
Program: 6505
Project: 6505
Buggy source:
public CppClass addExtended(long vis,String... extendeds) throws CppDuplicateException {
  for (  String e : extendeds) {
    String tmp=Cpp.toString(vis) + "String_Node_Str" + e;
    if (this.extendeds_string.contains(tmp)) {
      throw new CppDuplicateException(this.className + "String_Node_Str" + tmp);
    }
    this.extendeds_string.add(tmp);
  }
  return this;
}

Fixed version (ground truth):
public CppClass addExtended(long vis,String... extendeds) throws CppDuplicateException {
  for (  String e : extendeds) {
    String tmp=Cpp.toString(vis) + "String_Node_Str" + e;
    if (this.extendeds_string.contains(tmp)) {
      throw new CppDuplicateException("String_Node_Str" + tmp + "String_Node_Str");
    }
    for (    VisElem ex : this.extendeds) {
      if (ex.elem instanceof CppClass) {
        CppClass clazz=(CppClass)ex.elem;
        if (clazz.getName().equals(e)) {
          throw new CppDuplicateException("String_Node_Str" + clazz.getName() + "String_Node_Str");
        }
      }
    }
    this.extendeds_string.add(tmp);
  }
  return this;
}
Program: 6506
Project: 6506
Buggy source:
private void addExtendedInternal(long vis,CppClass extended) throws CppDuplicateException {
  if (containsExtended(extended))   throw new CppDuplicateException("String_Node_Str");
  extendeds.add(new VisElem(extended,vis));
}

Fixed version (ground truth):
private void addExtendedInternal(long vis,CppClass extended) throws CppDuplicateException {
  if (containsExtended(extended)) {
    throw new CppDuplicateException("String_Node_Str" + extended.getName() + "String_Node_Str");
  }
  if (this.extendeds_string.contains(extended.getName())) {
    throw new CppDuplicateException("String_Node_Str");
  }
  extendeds.add(new VisElem(extended,vis));
}
Program: 6507
Project: 6507
Buggy source:
public List<String> getExtendeds(){
  List<String> e=new LinkedList<String>();
  for (  String ex : this.extendeds) {
    e.add(ex);
  }
  for (  CppConstructor ex : this.extendeds_con) {
    e.add(ex.getSignature());
  }
  return e;
}

Fixed version (ground truth):
public List<String> getExtendeds(){
  List<String> e=new LinkedList<String>();
  e.addAll(this.extendeds);
  for (  CppConstructor ex : this.extendeds_con) {
    e.add(ex.getSignature());
  }
  return e;
}
Program: 6509
Project: 6509
Buggy source:
/** 
 * This method returns a class object that can be added to a source file. Return value should be casted to CppClass before further use. The returned class has public visibility.
 * @param container AttributeContainer for conversion
 * @return Generated WorkspaceElement object
 * @throws Exception Error during class object generation
 */
@Override public WorkspaceElement generateClassObject(final AttributeContainer container) throws Exception {
  return this.generateCppClassObject(container,null);
}

Fixed version (ground truth):
/** 
 * This method returns a class object that can be added to a source file. Return value should be casted to CppClass before further use. The returned class will be an extended version of the given parent class.
 * @param container AttributeContainer for conversion
 * @param parent Name of parent class for inheritance
 * @return Generated WorkspaceElement object
 * @throws Exception Error during class object generation
 */
public WorkspaceElement generateClassObject(final AttributeContainer container,final String parent) throws Exception {
  return this.generateCppClassObject(container,parent);
}