nus-yam/ex-repair huggingface dataset:
Program: 67530
Project: 67530
Buggy source:
/** 
 * Marshal any 'self' mapped attributes.
 * @param xPathFragment
 * @param marshalRecord
 * @param object
 * @param session
 * @param namespaceResolver
 * @param marshaller
 * @return
 */
public boolean marshalSelfAttributes(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver,XMLMarshaller marshaller){
  Object objectValue=xmlCompositeObjectMapping.getAttributeValueFromObject(object);
  if (xmlCompositeObjectMapping.getConverter() != null) {
    Converter converter=xmlCompositeObjectMapping.getConverter();
    if (converter instanceof XMLConverter) {
      objectValue=((XMLConverter)converter).convertObjectValueToDataValue(objectValue,session,marshaller);
    }
 else {
      objectValue=converter.convertObjectValueToDataValue(objectValue,session);
    }
  }
  XMLDescriptor descriptor=(XMLDescriptor)session.getDescriptor(objectValue);
  TreeObjectBuilder objectBuilder=(TreeObjectBuilder)descriptor.getObjectBuilder();
  return objectBuilder.marshalAttributes(marshalRecord,objectValue,session);
}

Fixed version (ground truth):
/** 
 * Marshal any 'self' mapped attributes.
 * @param xPathFragment
 * @param marshalRecord
 * @param object
 * @param session
 * @param namespaceResolver
 * @param marshaller
 * @return
 */
