nus-yam/ex-repair huggingface dataset:
Program: 68510
Project: 68510
Buggy source:
/** 
 * Build the row representation of the object for update. The row built does not contain entries for uninstantiated attributes.
 */
public AbstractRecord buildRowForUpdate(WriteObjectQuery query){
  AbstractRecord databaseRow=createRecord();
  for (Iterator mappings=getNonPrimaryKeyMappings().iterator(); mappings.hasNext(); ) {
    DatabaseMapping mapping=(DatabaseMapping)mappings.next();
    mapping.writeFromObjectIntoRowForUpdate(query,databaseRow);
  }
  if (this.descriptor.hasInheritance() && this.descriptor.isAggregateDescriptor()) {
    if (query.getObject() != null) {
      if (query.getBackupClone() == null) {
        this.descriptor.getInheritancePolicy().addClassIndicatorFieldToRow(databaseRow);
      }
 else {
        if (!query.getObject().getClass().equals(query.getBackupClone().getClass())) {
          this.descriptor.getInheritancePolicy().addClassIndicatorFieldToRow(databaseRow);
        }
      }
    }
  }
  return databaseRow;
}

Fixed version (ground truth):
/** 
 * Build the row representation of the object for update. The row built does not contain entries for uninstantiated attributes.
 */
public AbstractRecord buildRowForUpdate(WriteObjectQuery query){
  AbstractRecord databaseRow=createRecord(query.getSession());
  for (Iterator mappings=getNonPrimaryKeyMappings().iterator(); mappings.hasNext(); ) {
    DatabaseMapping mapping=(DatabaseMapping)mappings.next();
    mapping.writeFromObjectIntoRowForUpdate(query,databaseRow);
  }
  if (this.descriptor.hasInheritance() && this.descriptor.isAggregateDescriptor()) {
    if (query.getObject() != null) {
      if (query.getBackupClone() == null) {
        this.descriptor.getInheritancePolicy().addClassIndicatorFieldToRow(databaseRow);
      }
 else {
        if (!query.getObject().getClass().equals(query.getBackupClone().getClass())) {
          this.descriptor.getInheritancePolicy().addClassIndicatorFieldToRow(databaseRow);
        }
      }
    }
  }
  return databaseRow;
}
Program: 68511
Project: 68511
Buggy source:
/** 
 * Build the row from the primary key values.
 */
public AbstractRecord buildRowFromPrimaryKeyValues(Vector key,AbstractSession session){
  AbstractRecord databaseRow=createRecord(key.size());
  int keySize=key.size();
  for (int index=0; index < keySize; index++) {
    DatabaseField field=this.descriptor.getPrimaryKeyFields().get(index);
    Object value=key.elementAt(index);
    value=session.getPlatform(this.descriptor.getJavaClass()).getConversionManager().convertObject(value,field.getType());
    databaseRow.put(field,value);
  }
  return databaseRow;
}

Fixed version (ground truth):
/** 
 * Build the row from the primary key values.
 */
public AbstractRecord buildRowFromPrimaryKeyValues(Vector key,AbstractSession session){
  AbstractRecord databaseRow=createRecord(key.size(),session);
  int keySize=key.size();
  for (int index=0; index < keySize; index++) {
    DatabaseField field=this.descriptor.getPrimaryKeyFields().get(index);
    Object value=key.elementAt(index);
    value=session.getPlatform(this.descriptor.getJavaClass()).getConversionManager().convertObject(value,field.getType());
    databaseRow.put(field,value);
  }
  return databaseRow;
}
Program: 68512
Project: 68512
Buggy source:
/** 
 * Return the row with primary keys and their values from the given expression.
 */
public Vector extractPrimaryKeyFromExpression(boolean requiresExactMatch,Expression expression,AbstractRecord translationRow,AbstractSession session){
  AbstractRecord primaryKeyRow=createRecord(getPrimaryKeyMappings().size());
  expression.getBuilder().setSession(session.getRootSession(null));
  boolean isValid=expression.extractPrimaryKeyValues(requiresExactMatch,this.descriptor,primaryKeyRow,translationRow);
  if (requiresExactMatch && (!isValid)) {
    return null;
  }
  if (primaryKeyRow.size() != this.descriptor.getPrimaryKeyFields().size()) {
    return null;
  }
  return extractPrimaryKeyFromRow(primaryKeyRow,session);
}

Fixed version (ground truth):
/** 
 * Return the row with primary keys and their values from the given expression.
 */
public Vector extractPrimaryKeyFromExpression(boolean requiresExactMatch,Expression expression,AbstractRecord translationRow,AbstractSession session){
  AbstractRecord primaryKeyRow=createRecord(getPrimaryKeyMappings().size(),session);
  expression.getBuilder().setSession(session.getRootSession(null));
  boolean isValid=expression.extractPrimaryKeyValues(requiresExactMatch,this.descriptor,primaryKeyRow,translationRow);
  if (requiresExactMatch && (!isValid)) {
    return null;
  }
  if (primaryKeyRow.size() != this.descriptor.getPrimaryKeyFields().size()) {
    return null;
  }
  return extractPrimaryKeyFromRow(primaryKeyRow,session);
}
Program: 68514
Project: 68514
Buggy source:
/** 
 * Return the row with primary keys and their values from the given expression.
 */
public AbstractRecord extractPrimaryKeyRowFromExpression(Expression expression,AbstractRecord translationRow,AbstractSession session){
  AbstractRecord primaryKeyRow=createRecord(getPrimaryKeyMappings().size());
  expression.getBuilder().setSession(session.getRootSession(null));
  boolean isValid=expression.extractPrimaryKeyValues(true,this.descriptor,primaryKeyRow,translationRow);
  if (!isValid) {
    return null;
  }
  if (primaryKeyRow.size() != this.descriptor.getPrimaryKeyFields().size()) {
    return null;
  }
  return primaryKeyRow;
}

Fixed version (ground truth):
/** 
 * Return the row with primary keys and their values from the given expression.
 */
public AbstractRecord extractPrimaryKeyRowFromExpression(Expression expression,AbstractRecord translationRow,AbstractSession session){
  AbstractRecord primaryKeyRow=createRecord(getPrimaryKeyMappings().size(),session);
  expression.getBuilder().setSession(session.getRootSession(null));
  boolean isValid=expression.extractPrimaryKeyValues(true,this.descriptor,primaryKeyRow,translationRow);
  if (!isValid) {
    return null;
  }
  if (primaryKeyRow.size() != this.descriptor.getPrimaryKeyFields().size()) {
    return null;
  }
  return primaryKeyRow;
}
Program: 68515
Project: 68515
Buggy source:
/** 
 * Create a new row/record for the object builder. This allows subclasses to define different record types.
 */
