nus-yam/ex-repair huggingface dataset:
Program: 67229
Project: 67229
Buggy source:
public NestedTable(QueryKeyExpression queryKeyExpression){
  super();
  this.queryKeyExpression=queryKeyExpression;
  name=(queryKeyExpression.getMapping().getDescriptor().getTables().firstElement()).getName();
  tableQualifier=(queryKeyExpression.getMapping().getDescriptor().getTables().firstElement()).getQualifiedNameDelimited();
}

Fixed version (ground truth):
public NestedTable(QueryKeyExpression queryKeyExpression){
  super();
  this.queryKeyExpression=queryKeyExpression;
  name=(queryKeyExpression.getMapping().getDescriptor().getTables().firstElement()).getName();
  tableQualifier=(queryKeyExpression.getMapping().getDescriptor().getTables().firstElement()).getQualifiedName();
}
Program: 67233
Project: 67233
Buggy source:
public void initialize(DatabaseMapping mapping,Session session){
  XPathFragment fragment=associatedField.getXPathFragment();
  while (fragment.getNextFragment() != null && !(fragment.getNextFragment().nameIsText())) {
    fragment=fragment.getNextFragment();
  }
  this.rootFragment=fragment;
  this.mapping=mapping;
}

Fixed version (ground truth):
public void initialize(DatabaseMapping mapping,Session session){
  XPathFragment fragment=associatedField.getXPathFragment();
  while (fragment.getNextFragment() != null && !(fragment.getNextFragment().nameIsText())) {
    fragment=fragment.getNextFragment();
  }
  if (fragment.hasNamespace() && associatedField.getNamespaceResolver() != null) {
    String uri=associatedField.getNamespaceResolver().resolveNamespacePrefix(fragment.getPrefix());
    fragment.setNamespaceURI(uri);
  }
  this.rootFragment=fragment;
  this.mapping=mapping;
}
Program: 67237
Project: 67237
Buggy source:
/** 
 * Store a QName (if necessary) based on a given TypeInfo's schema type name.
 * @param javaClass
 * @param info
 */
private void processTypeQName(JavaClass javaClass,TypeInfo info,NamespaceInfo packageNamespace){
  String typeName=info.getSchemaTypeName();
  if (typeName != null && !("String_Node_Str".equals(typeName))) {
    QName typeQName=new QName(packageNamespace.getNamespace(),typeName);
    boolean containsQName=typeQNames.contains(typeQName);
    if (containsQName) {
      throw JAXBException.nameCollision(typeQName.getNamespaceURI(),typeQName.getLocalPart());
    }
 else {
      typeQNames.add(typeQName);
    }
  }
}

Fixed version (ground truth):
/** 
 * Store a QName (if necessary) based on a given TypeInfo's schema type name.
 * @param javaClass
 * @param info
 */
private void processTypeQName(JavaClass javaClass,TypeInfo info,NamespaceInfo packageNamespace){
  String typeName=info.getSchemaTypeName();
  if (typeName != null && !("String_Node_Str".equals(typeName))) {
    QName typeQName=new QName(info.getClassNamespace(),typeName);
    boolean containsQName=typeQNames.contains(typeQName);
    if (containsQName) {
      throw JAXBException.nameCollision(typeQName.getNamespaceURI(),typeQName.getLocalPart());
    }
 else {
      typeQNames.add(typeQName);
    }
  }
}
Program: 67238
Project: 67238
Buggy source:
public QName getQNameForProperty(String defaultName,JavaHasAnnotations element,NamespaceInfo namespaceInfo){
  String name="String_Node_Str";
  String namespace="String_Node_Str";
  QName qName=null;
  if (helper.isAnnotationPresent(element,XmlAttribute.class)) {
    XmlAttribute xmlAttribute=(XmlAttribute)helper.getAnnotation(element,XmlAttribute.class);
    name=xmlAttribute.name();
    namespace=xmlAttribute.namespace();
    if (name.equals("String_Node_Str")) {
      name=defaultName;
    }
    if (!namespace.equals("String_Node_Str")) {
      qName=new QName(namespace,name);
    }
 else {
      if (namespaceInfo.isAttributeFormQualified()) {
        qName=new QName(namespaceInfo.getNamespace(),name);
      }
 else {
        qName=new QName(name);
      }
    }
  }
 else {
    if (helper.isAnnotationPresent(element,XmlElement.class)) {
      XmlElement xmlElement=(XmlElement)helper.getAnnotation(element,XmlElement.class);
      name=xmlElement.name();
      namespace=xmlElement.namespace();
    }
    if (name.equals("String_Node_Str")) {
      name=defaultName;
    }
    if (!namespace.equals("String_Node_Str")) {
      qName=new QName(namespace,name);
    }
 else {
      if (namespaceInfo.isElementFormQualified()) {
        qName=new QName(namespaceInfo.getNamespace(),name);
      }
 else {
        qName=new QName(name);
      }
    }
  }
  return qName;
}