public boolean marshalSelfAttributes(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver,XMLMarshaller marshaller){
  Object objectValue=xmlCompositeObjectMapping.getAttributeValueFromObject(object);
  if (xmlCompositeObjectMapping.getConverter() != null) {
    Converter converter=xmlCompositeObjectMapping.getConverter();
    if (converter instanceof XMLConverter) {
      objectValue=((XMLConverter)converter).convertObjectValueToDataValue(objectValue,session,marshaller);
    }
 else {
      objectValue=converter.convertObjectValueToDataValue(objectValue,session);
    }
  }
  XMLDescriptor descriptor=(XMLDescriptor)session.getDescriptor(objectValue);
  if (descriptor != null) {
    TreeObjectBuilder objectBuilder=(TreeObjectBuilder)descriptor.getObjectBuilder();
    return objectBuilder.marshalAttributes(marshalRecord,objectValue,session);
  }
  return false;
}
Program: 67532
Project: 67532
Buggy source:
protected XMLDescriptor findReferenceDescriptor(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts,DatabaseMapping mapping,UnmarshalKeepAsElementPolicy policy){
  XMLDescriptor returnDescriptor=null;
  XMLContext xmlContext=unmarshalRecord.getUnmarshaller().getXMLContext();
  String schemaType=atts.getValue(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.SCHEMA_TYPE_ATTRIBUTE);
  if ((schemaType != null) && (!schemaType.equals("String_Node_Str"))) {
    XPathFragment frag=new XPathFragment();
    frag.setXPath(schemaType);
    QName qname=null;
    if (frag.hasNamespace()) {
      String prefix=frag.getPrefix();
      String url=unmarshalRecord.resolveNamespacePrefix(prefix);
      frag.setNamespaceURI(url);
      qname=new QName(url,frag.getLocalName());
      unmarshalRecord.setTypeQName(qname);
    }
    returnDescriptor=xmlContext.getDescriptorByGlobalType(frag);
    if (returnDescriptor == null) {
      if (policy == null || (policy != null && policy != UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT && policy != UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) {
        Class theClass=(Class)((XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager()).getDefaultXMLTypes().get(qname);
        if (theClass == null) {
          throw XMLMarshalException.noDescriptorFound(mapping);
        }
      }
    }
  }
  return returnDescriptor;
}

Fixed version (ground truth):
protected XMLDescriptor findReferenceDescriptor(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts,DatabaseMapping mapping,UnmarshalKeepAsElementPolicy policy){
  XMLDescriptor returnDescriptor=null;
  if (atts != null) {
    XMLContext xmlContext=unmarshalRecord.getUnmarshaller().getXMLContext();
    String schemaType=atts.getValue(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.SCHEMA_TYPE_ATTRIBUTE);
    if ((schemaType != null) && (!schemaType.equals("String_Node_Str"))) {
      XPathFragment frag=new XPathFragment();
      frag.setXPath(schemaType);
      QName qname=null;
      if (frag.hasNamespace()) {
        String prefix=frag.getPrefix();
        String url=unmarshalRecord.resolveNamespacePrefix(prefix);
        frag.setNamespaceURI(url);
        qname=new QName(url,frag.getLocalName());
        unmarshalRecord.setTypeQName(qname);
      }
      returnDescriptor=xmlContext.getDescriptorByGlobalType(frag);
      if (returnDescriptor == null) {
        if (policy == null || (policy != null && policy != UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT && policy != UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) {
          Class theClass=(Class)((XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager()).getDefaultXMLTypes().get(qname);
          if (theClass == null) {
            throw XMLMarshalException.noDescriptorFound(mapping);
          }
        }
      }
    }
  }
  return returnDescriptor;
}
Program: 67534
Project: 67534
Buggy source:
public void writeSingleValue(Object value,Object parent,XMLRecord record,AbstractSession session){
  Object attributeValue=value;
  if (getConverter() != null) {
    if (getConverter() instanceof XMLConverter) {
      attributeValue=((XMLConverter)getConverter()).convertObjectValueToDataValue(attributeValue,session,record.getMarshaller());
    }
 else {
      attributeValue=getConverter().convertObjectValueToDataValue(attributeValue,session);
    }
  }
  if (((XMLField)getField()).isSelfField()) {
    XMLObjectBuilder objectBuilder=(XMLObjectBuilder)this.getReferenceDescriptor(attributeValue.getClass(),session).getObjectBuilder();
    objectBuilder.buildIntoNestedRow(record,attributeValue,session);
  }
 else {
    Object fieldValue=null;
    if (attributeValue != null) {
      fieldValue=buildCompositeRow(attributeValue,session,record);
    }
 else     if (getNullPolicy().compositeObjectMarshal(record,parent,(XMLField)getField(),session)) {
      return;
    }
    record.put(this.getField(),fieldValue);
  }
}

Fixed version (ground truth):
public void writeSingleValue(Object value,Object parent,XMLRecord record,AbstractSession session){
  Object attributeValue=value;
  if (getConverter() != null) {
    if (getConverter() instanceof XMLConverter) {
      attributeValue=((XMLConverter)getConverter()).convertObjectValueToDataValue(attributeValue,session,record.getMarshaller());
    }
 else {
      attributeValue=getConverter().convertObjectValueToDataValue(attributeValue,session);
    }
  }
  if (((XMLField)getField()).isSelfField()) {
    if (((keepAsElementPolicy == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (keepAsElementPolicy == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) && attributeValue instanceof org.w3c.dom.Node) {
      org.w3c.dom.Document doc=record.getDocument();
      Node root=record.getDOM();
      NodeList children=((Node)attributeValue).getChildNodes();
      for (int i=0; i < children.getLength(); i++) {
        Node importedCopy=doc.importNode(children.item(i),true);
        root.appendChild(importedCopy);
      }
    }
 else {
      XMLObjectBuilder objectBuilder=(XMLObjectBuilder)this.getReferenceDescriptor(attributeValue.getClass(),session).getObjectBuilder();
      objectBuilder.buildIntoNestedRow(record,attributeValue,session);
    }
  }
 else {
    Object fieldValue=null;
    if (attributeValue != null) {
      fieldValue=buildCompositeRow(attributeValue,session,record);
    }
 else     if (getNullPolicy().compositeObjectMarshal(record,parent,(XMLField)getField(),session)) {
      return;
    }
    record.put(this.getField(),fieldValue);
  }
}
Program: 67535
Project: 67535
Buggy source:
/** 
 * Returns true if this attribute accessor has been initialized and now stores a reference to the class's attribute.  An attribute accessor can become uninitialized on serialization.
 */
public boolean isInitialized(){
  return this.getMethod != null && this.setMethod != null;
}

Fixed version (ground truth):
/** 
 * Returns true if this attribute accessor has been initialized and now stores a reference to the class's attribute.  An attribute accessor can become uninitialized on serialization.
 */
public boolean isInitialized(){
  return (this.getMethod != null || isReadOnly()) && (this.setMethod != null || isWriteOnly());
}
Program: 67536
Project: 67536
Buggy source:
/** 
 * Set get and set method after creating these methods by using get and set method names
 */
public void initializeAttributes(Class theJavaClass) throws DescriptorException {
  if (getAttributeName() == null) {
    throw DescriptorException.attributeNameNotSpecified();
  }
  try {
    setGetMethod(Helper.getDeclaredMethod(theJavaClass,getGetMethodName(),(Class[])null));
    Class[] parameterTypes=new Class[1];
    parameterTypes[0]=getGetMethodReturnType();
    setSetMethod(Helper.getDeclaredMethod(theJavaClass,getSetMethodName(),parameterTypes));
  }
 catch (  NoSuchMethodException ex) {
    DescriptorException descriptorException=DescriptorException.noSuchMethodWhileInitializingAttributesInMethodAccessor(getSetMethodName(),getGetMethodName(),theJavaClass.getName());
    descriptorException.setInternalException(ex);
    throw descriptorException;
  }
catch (  SecurityException exception) {
    DescriptorException descriptorException=DescriptorException.securityWhileInitializingAttributesInMethodAccessor(getSetMethodName(),getGetMethodName(),theJavaClass.getName());
    descriptorException.setInternalException(exception);
    throw descriptorException;
  }
}

Fixed version (ground truth):
/** 
 * Set get and set method after creating these methods by using get and set method names
 */
public void initializeAttributes(Class theJavaClass) throws DescriptorException {
  if (getAttributeName() == null) {
    throw DescriptorException.attributeNameNotSpecified();
  }
  try {
    setGetMethod(Helper.getDeclaredMethod(theJavaClass,getGetMethodName(),(Class[])null));
    if (!isWriteOnly()) {
      Class[] parameterTypes=new Class[1];
      parameterTypes[0]=getGetMethodReturnType();
      setSetMethod(Helper.getDeclaredMethod(theJavaClass,getSetMethodName(),parameterTypes));
    }
  }
 catch (  NoSuchMethodException ex) {
    DescriptorException descriptorException=DescriptorException.noSuchMethodWhileInitializingAttributesInMethodAccessor(getSetMethodName(),getGetMethodName(),theJavaClass.getName());
    descriptorException.setInternalException(ex);
    throw descriptorException;
  }
catch (  SecurityException exception) {
    DescriptorException descriptorException=DescriptorException.securityWhileInitializingAttributesInMethodAccessor(getSetMethodName(),getGetMethodName(),theJavaClass.getName());
    descriptorException.setInternalException(exception);
    throw descriptorException;
  }
}
Program: 67538
Project: 67538
Buggy source:
/** 
 * INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.
 */
@Override public void postCalculateChanges(org.eclipse.persistence.sessions.changesets.ChangeRecord changeRecord,UnitOfWorkImpl uow){
  Object oldValue=((ObjectReferenceChangeRecord)changeRecord).getOldValue();
  uow.addDeletedPrivateOwnedObjects(this,oldValue);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.
 */
@Override public void postCalculateChanges(org.eclipse.persistence.sessions.changesets.ChangeRecord changeRecord,UnitOfWorkImpl uow){
  Object oldValue=((ObjectReferenceChangeRecord)changeRecord).getOldValue();
  if (oldValue != null) {
    uow.addDeletedPrivateOwnedObjects(this,oldValue);
  }
}
Program: 67540
Project: 67540
Buggy source:
/** 
 * INTERNAL: Sets a javax.persistence.LockModeType to used with this queries execution.  The valid types are: - WRITE - READ - OPTIMISTIC - OPTIMISTIC_FORCE_INCREMENT - PESSIMISTIC - PESSIMISTIC_FORCE_INCREMENT - NONE Setting a null type will do nothing.
 * @return returns a failure flag indicating that we were UNABLE to set the lock mode because of validation. Callers to this method should check the  return value and throw the necessary exception.
 */
public boolean setLockModeType(String lockModeType,AbstractSession session){
  if (lockModeType != null) {
    OptimisticLockingPolicy lockingPolicy=session.getDescriptor(getReferenceClass()).getOptimisticLockingPolicy();
    if (lockingPolicy == null || !(lockingPolicy instanceof VersionLockingPolicy)) {
      if (!lockModeType.equals(PESSIMISTIC) && !lockModeType.equals(NONE)) {
        return true;
      }
    }
    this.lockModeType=lockModeType;
    setIsPrePrepared(false);
    setIsPrepared(false);
    setWasDefaultLockMode(false);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Sets a javax.persistence.LockModeType to used with this queries execution.  The valid types are: - WRITE - READ - OPTIMISTIC - OPTIMISTIC_FORCE_INCREMENT - PESSIMISTIC_READ - PESSIMISTIC_WRITE - PESSIMISTIC_FORCE_INCREMENT - NONE Setting a null type will do nothing.
 * @return returns a failure flag indicating that we were UNABLE to set the lock mode because of validation. Callers to this method should check the  return value and throw the necessary exception.
 */
public boolean setLockModeType(String lockModeType,AbstractSession session){
  if (lockModeType != null) {
    OptimisticLockingPolicy lockingPolicy=session.getDescriptor(getReferenceClass()).getOptimisticLockingPolicy();
    if (lockingPolicy == null || !(lockingPolicy instanceof VersionLockingPolicy)) {
      if (!lockModeType.equals(PESSIMISTIC_READ) && !lockModeType.equals(PESSIMISTIC_WRITE) && !lockModeType.equals(NONE)) {
        return true;
      }
    }
    this.lockModeType=lockModeType;
    setIsPrePrepared(false);
    setIsPrepared(false);
    setWasDefaultLockMode(false);
  }
  return false;
}
Program: 67542
Project: 67542
Buggy source:
/** 
 * INTERNAL: Sets a javax.persistence.LockModeType to used with this queries execution.  The valid types are: - WRITE - READ - OPTIMISTIC - OPTIMISTIC_FORCE_INCREMENT - PESSIMISTIC - PESSIMISTIC_FORCE_INCREMENT - NONE Setting a null type will do nothing.
 * @return returns a failure flag indicating that we were UNABLE to set the lock mode because of validation. Callers to this method should check the  return value and throw the necessary exception.
 */
@Override public boolean setLockModeType(String lockModeType,AbstractSession session){
  if (lockModeType != null) {
    if (super.setLockModeType(lockModeType,session)) {
      return true;
    }
 else {
      if (!lockModeType.equals(PESSIMISTIC) && !lockModeType.equals(NONE)) {
        for (        ReportItem reportItem : (Vector<ReportItem>)getItems()) {
          if (reportItem.getAttributeExpression() != null && reportItem.getAttributeExpression().isExpressionBuilder()) {
            OptimisticLockingPolicy lockingPolicy=reportItem.getDescriptor().getOptimisticLockingPolicy();
            if (lockingPolicy == null || !(lockingPolicy instanceof VersionLockingPolicy)) {
              return true;
            }
          }
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Sets a javax.persistence.LockModeType to used with this queries execution.  The valid types are: - WRITE - READ - OPTIMISTIC - OPTIMISTIC_FORCE_INCREMENT - PESSIMISTIC - PESSIMISTIC_FORCE_INCREMENT - NONE Setting a null type will do nothing.
 * @return returns a failure flag indicating that we were UNABLE to set the lock mode because of validation. Callers to this method should check the  return value and throw the necessary exception.
 */
@Override public boolean setLockModeType(String lockModeType,AbstractSession session){
  if (lockModeType != null) {
    if (super.setLockModeType(lockModeType,session)) {
      return true;
    }
 else {
      if (!lockModeType.equals(PESSIMISTIC_READ) && !lockModeType.equals(PESSIMISTIC_WRITE) && !lockModeType.equals(NONE)) {
        for (        ReportItem reportItem : (Vector<ReportItem>)getItems()) {
          if (reportItem.getAttributeExpression() != null && reportItem.getAttributeExpression().isExpressionBuilder()) {
            OptimisticLockingPolicy lockingPolicy=reportItem.getDescriptor().getOptimisticLockingPolicy();
            if (lockingPolicy == null || !(lockingPolicy instanceof VersionLockingPolicy)) {
              return true;
            }
          }
        }
      }
    }
  }
  return false;
}
Program: 67544
Project: 67544
Buggy source:
public void addTests(){
  setManager(PopulationManager.getDefaultManager());
  addTest(new UnitTestCase("String_Node_Str"));
  addTest(new UnitTestCase("String_Node_Str"));
  addTest(new UnitTestCase("String_Node_Str"));
  addTest(new UnitTestCase("String_Node_Str"));
  addTest(new UnitTestCase("String_Node_Str"));
  addTest(new UnitTestCase("String_Node_Str"));
}

Fixed version (ground truth):
public void addTests(){
  setManager(PopulationManager.getDefaultManager());
  addTest(new UnitTestCase("String_Node_Str"));
  addTest(new UnitTestCase("String_Node_Str"));
  addTest(new UnitTestCase("String_Node_Str"));
  addTest(new UnitTestCase("String_Node_Str"));
  addTest(new UnitTestCase("String_Node_Str"));
  addTest(new UnitTestCase("String_Node_Str"));
  addTest(new UnitTestCase("String_Node_Str"));
}
Program: 67545
Project: 67545
Buggy source:
/** 
 * INTERNAL: Return if the operator is equal to the other.
 */
public boolean equals(Object object){
  if (this == object) {
    return true;
  }
  if ((object == null) || (getClass() != object.getClass())) {
    return false;
  }
  ExpressionOperator operator=(ExpressionOperator)object;
  if (getSelector() == 0) {
    return getDatabaseStrings().equals(operator.getDatabaseStrings());
  }
 else {
    return getSelector() == operator.getSelector();
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return if the operator is equal to the other.
 */
public boolean equals(Object object){
  if (this == object) {
    return true;
  }
  if ((object == null) || (getClass() != object.getClass())) {
    return false;
  }
  ExpressionOperator operator=(ExpressionOperator)object;
  if (getSelector() == 0) {
    return Arrays.equals(getDatabaseStrings(),operator.getDatabaseStrings());
  }
 else {
    return getSelector() == operator.getSelector();
  }
}
Program: 67546
Project: 67546
Buggy source:
/** 
 * Notice that the usage of value holders does not effect the public interface or usage of the class. The get/set methods must however be changed to wrap/unwrap the value holder.
 */
public void setPhoneNumbers(Vector phoneNumbers){
  for (int index=0; index < getPhoneNumbers().size(); index++) {
    collectionChange("String_Node_Str",this.phoneNumbers,getPhoneNumbers().get(index),1);
  }
  if (phoneNumbers != null) {
    for (int index=0; index < phoneNumbers.size(); index++) {
      collectionChange("String_Node_Str",this.phoneNumbers,phoneNumbers.get(index),0);
    }
  }
  this.phoneNumbers.setValue(phoneNumbers);
}

Fixed version (ground truth):
/** 
 * Notice that the usage of value holders does not effect the public interface or usage of the class. The get/set methods must however be changed to wrap/unwrap the value holder.
 */
public void setPhoneNumbers(Vector phoneNumbers){
  propertyChange("String_Node_Str",this.phoneNumbers.getValue(),phoneNumbers);
  this.phoneNumbers.setValue(phoneNumbers);
}
Program: 67547
Project: 67547
Buggy source:
/** 
 * For bi-directional relationships, it is important to maintain both sides of the relationship when changing it.
 */
public void addPhoneNumber(PhoneNumber phoneNumber){
  collectionChange("String_Node_Str",phoneNumbers,phoneNumber,0);
  getPhoneNumbers().addElement(phoneNumber);
  phoneNumber.setOwner(this);
}

Fixed version (ground truth):
/** 
 * For bi-directional relationships, it is important to maintain both sides of the relationship when changing it.
 */
public void addPhoneNumber(PhoneNumber phoneNumber){
  if (getPhoneNumbers().add(phoneNumber)) {
    collectionChange("String_Node_Str",phoneNumbers,phoneNumber,0);
    phoneNumber.setOwner(this);
  }
}
Program: 67548
Project: 67548
Buggy source:
public void addResponsibility(String responsibility){
  collectionChange("String_Node_Str",responsibilitiesList,responsibility,0);
  getResponsibilitiesList().addElement(responsibility);
}

Fixed version (ground truth):
public void addResponsibility(String responsibility){
  if (getResponsibilitiesList().add(responsibility)) {
    collectionChange("String_Node_Str",responsibilitiesList,responsibility,0);
  }
}
Program: 67549
Project: 67549
Buggy source:
/** 
 * Remove the phone number. The phone number's owner must not be set to null as it is part of it primary key, and you can never change the primary key of an existing object. Only in independent relationships should you null out the back reference.
 */
public void removePhoneNumber(PhoneNumber phoneNumber){
  collectionChange("String_Node_Str",phoneNumbers,phoneNumber,1);
  getPhoneNumbers().removeElement(phoneNumber);
}

Fixed version (ground truth):
/** 
 * Remove the phone number. The phone number's owner must not be set to null as it is part of it primary key, and you can never change the primary key of an existing object. Only in independent relationships should you null out the back reference.
 */
public void removePhoneNumber(PhoneNumber phoneNumber){
  if (getPhoneNumbers().removeElement(phoneNumber)) {
    collectionChange("String_Node_Str",phoneNumbers,phoneNumber,1);
  }
}
Program: 67550
Project: 67550
Buggy source:
public void removeProject(org.eclipse.persistence.testing.models.employee.interfaces.Project project){
  collectionChange("String_Node_Str",projects,project,1);
  getProjects().removeElement(project);
}

Fixed version (ground truth):
public void removeProject(org.eclipse.persistence.testing.models.employee.interfaces.Project project){
  if (getProjects().removeElement(project)) {
    collectionChange("String_Node_Str",projects,project,1);
  }
}
Program: 67551
Project: 67551
Buggy source:
/** 
 * For bi-directional relationships, it is important to maintain both sides of the relationship when changing it.
 */
public void removeManagedEmployee(org.eclipse.persistence.testing.models.employee.interfaces.Employee employee){
  collectionChange("String_Node_Str",managedEmployees,employee,1);
  getManagedEmployees().removeElement(employee);
  employee.setManager(null);
}

Fixed version (ground truth):
/** 
 * For bi-directional relationships, it is important to maintain both sides of the relationship when changing it.
 */
public void removeManagedEmployee(org.eclipse.persistence.testing.models.employee.interfaces.Employee employee){
  if (getManagedEmployees().removeElement(employee)) {
    collectionChange("String_Node_Str",managedEmployees,employee,1);
    employee.setManager(null);
  }
}
Program: 67552
Project: 67552
Buggy source:
/** 
 * Notice that the usage of value holders does not effect the public interface or usage of the class. The get/set methods must however be changed to wrap/unwrap the value holder.
 */
public void setManagedEmployees(Vector managedEmployees){
  for (int index=0; index < getManagedEmployees().size(); index++) {
    collectionChange("String_Node_Str",this.managedEmployees,getManagedEmployees().get(index),1);
  }
  if (managedEmployees != null) {
    for (int index=0; index < managedEmployees.size(); index++) {
      collectionChange("String_Node_Str",this.managedEmployees,managedEmployees.get(index),0);
    }
  }
  this.managedEmployees.setValue(managedEmployees);
}

Fixed version (ground truth):
/** 
 * Notice that the usage of value holders does not effect the public interface or usage of the class. The get/set methods must however be changed to wrap/unwrap the value holder.
 */
public void setManagedEmployees(Vector managedEmployees){
  propertyChange("String_Node_Str",this.managedEmployees.getValue(),managedEmployees);
  this.managedEmployees.setValue(managedEmployees);
}
Program: 67553
Project: 67553
Buggy source:
public void removeResponsibility(String responsibility){
  collectionChange("String_Node_Str",responsibilitiesList,responsibility,1);
  getResponsibilitiesList().removeElement(responsibility);
}

Fixed version (ground truth):
public void removeResponsibility(String responsibility){
  if (getResponsibilitiesList().removeElement(responsibility)) {
    collectionChange("String_Node_Str",responsibilitiesList,responsibility,1);
  }
}
Program: 67554
Project: 67554
Buggy source:
public void addProject(org.eclipse.persistence.testing.models.employee.interfaces.Project project){
  collectionChange("String_Node_Str",projects,project,0);
  getProjects().addElement(project);
}

Fixed version (ground truth):
public void addProject(org.eclipse.persistence.testing.models.employee.interfaces.Project project){
  if (getProjects().add(project)) {
    collectionChange("String_Node_Str",projects,project,0);
  }
}
Program: 67555
Project: 67555
Buggy source:
/** 
 * Notice that the usage of value holders does not effect the public interface or usage of the class. The get/set methods must however be changed to wrap/unwrap the value holder.
 */
public void setProjects(Vector projects){
  for (int index=0; index < getProjects().size(); index++) {
    collectionChange("String_Node_Str",this.projects,getProjects().get(index),1);
  }
  if (projects != null) {
    for (int index=0; index < projects.size(); index++) {
      collectionChange("String_Node_Str",this.projects,projects.get(index),0);
    }
  }
  this.projects.setValue(projects);
}

Fixed version (ground truth):
/** 
 * Notice that the usage of value holders does not effect the public interface or usage of the class. The get/set methods must however be changed to wrap/unwrap the value holder.
 */
public void setProjects(Vector projects){
  propertyChange("String_Node_Str",this.projects.getValue(),projects);
  this.projects.setValue(projects);
}
Program: 67556
Project: 67556
Buggy source:
/** 
 * For bi-directional relationships, it is important to maintain both sides of the relationship when changing it.
 */
public void addManagedEmployee(org.eclipse.persistence.testing.models.employee.interfaces.Employee employee){
  collectionChange("String_Node_Str",managedEmployees,employee,0);
  getManagedEmployees().addElement(employee);
  employee.setManager(this);
}

Fixed version (ground truth):
/** 
 * For bi-directional relationships, it is important to maintain both sides of the relationship when changing it.
 */
public void addManagedEmployee(org.eclipse.persistence.testing.models.employee.interfaces.Employee employee){
  if (getManagedEmployees().add(employee)) {
    collectionChange("String_Node_Str",managedEmployees,employee,0);
    employee.setManager(this);
  }
}
Program: 67558
Project: 67558
Buggy source:
/** 
 * INTERNAL: Remove a privately owned object from the privateOwnedObjects Map. The UnitOfWork needs to keep track of privately owned objects in order to detect and remove private owned objects which are de-referenced. When an object (which is referenced) is removed from the privateOwnedObjects Map,  it is no longer considered for removal from ChangeSets and the UnitOfWork identitymap.
 */
public void removePrivateOwnedObject(DatabaseMapping mapping,Object privateOwnedObject){
  if (privateOwnedObject != null) {
    Set privateOwnedObjects=getPrivateOwnedObjects().get(mapping);
    if (privateOwnedObjects != null) {
      privateOwnedObjects.remove(privateOwnedObject);
      if (privateOwnedObjects.isEmpty()) {
        privateOwnedObjects.remove(mapping);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Remove a privately owned object from the privateOwnedObjects Map. The UnitOfWork needs to keep track of privately owned objects in order to detect and remove private owned objects which are de-referenced. When an object (which is referenced) is removed from the privateOwnedObjects Map,  it is no longer considered for removal from ChangeSets and the UnitOfWork identitymap.
 */
public void removePrivateOwnedObject(DatabaseMapping mapping,Object privateOwnedObject){
  if (this.privateOwnedObjects != null) {
    Set objectsForMapping=this.privateOwnedObjects.get(mapping);
    if (objectsForMapping != null) {
      objectsForMapping.remove(privateOwnedObject);
      if (objectsForMapping.isEmpty()) {
        this.privateOwnedObjects.remove(mapping);
      }
    }
  }
}
Program: 67559
Project: 67559
Buggy source:
public void iterateReferenceObjectForMapping(Object referenceObject,DatabaseMapping mapping){
  super.iterateReferenceObjectForMapping(referenceObject,mapping);
  if (hasPrivateOwnedObjects()) {
    removePrivateOwnedObject(mapping,referenceObject);
  }
}

Fixed version (ground truth):
public void iterateReferenceObjectForMapping(Object referenceObject,DatabaseMapping mapping){
  super.iterateReferenceObjectForMapping(referenceObject,mapping);
  if (mapping.isCandidateForPrivateOwnedRemoval()) {
    removePrivateOwnedObject(mapping,referenceObject);
  }
}
Program: 67561
Project: 67561
Buggy source:
/** 
 * INTERNAL: Cascade registerNew for Create through mappings that require the cascade
 */
public void cascadeRegisterNewIfRequired(Object object,UnitOfWorkImpl uow,Map visitedObjects){
  Object cloneAttribute=null;
  cloneAttribute=getAttributeValueFromObject(object);
  if ((cloneAttribute == null) || (!this.isCascadePersist()) || (!getIndirectionPolicy().objectIsInstantiated(cloneAttribute))) {
    return;
  }
  ContainerPolicy cp=getContainerPolicy();
  Object cloneObjectCollection=null;
  cloneObjectCollection=getRealCollectionAttributeValueFromObject(object,uow);
  Object cloneIter=cp.iteratorFor(cloneObjectCollection);
  while (cp.hasNext(cloneIter)) {
    Object wrappedObject=cp.nextEntry(cloneIter,uow);
    Object nextObject=cp.unwrapIteratorResult(wrappedObject);
    if (isCandidateForPrivateOwnedRemoval() && uow.shouldDiscoverNewObjects()) {
      uow.addPrivateOwnedObject(this,nextObject);
    }
    uow.registerNewObjectForPersist(nextObject,visitedObjects);
    cp.cascadeRegisterNewIfRequired(wrappedObject,uow,visitedObjects);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Cascade registerNew for Create through mappings that require the cascade
 */
public void cascadeRegisterNewIfRequired(Object object,UnitOfWorkImpl uow,Map visitedObjects){
  Object cloneAttribute=null;
  cloneAttribute=getAttributeValueFromObject(object);
  if ((cloneAttribute == null) || (!this.isCascadePersist()) || (!getIndirectionPolicy().objectIsInstantiated(cloneAttribute))) {
    return;
  }
  ContainerPolicy cp=getContainerPolicy();
  Object cloneObjectCollection=null;
  cloneObjectCollection=getRealCollectionAttributeValueFromObject(object,uow);
  Object cloneIter=cp.iteratorFor(cloneObjectCollection);
  boolean shouldAddPrivateOwnedObject=isCandidateForPrivateOwnedRemoval() && uow.shouldDiscoverNewObjects() && uow.isObjectNew(object);
  while (cp.hasNext(cloneIter)) {
    Object wrappedObject=cp.nextEntry(cloneIter,uow);
    Object nextObject=cp.unwrapIteratorResult(wrappedObject);
    if (shouldAddPrivateOwnedObject && nextObject != null) {
      uow.addPrivateOwnedObject(this,nextObject);
    }
    uow.registerNewObjectForPersist(nextObject,visitedObjects);
    cp.cascadeRegisterNewIfRequired(wrappedObject,uow,visitedObjects);
  }
}
Program: 67563
Project: 67563
Buggy source:
/** 
 * INTERNAL: Cascade registerNew for Create through mappings that require the cascade
 */
public void cascadeRegisterNewIfRequired(Object object,UnitOfWorkImpl uow,Map visitedObjects,boolean getAttributeValueFromObject){
  Object attributeValue=null;
  if (getAttributeValueFromObject) {
    attributeValue=getAttributeValueFromObject(object);
  }
 else {
    attributeValue=object;
  }
  if (attributeValue != null && this.isCascadePersist() && getIndirectionPolicy().objectIsInstantiated(attributeValue)) {
    if (getAttributeValueFromObject) {
      attributeValue=getIndirectionPolicy().getRealAttributeValueFromObject(object,attributeValue);
    }
    uow.registerNewObjectForPersist(attributeValue,visitedObjects);
    if (isCandidateForPrivateOwnedRemoval() && uow.shouldDiscoverNewObjects()) {
      uow.addPrivateOwnedObject(this,attributeValue);
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Cascade registerNew for Create through mappings that require the cascade
 */
public void cascadeRegisterNewIfRequired(Object object,UnitOfWorkImpl uow,Map visitedObjects,boolean getAttributeValueFromObject){
  Object attributeValue=null;
  if (getAttributeValueFromObject) {
    attributeValue=getAttributeValueFromObject(object);
  }
 else {
    attributeValue=object;
  }
  if (attributeValue != null && this.isCascadePersist() && getIndirectionPolicy().objectIsInstantiated(attributeValue)) {
    if (getAttributeValueFromObject) {
      attributeValue=getIndirectionPolicy().getRealAttributeValueFromObject(object,attributeValue);
    }
    uow.registerNewObjectForPersist(attributeValue,visitedObjects);
    if (isCandidateForPrivateOwnedRemoval() && uow.shouldDiscoverNewObjects() && reference != null && uow.isObjectNew(object)) {
      uow.addPrivateOwnedObject(this,attributeValue);
    }
  }
}
Program: 67564
Project: 67564
Buggy source:
/** 
 * INTERNAL: Cascade discover and persist new objects during commit.
 */
public void cascadeDiscoverAndPersistUnregisteredNewObjects(Object object,Map newObjects,Map unregisteredExistingObjects,Map visitedObjects,UnitOfWorkImpl uow,boolean getAttributeValueFromObject){
  Object attributeValue=null;
  if (getAttributeValueFromObject) {
    attributeValue=getAttributeValueFromObject(object);
  }
 else {
    attributeValue=object;
  }
  if (attributeValue != null && getIndirectionPolicy().objectIsInstantiated(attributeValue)) {
    if (getAttributeValueFromObject) {
      attributeValue=getIndirectionPolicy().getRealAttributeValueFromObject(object,attributeValue);
    }
    if (uow.hasPrivateOwnedObjects()) {
      uow.removePrivateOwnedObject(this,attributeValue);
    }
    uow.discoverAndPersistUnregisteredNewObjects(attributeValue,isCascadePersist(),newObjects,unregisteredExistingObjects,visitedObjects);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Cascade discover and persist new objects during commit.
 */
public void cascadeDiscoverAndPersistUnregisteredNewObjects(Object object,Map newObjects,Map unregisteredExistingObjects,Map visitedObjects,UnitOfWorkImpl uow,boolean getAttributeValueFromObject){
  Object attributeValue=null;
  if (getAttributeValueFromObject) {
    attributeValue=getAttributeValueFromObject(object);
  }
 else {
    attributeValue=object;
  }
  if (attributeValue != null && getIndirectionPolicy().objectIsInstantiated(attributeValue)) {
    if (getAttributeValueFromObject) {
      attributeValue=getIndirectionPolicy().getRealAttributeValueFromObject(object,attributeValue);
    }
    if (isCandidateForPrivateOwnedRemoval()) {
      uow.removePrivateOwnedObject(this,attributeValue);
    }
    uow.discoverAndPersistUnregisteredNewObjects(attributeValue,isCascadePersist(),newObjects,unregisteredExistingObjects,visitedObjects);
  }
}
Program: 67565
Project: 67565
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  suite.addTest(new PrivateOwnedJUnitTestCase("String_Node_Str"));
  return suite;
}
Program: 67567
Project: 67567
Buggy source:
/** 
 * PUBLIC: Return a new descriptor.
 */
public ClassDescriptor(){
  this.tables=NonSynchronizedVector.newInstance(3);
  this.mappings=NonSynchronizedVector.newInstance();
  this.primaryKeyFields=new ArrayList(2);
  this.fields=NonSynchronizedVector.newInstance();
  this.allFields=NonSynchronizedVector.newInstance();
  this.constraintDependencies=NonSynchronizedVector.newInstance(2);
  this.multipleTableForeignKeys=new HashMap(5);
  this.queryKeys=new HashMap(5);
  this.initializationStage=UNINITIALIZED;
  this.interfaceInitializationStage=UNINITIALIZED;
  this.shouldAlwaysRefreshCache=false;
  this.shouldOnlyRefreshCacheIfNewerVersion=false;
  this.shouldDisableCacheHits=false;
  this.identityMapSize=-1;
  this.remoteIdentityMapSize=-1;
  this.remoteIdentityMapClass=null;
  this.descriptorType=NORMAL;
  this.shouldAlwaysRefreshCacheOnRemote=false;
  this.shouldDisableCacheHitsOnRemote=false;
  this.shouldOrderMappings=true;
  this.shouldBeReadOnly=false;
  this.shouldAlwaysConformResultsInUnitOfWork=false;
  this.shouldAcquireCascadedLocks=false;
  this.hasSimplePrimaryKey=false;
  this.isIDSpecified=false;
  this.objectBuilder=new ObjectBuilder(this);
  this.cascadeLockingPolicies=NonSynchronizedVector.newInstance();
}

Fixed version (ground truth):
/** 
 * PUBLIC: Return a new descriptor.
 */
public ClassDescriptor(){
  this.tables=NonSynchronizedVector.newInstance(3);
  this.mappings=NonSynchronizedVector.newInstance();
  this.primaryKeyFields=new ArrayList(2);
  this.fields=NonSynchronizedVector.newInstance();
  this.allFields=NonSynchronizedVector.newInstance();
  this.constraintDependencies=NonSynchronizedVector.newInstance(2);
  this.multipleTableForeignKeys=new HashMap(5);
  this.queryKeys=new HashMap(5);
  this.initializationStage=UNINITIALIZED;
  this.interfaceInitializationStage=UNINITIALIZED;
  this.shouldAlwaysRefreshCache=false;
  this.shouldOnlyRefreshCacheIfNewerVersion=false;
  this.shouldDisableCacheHits=false;
  this.identityMapSize=-1;
  this.remoteIdentityMapSize=-1;
  this.remoteIdentityMapClass=null;
  this.descriptorType=NORMAL;
  this.shouldAlwaysRefreshCacheOnRemote=false;
  this.shouldDisableCacheHitsOnRemote=false;
  this.shouldOrderMappings=true;
  this.shouldBeReadOnly=false;
  this.shouldAlwaysConformResultsInUnitOfWork=false;
  this.shouldAcquireCascadedLocks=false;
  this.hasSimplePrimaryKey=false;
  this.hasDerivedId=false;
  this.objectBuilder=new ObjectBuilder(this);
  this.cascadeLockingPolicies=NonSynchronizedVector.newInstance();
}
Program: 67569
Project: 67569
Buggy source:
/** 
 * This method decodes the given byte[] using the base64-encoding specified in RFC-2045 (Section 6.8).
 * @param data the base64-encoded data.
 * @return the decoded <var>data</var>.
 */
public final static byte[] base64Decode(byte[] data){
  if (data == null) {
    return null;
  }
  int tail=data.length;
  while (data[tail - 1] == '=') {
    tail--;
  }
  byte[] dest=new byte[tail - (data.length / 4)];
  for (int idx=0; idx < data.length; idx++) {
    data[idx]=Base64DecMap[data[idx]];
  }
  int sidx;
  int didx;
  for (sidx=0, didx=0; didx < (dest.length - 2); sidx+=4, didx+=3) {
    dest[didx]=(byte)(((data[sidx] << 2) & 255) | ((data[sidx + 1] >>> 4) & 003));
    dest[didx + 1]=(byte)(((data[sidx + 1] << 4) & 255) | ((data[sidx + 2] >>> 2) & 017));
    dest[didx + 2]=(byte)(((data[sidx + 2] << 6) & 255) | (data[sidx + 3] & 077));
  }
  if (didx < dest.length) {
    dest[didx]=(byte)(((data[sidx] << 2) & 255) | ((data[sidx + 1] >>> 4) & 003));
  }
  if (++didx < dest.length) {
    dest[didx]=(byte)(((data[sidx + 1] << 4) & 255) | ((data[sidx + 2] >>> 2) & 017));
  }
  return dest;
}

Fixed version (ground truth):
/** 
 * This method decodes the given byte[] using the base64-encoding specified in RFC-2045 (Section 6.8).
 * @param data the base64-encoded data.
 * @return the decoded <var>data</var>.
 */
public final static byte[] base64Decode(byte[] data){
  if (data == null) {
    return null;
  }
  if (data.length == 0) {
    return new byte[0];
  }
  int tail=data.length;
  while (data[tail - 1] == '=') {
    tail--;
  }
  byte[] dest=new byte[tail - (data.length / 4)];
  for (int idx=0; idx < data.length; idx++) {
    data[idx]=Base64DecMap[data[idx]];
  }
  int sidx;
  int didx;
  for (sidx=0, didx=0; didx < (dest.length - 2); sidx+=4, didx+=3) {
    dest[didx]=(byte)(((data[sidx] << 2) & 255) | ((data[sidx + 1] >>> 4) & 003));
    dest[didx + 1]=(byte)(((data[sidx + 1] << 4) & 255) | ((data[sidx + 2] >>> 2) & 017));
    dest[didx + 2]=(byte)(((data[sidx + 2] << 6) & 255) | (data[sidx + 3] & 077));
  }
  if (didx < dest.length) {
    dest[didx]=(byte)(((data[sidx] << 2) & 255) | ((data[sidx + 1] >>> 4) & 003));
  }
  if (++didx < dest.length) {
    dest[didx]=(byte)(((data[sidx + 1] << 4) & 255) | ((data[sidx + 2] >>> 2) & 017));
  }
  return dest;
}
Program: 67571
Project: 67571
Buggy source:
/** 
 * INTERNAL:
 */
public void characters(String value){
  Text text=getDocument().createTextNode(value);
  getNode().appendChild(text);
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void characters(String value){
  if (value.length() > 0) {
    Text text=getDocument().createTextNode(value);
    getNode().appendChild(text);
  }
}
Program: 67572
Project: 67572
Buggy source:
/** 
 * INTERNAL:
 */
public void processDerivedIdFields(OneToOneMapping mapping,MetadataDescriptor referenceDescriptor){
  if (referenceDescriptor.hasEmbeddedId()) {
    for (    MappingAccessor basicAccessor : getReferenceAccessors()) {
      String defaultFieldName=basicAccessor.getMapping().getField().getName();
      DatabaseField dependentField=getField(defaultFieldName);
      EmbeddedIdAccessor embeddedIdAccessor=referenceDescriptor.getEmbeddedIdAccessor();
      DatabaseField parentField=embeddedIdAccessor.getField(defaultFieldName);
      mapping.addForeignKeyField(dependentField,parentField);
    }
  }
 else {
    for (    MappingAccessor basicAccessor : getReferenceAccessors()) {
      DatabaseField dependentField=((BasicAccessor)basicAccessor).getField();
      DatabaseField parentField=referenceDescriptor.getAccessorFor(basicAccessor.getAttributeName()).getMapping().getField();
      mapping.addForeignKeyField(dependentField,parentField);
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: The reference descriptor in this case is the descriptor for the one to one mapping's reference class. This method is called when processing a  derived mapped by id case. This embedded accessor (aka the derived id class accessor) is either directly on the dependent entity or nested  within the dependent's embedded id. In either case it does not affect  processing details of the dependent field and we must always take an  attribute override setting into consideration.
 */
public void processDerivedIdFields(OneToOneMapping mapping,MetadataDescriptor referenceDescriptor){
  EmbeddedIdAccessor referenceEmbeddedIdAccessor=referenceDescriptor.getEmbeddedIdAccessor();
  for (  MappingAccessor basicAccessor : getReferenceAccessors()) {
    String defaultFieldName=((BasicAccessor)basicAccessor).getField().getName();
    DatabaseField dependentField=getField(defaultFieldName);
    DatabaseField parentField;
    if (referenceEmbeddedIdAccessor == null) {
      parentField=referenceDescriptor.getAccessorFor(basicAccessor.getAttributeName()).getMapping().getField();
    }
 else {
      parentField=referenceEmbeddedIdAccessor.getField(defaultFieldName);
    }
    mapping.addForeignKeyField(dependentField,parentField);
  }
}
Program: 67573
Project: 67573
Buggy source:
public void addTests(){
  addTest(new NotConnectedDeleteObjectTest());
  addTest(new NotConnectedReadObjectTest());
  addTest(new NotConnectedUpdateObjectQueryTest());
  addTest(new NotConnectedWriteObjectTest());
}

Fixed version (ground truth):
public void addTests(){
  addTest(new NotConnectedDeleteObjectTest());
  addTest(new NotConnectedReadObjectTest());
  addTest(new NotConnectedUpdateObjectQueryTest());
  addTest(new NotConnectedWriteObjectTest());
  addTest(new ConnectionIsNullAccessorTest());
}
Program: 67575
Project: 67575
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(DateAndTimeTestCases.class);
  suite.addTestSuite(QNameTestCases.class);
  suite.addTestSuite(Base64TestCases.class);
  suite.addTestSuite(ListTestCases.class);
  suite.addTestSuite(DoubleToBigDecimalTestCases.class);
  suite.addTestSuite(XMLGregorianCalendarTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(DateAndTimeTestCases.class);
  suite.addTestSuite(QNameTestCases.class);
  suite.addTestSuite(Base64TestCases.class);
  suite.addTestSuite(ListTestCases.class);
  suite.addTestSuite(DoubleToBigDecimalTestCases.class);
  suite.addTestSuite(XMLGregorianCalendarTestCases.class);
  suite.addTestSuite(NumberTestCases.class);
  return suite;
}
Program: 67577
Project: 67577
Buggy source:
public void convertClassNamesToClasses(ClassLoader classLoader){
  Iterator<XMLField> xpaths=fieldToClassNameMappings.keySet().iterator();
  while (xpaths.hasNext()) {
    XMLField xpath=xpaths.next();
    String className=fieldToClassNameMappings.get(xpath);
    Class elementType=null;
    try {
      if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
        try {
          elementType=(Class)AccessController.doPrivileged(new PrivilegedClassForName(className,true,classLoader));
        }
 catch (        PrivilegedActionException exception) {
          throw ValidationException.classNotFoundWhileConvertingClassNames(className,exception.getException());
        }
      }
 else {
        elementType=org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(className,true,classLoader);
      }
    }
 catch (    ClassNotFoundException exc) {
      throw ValidationException.classNotFoundWhileConvertingClassNames(className,exc);
    }
    addChoiceElement(xpath,elementType);
  }
}

Fixed version (ground truth):
public void convertClassNamesToClasses(ClassLoader classLoader){
  Iterator<XMLField> xpaths=fieldToClassNameMappings.keySet().iterator();
  while (xpaths.hasNext()) {
    XMLField xpath=xpaths.next();
    String className=fieldToClassNameMappings.get(xpath);
    Class elementType=null;
    try {
      if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
        try {
          elementType=(Class)AccessController.doPrivileged(new PrivilegedClassForName(className,true,classLoader));
        }
 catch (        PrivilegedActionException exception) {
          throw ValidationException.classNotFoundWhileConvertingClassNames(className,exception.getException());
        }
      }
 else {
        elementType=org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(className,true,classLoader);
      }
    }
 catch (    ClassNotFoundException exc) {
      throw ValidationException.classNotFoundWhileConvertingClassNames(className,exc);
    }
    if (classToFieldMappings.get(elementType) == null) {
      classToFieldMappings.put(elementType,xpath);
    }
  }
}