public AbstractRecord createRecord(int size){
  return new DatabaseRecord(size);
}

Fixed version (ground truth):
/** 
 * Create a new row/record for the object builder. This allows subclasses to define different record types.
 */
public AbstractRecord createRecord(int size,AbstractSession session){
  return new DatabaseRecord(size);
}
Program: 68516
Project: 68516
Buggy source:
/** 
 * Build the row representation of an object. The row built is used only for translations for the expressions in the expression framework.
 */
public AbstractRecord buildRowForTranslation(Object object,AbstractSession session){
  AbstractRecord databaseRow=createRecord();
  for (Iterator mappings=getPrimaryKeyMappings().iterator(); mappings.hasNext(); ) {
    DatabaseMapping mapping=(DatabaseMapping)mappings.next();
    if (mapping != null) {
      mapping.writeFromObjectIntoRow(object,databaseRow,session);
    }
  }
  addPrimaryKeyForNonDefaultTable(databaseRow,object,session);
  return databaseRow;
}

Fixed version (ground truth):
/** 
 * Build the row representation of an object. The row built is used only for translations for the expressions in the expression framework.
 */
public AbstractRecord buildRowForTranslation(Object object,AbstractSession session){
  AbstractRecord databaseRow=createRecord(session);
  for (Iterator mappings=getPrimaryKeyMappings().iterator(); mappings.hasNext(); ) {
    DatabaseMapping mapping=(DatabaseMapping)mappings.next();
    if (mapping != null) {
      mapping.writeFromObjectIntoRow(object,databaseRow,session);
    }
  }
  addPrimaryKeyForNonDefaultTable(databaseRow,object,session);
  return databaseRow;
}
Program: 68517
Project: 68517
Buggy source:
/** 
 * INTERNAL: Update the object primary key by fetching a new sequence number from the accessor. This assume the uses sequence numbers check has already been done.
 * @return the sequence value or null if not assigned.
 * @exception DatabaseException - an error has occurred on the database.
 */