Fixed version (ground truth):
public QName getQNameForProperty(String defaultName,JavaHasAnnotations element,NamespaceInfo namespaceInfo,String uri){
  String name="String_Node_Str";
  String namespace="String_Node_Str";
  QName qName=null;
  if (helper.isAnnotationPresent(element,XmlAttribute.class)) {
    XmlAttribute xmlAttribute=(XmlAttribute)helper.getAnnotation(element,XmlAttribute.class);
    name=xmlAttribute.name();
    namespace=xmlAttribute.namespace();
    if (name.equals("String_Node_Str")) {
      name=defaultName;
    }
    if (!namespace.equals("String_Node_Str")) {
      qName=new QName(namespace,name);
    }
 else {
      if (namespaceInfo.isAttributeFormQualified()) {
        qName=new QName(uri,name);
      }
 else {
        qName=new QName(name);
      }
    }
  }
 else {
    if (helper.isAnnotationPresent(element,XmlElement.class)) {
      XmlElement xmlElement=(XmlElement)helper.getAnnotation(element,XmlElement.class);
      name=xmlElement.name();
      namespace=xmlElement.namespace();
    }
    if (name.equals("String_Node_Str")) {
      name=defaultName;
    }
    if (!namespace.equals("String_Node_Str")) {
      qName=new QName(namespace,name);
    }
 else {
      if (namespaceInfo.isElementFormQualified()) {
        qName=new QName(uri,name);
      }
 else {
        qName=new QName(name);
      }
    }
  }
  return qName;
}
Program: 67240
Project: 67240
Buggy source:
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;
}

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=schemaType.trim();
      if (!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: 67242
Project: 67242
Buggy source:
private void addChoiceElementMapping(XMLField xmlField,Class theClass){
  if (xmlField.getLastXPathFragment().nameIsText()) {
    XMLCompositeDirectCollectionMapping xmlMapping=new XMLCompositeDirectCollectionMapping();
    xmlMapping.setAttributeElementClass(theClass);
    xmlMapping.setField(xmlField);
    this.choiceElementMappings.put(xmlField,xmlMapping);
  }
 else {
    XMLCompositeCollectionMapping xmlMapping=new XMLCompositeCollectionMapping();
    if (!theClass.equals(ClassConstants.OBJECT)) {
      xmlMapping.setReferenceClass(theClass);
    }
    xmlMapping.setField(xmlField);
    this.choiceElementMappings.put(xmlField,xmlMapping);
  }
}

Fixed version (ground truth):
private void addChoiceElementMapping(XMLField xmlField,Class theClass){
  if (xmlField.getLastXPathFragment().nameIsText()) {
    XMLCompositeDirectCollectionMapping xmlMapping=new XMLCompositeDirectCollectionMapping();
    xmlMapping.setAttributeElementClass(theClass);
    xmlMapping.setField(xmlField);
    xmlMapping.setAttributeAccessor(temporaryAccessor);
    this.choiceElementMappings.put(xmlField,xmlMapping);
  }
 else {
    XMLCompositeCollectionMapping xmlMapping=new XMLCompositeCollectionMapping();
    if (!theClass.equals(ClassConstants.OBJECT)) {
      xmlMapping.setReferenceClass(theClass);
    }
    xmlMapping.setField(xmlField);
    xmlMapping.setAttributeAccessor(temporaryAccessor);
    this.choiceElementMappings.put(xmlField,xmlMapping);
  }
}
Program: 67243
Project: 67243
Buggy source:
public void preInitialize(AbstractSession session) throws DescriptorException {
  getAttributeAccessor().setIsWriteOnly(this.isWriteOnly());
  getAttributeAccessor().setIsReadOnly(this.isReadOnly());
  super.preInitialize(session);
}

Fixed version (ground truth):
public void preInitialize(AbstractSession session) throws DescriptorException {
  getAttributeAccessor().setIsWriteOnly(this.isWriteOnly());
  getAttributeAccessor().setIsReadOnly(this.isReadOnly());
  super.preInitialize(session);
  Iterator<XMLMapping> mappings=getChoiceElementMappings().values().iterator();
  while (mappings.hasNext()) {
    DatabaseMapping nextMapping=(DatabaseMapping)mappings.next();
    nextMapping.setAttributeName(this.getAttributeName());
    if (nextMapping.getAttributeAccessor() == temporaryAccessor) {
      nextMapping.setAttributeAccessor(getAttributeAccessor());
    }
    nextMapping.setDescriptor(getDescriptor());
    nextMapping.preInitialize(session);
  }
}
Program: 67245
Project: 67245
Buggy source:
private void addChoiceElementMapping(XMLField xmlField,Class theClass){
  if (xmlField.getLastXPathFragment().nameIsText()) {
    XMLDirectMapping xmlMapping=new XMLDirectMapping();
    xmlMapping.setAttributeClassification(theClass);
    xmlMapping.setField(xmlField);
    this.choiceElementMappings.put(xmlField,xmlMapping);
  }
 else {
    XMLCompositeObjectMapping xmlMapping=new XMLCompositeObjectMapping();
    if (!theClass.equals(ClassConstants.OBJECT)) {
      xmlMapping.setReferenceClass(theClass);
    }
    xmlMapping.setField(xmlField);
    this.choiceElementMappings.put(xmlField,xmlMapping);
  }
}

Fixed version (ground truth):
private void addChoiceElementMapping(XMLField xmlField,Class theClass){
  if (xmlField.getLastXPathFragment().nameIsText()) {
    XMLDirectMapping xmlMapping=new XMLDirectMapping();
    xmlMapping.setAttributeClassification(theClass);
    xmlMapping.setAttributeAccessor(temporaryAccessor);
    xmlMapping.setField(xmlField);
    this.choiceElementMappings.put(xmlField,xmlMapping);
  }
 else {
    XMLCompositeObjectMapping xmlMapping=new XMLCompositeObjectMapping();
    xmlMapping.setAttributeAccessor(temporaryAccessor);
    if (!theClass.equals(ClassConstants.OBJECT)) {
      xmlMapping.setReferenceClass(theClass);
    }
    xmlMapping.setField(xmlField);
    this.choiceElementMappings.put(xmlField,xmlMapping);
  }
}
Program: 67246
Project: 67246
Buggy source:
public void preInitialize(AbstractSession session) throws DescriptorException {
  getAttributeAccessor().setIsWriteOnly(this.isWriteOnly());
  getAttributeAccessor().setIsReadOnly(this.isReadOnly());
  super.preInitialize(session);
}

Fixed version (ground truth):
public void preInitialize(AbstractSession session) throws DescriptorException {
  getAttributeAccessor().setIsWriteOnly(this.isWriteOnly());
  getAttributeAccessor().setIsReadOnly(this.isReadOnly());
  super.preInitialize(session);
  Iterator<XMLMapping> mappings=getChoiceElementMappings().values().iterator();
  while (mappings.hasNext()) {
    DatabaseMapping nextMapping=(DatabaseMapping)mappings.next();
    nextMapping.setDescriptor(getDescriptor());
    nextMapping.setAttributeName(this.getAttributeName());
    if (nextMapping.getAttributeAccessor() == temporaryAccessor) {
      nextMapping.setAttributeAccessor(getAttributeAccessor());
    }
    nextMapping.preInitialize(session);
  }
}
Program: 67247
Project: 67247
Buggy source:
public void initialize(AbstractSession session) throws DescriptorException {
  super.initialize(session);
  if (this.fieldToClassMappings.size() == 0) {
    this.convertClassNamesToClasses(((XMLConversionManager)session.getDatasourcePlatform().getConversionManager()).getLoader());
  }
  Iterator<XMLMapping> mappings=getChoiceElementMappings().values().iterator();
  while (mappings.hasNext()) {
    DatabaseMapping nextMapping=(DatabaseMapping)mappings.next();
    nextMapping.setDescriptor(getDescriptor());
    nextMapping.setAttributeName(this.getAttributeName());
    nextMapping.setAttributeAccessor(getAttributeAccessor());
    Converter converter=null;
    if (fieldsToConverters != null) {
      converter=fieldsToConverters.get(nextMapping.getField());
    }
    if (nextMapping.isAbstractDirectMapping()) {
      if (converter != null) {
        ((AbstractDirectMapping)nextMapping).setConverter(converter);
      }
      XMLConversionManager xmlConversionManager=(XMLConversionManager)session.getDatasourcePlatform().getConversionManager();
      QName schemaType=(QName)xmlConversionManager.getDefaultJavaTypes().get(nextMapping.getAttributeClassification());
      if (schemaType != null && ((XMLField)nextMapping.getField()).getSchemaType() == null) {
        ((XMLField)nextMapping.getField()).setSchemaType(schemaType);
      }
    }
 else {
      if (converter != null) {
        ((AbstractCompositeObjectMapping)nextMapping).setConverter(converter);
      }
    }
    nextMapping.initialize(session);
  }
}

Fixed version (ground truth):
public void initialize(AbstractSession session) throws DescriptorException {
  super.initialize(session);
  if (this.fieldToClassMappings.size() == 0) {
    this.convertClassNamesToClasses(((XMLConversionManager)session.getDatasourcePlatform().getConversionManager()).getLoader());
  }
  Iterator<XMLMapping> mappings=getChoiceElementMappings().values().iterator();
  while (mappings.hasNext()) {
    DatabaseMapping nextMapping=(DatabaseMapping)mappings.next();
    Converter converter=null;
    if (fieldsToConverters != null) {
      converter=fieldsToConverters.get(nextMapping.getField());
    }
    if (nextMapping.isAbstractDirectMapping()) {
      if (converter != null) {
        ((AbstractDirectMapping)nextMapping).setConverter(converter);
      }
      XMLConversionManager xmlConversionManager=(XMLConversionManager)session.getDatasourcePlatform().getConversionManager();
      QName schemaType=(QName)xmlConversionManager.getDefaultJavaTypes().get(nextMapping.getAttributeClassification());
      if (schemaType != null && ((XMLField)nextMapping.getField()).getSchemaType() == null) {
        ((XMLField)nextMapping.getField()).setSchemaType(schemaType);
      }
    }
 else {
      if (converter != null) {
        ((AbstractCompositeObjectMapping)nextMapping).setConverter(converter);
      }
    }
    nextMapping.initialize(session);
  }
}
Program: 67249
Project: 67249
Buggy source:
/** 
 * Return the appropriate select statement containing the fields in the table.
 */
protected SQLSelectStatement buildNormalSelectStatement(){
  Map clonedExpressions=new IdentityHashMap();
  SQLSelectStatement selectStatement=buildBaseSelectStatement(false,clonedExpressions);
  ObjectLevelReadQuery query=((ObjectLevelReadQuery)getQuery());
  if (getDescriptor().hasInheritance()) {
    getDescriptor().getInheritancePolicy().appendWithAllSubclassesExpression(selectStatement);
    if ((!query.isReportQuery()) && query.shouldOuterJoinSubclasses()) {
      selectStatement.getExpressionBuilder().setShouldUseOuterJoinForMultitableInheritance(true);
    }
  }
  selectStatement.setFields(getSelectionFields(selectStatement,true));
  if (query.hasNonFetchJoinedAttributeExpressions()) {
    selectStatement.setNonSelectFields(query.getNonFetchJoinAttributeExpressions());
  }
  selectStatement.normalize(getSession(),getDescriptor(),clonedExpressions);
  if (((ObjectLevelReadQuery)getQuery()).hasJoining()) {
    ((ObjectLevelReadQuery)getQuery()).getJoinedAttributeManager().computeJoiningMappingIndexes(true,getSession(),0);
  }
  return selectStatement;
}

Fixed version (ground truth):
/** 
 * Return the appropriate select statement containing the fields in the table.
 */
protected SQLSelectStatement buildNormalSelectStatement(){
  Map clonedExpressions=new IdentityHashMap();
  SQLSelectStatement selectStatement=buildBaseSelectStatement(false,clonedExpressions);
  ObjectLevelReadQuery query=((ObjectLevelReadQuery)getQuery());
  if (getDescriptor().hasInheritance()) {
    getDescriptor().getInheritancePolicy().appendWithAllSubclassesExpression(selectStatement);
    if ((!query.isReportQuery()) && query.shouldOuterJoinSubclasses()) {
      selectStatement.getExpressionBuilder().setShouldUseOuterJoinForMultitableInheritance(true);
    }
  }
  selectStatement.setFields(getSelectionFields(selectStatement,true));
  if (query.hasNonFetchJoinedAttributeExpressions()) {
    selectStatement.setNonSelectFields(new ArrayList(query.getNonFetchJoinAttributeExpressions()));
  }
  selectStatement.normalize(getSession(),getDescriptor(),clonedExpressions);
  if (((ObjectLevelReadQuery)getQuery()).hasJoining()) {
    ((ObjectLevelReadQuery)getQuery()).getJoinedAttributeManager().computeJoiningMappingIndexes(true,getSession(),0);
  }
  return selectStatement;
}
Program: 67252
Project: 67252
Buggy source:
/** 
 * Inherited suite method for generating all test cases.
 * @return
 */
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new TestSuite(SDOTypeHelperBuiltinCommonjMapTestCases.class));
  suite.addTest(new SDOTypeHelperDefineTestSuite().suite());
  suite.addTest(new TestSuite(OpenContentPropertiesByNameTestCases.class));
  suite.addTestSuite(SDOTypeHelperExceptionTestCases.class);
  return suite;
}

