nus-yam/ex-repair huggingface dataset:
Program: 144525
Project: 144525
Buggy source:
public void validateOnSubmitDriver(DriverBean driverBean){
  clearErrorsAndMessages();
  String alpha="String_Node_Str";
  String alphaNumeric="String_Node_Str";
  Pattern namePattern=Pattern.compile(alpha);
  Pattern alphaNumericPattern=Pattern.compile(alphaNumeric);
  Matcher matcher=namePattern.matcher(driverBean.getLastName());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=namePattern.matcher(driverBean.getFirstName());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=namePattern.matcher(driverBean.getTitle());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=alphaNumericPattern.matcher(driverBean.getLicenseNumber());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  if (StringUtils.isBlank(driverBean.getLicenseNumber())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(driverBean.getLastName())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(driverBean.getFirstName())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(driverBean.getTitle())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void validateOnSubmitDriver(DriverBean driverBean){
  clearErrorsAndMessages();
  String alpha="String_Node_Str";
  String alphaNumeric="String_Node_Str";
  String title="String_Node_Str";
  Pattern namePattern=Pattern.compile(alpha);
  Pattern alphaNumericPattern=Pattern.compile(alphaNumeric);
  Pattern stringtitle=Pattern.compile(title);
  Matcher matcher=namePattern.matcher(driverBean.getLastName());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=namePattern.matcher(driverBean.getFirstName());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=stringtitle.matcher(driverBean.getTitle());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  if (StringUtils.isBlank(driverBean.getLicenseNumber())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(driverBean.getLastName())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(driverBean.getFirstName())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(driverBean.getTitle())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}
Program: 144527
Project: 144527
Buggy source:
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateDriver(Driver driver) throws DriverAlreadyExistsException {
  if (driverDao.findDriverByDriverCodeAndId(driver.getDriverCode(),driver.getDriverId()).size() > 0) {
    throw new DriverAlreadyExistsException(driver.getDriverCode());
  }
 else {
    driver.setDateHired(new Date());
    driverDao.updateDriver(driver);
  }
}

Fixed version (ground truth):
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateDriver(Driver driver) throws DriverAlreadyExistsException {
  if (driverDao.findDriverByLicenseAndId(driver.getLicenseNumber(),driver.getDriverId()).size() > 0) {
    throw new DriverAlreadyExistsException(driver.getLicenseNumber());
  }
 else {
    driver.setDateHired(new Date());
    driverDao.updateDriver(driver);
  }
}
Program: 144528
Project: 144528
Buggy source:
public String deleteDriver(){
  Driver driverEntity=vendorService.findDriverByDriverCode(driverCodeParam);
  vendorService.deleteDriver(driverEntity);
  clearErrorsAndMessages();
  addActionMessage("String_Node_Str");
  return SUCCESS;
}

Fixed version (ground truth):
public String deleteDriver(){
  Driver driverEntity=vendorService.findDriverById(driverIdParam);
  vendorService.deleteDriver(driverEntity);
  clearErrorsAndMessages();
  addActionMessage("String_Node_Str");
  return SUCCESS;
}
Program: 144529
Project: 144529
Buggy source:
public String loadEditDriverPage(){
  Integer vendorId=getSessionVendorId();
  List<Driver> driverEntityList=vendorService.findDriverByVendorId(vendorId);
  for (  Driver driverE1em : driverEntityList) {
    drivers.add(transformToFormBeanDriver(driverE1em));
  }
  Driver driverEntity=vendorService.findDriverByDriverCode(driverCodeParam);
  driver=transformToFormBeanDriver(driverEntity);
  return SUCCESS;
}

Fixed version (ground truth):
public String loadEditDriverPage(){
  Integer vendorId=getSessionVendorId();
  List<Driver> driverEntityList=vendorService.findDriverByVendorId(vendorId);
  for (  Driver driverE1em : driverEntityList) {
    drivers.add(transformToFormBeanDriver(driverE1em));
  }
  Driver driverEntity=vendorService.findDriverById(driverIdParam);
  driver=transformToFormBeanDriver(driverEntity);
  return SUCCESS;
}
Program: 144530
Project: 144530
Buggy source:
@Override public void prepare() throws Exception {
  customerList=customerService.findAllCustomer();
  serviceRequirementList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.SERVICE_REQUIREMENT);
  freightTypeList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.FREIGHT_TYPE);
  modeOfPaymentList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.MODE_OF_PAYMENT);
  modeOfServiceList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.MODE_OF_SERVICE);
  notifyByList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.NOTIFY_BY);
  orderSearchList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.ORDER_SEARCH);
  portsList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.PORTS);
  containerList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.CONTAINER_SIZE);
  containerQuantity=new ArrayList<Integer>();
  containerQuantity.add(1);
  containerQuantity.add(2);
  containerQuantity.add(3);
  containerQuantity.add(4);
  containerQuantity.add(5);
  itemQuantity=new ArrayList<Integer>();
  itemQuantity.add(1);
  itemQuantity.add(2);
  itemQuantity.add(3);
  itemQuantity.add(4);
  itemQuantity.add(5);
  itemQuantity.add(6);
  itemQuantity.add(7);
  itemQuantity.add(8);
  itemQuantity.add(9);
  itemQuantity.add(10);
}