public Object assignSequenceNumber(Object object,AbstractSession writeSession) throws DatabaseException {
  DatabaseField sequenceNumberField=this.descriptor.getSequenceNumberField();
  Object existingValue=getBaseValueForField(sequenceNumberField,object);
  if (existingValue != null) {
    if (!writeSession.getSequencing().shouldOverrideExistingValue(object.getClass(),existingValue)) {
      return null;
    }
  }
  Object sequenceValue=writeSession.getSequencing().getNextValue(object.getClass());
  writeSession.log(SessionLog.FINEST,SessionLog.SEQUENCING,"String_Node_Str",sequenceValue,object);
  if (sequenceValue == null) {
    return null;
  }
  AbstractRecord tempRow=createRecord(1);
  tempRow.put(sequenceNumberField,sequenceValue);
  ReadObjectQuery query=new ReadObjectQuery();
  query.setSession(writeSession);
  DatabaseMapping mapping=getBaseMappingForField(sequenceNumberField);
  Object sequenceIntoObject=getParentObjectForField(sequenceNumberField,object);
  Object convertedSequenceValue=mapping.readFromRowIntoObject(tempRow,null,sequenceIntoObject,query);
  clearPrimaryKey(object);
  return convertedSequenceValue;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Update the object primary key by fetching a new sequence number from the accessor. This assume the uses sequence numbers check has already been done.
 * @return the sequence value or null if not assigned.
 * @exception DatabaseException - an error has occurred on the database.
 */
public Object assignSequenceNumber(Object object,AbstractSession writeSession) throws DatabaseException {
  DatabaseField sequenceNumberField=this.descriptor.getSequenceNumberField();
  Object existingValue=getBaseValueForField(sequenceNumberField,object);
  if (existingValue != null) {
    if (!writeSession.getSequencing().shouldOverrideExistingValue(object.getClass(),existingValue)) {
      return null;
    }
  }
  Object sequenceValue=writeSession.getSequencing().getNextValue(object.getClass());
  writeSession.log(SessionLog.FINEST,SessionLog.SEQUENCING,"String_Node_Str",sequenceValue,object);
  if (sequenceValue == null) {
    return null;
  }
  AbstractRecord tempRow=createRecord(1,writeSession);
  tempRow.put(sequenceNumberField,sequenceValue);
  ReadObjectQuery query=new ReadObjectQuery();
  query.setSession(writeSession);
  DatabaseMapping mapping=getBaseMappingForField(sequenceNumberField);
  Object sequenceIntoObject=getParentObjectForField(sequenceNumberField,object);
  Object convertedSequenceValue=mapping.readFromRowIntoObject(tempRow,null,sequenceIntoObject,query);
  clearPrimaryKey(object);
  return convertedSequenceValue;
}
Program: 68518
Project: 68518
Buggy source:
/** 
 * Build the row representation of the object for update. The row built does not contain entries for uninstantiated attributes.
 */
public AbstractRecord buildTemplateUpdateRow(AbstractSession session){
  AbstractRecord databaseRow=createRecord();
  for (Iterator mappings=getNonPrimaryKeyMappings().iterator(); mappings.hasNext(); ) {
    DatabaseMapping mapping=(DatabaseMapping)mappings.next();
    mapping.writeUpdateFieldsIntoRow(databaseRow,session);
  }
  if (getDescriptor().usesOptimisticLocking()) {
    getDescriptor().getOptimisticLockingPolicy().addLockFieldsToUpdateRow(databaseRow,session);
  }
  return databaseRow;
}

Fixed version (ground truth):
/** 
 * Build the row representation of the object for update. The row built does not contain entries for uninstantiated attributes.
 */
public AbstractRecord buildTemplateUpdateRow(AbstractSession session){
  AbstractRecord databaseRow=createRecord(session);
  for (Iterator mappings=getNonPrimaryKeyMappings().iterator(); mappings.hasNext(); ) {
    DatabaseMapping mapping=(DatabaseMapping)mappings.next();
    mapping.writeUpdateFieldsIntoRow(databaseRow,session);
  }
  if (getDescriptor().usesOptimisticLocking()) {
    getDescriptor().getOptimisticLockingPolicy().addLockFieldsToUpdateRow(databaseRow,session);
  }
  return databaseRow;
}
Program: 68519
Project: 68519
Buggy source:
/** 
 * Build the row representation of the object for update. The row built does not contain entries for uninstantiated attributes.
 */
public AbstractRecord buildRowForUpdateWithChangeSet(WriteObjectQuery query){
  AbstractRecord databaseRow=createRecord();
  AbstractSession session=query.getSession();
  List changes=query.getObjectChangeSet().getChanges();
  int size=changes.size();
  for (int index=0; index < size; index++) {
    ChangeRecord changeRecord=(ChangeRecord)changes.get(index);
    DatabaseMapping mapping=changeRecord.getMapping();
    mapping.writeFromObjectIntoRowWithChangeRecord(changeRecord,databaseRow,session);
  }
  return databaseRow;
}

Fixed version (ground truth):
/** 
 * Build the row representation of the object for update. The row built does not contain entries for uninstantiated attributes.
 */
public AbstractRecord buildRowForUpdateWithChangeSet(WriteObjectQuery query){
  AbstractRecord databaseRow=createRecord(query.getSession());
  AbstractSession session=query.getSession();
  List changes=query.getObjectChangeSet().getChanges();
  int size=changes.size();
  for (int index=0; index < size; index++) {
    ChangeRecord changeRecord=(ChangeRecord)changes.get(index);
    DatabaseMapping mapping=changeRecord.getMapping();
    mapping.writeFromObjectIntoRowWithChangeRecord(changeRecord,databaseRow,session);
  }
  return databaseRow;
}
Program: 68520
Project: 68520
Buggy source:
/** 
 * Extract primary key attribute values from the domainObject.
 */
public AbstractRecord extractPrimaryKeyRowFromObject(Object domainObject,AbstractSession session){
  AbstractRecord databaseRow=createRecord(getPrimaryKeyMappings().size());
  for (int index=0; index < getPrimaryKeyMappings().size(); index++) {
    getPrimaryKeyMappings().get(index).writeFromObjectIntoRow(domainObject,databaseRow,session);
  }
  if (this.descriptor.hasSimplePrimaryKey()) {
    return databaseRow;
  }
  AbstractRecord primaryKeyRow=createRecord(getPrimaryKeyMappings().size());
  List primaryKeyFields=this.descriptor.getPrimaryKeyFields();
  for (int index=0; index < primaryKeyFields.size(); index++) {
    Class classification=getPrimaryKeyClassifications().get(index);
    DatabaseField field=(DatabaseField)primaryKeyFields.get(index);
    Object value=databaseRow.get(field);
    primaryKeyRow.put(field,session.getPlatform(domainObject.getClass()).convertObject(value,classification));
  }
  return primaryKeyRow;
}

Fixed version (ground truth):
/** 
 * Extract primary key attribute values from the domainObject.
 */
public AbstractRecord extractPrimaryKeyRowFromObject(Object domainObject,AbstractSession session){
  AbstractRecord databaseRow=createRecord(getPrimaryKeyMappings().size(),session);
  for (int index=0; index < getPrimaryKeyMappings().size(); index++) {
    getPrimaryKeyMappings().get(index).writeFromObjectIntoRow(domainObject,databaseRow,session);
  }
  if (this.descriptor.hasSimplePrimaryKey()) {
    return databaseRow;
  }
  AbstractRecord primaryKeyRow=createRecord(getPrimaryKeyMappings().size(),session);
  List primaryKeyFields=this.descriptor.getPrimaryKeyFields();
  for (int index=0; index < primaryKeyFields.size(); index++) {
    Class classification=getPrimaryKeyClassifications().get(index);
    DatabaseField field=(DatabaseField)primaryKeyFields.get(index);
    Object value=databaseRow.get(field);
    primaryKeyRow.put(field,session.getPlatform(domainObject.getClass()).convertObject(value,classification));
  }
  return primaryKeyRow;
}
Program: 68521
Project: 68521
Buggy source:
/** 
 * Build the row representation of an object.
 */
public AbstractRecord buildRowForWhereClause(ObjectLevelModifyQuery query){
  AbstractRecord databaseRow=createRecord();
  for (Iterator mappings=this.descriptor.getMappings().iterator(); mappings.hasNext(); ) {
    DatabaseMapping mapping=(DatabaseMapping)mappings.next();
    mapping.writeFromObjectIntoRowForWhereClause(query,databaseRow);
  }
  if (!this.descriptor.isAggregateDescriptor()) {
    addPrimaryKeyForNonDefaultTable(databaseRow);
  }
  return databaseRow;
}

Fixed version (ground truth):
/** 
 * Build the row representation of an object.
 */
public AbstractRecord buildRowForWhereClause(ObjectLevelModifyQuery query){
  AbstractRecord databaseRow=createRecord(query.getSession());
  for (Iterator mappings=this.descriptor.getMappings().iterator(); mappings.hasNext(); ) {
    DatabaseMapping mapping=(DatabaseMapping)mappings.next();
    mapping.writeFromObjectIntoRowForWhereClause(query,databaseRow);
  }
  if (!this.descriptor.isAggregateDescriptor()) {
    addPrimaryKeyForNonDefaultTable(databaseRow);
  }
  return databaseRow;
}
Program: 68523
Project: 68523
Buggy source:
private void reloadGroups(XSNamedMap modelGroupDefs){
  Collection removedGroups=new HashBag(this.modelGroupDefinitions.values());
  for (int i=modelGroupDefs.getLength() - 1; i >= 0; i--) {
    ModelGroupDefinition group=this.reloadGroup((XSModelGroupDefinition)modelGroupDefs.item(i));
    removedGroups.remove(group);
  }
  for (Iterator stream=removedGroups.iterator(); stream.hasNext(); ) {
    this.removeGroup((ModelGroupDefinition)stream.next());
  }
}

Fixed version (ground truth):
private void reloadGroups(XSNamedMap modelGroupDefs){
  Collection removedGroups=new HashBag(this.modelGroupDefinitions.values());
  for (int i=modelGroupDefs.getLength() - 1; i >= 0; i--) {
    XSModelGroupDefinition modelGroupDef=(XSModelGroupDefinition)modelGroupDefs.item(i);
    String ns=modelGroupDef.getNamespace();
    if (ns == null) {
      ns="String_Node_Str";
    }
    if (ns.equals(getNamespaceUrl())) {
      ModelGroupDefinition group=this.reloadGroup(modelGroupDef);
      removedGroups.remove(group);
    }
  }
  for (Iterator stream=removedGroups.iterator(); stream.hasNext(); ) {
    this.removeGroup((ModelGroupDefinition)stream.next());
  }
}
Program: 68524
Project: 68524
Buggy source:
private void reloadElements(XSNamedMap elementDeclarations){
  Collection removedElements=new HashBag(this.elementDeclarations.values());
  for (int i=elementDeclarations.getLength() - 1; i >= 0; i--) {
    ExplicitElementDeclaration element=this.reloadElement((XSElementDecl)elementDeclarations.item(i));
    removedElements.remove(element);
  }
  for (Iterator stream=removedElements.iterator(); stream.hasNext(); ) {
    this.removeElement((ExplicitElementDeclaration)stream.next());
  }
}

Fixed version (ground truth):
private void reloadElements(XSNamedMap elementDeclarations){
  Collection removedElements=new HashBag(this.elementDeclarations.values());
  for (int i=elementDeclarations.getLength() - 1; i >= 0; i--) {
    XSElementDecl elementDecl=(XSElementDecl)elementDeclarations.item(i);
    String ns=elementDecl.getNamespace();
    if (ns == null) {
      ns="String_Node_Str";
    }
    if (ns.equals(this.getNamespaceUrl())) {
      ExplicitElementDeclaration element=this.reloadElement(elementDecl);
      removedElements.remove(element);
    }
  }
  for (Iterator stream=removedElements.iterator(); stream.hasNext(); ) {
    this.removeElement((ExplicitElementDeclaration)stream.next());
  }
}
Program: 68525
Project: 68525
Buggy source:
private void reloadAttributes(XSNamedMap attributeDeclarations){
  Collection removedAttributes=new HashBag(this.attributeDeclarations.values());
  for (int i=attributeDeclarations.getLength() - 1; i >= 0; i--) {
    ExplicitAttributeDeclaration attribute=this.reloadAttribute((XSAttributeDecl)attributeDeclarations.item(i));
    removedAttributes.remove(attribute);
  }
  for (Iterator stream=removedAttributes.iterator(); stream.hasNext(); ) {
    this.removeAttribute((ExplicitAttributeDeclaration)stream.next());
  }
}

Fixed version (ground truth):
private void reloadAttributes(XSNamedMap attributeDeclarations){
  Collection removedAttributes=new HashBag(this.attributeDeclarations.values());
  for (int i=attributeDeclarations.getLength() - 1; i >= 0; i--) {
    XSAttributeDecl attrDecl=(XSAttributeDecl)attributeDeclarations.item(i);
    String ns=attrDecl.getNamespace();
    if (ns == null) {
      ns="String_Node_Str";
    }
    if (ns.equals(getNamespaceUrl())) {
      ExplicitAttributeDeclaration attribute=this.reloadAttribute(attrDecl);
      removedAttributes.remove(attribute);
    }
  }
  for (Iterator stream=removedAttributes.iterator(); stream.hasNext(); ) {
    this.removeAttribute((ExplicitAttributeDeclaration)stream.next());
  }
}
Program: 68526
Project: 68526
Buggy source:
private void reloadTypes(XSNamedMap typeDefs){
  Collection removedTypeNames=CollectionTools.collection(this.typeDefinitions.keySet().iterator());
  for (int i=typeDefs.getLength() - 1; i >= 0; i--) {
    XSTypeDefinition typeDef=(XSTypeDefinition)typeDefs.item(i);
    ExplicitSchemaTypeDefinition type=null;
    if (!XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(typeDef.getNamespace())) {
      if (typeDef.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
        type=this.reloadSimpleType((XSSimpleTypeDecl)typeDef);
      }
 else {
        type=this.reloadComplexType((XSComplexTypeDecl)typeDef);
      }
      removedTypeNames.remove(type.getName());
    }
  }
  for (Iterator stream=removedTypeNames.iterator(); stream.hasNext(); ) {
    this.removeType((String)stream.next());
  }
}

Fixed version (ground truth):
private void reloadTypes(XSNamedMap typeDefs){
  Collection removedTypeNames=CollectionTools.collection(this.typeDefinitions.keySet().iterator());
  for (int i=typeDefs.getLength() - 1; i >= 0; i--) {
    XSTypeDefinition typeDef=(XSTypeDefinition)typeDefs.item(i);
    ExplicitSchemaTypeDefinition type=null;
    String ns=typeDef.getNamespace();
    if (ns == null) {
      ns="String_Node_Str";
    }
    if (!XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(typeDef.getNamespace()) && ns.equals(getNamespaceUrl())) {
      if (typeDef.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
        type=this.reloadSimpleType((XSSimpleTypeDecl)typeDef);
      }
 else {
        type=this.reloadComplexType((XSComplexTypeDecl)typeDef);
      }
      removedTypeNames.remove(type.getName());
    }
  }
  for (Iterator stream=removedTypeNames.iterator(); stream.hasNext(); ) {
    this.removeType((String)stream.next());
  }
}
Program: 68527
Project: 68527
Buggy source:
/** 
 * Constructor called from the EntityManagerFactory to create an EntityManager
 * @param factory the EntityMangerFactoryImpl that created this entity manager.Note: The properties argument is provided to allow properties to be passed into this EntityManager, but there are currently no such properties implemented
 */
public EntityManagerImpl(EntityManagerFactoryImpl factory,Map properties,boolean propagatePersistenceContext,boolean extended){
  this.factory=factory;
  this.serverSession=factory.getServerSession();
  detectTransactionWrapper();
  this.extended=true;
  this.propagatePersistenceContext=false;
  this.properties=properties;
  processProperties();
  flushMode=FlushModeType.AUTO;
}

Fixed version (ground truth):
/** 
 * Constructor called from the EntityManagerFactory to create an EntityManager
 * @param factory the EntityMangerFactoryImpl that created this entity manager.Note: The properties argument is provided to allow properties to be passed into this EntityManager, but there are currently no such properties implemented
 */
public EntityManagerImpl(EntityManagerFactoryImpl factory,Map properties,boolean propagatePersistenceContext,boolean extended){
  this.factory=factory;
  this.serverSession=factory.getServerSession();
  detectTransactionWrapper();
  this.extended=true;
  this.propagatePersistenceContext=false;
  if (properties != null) {
    this.properties=new HashMap(properties);
  }
  processProperties();
  flushMode=FlushModeType.AUTO;
}
Program: 68528
Project: 68528
Buggy source:
public static QueryException expressionDoesNotSupportPartialAttributeReading(Expression expression){
  Object[] args={expression};
  QueryException queryException=new QueryException(ExceptionMessageGenerator.buildMessage(QueryException.class,EXPRESSION_DOES_NOT_SUPPORT_PARTAIL_ATTRIBUTE_READING,args));
  queryException.setErrorCode(EXPRESSION_DOES_NOT_SUPPORT_PARTAIL_ATTRIBUTE_READING);
  return queryException;
}

Fixed version (ground truth):
public static QueryException expressionDoesNotSupportPartialAttributeReading(Expression expression){
  Object[] args={expression};
  QueryException queryException=new QueryException(ExceptionMessageGenerator.buildMessage(QueryException.class,EXPRESSION_DOES_NOT_SUPPORT_PARTIAL_ATTRIBUTE_READING,args));
  queryException.setErrorCode(EXPRESSION_DOES_NOT_SUPPORT_PARTIAL_ATTRIBUTE_READING);
  return queryException;
}
Program: 68529
Project: 68529
Buggy source:
/** 
 * Delete the first phone number on the employee with multiple phone numbers.
 */
private void deleteTest(int empId){
  try {
    beginTransaction();
    Employee employee=getEntityManager().find(Employee.class,empId);
    commitTransaction();
  }
 catch (  Exception e) {
    rollbackTransaction();
    m_deleteException=e;
  }
}

Fixed version (ground truth):
/** 
 * Delete the first phone number on the employee with multiple phone numbers.
 */
private void deleteTest(int empId){
  try {
    beginTransaction();
    Employee employee=getEntityManager().find(Employee.class,empId);
    getEntityManager().remove(((Vector)employee.getPhoneNumbers()).firstElement());
    commitTransaction();
  }
 catch (  Exception e) {
    rollbackTransaction();
    m_deleteException=e;
  }
}
Program: 68530
Project: 68530
Buggy source:
/** 
 * Update the phone numbers on the employee with multiple phone numbers.
 */
private void updateTest(int empId){
  try {
    beginTransaction();
    Employee employee=getEntityManager().find(Employee.class,empId);
    LinkedList phones=(LinkedList)employee.getPhoneNumbers();
    Iterator e=phones.listIterator();
    while (e.hasNext()) {
      PhoneNumber phone=(PhoneNumber)e.next();
      phone.setAreaCode("String_Node_Str");
    }
    getEntityManager().persist(employee);
    commitTransaction();
  }
 catch (  Exception e) {
    rollbackTransaction();
    m_updateException=e;
  }
}

Fixed version (ground truth):
/** 
 * Update the phone numbers on the employee with multiple phone numbers.
 */
private void updateTest(int empId){
  try {
    beginTransaction();
    Employee employee=getEntityManager().find(Employee.class,empId);
    Vector phones=(Vector)employee.getPhoneNumbers();
    Enumeration e=phones.elements();
    while (e.hasMoreElements()) {
      PhoneNumber phone=(PhoneNumber)e.nextElement();
      phone.setAreaCode("String_Node_Str");
    }
    getEntityManager().persist(employee);
    commitTransaction();
  }
 catch (  Exception e) {
    rollbackTransaction();
    m_updateException=e;
  }
}
Program: 68531
Project: 68531
Buggy source:
public void testSelectPhoneNumberNumberWithEmployeeWithFirstNameFirst(){
  org.eclipse.persistence.jpa.JpaEntityManager em=(org.eclipse.persistence.jpa.JpaEntityManager)createEntityManager();
  ExpressionBuilder employees=new ExpressionBuilder();
  Expression exp=employees.get("String_Node_Str").equal("String_Node_Str");
  exp=exp.and(employees.get("String_Node_Str").equal("String_Node_Str"));
  Employee emp=(Employee)em.getActiveSession().readAllObjects(Employee.class,exp).firstElement();
  PhoneNumber phone=(PhoneNumber)((java.util.LinkedList)emp.getPhoneNumbers()).getFirst();
  String areaCode=phone.getAreaCode();
  String firstName=emp.getFirstName();
  ExpressionBuilder employeeBuilder=new ExpressionBuilder();
  Expression phones=employeeBuilder.anyOf("String_Node_Str");
  Expression whereClause=phones.get("String_Node_Str").get("String_Node_Str").equal(firstName).and(phones.get("String_Node_Str").equal(areaCode));
  ReportQuery rq=new ReportQuery();
  rq.setSelectionCriteria(whereClause);
  rq.addAttribute("String_Node_Str",phones.get("String_Node_Str"));
  rq.setReferenceClass(Employee.class);
  Vector expectedResult=getAttributeFromAll("String_Node_Str",(Vector)em.getActiveSession().executeQuery(rq),Employee.class);
  clearCache();
  String ejbqlString;
  ejbqlString="String_Node_Str" + "String_Node_Str" + firstName + "String_Node_Str"+ areaCode+ "String_Node_Str";
  List result=em.createQuery(ejbqlString).getResultList();
  Assert.assertTrue("String_Node_Str",comparer.compareObjects(result,expectedResult));
}

Fixed version (ground truth):
public void testSelectPhoneNumberNumberWithEmployeeWithFirstNameFirst(){
  org.eclipse.persistence.jpa.JpaEntityManager em=(org.eclipse.persistence.jpa.JpaEntityManager)createEntityManager();
  ExpressionBuilder employees=new ExpressionBuilder();
  Expression exp=employees.get("String_Node_Str").equal("String_Node_Str");
  exp=exp.and(employees.get("String_Node_Str").equal("String_Node_Str"));
  Employee emp=(Employee)em.getActiveSession().readAllObjects(Employee.class,exp).firstElement();
  PhoneNumber phone=(PhoneNumber)((Vector)emp.getPhoneNumbers()).firstElement();
  String areaCode=phone.getAreaCode();
  String firstName=emp.getFirstName();
  ExpressionBuilder employeeBuilder=new ExpressionBuilder();
  Expression phones=employeeBuilder.anyOf("String_Node_Str");
  Expression whereClause=phones.get("String_Node_Str").get("String_Node_Str").equal(firstName).and(phones.get("String_Node_Str").equal(areaCode));
  ReportQuery rq=new ReportQuery();
  rq.setSelectionCriteria(whereClause);
  rq.addAttribute("String_Node_Str",phones.get("String_Node_Str"));
  rq.setReferenceClass(Employee.class);
  Vector expectedResult=getAttributeFromAll("String_Node_Str",(Vector)em.getActiveSession().executeQuery(rq),Employee.class);
  clearCache();
  String ejbqlString;
  ejbqlString="String_Node_Str" + "String_Node_Str" + firstName + "String_Node_Str"+ areaCode+ "String_Node_Str";
  List result=em.createQuery(ejbqlString).getResultList();
  Assert.assertTrue("String_Node_Str",comparer.compareObjects(result,expectedResult));
}
Program: 68532
Project: 68532
Buggy source:
public void testPrimaryKeysSpecifiedProblem(){
  String errorName=ProblemConstants.EIS_DESCRIPTOR_NO_PRIMARY_KEYS_SPECIFIED;
  checkEisDescriptorsForFalseFailures(errorName);
  MWRootEisDescriptor employeeDescriptor=(MWRootEisDescriptor)this.getEmployeeEisDescriptor();
  MWEisPrimaryKeyPolicy pkPolicy=((MWEisTransactionalPolicy)employeeDescriptor.getTransactionalPolicy()).getPrimaryKeyPolicy();
  Collection primaryKeyXpaths=new ArrayList();
  for (Iterator stream=pkPolicy.primaryKeyXpaths(); stream.hasNext(); ) {
    primaryKeyXpaths.add(stream.next());
  }
  pkPolicy.clearPrimaryKeys();
  assertTrue("String_Node_Str",this.hasProblem(errorName,employeeDescriptor));
  for (Iterator stream=primaryKeyXpaths.iterator(); stream.hasNext(); ) {
    pkPolicy.addPrimaryKey((String)stream.next());
  }
  assertTrue("String_Node_Str",!this.hasProblem(errorName,employeeDescriptor));
}

Fixed version (ground truth):
public void testPrimaryKeysSpecifiedProblem(){
  String errorName=ProblemConstants.EIS_DESCRIPTOR_NO_PRIMARY_KEYS_SPECIFIED;
  checkEisDescriptorsForFalseFailures(errorName);
  MWRootEisDescriptor employeeDescriptor=(MWRootEisDescriptor)this.getEmployeeEisDescriptor();
  MWXmlPrimaryKeyPolicy pkPolicy=((MWEisTransactionalPolicy)employeeDescriptor.getTransactionalPolicy()).getPrimaryKeyPolicy();
  Collection primaryKeyXpaths=new ArrayList();
  for (Iterator stream=pkPolicy.primaryKeyXpaths(); stream.hasNext(); ) {
    primaryKeyXpaths.add(stream.next());
  }
  pkPolicy.clearPrimaryKeys();
  assertTrue("String_Node_Str",this.hasProblem(errorName,employeeDescriptor));
  for (Iterator stream=primaryKeyXpaths.iterator(); stream.hasNext(); ) {
    pkPolicy.addPrimaryKey((String)stream.next());
  }
  assertTrue("String_Node_Str",!this.hasProblem(errorName,employeeDescriptor));
}
Program: 68536
Project: 68536
Buggy source:
/** 
 * ADVANCED: Set all of the objects of a specific class to be invalid in TopLink's identity maps. User can set the recurse flag to false if they do not want to invalidate all the classes within an inheritance tree.
 */
public void invalidateClass(Class myClass,boolean recurse){
  IdentityMap identityMap=this.getIdentityMap(myClass);
synchronized (identityMap) {
    Enumeration keys=identityMap.keys();
    while (keys.hasMoreElements()) {
      CacheKey key=(CacheKey)keys.nextElement();
      Object obj=key.getObject();
      if (recurse || ((obj != null) && obj.getClass().equals(myClass))) {
        key.setInvalidationState(CacheKey.CACHE_KEY_INVALID);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * ADVANCED: Set all of the objects of a specific class to be invalid in TopLink's identity maps. User can set the recurse flag to false if they do not want to invalidate all the classes within an inheritance tree.
 */
public void invalidateClass(Class myClass,boolean recurse){
  IdentityMap identityMap=this.getIdentityMap(myClass);
  Enumeration keys=identityMap.keys();
  while (keys.hasMoreElements()) {
    CacheKey key=(CacheKey)keys.nextElement();
    Object obj=key.getObject();
    if (recurse || ((obj != null) && obj.getClass().equals(myClass))) {
      key.setInvalidationState(CacheKey.CACHE_KEY_INVALID);
    }
  }
}
Program: 68537
Project: 68537
Buggy source:
protected void setup(){
  expectedException=DescriptorException.attributeAndMappingWithTransparentIndirectionMismatch(new DirectToFieldMapping(),null);
  expectedException.setErrorCode(138);
  orgIntegrityChecker=getSession().getIntegrityChecker();
  getSession().setIntegrityChecker(new IntegrityChecker());
  getSession().getIntegrityChecker().dontCatchExceptions();
}

Fixed version (ground truth):
protected void setup(){
  expectedException=DescriptorException.attributeAndMappingWithTransparentIndirectionMismatch(new DirectToFieldMapping(),null,null);
  expectedException.setErrorCode(138);
  orgIntegrityChecker=getSession().getIntegrityChecker();
  getSession().setIntegrityChecker(new IntegrityChecker());
  getSession().getIntegrityChecker().dontCatchExceptions();
}
Program: 68538
Project: 68538
Buggy source:
protected void setup(){
  expectedException=DescriptorException.parameterAndMappingWithTransparentIndirectionMismatch(new OneToManyMapping(),null);
  orgIntegrityChecker=getSession().getIntegrityChecker();
  getSession().setIntegrityChecker(new IntegrityChecker());
  getSession().getIntegrityChecker().dontCatchExceptions();
}

Fixed version (ground truth):
protected void setup(){
  expectedException=DescriptorException.parameterAndMappingWithTransparentIndirectionMismatch(new OneToManyMapping(),null,null);
  orgIntegrityChecker=getSession().getIntegrityChecker();
  getSession().setIntegrityChecker(new IntegrityChecker());
  getSession().getIntegrityChecker().dontCatchExceptions();
}
Program: 68539
Project: 68539
Buggy source:
protected void setup(){
  expectedException=DescriptorException.returnAndMappingWithTransparentIndirectionMismatch(new OneToManyMapping(),null);
  super.setup();
}

Fixed version (ground truth):
protected void setup(){
  expectedException=DescriptorException.returnAndMappingWithTransparentIndirectionMismatch(new OneToManyMapping(),null,null);
  super.setup();
}
Program: 68540
Project: 68540
Buggy source:
public static DescriptorException returnAndMappingWithTransparentIndirectionMismatch(DatabaseMapping mapping,String validTypeName){
  Object[] args={mapping.getAttributeName(),validTypeName};
  DescriptorException exception=new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class,RETURN_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH,args),mapping);
  exception.setErrorCode(RETURN_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH);
  return exception;
}

Fixed version (ground truth):
public static DescriptorException returnAndMappingWithTransparentIndirectionMismatch(DatabaseMapping mapping,Class parameterType,String validTypeName){
  Object[] args={mapping.getAttributeName(),parameterType,validTypeName};
  DescriptorException exception=new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class,RETURN_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH,args),mapping);
  exception.setErrorCode(RETURN_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH);
  return exception;
}
Program: 68541
Project: 68541
Buggy source:
public static DescriptorException parameterAndMappingWithTransparentIndirectionMismatch(DatabaseMapping mapping,String validTypeName){
  Object[] args={mapping.getAttributeName(),validTypeName};
  DescriptorException exception=new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class,PARAMETER_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH,args),mapping);
  exception.setErrorCode(PARAMETER_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH);
  return exception;
}