Fixed version (ground truth):
/** 
 * Inherited suite method for generating all test cases.
 * @return
 */
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new TestSuite(SDOTypeHelperBuiltinCommonjMapTestCases.class));
  suite.addTest(new SDOTypeHelperDefineTestSuite().suite());
  suite.addTest(new TestSuite(OpenContentPropertiesByNameTestCases.class));
  suite.addTestSuite(SDOTypeHelperExceptionTestCases.class);
  suite.addTest(new TestSuite(SDOTypeHelperDelegateInitializeTestCases.class));
  return suite;
}
Program: 67253
Project: 67253
Buggy source:
public SDOTypeHelperDelegate(HelperContext aContext){
  aHelperContext=aContext;
  initWrapperTypes();
  initTypesHashMap();
  initCommonjHashMap();
  initCommonjJavaHashMap();
  initXsdToSDOType();
  initSdoToXSDType();
  initOpenProps();
}

Fixed version (ground truth):
public SDOTypeHelperDelegate(HelperContext aContext){
  aHelperContext=aContext;
  initWrapperTypes();
  initCommonjHashMap();
  initCommonjJavaHashMap();
  initTypesHashMap();
  initXsdToSDOType();
  initSdoToXSDType();
  initOpenProps();
}
Program: 67254
Project: 67254
Buggy source:
public RelationshipsTableManager(){
  setName("String_Node_Str");
  addTableDefinition(buildCMP3_CUSTOMERTable());
  addTableDefinition(buildCMP3_ITEMTable());
  addTableDefinition(buildCMP3_ISOLATEDITEMTable());
  addTableDefinition(buildCMP3_ORDERTable());
  addTableDefinition(buildCMP3_SALESPERSONTable());
  addTableDefinition(buildCUSTOMER_CUSTOMERTable());
  addTableDefinition(buildCMP3_ENTITYATable());
  addTableDefinition(buildCMP3_ENTITYBTable());
  addTableDefinition(buildCMP3_ENTITYA_ENTITYBTable());
  addTableDefinition(buildCMP3_ENTITYCTable());
  addTableDefinition(buildCMP3_ENTITYDTable());
  addTableDefinition(buildCMP3_UNIDIR_ENTITYC_ENTITYDTable());
  addTableDefinition(buildMATTELTable());
  addTableDefinition(buildLEGOTable());
  addTableDefinition(buildMEGABRANDSTable());
  addTableDefinition(buildNAMCOTable());
}