Fixed version (ground truth):
@Override public void prepare() throws Exception {
  customerList=customerService.findAllCustomer();
  serviceRequirementList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.SERVICE_REQUIREMENT);
  freightTypeList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.FREIGHT_TYPE);
  modeOfPaymentList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.MODE_OF_PAYMENT);
  modeOfServiceList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.MODE_OF_SERVICE);
  notifyByList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.NOTIFY_BY);
  orderSearchList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.ORDER_SEARCH);
  portsList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.PORTS);
  containerList=parameterService.getParameterMap(ParameterConstants.ORDER,ParameterConstants.CONTAINER_SIZE);
  contactTypeList=parameterService.getParameterMap(ParameterConstants.CONTACT_TYPE);
  containerQuantity=new ArrayList<Integer>();
  containerQuantity.add(1);
  containerQuantity.add(2);
  containerQuantity.add(3);
  containerQuantity.add(4);
  containerQuantity.add(5);
  itemQuantity=new ArrayList<Integer>();
  itemQuantity.add(1);
  itemQuantity.add(2);
  itemQuantity.add(3);
  itemQuantity.add(4);
  itemQuantity.add(5);
  itemQuantity.add(6);
  itemQuantity.add(7);
  itemQuantity.add(8);
  itemQuantity.add(9);
  itemQuantity.add(10);
}
Program: 144531
Project: 144531
Buggy source:
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void addItem(Items items) throws ItemAlreadyExistsException {
  if (itemsDao.findUserByItemName(items.getItemName()).size() > 0)   throw new ItemAlreadyExistsException(items.getItemName());
 else   itemsDao.addItems(items);
}