Fixed version (ground truth):
public static DescriptorException parameterAndMappingWithTransparentIndirectionMismatch(DatabaseMapping mapping,Class parameterType,String validTypeName){
  Object[] args={mapping.getAttributeName(),parameterType,validTypeName};
  DescriptorException exception=new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class,PARAMETER_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH,args),mapping);
  exception.setErrorCode(PARAMETER_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH);
  return exception;
}
Program: 68542
Project: 68542
Buggy source:
public static DescriptorException attributeAndMappingWithTransparentIndirectionMismatch(DatabaseMapping mapping,String validTypeName){
  Object[] args={mapping.getAttributeName(),validTypeName};
  DescriptorException exception=new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class,ATTRIBUTE_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH,args),mapping);
  exception.setErrorCode(ATTRIBUTE_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH);
  return exception;
}

Fixed version (ground truth):
public static DescriptorException attributeAndMappingWithTransparentIndirectionMismatch(DatabaseMapping mapping,Class parameterType,String validTypeName){
  Object[] args={mapping.getAttributeName(),parameterType,validTypeName};
  DescriptorException exception=new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class,ATTRIBUTE_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH,args),mapping);
  exception.setErrorCode(ATTRIBUTE_AND_MAPPING_WITH_TRANSPARENT_INDIRECTION_MISMATCH);
  return exception;
}
Program: 68543
Project: 68543
Buggy source:
/** 
 * INTERNAL: Verify that getter returnType is correct for the indirection policy. If it is incorrect, add an exception to the integrity checker. In this case, the attribute type MUST be compatible with the one specified by the ContainerPolicy.
 */