Fixed version (ground truth):
public RelationshipsTableManager(){
  setName("String_Node_Str");
  addTableDefinition(buildCMP3_CUSTOMERTable());
  addTableDefinition(buildCMP3_ITEMTable());
  addTableDefinition(buildCMP3_ISOLATEDITEMTable());
  addTableDefinition(buildCMP3_ORDERTable());
  addTableDefinition(buildCMP3_SALESPERSONTable());
  addTableDefinition(buildCUSTOMER_CUSTOMERTable());
  addTableDefinition(buildCMP3_ENTITYATable());
  addTableDefinition(buildCMP3_ENTITYBTable());
  addTableDefinition(buildCMP3_ENTITYA_ENTITYBTable());
  addTableDefinition(buildCMP3_ENTITYCTable());
  addTableDefinition(buildCMP3_ENTITYDTable());
  addTableDefinition(buildCMP3_UNIDIR_ENTITYC_ENTITYDTable());
  addTableDefinition(buildMATTELTable());
  addTableDefinition(buildLEGOTable());
  addTableDefinition(buildMEGABRANDSTable());
  addTableDefinition(buildNAMCOTable());
  addTableDefinition(buildServiceCallTable());
  addTableDefinition(buildCustomerServiceRepTable());
  addTableDefinition(buildCustRepTable());
}
Program: 67255
Project: 67255
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  suite.addTest(new RelationshipModelJUnitTestSuite("String_Node_Str"));
  return suite;
}
Program: 67256
Project: 67256
Buggy source:
/** 
 * INTERNAL: Process the map key to be an entity class.
 */