Fixed version (ground truth):
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void addItem(Items items) throws ItemAlreadyExistsException {
  if (itemsDao.findUserByItemName(items.getItemCode()).size() > 0)   throw new ItemAlreadyExistsException(items.getItemName());
 else   itemsDao.addItems(items);
}
Program: 144532
Project: 144532
Buggy source:
public void validateOnSubmit(CustomerBean customerBean){
  clearErrorsAndMessages();
  String alpha="String_Node_Str";
  Pattern namePattern=Pattern.compile(alpha);
  Matcher matcher=namePattern.matcher(customerBean.getCustomerName());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  if (StringUtils.isBlank(customerBean.getCustomerName())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(customerBean.getPhone())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(customerBean.getMobile())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(customerBean.getEmail())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void validateOnSubmit(CustomerBean customerBean){
  clearErrorsAndMessages();
  if (StringUtils.isBlank(customerBean.getCustomerName())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(customerBean.getPhone())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(customerBean.getMobile())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(customerBean.getEmail())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}
Program: 144533
Project: 144533
Buggy source:
public String addVesselSchedule(){
  validateOnSubmit(vesselSchedule);
  if (hasFieldErrors()) {
    return INPUT;
  }
  VesselSchedules entity=transformToEntityBean(vesselSchedule);
  entity.setCreatedBy(commonUtils.getUserNameFromSession());
  entity.setCreatedTimestamp(new Date());
  entity.setModifiedBy(commonUtils.getUserNameFromSession());
  entity.setModifiedTimestamp(new Date());
  System.out.println("String_Node_Str" + entity.getVoyageNumber());
  vesselSchedulesService.addVesselSchedule(entity);
  return SUCCESS;
}

Fixed version (ground truth):
public String addVesselSchedule(){
  validateOnSubmit(vesselSchedule);
  if (hasFieldErrors()) {
    return INPUT;
  }
  try {
    VesselSchedules entity=transformToEntityBean(vesselSchedule);
    entity.setCreatedBy(commonUtils.getUserNameFromSession());
    entity.setCreatedTimestamp(new Date());
    entity.setModifiedBy(commonUtils.getUserNameFromSession());
    entity.setModifiedTimestamp(new Date());
    System.out.println("String_Node_Str" + entity.getVoyageNumber());
    vesselSchedulesService.addVesselSchedule(entity);
  }
 catch (  Exception e) {
    addFieldError("String_Node_Str","String_Node_Str");
    return INPUT;
  }
  return SUCCESS;
}
Program: 144534
Project: 144534
Buggy source:
public String editVesselSchedule(){
  validateOnSubmit(vesselSchedule);
  if (hasFieldErrors()) {
    return INPUT;
  }
  try {
    VesselSchedules entity=transformToEntityBean(vesselSchedule);
    entity.setModifiedBy(commonUtils.getUserNameFromSession());
    entity.setModifiedTimestamp(new Date());
    vesselSchedulesService.updateVesselSchedule(entity);
  }
 catch (  Exception e) {
    addFieldError("String_Node_Str","String_Node_Str");
    return INPUT;
  }
  return SUCCESS;
}

Fixed version (ground truth):
public String editVesselSchedule(){
  validateOnSubmit(vesselSchedule);
  if (hasFieldErrors()) {
    return INPUT;
  }
  VesselSchedules entity=transformToEntityBean(vesselSchedule);
  entity.setModifiedBy(commonUtils.getUserNameFromSession());
  entity.setModifiedTimestamp(new Date());
  vesselSchedulesService.updateVesselSchedule(entity);
  return SUCCESS;
}
Program: 144535
Project: 144535
Buggy source:
public void validateOnSubmitAddress(AddressBean addressBean){
  clearErrorsAndMessages();
  String PATTERN="String_Node_Str";
  Pattern pattern=Pattern.compile(PATTERN);
  Matcher matcher1=pattern.matcher(addressBean.getZip());
  if (!matcher1.matches()) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (org.apache.commons.lang.StringUtils.isBlank(addressBean.getAddressLine1())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (org.apache.commons.lang.StringUtils.isBlank(addressBean.getCity())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (org.apache.commons.lang.StringUtils.isBlank(addressBean.getState())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void validateOnSubmitAddress(AddressBean addressBean){
  clearErrorsAndMessages();
  String PATTERN="String_Node_Str";
  Pattern pattern=Pattern.compile(PATTERN);
  Matcher matcher1=pattern.matcher(addressBean.getZip());
  if (!matcher1.matches()) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (org.apache.commons.lang.StringUtils.isBlank(addressBean.getAddressLine1())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (org.apache.commons.lang.StringUtils.isBlank(addressBean.getCity())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}
Program: 144536
Project: 144536
Buggy source:
public void validateOnSubmitAddress(AddressBean addressBean){
  clearErrorsAndMessages();
  String PATTERN="String_Node_Str";
  Pattern pattern=Pattern.compile(PATTERN);
  Matcher matcher1=pattern.matcher(addressBean.getZip());
  if (!matcher1.matches()) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(addressBean.getAddressLine1())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(addressBean.getCity())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(addressBean.getState())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void validateOnSubmitAddress(AddressBean addressBean){
  clearErrorsAndMessages();
  String PATTERN="String_Node_Str";
  Pattern pattern=Pattern.compile(PATTERN);
  Matcher matcher1=pattern.matcher(addressBean.getZip());
  if (!matcher1.matches()) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(addressBean.getAddressLine1())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(addressBean.getCity())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}
Program: 144537
Project: 144537
Buggy source:
public String getColumnFilter(){
  String column="String_Node_Str";
  if ("String_Node_Str".equals(vendor.getVendorSearchCriteria())) {
    column="String_Node_Str";
  }
 else   if ("String_Node_Str".equals(vendor.getVendorSearchCriteria())) {
    column="String_Node_Str";
  }
 else   if ("String_Node_Str".equals(vendor.getVendorSearchCriteria())) {
    column="String_Node_Str";
  }
  return column;
}

Fixed version (ground truth):
public String getColumnFilter(){
  String column="String_Node_Str";
  if ("String_Node_Str".equals(vendor.getVendorSearchCriteria())) {
    column="String_Node_Str";
  }
 else   if ("String_Node_Str".equals(vendor.getVendorSearchCriteria())) {
    column="String_Node_Str";
  }
 else   if ("String_Node_Str".equals(vendor.getVendorSearchCriteria())) {
    column="String_Node_Str";
  }
 else   if ("String_Node_Str".equals(vendor.getVendorSearchCriteria())) {
    column="String_Node_Str";
  }
  return column;
}
Program: 144539
Project: 144539
Buggy source:
public String viewPendingDocuments(){
  List<Orders> orderEntityList=new ArrayList<Orders>();
  orderEntityList=documentsService.findAllOrdersDocumentation();
  for (  Orders orderElem : orderEntityList) {
    orders.add(transformOrdersToFormBean(orderElem));
  }
  return SUCCESS;
}

Fixed version (ground truth):
public String viewPendingDocuments(){
  return SUCCESS;
}
Program: 144541
Project: 144541
Buggy source:
public void validateOnSubmitItem(ItemBean itemBean){
  clearErrorsAndMessages();
  String PATTERN="String_Node_Str";
  String PATTERN2="String_Node_Str";
  Pattern pattern1=Pattern.compile(PATTERN);
  Pattern pattern2=Pattern.compile(PATTERN2);
  Matcher matcher=pattern1.matcher(itemBean.getItemCode());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (itemBean.getLength() == null) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (itemBean.getWidth() == null) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (itemBean.getCriticalQuality() == null) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (itemBean.getBasePrice() == null) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(itemBean.getDescription())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void validateOnSubmitItem(ItemBean itemBean){
  clearErrorsAndMessages();
  String PATTERN="String_Node_Str";
  String PATTERN2="String_Node_Str";
  String PATTERN3="String_Node_Str";
  Pattern pattern1=Pattern.compile(PATTERN);
  Pattern pattern2=Pattern.compile(PATTERN2);
  Pattern pattern3=Pattern.compile(PATTERN3);
  Matcher matcher=pattern3.matcher(itemBean.getItemCode());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (itemBean.getLength() == null) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (itemBean.getWidth() == null) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (itemBean.getCriticalQuality() == null) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (itemBean.getBasePrice() == null) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(itemBean.getDescription())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}
Program: 144542
Project: 144542
Buggy source:
@Column(name="String_Node_Str",unique=true,nullable=false) public String getDriverCode(){
  return driverCode;
}

Fixed version (ground truth):
@Column(name="String_Node_Str",unique=true) public String getDriverCode(){
  return driverCode;
}
Program: 144543
Project: 144543
Buggy source:
public void validateOnSubmitDriver(DriverBean driverBean){
  clearErrorsAndMessages();
  String alpha="String_Node_Str";
  String alphaNumeric="String_Node_Str";
  Pattern namePattern=Pattern.compile(alpha);
  Pattern alphaNumericPattern=Pattern.compile(alphaNumeric);
  Matcher matcher=namePattern.matcher(driverBean.getLastName());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=namePattern.matcher(driverBean.getFirstName());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=namePattern.matcher(driverBean.getTitle());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=alphaNumericPattern.matcher(driverBean.getLicenseNumber());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=alphaNumericPattern.matcher(driverBean.getDriverCode());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  if (StringUtils.isBlank(driverBean.getDriverCode())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(driverBean.getLicenseNumber())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(driverBean.getLastName())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(driverBean.getFirstName())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(driverBean.getTitle())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void validateOnSubmitDriver(DriverBean driverBean){
  clearErrorsAndMessages();
  String alpha="String_Node_Str";
  String alphaNumeric="String_Node_Str";
  Pattern namePattern=Pattern.compile(alpha);
  Pattern alphaNumericPattern=Pattern.compile(alphaNumeric);
  Matcher matcher=namePattern.matcher(driverBean.getLastName());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=namePattern.matcher(driverBean.getFirstName());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=namePattern.matcher(driverBean.getTitle());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=alphaNumericPattern.matcher(driverBean.getLicenseNumber());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  if (StringUtils.isBlank(driverBean.getLicenseNumber())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(driverBean.getLastName())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(driverBean.getFirstName())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(driverBean.getTitle())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}
Program: 144544
Project: 144544
Buggy source:
public Driver transformToEntityBeanDriver(DriverBean driverBean){
  Driver entity=new Driver();
  Client client=clientService.findClientById(getClientId().toString());
  entity.setClient(client);
  if (driverBean.getDriverId() != null) {
    entity.setDriverId(driverBean.getDriverId());
  }
  Map sessionAttributes=ActionContext.getContext().getSession();
  entity.setVendorId((Integer)sessionAttributes.get("String_Node_Str"));
  entity.setDriverCode(driverBean.getDriverCode());
  entity.setLicenseNumber(driverBean.getLicenseNumber());
  entity.setLastName(driverBean.getLastName());
  entity.setFirstName(driverBean.getFirstName());
  entity.setMiddleName(driverBean.getMiddleName());
  entity.setTitle(driverBean.getTitle());
  entity.setStatus(driverBean.getStatus());
  entity.setCreatedBy(driverBean.getCreatedBy());
  entity.setCreatedTimestamp(driverBean.getCreatedTimeStamp());
  return entity;
}

Fixed version (ground truth):
public Driver transformToEntityBeanDriver(DriverBean driverBean){
  Driver entity=new Driver();
  Client client=clientService.findClientById(getClientId().toString());
  entity.setClient(client);
  if (driverBean.getDriverId() != null) {
    entity.setDriverId(driverBean.getDriverId());
  }
  Map sessionAttributes=ActionContext.getContext().getSession();
  entity.setVendorId((Integer)sessionAttributes.get("String_Node_Str"));
  entity.setLicenseNumber(driverBean.getLicenseNumber());
  entity.setLastName(driverBean.getLastName());
  entity.setFirstName(driverBean.getFirstName());
  entity.setMiddleName(driverBean.getMiddleName());
  entity.setTitle(driverBean.getTitle());
  entity.setStatus(driverBean.getStatus());
  entity.setCreatedBy(driverBean.getCreatedBy());
  entity.setCreatedTimestamp(driverBean.getCreatedTimeStamp());
  return entity;
}
Program: 144545
Project: 144545
Buggy source:
public void validateOnSubmit(CustomerBean customerBean){
  clearErrorsAndMessages();
  if (StringUtils.isBlank(customerBean.getCustomerName())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(customerBean.getPhone())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(customerBean.getMobile())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(customerBean.getEmail())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void validateOnSubmit(CustomerBean customerBean){
  clearErrorsAndMessages();
  String alpha="String_Node_Str";
  Pattern namePattern=Pattern.compile(alpha);
  Matcher matcher=namePattern.matcher(customerBean.getCustomerName());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  if (StringUtils.isBlank(customerBean.getCustomerName())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(customerBean.getPhone())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(customerBean.getMobile())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(customerBean.getEmail())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}
Program: 144548
Project: 144548
Buggy source:
public String deleteVesselSchedule(){
  VesselSchedules entity=vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam);
  vesselSchedulesService.deleteVesselSchedule(entity);
  return SUCCESS;
}

Fixed version (ground truth):
public String deleteVesselSchedule(){
  VesselSchedules entity=vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam);
  vesselSchedulesService.deleteVesselSchedule(entity);
  clearErrorsAndMessages();
  addActionMessage("String_Node_Str");
  return SUCCESS;
}
Program: 144549
Project: 144549
Buggy source:
public String loadEditVesselSchedule(){
  VesselSchedules entity=vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam);
  vesselSchedule=transformToFormBean(entity);
  return SUCCESS;
}

Fixed version (ground truth):
public String loadEditVesselSchedule(){
  VesselSchedules entity=vesselSchedulesService.findVesselSchedulesById(vesselScheduleIdParam);
  vesselSchedule=transformToFormBean(entity);
  clearErrorsAndMessages();
  addActionMessage("String_Node_Str");
  return SUCCESS;
}
Program: 144550
Project: 144550
Buggy source:
public String findVesselSchedule(){
  Map sessionAttributes=ActionContext.getContext().getSession();
  sessionAttributes.put("String_Node_Str",operationsBean.getOrderItemParam());
  sessionAttributes.put("String_Node_Str",operationsBean.getNameSizeParam());
  List<VesselSchedules> vesselSchedulesList=new ArrayList<VesselSchedules>();
  vesselSchedulesList=operationsService.findVesselScheduleByVendorId(operationsBean.getVendorList());
  for (  VesselSchedules vesselScheduleElem : vesselSchedulesList) {
    vesselSchedules.add(transformToFormBeanVesselSchedule(vesselScheduleElem));
  }
  return SUCCESS;
}

Fixed version (ground truth):
public String findVesselSchedule(){
  List<VesselSchedules> vesselSchedulesList=new ArrayList<VesselSchedules>();
  vesselSchedulesList=operationsService.findVesselScheduleByVendorId(operationsBean.getVendorList());
  Map sessionAttributes=ActionContext.getContext().getSession();
  sessionAttributes.put("String_Node_Str",operationsBean.getOrderItemParam());
  sessionAttributes.put("String_Node_Str",operationsBean.getNameSizeParam());
  System.out.println("String_Node_Str" + sessionAttributes.get("String_Node_Str") + "String_Node_Str");
  System.out.println("String_Node_Str" + sessionAttributes.get("String_Node_Str") + "String_Node_Str");
  for (  VesselSchedules vesselScheduleElem : vesselSchedulesList) {
    vesselSchedules.add(transformToFormBeanVesselSchedule(vesselScheduleElem));
  }
  return SUCCESS;
}
Program: 144551
Project: 144551
Buggy source:
@Override public List<Orders> findAllOrdersDocumentation(){
  return documentationDao.findAllOrdersDocuments();
}

Fixed version (ground truth):
@Override public List<Orders> findAllOrdersDocumentation(){
  return documentsDao.findAllOrdersDocuments();
}
Program: 144552
Project: 144552
Buggy source:
@Override public List<Documents> findDocumentationByCriteria(String column,String value){
  return documentationDao.findDocumentationByCriteria(column,value);
}

Fixed version (ground truth):
@Override public List<Documents> findDocumentationByCriteria(String column,String value){
  return documentsDao.findDocumentationByCriteria(column,value);
}
Program: 144553
Project: 144553
Buggy source:
public List<VesselSchedules> findVesselSchedulesByCriteria(String column,String value,Integer clientId);

Fixed version (ground truth):
public List<VesselSchedules> findVesselSchedulesByCriteria(String column,String value);
Program: 144554
Project: 144554
Buggy source:
@Override public List<VesselSchedules> findVesselSchedulesByCriteria(String column,String value,Integer clientId){
  log.debug("String_Node_Str");
  Session session=getSessionFactory().getCurrentSession();
  List<VesselSchedules> vesselSchedules=session.createCriteria(VesselSchedules.class).add(Restrictions.like(column,value)).add(Restrictions.eq("String_Node_Str",clientId)).list();
  return vesselSchedules;
}

Fixed version (ground truth):
@Override public List<VesselSchedules> findVesselSchedulesByCriteria(String column,String value){
  log.debug("String_Node_Str");
  Session session=getSessionFactory().getCurrentSession();
  List<VesselSchedules> vesselSchedules=session.createCriteria(VesselSchedules.class).add(Restrictions.like(column,value)).list();
  return vesselSchedules;
}
Program: 144555
Project: 144555
Buggy source:
public List<VesselSchedules> findVesselSchedulesByCriteria(String column,String value,Integer clientId);

Fixed version (ground truth):
public List<VesselSchedules> findVesselSchedulesByCriteria(String column,String value);
Program: 144556
Project: 144556
Buggy source:
@Override public List<VesselSchedules> findVesselSchedulesByCriteria(String column,String value,Integer clientId){
  return vesselSchedulesDao.findVesselSchedulesByCriteria(column,value,clientId);
}

Fixed version (ground truth):
@Override public List<VesselSchedules> findVesselSchedulesByCriteria(String column,String value){
  return vesselSchedulesDao.findVesselSchedulesByCriteria(column,value);
}
Program: 144557
Project: 144557
Buggy source:
public String viewVesselSchedules(){
  String column=getColumnFilter();
  List<VesselSchedules> vesselSchedulesEntityList=new ArrayList<VesselSchedules>();
  if (StringUtils.isNotBlank(column)) {
    vesselSchedulesEntityList=vesselSchedulesService.findVesselSchedulesByCriteria(column,vesselSchedule.getVesselScheduleKeyword(),getClientId());
  }
 else {
    vesselSchedulesEntityList=vesselSchedulesService.findAllVesselSchedules();
  }
  for (  VesselSchedules vesselScheduleElem : vesselSchedulesEntityList) {
    vesselSchedules.add(transformToFormBean(vesselScheduleElem));
  }
  return SUCCESS;
}

Fixed version (ground truth):
public String viewVesselSchedules(){
  String column=getColumnFilter();
  List<VesselSchedules> vesselSchedulesEntityList=new ArrayList<VesselSchedules>();
  if (StringUtils.isNotBlank(column)) {
    vesselSchedulesEntityList=vesselSchedulesService.findVesselSchedulesByCriteria(column,vesselSchedule.getVesselScheduleKeyword());
  }
 else {
    vesselSchedulesEntityList=vesselSchedulesService.findAllVesselSchedules();
  }
  for (  VesselSchedules vesselScheduleElem : vesselSchedulesEntityList) {
    vesselSchedules.add(transformToFormBean(vesselScheduleElem));
  }
  return SUCCESS;
}
Program: 144558
Project: 144558
Buggy source:
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public Integer addCustomer(Customer customer) throws CustomerAlreadyExistsException {
  if (customerDao.findCustomerByName(customer.getCustomerName()).size() > 0)   throw new CustomerAlreadyExistsException(customer.getCustomerName());
 else   return customerDao.addCustomer(customer);
}

Fixed version (ground truth):
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public Integer addCustomer(Customer customer) throws CustomerAlreadyExistsException {
  if (customerDao.findCustomerByCustomerCode(customer.getCustomerCode()).size() > 0)   throw new CustomerAlreadyExistsException(customer.getCustomerCode());
 else   return customerDao.addCustomer(customer);
}
Program: 144559
Project: 144559
Buggy source:
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateCustomer(Customer customer){
  customerDao.updateCustomer(customer);
}

Fixed version (ground truth):
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateCustomer(Customer customer) throws CustomerAlreadyExistsException {
  if (customerDao.findDuplicateCustomerByCodeAndId(customer.getCustomerCode(),customer.getCustomerId()).size() > 0)   throw new CustomerAlreadyExistsException(customer.getCustomerCode());
 else   customerDao.updateCustomer(customer);
}
Program: 144560
Project: 144560
Buggy source:
public void validateOnSubmitTrucks(TruckBean truckBean){
  clearErrorsAndMessages();
  if (StringUtils.isBlank(truckBean.getPlateNumber())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(truckBean.getModelNumber())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (truckBean.getModelYear() == null) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(truckBean.getEngineNumber())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(truckBean.getTruckCode())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (truckBean.getGrossWeight() == null) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void validateOnSubmitTrucks(TruckBean truckBean){
  clearErrorsAndMessages();
  String alpha="String_Node_Str";
  String plate="String_Node_Str";
  String alphaNumeric="String_Node_Str";
  String year="String_Node_Str";
  String weight="String_Node_Str";
  Pattern codePattern=Pattern.compile(alpha);
  Pattern plateNumberPattern=Pattern.compile(plate);
  Pattern alphaNumericPattern=Pattern.compile(alphaNumeric);
  Pattern yearPattern=Pattern.compile(year);
  Pattern weightPattern=Pattern.compile(weight);
  Matcher matcher=codePattern.matcher(truckBean.getTruckCode());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=plateNumberPattern.matcher(truckBean.getPlateNumber());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=alphaNumericPattern.matcher(truckBean.getModelNumber());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=yearPattern.matcher(truckBean.getModelYear().toString());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=weightPattern.matcher(truckBean.getGrossWeight().toString());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  matcher=alphaNumericPattern.matcher(truckBean.getEngineNumber());
  if (!matcher.matches()) {
    addFieldError("String_Node_Str","String_Node_Str");
  }
  if (StringUtils.isBlank(truckBean.getPlateNumber())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(truckBean.getModelNumber())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (truckBean.getModelYear() == null) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(truckBean.getEngineNumber())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (StringUtils.isBlank(truckBean.getTruckCode())) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
  if (truckBean.getGrossWeight() == null) {
    addFieldError("String_Node_Str",getText("String_Node_Str"));
  }
}
Program: 144561
Project: 144561
Buggy source:
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateContact(Contacts contacts) throws ContactAlreadyExistsException {
  List<Contacts> contactList=new ArrayList<Contacts>();
  Map<String,Object> paramMap=new HashMap<String,Object>();
  paramMap.put("String_Node_Str",contacts.getFirstName());
  paramMap.put("String_Node_Str",contacts.getLastName());
  paramMap.put("String_Node_Str",contacts.getReferenceId());
  paramMap.put("String_Node_Str",contacts.getContactType());
  contactList=contactsDao.findContactsByParameterMap(paramMap,"String_Node_Str");
  if (contactList != null && contactList.size() > 0)   throw new ContactAlreadyExistsException(contacts.getLastName());
 else   contactsDao.updateContact(contacts);
}

Fixed version (ground truth):
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateContact(Contacts contacts) throws ContactAlreadyExistsException {
  if (contactsDao.findDuplicateContactByNameAndId(contacts.getLastName(),contacts.getFirstName(),contacts.getContactId(),contacts.getReferenceId()).size() > 0)   throw new ContactAlreadyExistsException(contacts.getLastName());
 else   contactsDao.updateContact(contacts);
}
Program: 144562
Project: 144562
Buggy source:
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void addContact(Contacts contacts) throws ContactAlreadyExistsException {
  List<Contacts> contactList=new ArrayList<Contacts>();
  Map<String,Object> paramMap=new HashMap<String,Object>();
  paramMap.put("String_Node_Str",contacts.getFirstName());
  paramMap.put("String_Node_Str",contacts.getLastName());
  paramMap.put("String_Node_Str",contacts.getReferenceId());
  paramMap.put("String_Node_Str",contacts.getContactType());
  contactList=contactsDao.findContactsByParameterMap(paramMap,"String_Node_Str");
  if (contactList != null && contactList.size() > 0)   throw new ContactAlreadyExistsException(contacts.getLastName());
 else   contactsDao.addContact(contacts);
}

Fixed version (ground truth):
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void addContact(Contacts contacts) throws ContactAlreadyExistsException {
  if (contactsDao.findDuplicateContactByNameAndId(contacts.getLastName(),contacts.getFirstName(),contacts.getContactId(),contacts.getReferenceId()).size() > 0)   throw new ContactAlreadyExistsException(contacts.getLastName());
 else   contactsDao.addContact(contacts);
}
Program: 144563
Project: 144563
Buggy source:
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateContact(Contacts contacts) throws ContactAlreadyExistsException {
  List<Contacts> contactList=new ArrayList<Contacts>();
  Map<String,Object> paramMap=new HashMap<String,Object>();
  paramMap.put("String_Node_Str",contacts.getFirstName());
  paramMap.put("String_Node_Str",contacts.getLastName());
  paramMap.put("String_Node_Str",contacts.getReferenceId());
  paramMap.put("String_Node_Str",contacts.getContactType());
  contactList=contactsDao.findContactsByParameterMap(paramMap,"String_Node_Str");
  if (contactList != null && contactList.size() > 0)   throw new ContactAlreadyExistsException(contacts.getLastName());
 else   contactsDao.updateContact(contacts);
}

Fixed version (ground truth):
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateContact(Contacts contacts) throws ContactAlreadyExistsException {
  if (contactsDao.findDuplicateContactByNameAndId(contacts.getLastName(),contacts.getFirstName(),contacts.getContactId(),contacts.getReferenceId()).size() > 0)   throw new ContactAlreadyExistsException(contacts.getLastName());
 else   contactsDao.updateContact(contacts);
}
Program: 144564
Project: 144564
Buggy source:
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateVessel(Vessel vessel){
  vesselDao.updateVessel(vessel);
}

Fixed version (ground truth):
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateVessel(Vessel vessel) throws VesselAlreadyExistsException {
  if (vesselDao.findDuplicateByVesselNumber(vessel.getVesselNumber(),vessel.getVesselId()).size() > 0)   throw new VesselAlreadyExistsException(vessel.getVesselNumber());
 else   vesselDao.updateVessel(vessel);
}
Program: 144565
Project: 144565
Buggy source:
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void addContact(Contacts contacts) throws ContactAlreadyExistsException {
  List<Contacts> contactList=new ArrayList<Contacts>();
  Map<String,Object> paramMap=new HashMap<String,Object>();
  paramMap.put("String_Node_Str",contacts.getFirstName());
  paramMap.put("String_Node_Str",contacts.getLastName());
  paramMap.put("String_Node_Str",contacts.getReferenceId());
  paramMap.put("String_Node_Str",contacts.getContactType());
  contactList=contactsDao.findContactsByParameterMap(paramMap,"String_Node_Str");
  if (contactList != null && contactList.size() > 0)   throw new ContactAlreadyExistsException(contacts.getLastName());
 else   contactsDao.addContact(contacts);
}

Fixed version (ground truth):
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void addContact(Contacts contacts) throws ContactAlreadyExistsException {
  if (contactsDao.findDuplicateContactByNameAndId(contacts.getLastName(),contacts.getFirstName(),contacts.getContactId(),contacts.getReferenceId()).size() > 0)   throw new ContactAlreadyExistsException(contacts.getLastName());
 else   contactsDao.addContact(contacts);
}
Program: 144566
Project: 144566
Buggy source:
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void addVessel(Vessel vessel) throws VesselAlreadyExistsException {
  vesselDao.addVessel(vessel);
}

Fixed version (ground truth):
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void addVessel(Vessel vessel) throws VesselAlreadyExistsException {
  if (vesselDao.findDuplicateByVesselNumber(vessel.getVesselNumber(),vessel.getVesselId()).size() > 0)   throw new VesselAlreadyExistsException(vessel.getVesselNumber());
 else   vesselDao.addVessel(vessel);
}
Program: 144567
Project: 144567
Buggy source:
public List<Vessel> findDuplicateByVesselNumber(String vesselNumber,Integer vesselId);

Fixed version (ground truth):
public List<Vessel> findDuplicateByVesselNumber(String vesselNumber);
Program: 144568
Project: 144568
Buggy source:
@Override public List<Vessel> findDuplicateByVesselNumber(String vesselNumber,Integer vesselId){
  Log.debug("String_Node_Str");
  try {
    Query query=getSessionFactory().getCurrentSession().createQuery("String_Node_Str");
    query.setParameter("String_Node_Str",vesselNumber);
    query.setParameter("String_Node_Str",vesselId);
    List<Vessel> results=(List<Vessel>)query.list();
    Log.debug("String_Node_Str" + results.size());
    return results;
  }
 catch (  RuntimeException re) {
    Log.error("String_Node_Str",re);
    throw re;
  }
}

Fixed version (ground truth):
@Override public List<Vessel> findDuplicateByVesselNumber(String vesselNumber){
  Log.debug("String_Node_Str");
  try {
    Query query=getSessionFactory().getCurrentSession().createQuery("String_Node_Str");
    query.setParameter("String_Node_Str",vesselNumber);
    List<Vessel> results=(List<Vessel>)query.list();
    Log.debug("String_Node_Str" + results.size());
    return results;
  }
 catch (  RuntimeException re) {
    Log.error("String_Node_Str",re);
    throw re;
  }
}
Program: 144569
Project: 144569
Buggy source:
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateTrucks(Trucks trucks) throws TrucksAlreadyExistsException {
  if (trucksDao.findTrucksByTruckCode(trucks.getTruckCode()).size() > 0) {
    throw new TrucksAlreadyExistsException(trucks.getTruckCode());
  }
 else {
    trucksDao.updateTrucks(trucks);
  }
}

Fixed version (ground truth):
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateTrucks(Trucks trucks) throws TrucksAlreadyExistsException {
  if (trucksDao.findDuplicateTruckByTruckCodeAndId(trucks.getTruckCode(),trucks.getTruckId()).size() > 0) {
    throw new TrucksAlreadyExistsException(trucks.getTruckCode());
  }
 else {
    trucksDao.updateTrucks(trucks);
  }
}
Program: 144570
Project: 144570
Buggy source:
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateVessel(Vessel vessel) throws VesselAlreadyExistsException {
  if (vesselDao.findDuplicateByVesselNumber(vessel.getVesselNumber(),vessel.getVesselId()).size() > 0)   throw new VesselAlreadyExistsException(vessel.getVesselNumber());
 else   vesselDao.updateVessel(vessel);
}

Fixed version (ground truth):
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateVessel(Vessel vessel) throws VesselAlreadyExistsException {
  if (vesselDao.findDuplicateByVesselNumberAndId(vessel.getVesselNumber(),vessel.getVesselId()).size() > 0)   throw new VesselAlreadyExistsException(vessel.getVesselNumber());
 else   vesselDao.updateVessel(vessel);
}
Program: 144571
Project: 144571
Buggy source:
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void addContact(Contacts contacts) throws ContactAlreadyExistsException {
  if (contactsDao.findDuplicateContactByNameAndId(contacts.getLastName(),contacts.getFirstName(),contacts.getContactId(),contacts.getReferenceId()).size() > 0)   throw new ContactAlreadyExistsException(contacts.getLastName());
 else   contactsDao.addContact(contacts);
}

Fixed version (ground truth):
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void addContact(Contacts contacts) throws ContactAlreadyExistsException {
  if (contactsDao.findContactByLastNameAndFirstName(contacts.getLastName(),contacts.getFirstName()).size() > 0)   throw new ContactAlreadyExistsException(contacts.getLastName());
 else   contactsDao.addContact(contacts);
}
Program: 144572
Project: 144572
Buggy source:
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateDriver(Driver driver) throws DriverAlreadyExistsException {
  if (driverDao.findDriverByDriverCode(driver.getDriverCode()).size() > 0) {
    throw new DriverAlreadyExistsException(driver.getDriverCode());
  }
 else {
    driver.setDateHired(new Date());
    driverDao.updateDriver(driver);
  }
}

Fixed version (ground truth):
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void updateDriver(Driver driver) throws DriverAlreadyExistsException {
  if (driverDao.findDriverByDriverCodeAndId(driver.getDriverCode(),driver.getDriverId()).size() > 0) {
    throw new DriverAlreadyExistsException(driver.getDriverCode());
  }
 else {
    driver.setDateHired(new Date());
    driverDao.updateDriver(driver);
  }
}
Program: 144573
Project: 144573
Buggy source:
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void addVessel(Vessel vessel) throws VesselAlreadyExistsException {
  if (vesselDao.findDuplicateByVesselNumber(vessel.getVesselNumber(),vessel.getVesselId()).size() > 0)   throw new VesselAlreadyExistsException(vessel.getVesselNumber());
 else   vesselDao.addVessel(vessel);
}

Fixed version (ground truth):
@Override @Transactional(propagation=Propagation.REQUIRED,readOnly=false) public void addVessel(Vessel vessel) throws VesselAlreadyExistsException {
  if (vesselDao.findDuplicateByVesselNumber(vessel.getVesselNumber()).size() > 0)   throw new VesselAlreadyExistsException(vessel.getVesselNumber());
 else   vesselDao.addVessel(vessel);
}