public void validateGetMethodReturnType(Class returnType,IntegrityChecker checker) throws DescriptorException {
  super.validateGetMethodReturnType(returnType,checker);
  if (!this.typeIsValid(returnType)) {
    checker.handleError(DescriptorException.returnAndMappingWithTransparentIndirectionMismatch(this.getMapping(),this.validTypeName()));
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Verify that getter returnType is correct for the indirection policy. If it is incorrect, add an exception to the integrity checker. In this case, the attribute type MUST be compatible with the one specified by the ContainerPolicy.
 */
public void validateGetMethodReturnType(Class returnType,IntegrityChecker checker) throws DescriptorException {
  super.validateGetMethodReturnType(returnType,checker);
  if (!this.typeIsValid(returnType)) {
    checker.handleError(DescriptorException.returnAndMappingWithTransparentIndirectionMismatch(this.getMapping(),returnType,this.validTypeName()));
  }
}
Program: 68544
Project: 68544
Buggy source:
/** 
 * INTERNAL: Verify that setter parameterType is correct for the indirection policy. If it is incorrect, add an exception to the integrity checker. In this case, the attribute type MUST be compatible with the one specified by the ContainerPolicy.
 */
public void validateSetMethodParameterType(Class parameterType,IntegrityChecker checker) throws DescriptorException {
  super.validateSetMethodParameterType(parameterType,checker);
  if (!this.typeIsValid(parameterType)) {
    checker.handleError(DescriptorException.parameterAndMappingWithTransparentIndirectionMismatch(this.getMapping(),this.validTypeName()));
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Verify that setter parameterType is correct for the indirection policy. If it is incorrect, add an exception to the integrity checker. In this case, the attribute type MUST be compatible with the one specified by the ContainerPolicy.
 */
public void validateSetMethodParameterType(Class parameterType,IntegrityChecker checker) throws DescriptorException {
  super.validateSetMethodParameterType(parameterType,checker);
  if (!this.typeIsValid(parameterType)) {
    checker.handleError(DescriptorException.parameterAndMappingWithTransparentIndirectionMismatch(this.getMapping(),parameterType,this.validTypeName()));
  }
}
Program: 68545
Project: 68545
Buggy source:
/** 
 * INTERNAL: Verify that attributeType is correct for the indirection policy. If it is incorrect, add an exception to the integrity checker. In this case, the attribute type MUST be compatible with the one specified by the ContainerPolicy.
 */
public void validateDeclaredAttributeType(Class attributeType,IntegrityChecker checker) throws DescriptorException {
  super.validateDeclaredAttributeType(attributeType,checker);
  if (!this.typeIsValid(attributeType)) {
    checker.handleError(DescriptorException.attributeAndMappingWithTransparentIndirectionMismatch(this.getMapping(),this.validTypeName()));
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Verify that attributeType is correct for the indirection policy. If it is incorrect, add an exception to the integrity checker. In this case, the attribute type MUST be compatible with the one specified by the ContainerPolicy.
 */
public void validateDeclaredAttributeType(Class attributeType,IntegrityChecker checker) throws DescriptorException {
  super.validateDeclaredAttributeType(attributeType,checker);
  if (!this.typeIsValid(attributeType)) {
    checker.handleError(DescriptorException.attributeAndMappingWithTransparentIndirectionMismatch(this.getMapping(),attributeType,this.validTypeName()));
  }
}
Program: 68546
Project: 68546
Buggy source:
@OneToMany(fetch=EAGER,cascade=PERSIST) public Collection<Employee> getManagers(){
  return managers;
}

Fixed version (ground truth):
@OneToMany(fetch=EAGER,cascade=PERSIST) @PrivateOwned public Collection<Employee> getManagers(){
  return managers;
}
Program: 68547
Project: 68547
Buggy source:
public void setPhoneNumbers(Collection<PhoneNumber> phoneNumbers){
  this.m_phoneNumbers=phoneNumbers;
}

Fixed version (ground truth):
public void setPhoneNumbers(LinkedList<PhoneNumber> phoneNumbers){
  this.m_phoneNumbers=phoneNumbers;
}
Program: 68548
Project: 68548
Buggy source:
@OneToMany(cascade=ALL,mappedBy="String_Node_Str") @PrivateOwned @Property(name="String_Node_Str",value="String_Node_Str") public Collection<PhoneNumber> getPhoneNumbers(){
  return m_phoneNumbers;
}

Fixed version (ground truth):
@OneToMany(fetch=EAGER,cascade=ALL,mappedBy="String_Node_Str") @PrivateOwned @Property(name="String_Node_Str",value="String_Node_Str") public LinkedList<PhoneNumber> getPhoneNumbers(){
  return m_phoneNumbers;
}
Program: 68549
Project: 68549
Buggy source:
/** 
 * Delete the first phone number on the employee with multiple phone numbers.
 */
private void deleteTest(int empId){
  try {
    beginTransaction();
    Employee employee=getEntityManager().find(Employee.class,empId);
    getEntityManager().remove(((Vector)employee.getPhoneNumbers()).firstElement());
    commitTransaction();
  }
 catch (  Exception e) {
    rollbackTransaction();
    m_deleteException=e;
  }
}

Fixed version (ground truth):
/** 
 * Delete the first phone number on the employee with multiple phone numbers.
 */
private void deleteTest(int empId){
  try {
    beginTransaction();
    Employee employee=getEntityManager().find(Employee.class,empId);
    commitTransaction();
  }
 catch (  Exception e) {
    rollbackTransaction();
    m_deleteException=e;
  }
}
Program: 68550
Project: 68550
Buggy source:
/** 
 * Create an employee with multiple phone numbers.
 */
private int createTest(){
  Vector phoneNumbers=new Vector();
  Employee employee=new Employee();
  try {
    beginTransaction();
    employee.setFirstName("String_Node_Str");
    employee.setLastName("String_Node_Str");
    PhoneNumber homeNumber=new PhoneNumber();
    homeNumber.setAreaCode("String_Node_Str");
    homeNumber.setNumber("String_Node_Str");
    homeNumber.setOwner(employee);
    homeNumber.setType("String_Node_Str");
    phoneNumbers.add(homeNumber);
    PhoneNumber cellNumber=new PhoneNumber();
    cellNumber.setAreaCode("String_Node_Str");
    cellNumber.setNumber("String_Node_Str");
    cellNumber.setOwner(employee);
    cellNumber.setType("String_Node_Str");
    phoneNumbers.add(cellNumber);
    PhoneNumber workNumber=new PhoneNumber();
    workNumber.setAreaCode("String_Node_Str");
    workNumber.setNumber("String_Node_Str");
    workNumber.setOwner(employee);
    workNumber.setType("String_Node_Str");
    phoneNumbers.add(workNumber);
    employee.setPhoneNumbers(phoneNumbers);
    getEntityManager().persist(employee);
    commitTransaction();
  }
 catch (  Exception e) {
    rollbackTransaction();
    m_createException=e;
  }
  return employee.getId();
}

Fixed version (ground truth):
/** 
 * Create an employee with multiple phone numbers.
 */
private int createTest(){
  LinkedList phoneNumbers=new LinkedList();
  Employee employee=new Employee();
  try {
    beginTransaction();
    employee.setFirstName("String_Node_Str");
    employee.setLastName("String_Node_Str");
    PhoneNumber homeNumber=new PhoneNumber();
    homeNumber.setAreaCode("String_Node_Str");
    homeNumber.setNumber("String_Node_Str");
    homeNumber.setOwner(employee);
    homeNumber.setType("String_Node_Str");
    phoneNumbers.add(homeNumber);
    PhoneNumber cellNumber=new PhoneNumber();
    cellNumber.setAreaCode("String_Node_Str");
    cellNumber.setNumber("String_Node_Str");
    cellNumber.setOwner(employee);
    cellNumber.setType("String_Node_Str");
    phoneNumbers.add(cellNumber);
    PhoneNumber workNumber=new PhoneNumber();
    workNumber.setAreaCode("String_Node_Str");
    workNumber.setNumber("String_Node_Str");
    workNumber.setOwner(employee);
    workNumber.setType("String_Node_Str");
    phoneNumbers.add(workNumber);
    employee.setPhoneNumbers(phoneNumbers);
    getEntityManager().persist(employee);
    commitTransaction();
  }
 catch (  Exception e) {
    rollbackTransaction();
    m_createException=e;
  }
  return employee.getId();
}
Program: 68551
Project: 68551
Buggy source:
/** 
 * Update the phone numbers on the employee with multiple phone numbers.
 */
private void updateTest(int empId){
  try {
    beginTransaction();
    Employee employee=getEntityManager().find(Employee.class,empId);
    Vector phones=(Vector)employee.getPhoneNumbers();
    Enumeration e=phones.elements();
    while (e.hasMoreElements()) {
      PhoneNumber phone=(PhoneNumber)e.nextElement();
      phone.setAreaCode("String_Node_Str");
    }
    getEntityManager().persist(employee);
    commitTransaction();
  }
 catch (  Exception e) {
    rollbackTransaction();
    m_updateException=e;
  }
}

Fixed version (ground truth):
/** 
 * Update the phone numbers on the employee with multiple phone numbers.
 */
private void updateTest(int empId){
  try {
    beginTransaction();
    Employee employee=getEntityManager().find(Employee.class,empId);
    LinkedList phones=(LinkedList)employee.getPhoneNumbers();
    Iterator e=phones.listIterator();
    while (e.hasNext()) {
      PhoneNumber phone=(PhoneNumber)e.next();
      phone.setAreaCode("String_Node_Str");
    }
    getEntityManager().persist(employee);
    commitTransaction();
  }
 catch (  Exception e) {
    rollbackTransaction();
    m_updateException=e;
  }
}