protected OneToOneMapping processEntityMapKeyClass(MetadataClass mapKeyClass,MappedKeyMapAccessor mappedKeyMapAccessor){
  OneToOneMapping keyMapping=new OneToOneMapping();
  keyMapping.setReferenceClassName(mapKeyClass.getName());
  keyMapping.dontUseIndirection();
  keyMapping.setDescriptor(getDescriptor().getClassDescriptor());
  EntityAccessor mapKeyAccessor=getProject().getEntityAccessor(mapKeyClass.getName());
  MetadataDescriptor mapKeyClassDescriptor=mapKeyAccessor.getDescriptor();
  String defaultPKFieldName=mapKeyClassDescriptor.getPrimaryKeyFieldName();
  String defaultFKFieldName=getAttributeName() + DEFAULT_MAP_KEY_COLUMN_SUFFIX;
  processOneToOneForeignKeyRelationship(keyMapping,getJoinColumns(mappedKeyMapAccessor.getMapKeyJoinColumns(),mapKeyClassDescriptor),defaultPKFieldName,mapKeyClassDescriptor.getPrimaryTable(),defaultFKFieldName,getReferenceDescriptor().getPrimaryTable());
  return keyMapping;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Process the map key to be an entity class.
 */
protected OneToOneMapping processEntityMapKeyClass(MetadataClass mapKeyClass,MappedKeyMapAccessor mappedKeyMapAccessor){
  OneToOneMapping keyMapping=new OneToOneMapping();
  keyMapping.setReferenceClassName(mapKeyClass.getName());
  keyMapping.dontUseIndirection();
  keyMapping.setDescriptor(getDescriptor().getClassDescriptor());
  EntityAccessor mapKeyAccessor=getProject().getEntityAccessor(mapKeyClass.getName());
  MetadataDescriptor mapKeyClassDescriptor=mapKeyAccessor.getDescriptor();
  String defaultPKFieldName=mapKeyClassDescriptor.getPrimaryKeyFieldName();
  String defaultFKFieldName=getAttributeName() + DEFAULT_MAP_KEY_COLUMN_SUFFIX;
  processOneToOneForeignKeyRelationship(keyMapping,getJoinColumns(mappedKeyMapAccessor.getMapKeyJoinColumns(),mapKeyClassDescriptor),defaultPKFieldName,mapKeyClassDescriptor.getPrimaryTable(),defaultFKFieldName,getDefaultTableForEntityMapKey());
  return keyMapping;
}
Program: 67257
Project: 67257
Buggy source:
/** 
 * Tests overriding @XmlAccessorOrder set at the package level in eclipselink-oxm.xml with one set at the class level in eclipselink-oxm.xml.  Here, the order is set to  'ALPHABETICAL' at the package level, but overridden as 'UNDEFINED'. Positive test.
 */
public void testXmlAccessorOrderClassOverridesPackage(){
  String contextPath=CONTEXT_PATH + "String_Node_Str";
  String path=PATH + "String_Node_Str";
  outputResolver=generateSchema(new Class[]{org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlaccessororder.packagelevel.Employee.class},contextPath,path,1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,0,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}

Fixed version (ground truth):
/** 
 * Tests overriding @XmlAccessorOrder set at the package level in eclipselink-oxm.xml with one set at the class level in eclipselink-oxm.xml.  Here, the order is set to  'ALPHABETICAL' at the package level, but overridden as 'UNDEFINED'. Positive test.
 */
public void testXmlAccessorOrderClassOverridesPackage(){
  String contextPath=CONTEXT_PATH + "String_Node_Str";
  String path=PATH + "String_Node_Str";
  outputResolver=generateSchema(new Class[]{org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlaccessororder.packagelevel.classoverride.Employee.class},contextPath,path,1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,0,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}
Program: 67258
Project: 67258
Buggy source:
/** 
 * Tests overriding @XmlAccessorType set at the package level in eclipselink-oxm.xml via class level override.  Here, the package level setting is 'PROPERTY', which is overridden for Employee as 'PUBLIC_MEMBER'.  Positive test.
 */
public void testXmlAccessorTypeClassOverridesPackage(){
  String contextPath=CONTEXT_PATH + "String_Node_Str";
  String path=PATH + "String_Node_Str";
  outputResolver=generateSchema(new Class[]{org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlaccessortype.packagelevel.Employee.class},contextPath,path,1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,0,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}

Fixed version (ground truth):
/** 
 * Tests overriding @XmlAccessorType set at the package level in eclipselink-oxm.xml via class level override.  Here, the package level setting is 'PROPERTY', which is overridden for Employee as 'PUBLIC_MEMBER'.  Positive test.
 */
public void testXmlAccessorTypeClassOverridesPackage(){
  String contextPath=CONTEXT_PATH + "String_Node_Str";
  String path=PATH + "String_Node_Str";
  outputResolver=generateSchema(new Class[]{org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlaccessortype.packagelevel.classoverride.Employee.class},contextPath,path,1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,0,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}
Program: 67259
Project: 67259
Buggy source:
/** 
 * Tests class level @XmlAccessorType override via eclipselink-oxm.xml. Here, the Employee object has the access set to 'NONE', but this is overridden as 'FIELD'. Positive test.
 */
public void testXmlAccessorTypeFieldOverride(){
  String contextPath=CONTEXT_PATH + "String_Node_Str";
  String path=PATH + "String_Node_Str";
  outputResolver=generateSchema(contextPath,path,1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,0,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}

Fixed version (ground truth):
/** 
 * Tests class level @XmlAccessorType override via eclipselink-oxm.xml. Here, the Employee object has the access set to 'NONE', but this is overridden as 'FIELD'. Positive test.
 */
public void testXmlAccessorTypeFieldOverride(){
  String contextPath=CONTEXT_PATH + "String_Node_Str";
  String path=PATH + "String_Node_Str";
  outputResolver=generateSchema(new Class[]{org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlaccessortype.field.Employee.class},contextPath,path,1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,0,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}
Program: 67260
Project: 67260
Buggy source:
/** 
 * Tests class level @XmlAccessorType override via eclipselink-oxm.xml. Here, the Employee object has the access set to 'NONE', but this is overridden as 'PROPERTY'. Positive test.
 */
public void testXmlAccessorTypePropertyOverride(){
  String contextPath=CONTEXT_PATH + "String_Node_Str";
  String path=PATH + "String_Node_Str";
  outputResolver=generateSchema(contextPath,path,1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,0,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}

Fixed version (ground truth):
/** 
 * Tests class level @XmlAccessorType override via eclipselink-oxm.xml. Here, the Employee object has the access set to 'NONE', but this is overridden as 'PROPERTY'. Positive test.
 */
public void testXmlAccessorTypePropertyOverride(){
  String contextPath=CONTEXT_PATH + "String_Node_Str";
  String path=PATH + "String_Node_Str";
  outputResolver=generateSchema(new Class[]{org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlaccessortype.property.Employee.class},contextPath,path,1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,0,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}
Program: 67261
Project: 67261
Buggy source:
/** 
 * Tests class level @XmlAccessorType override via eclipselink-oxm.xml. Here, the Employee object has the access set to 'NONE', but this is overridden as 'PUBLIC_MEMBER'. Positive test.
 */
public void testXmlAccessorTypePublicMemberOverride(){
  String contextPath=CONTEXT_PATH + "String_Node_Str";
  String path=PATH + "String_Node_Str";
  outputResolver=generateSchema(contextPath,path,1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,0,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}

Fixed version (ground truth):
/** 
 * Tests class level @XmlAccessorType override via eclipselink-oxm.xml. Here, the Employee object has the access set to 'NONE', but this is overridden as 'PUBLIC_MEMBER'. Positive test.
 */
public void testXmlAccessorTypePublicMemberOverride(){
  String contextPath=CONTEXT_PATH + "String_Node_Str";
  String path=PATH + "String_Node_Str";
  outputResolver=generateSchema(new Class[]{org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlaccessortype.publicmember.Employee.class},contextPath,path,1);
  String src=PATH + "String_Node_Str";
  String result=validateAgainstSchema(src,0,outputResolver);
  assertTrue("String_Node_Str" + result,result == null);
}
Program: 67262
Project: 67262
Buggy source:
/** 
 * Post process XmlAccessorType.  In some cases, such as @XmlSeeAlso classes, the access type may not have been set
 * @param info
 */
private void postProcessXmlAccessorType(TypeInfo info){
  if (!info.isSetXmlAccessType()) {
    info.setXmlAccessType(XmlAccessType.PUBLIC_MEMBER);
  }
}

Fixed version (ground truth):
/** 
 * Post process XmlAccessorType.  In some cases, such as @XmlSeeAlso classes, the access type may not have been set
 * @param info
 */
private void postProcessXmlAccessorType(TypeInfo info,NamespaceInfo packageNamespace){
  if (!info.isSetXmlAccessType()) {
    info.setXmlAccessType(org.eclipse.persistence.jaxb.xmlmodel.XmlAccessType.fromValue(packageNamespace.getAccessType().name()));
  }
}
Program: 67263
Project: 67263
Buggy source:
/** 
 * Post process XmlAccessorOrder.  This method assumes that the given TypeInfo has  already had its order set (via annotations in preProcessXmlAccessorOrder or via xml metadata override in XMLProcessor).
 * @param javaClass
 * @param info
 */
private void postProcessXmlAccessorOrder(TypeInfo info){
  info.orderProperties();
}

Fixed version (ground truth):
/** 
 * Post process XmlAccessorOrder.  This method assumes that the given TypeInfo has  already had its order set (via annotations in preProcessXmlAccessorOrder or via xml metadata override in XMLProcessor).
 * @param javaClass
 * @param info
 */
private void postProcessXmlAccessorOrder(TypeInfo info,NamespaceInfo packageNamespace){
  if (!info.isSetXmlAccessOrder()) {
    info.setXmlAccessOrder(org.eclipse.persistence.jaxb.xmlmodel.XmlAccessOrder.fromValue(packageNamespace.getAccessOrder().name()));
  }
  info.orderProperties();
}
Program: 67265
Project: 67265
Buggy source:
public void testCustomerServiceRepMap(){
  EntityManager em=createEntityManager();
  beginTransaction(em);
  Customer cust=new Customer();
  cust.setName("String_Node_Str");
  cust.setCity("String_Node_Str");
  CustomerServiceRepresentative rep=new CustomerServiceRepresentative();
  rep.setName("String_Node_Str");
  ServiceCall call=new ServiceCall();
  call.setDescription("String_Node_Str");
  cust.addCustomerServiceInteraction(call,rep);
  em.persist(call);
  em.persist(cust);
  em.flush();
  rollbackTransaction(em);
}

Fixed version (ground truth):
public void testCustomerServiceRepMap(){
  EntityManager em=createEntityManager();
  beginTransaction(em);
  Customer cust=new Customer();
  cust.setName("String_Node_Str");
  cust.setCity("String_Node_Str");
  CustomerServiceRepresentative rep=new CustomerServiceRepresentative();
  rep.setName("String_Node_Str");
  ServiceCall call=new ServiceCall();
  call.setDescription("String_Node_Str");
  cust.addCSInteraction(call,rep);
  em.persist(call);
  em.persist(cust);
  em.flush();
  rollbackTransaction(em);
}
Program: 67266
Project: 67266
Buggy source:
public void testEL254937(){
  EntityManager em=createEntityManager();
  beginTransaction(em);
  LargeProject lp1=new LargeProject();
  lp1.setName("String_Node_Str");
  em.persist(lp1);
  commitTransaction(em);
  em=createEntityManager();
  beginTransaction(em);
  em.remove(em.find(LargeProject.class,lp1.getId()));
  em.flush();
  JpaEntityManager eclipselinkEm=(JpaEntityManager)em.getDelegate();
  RepeatableWriteUnitOfWork uow=(RepeatableWriteUnitOfWork)eclipselinkEm.getActiveSession();
  uow.issueSQLbeforeCompletion();
  uow.setShouldTerminateTransaction(true);
  uow.commitTransaction();
  uow.mergeClonesAfterCompletion();
  em=createEntityManager();
  LargeProject cachedLargeProject=em.find(LargeProject.class,lp1.getId());
  closeEntityManager(em);
  assertTrue("String_Node_Str",cachedLargeProject == null);
}

Fixed version (ground truth):
public void testEL254937(){
  if (!isOnServer()) {
    EntityManager em=createEntityManager();
    beginTransaction(em);
    LargeProject lp1=new LargeProject();
    lp1.setName("String_Node_Str");
    em.persist(lp1);
    commitTransaction(em);
    em=createEntityManager();
    beginTransaction(em);
    em.remove(em.find(LargeProject.class,lp1.getId()));
    em.flush();
    JpaEntityManager eclipselinkEm=(JpaEntityManager)em.getDelegate();
    RepeatableWriteUnitOfWork uow=(RepeatableWriteUnitOfWork)eclipselinkEm.getActiveSession();
    uow.issueSQLbeforeCompletion();
    uow.setShouldTerminateTransaction(true);
    uow.commitTransaction();
    uow.mergeClonesAfterCompletion();
    em=createEntityManager();
    LargeProject cachedLargeProject=em.find(LargeProject.class,lp1.getId());
    closeEntityManager(em);
    assertTrue("String_Node_Str",cachedLargeProject == null);
  }
}
Program: 67267
Project: 67267
Buggy source:
/** 
 * test: updating the version field with value != in-memory value. This should throw an OptimisticLockException
 */
public void testVersionUpdateWithIncorrectValue(){
  EntityManager em=createEntityManager();
  Employee employee;
  try {
    beginTransaction(em);
    employee=ModelExamples.employeeExample1();
    em.persist(employee);
    commitTransaction(em);
    beginTransaction(em);
    Employee employee1=em.find(Employee.class,employee.getId());
    employee1.setVersion(2);
    commitTransaction(em);
    fail("String_Node_Str");
  }
 catch (  PersistenceException pe) {
  }
catch (  Exception e) {
    fail("String_Node_Str" + e.getMessage());
  }
 finally {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    closeEntityManager(em);
  }
}

Fixed version (ground truth):
/** 
 * test: updating the version field with value != in-memory value. This should throw an OptimisticLockException
 */
public void testVersionUpdateWithIncorrectValue(){
  EntityManager em=createEntityManager();
  Employee employee;
  try {
    beginTransaction(em);
    employee=ModelExamples.employeeExample1();
    em.persist(employee);
    commitTransaction(em);
    beginTransaction(em);
    Employee employee1=em.find(Employee.class,employee.getId());
    employee1.setVersion(2);
    commitTransaction(em);
    fail("String_Node_Str");
  }
 catch (  PersistenceException pe) {
  }
catch (  Exception exception) {
    Throwable persistenceException=exception;
    while (persistenceException != null && !(persistenceException instanceof OptimisticLockException)) {
      persistenceException=persistenceException.getCause();
    }
    if (persistenceException instanceof OptimisticLockException) {
      OptimisticLockException oe=(OptimisticLockException)persistenceException;
      return;
    }
 else {
      fail("String_Node_Str" + exception.getMessage());
    }
  }
 finally {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    closeEntityManager(em);
  }
}
Program: 67268
Project: 67268
Buggy source:
/** 
 * test: updating the version field with null value. This should throw an exception
 */
public void testVersionUpdateWithNullValue(){
  EntityManager em=createEntityManager();
  Employee employee;
  try {
    beginTransaction(em);
    employee=ModelExamples.employeeExample1();
    em.persist(employee);
    commitTransaction(em);
    beginTransaction(em);
    Employee employee2=em.find(Employee.class,employee.getId());
    employee2.setVersion(null);
    commitTransaction(em);
    fail("String_Node_Str");
  }
 catch (  PersistenceException pe) {
  }
catch (  Exception e) {
    fail("String_Node_Str" + e.getMessage());
  }
 finally {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    closeEntityManager(em);
  }
}

Fixed version (ground truth):
/** 
 * test: updating the version field with null value. This should throw an exception
 */
public void testVersionUpdateWithNullValue(){
  EntityManager em=createEntityManager();
  Employee employee;
  try {
    beginTransaction(em);
    employee=ModelExamples.employeeExample1();
    em.persist(employee);
    commitTransaction(em);
    beginTransaction(em);
    Employee employee2=em.find(Employee.class,employee.getId());
    employee2.setVersion(null);
    commitTransaction(em);
    fail("String_Node_Str");
  }
 catch (  PersistenceException pe) {
  }
catch (  Exception exception) {
    Throwable persistenceException=exception;
    while (persistenceException != null && !(persistenceException instanceof OptimisticLockException)) {
      persistenceException=persistenceException.getCause();
    }
    if (persistenceException instanceof OptimisticLockException) {
      OptimisticLockException oe=(OptimisticLockException)persistenceException;
      return;
    }
 else {
      fail("String_Node_Str" + exception.getMessage());
    }
  }
 finally {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    closeEntityManager(em);
  }
}
Program: 67269
Project: 67269
Buggy source:
/** 
 * test: updating the version field with value != in-memory value. This should throw an OptimisticLockException
 */
public void testVersionUpdateWithIncorrectValue(){
  EntityManager em=createEntityManager("String_Node_Str");
  Employee employee;
  try {
    beginTransaction(em);
    employee=ModelExamples.employeeExample1();
    em.persist(employee);
    commitTransaction(em);
    beginTransaction(em);
    Employee employee1=em.find(Employee.class,employee.getId());
    employee1.setVersion(2);
    commitTransaction(em);
    fail("String_Node_Str");
  }
 catch (  PersistenceException pe) {
  }
catch (  Exception e) {
    fail("String_Node_Str" + e.getMessage());
  }
 finally {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    closeEntityManager(em);
  }
}

Fixed version (ground truth):
/** 
 * test: updating the version field with value != in-memory value. This should throw an OptimisticLockException
 */
public void testVersionUpdateWithIncorrectValue(){
  EntityManager em=createEntityManager("String_Node_Str");
  Employee employee;
  try {
    beginTransaction(em);
    employee=ModelExamples.employeeExample1();
    em.persist(employee);
    commitTransaction(em);
    beginTransaction(em);
    Employee employee1=em.find(Employee.class,employee.getId());
    employee1.setVersion(2);
    commitTransaction(em);
    fail("String_Node_Str");
  }
 catch (  PersistenceException pe) {
  }
catch (  Exception exception) {
    Throwable persistenceException=exception;
    while (persistenceException != null && !(persistenceException instanceof OptimisticLockException)) {
      persistenceException=persistenceException.getCause();
    }
    if (persistenceException instanceof OptimisticLockException) {
      OptimisticLockException oe=(OptimisticLockException)persistenceException;
      return;
    }
 else {
      fail("String_Node_Str" + exception.getMessage());
    }
  }
 finally {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    closeEntityManager(em);
  }
}
Program: 67270
Project: 67270
Buggy source:
/** 
 * test: updating the version field with null value. This should throw an exception
 */
public void testVersionUpdateWithNullValue(){
  EntityManager em=createEntityManager("String_Node_Str");
  Employee employee;
  try {
    beginTransaction(em);
    employee=ModelExamples.employeeExample1();
    em.persist(employee);
    commitTransaction(em);
    beginTransaction(em);
    Employee employee2=em.find(Employee.class,employee.getId());
    employee2.setVersion(null);
    commitTransaction(em);
    fail("String_Node_Str");
  }
 catch (  PersistenceException pe) {
  }
catch (  Exception e) {
    fail("String_Node_Str" + e.getMessage());
  }
 finally {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    closeEntityManager(em);
  }
}

Fixed version (ground truth):
/** 
 * test: updating the version field with null value. This should throw an exception
 */
public void testVersionUpdateWithNullValue(){
  EntityManager em=createEntityManager("String_Node_Str");
  Employee employee;
  try {
    beginTransaction(em);
    employee=ModelExamples.employeeExample1();
    em.persist(employee);
    commitTransaction(em);
    beginTransaction(em);
    Employee employee2=em.find(Employee.class,employee.getId());
    employee2.setVersion(null);
    commitTransaction(em);
    fail("String_Node_Str");
  }
 catch (  PersistenceException pe) {
  }
catch (  Exception exception) {
    Throwable persistenceException=exception;
    while (persistenceException != null && !(persistenceException instanceof OptimisticLockException)) {
      persistenceException=persistenceException.getCause();
    }
    if (persistenceException instanceof OptimisticLockException) {
      OptimisticLockException oe=(OptimisticLockException)persistenceException;
      return;
    }
 else {
      fail("String_Node_Str" + exception.getMessage());
    }
  }
 finally {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    closeEntityManager(em);
  }
}
Program: 67271
Project: 67271
Buggy source:
/** 
 * Generate the schema for these tests once only.  If generation fails, it will do so for each test (meaning all tests will result in a generation failure).  If generation is successful it is not performed again.
 */
private void generateSchema(){
  if (shouldGenerateSchema) {
    outputResolver=new MySchemaOutputResolver();
    try {
      Class[] classes=new Class[]{ObjectFactory.class};
      JAXBContext context=(org.eclipse.persistence.jaxb.JAXBContext)org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(classes,null);
      context.generateSchema(outputResolver);
    }
 catch (    Exception ex) {
      fail("String_Node_Str" + ex.toString());
    }
    assertTrue("String_Node_Str",outputResolver.schemaFiles.size() > 0);
    assertTrue("String_Node_Str",outputResolver.schemaFiles.size() == 1);
    shouldGenerateSchema=false;
  }
}

Fixed version (ground truth):
/** 
 * Generate the schema for these tests once only.  If generation fails, it will do so for each test (meaning all tests will result in a generation failure).  If generation is successful it is not performed again.
 */
private void generateSchema(){
  if (shouldGenerateSchema) {
    outputResolver=new MySchemaOutputResolver();
    try {
      Class[] classes=new Class[]{WrappedByteArray.class};
      JAXBContext context=(org.eclipse.persistence.jaxb.JAXBContext)org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(classes,null);
      context.generateSchema(outputResolver);
    }
 catch (    Exception ex) {
      fail("String_Node_Str" + ex.toString());
    }
    assertTrue("String_Node_Str",outputResolver.schemaFiles.size() > 0);
    assertTrue("String_Node_Str",outputResolver.schemaFiles.size() == 1);
    shouldGenerateSchema=false;
  }
}
Program: 67272
Project: 67272
Buggy source:
protected void buildExpectedResults(){
}

Fixed version (ground truth):
protected void buildExpectedResults(){
  expectedResults=new Vector<Date[]>();
  Vector employees=getSession().readAllObjects(Employee.class);
  for (Enumeration e=employees.elements(); e.hasMoreElements(); ) {
    Employee emp=(Employee)e.nextElement();
    Object[] result=new Object[1];
    result[0]=emp.getPeriod();
    addResult(result,null);
  }
}