nus-yam/ex-repair huggingface dataset:
Program: 67791
Project: 67791
Buggy source:
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  Object value=unmarshalRecord.getStringBuffer().toString();
  boolean isCDATA=unmarshalRecord.isBufferCDATA();
  unmarshalRecord.resetStringBuffer();
  XMLField toWrite=xmlField;
  if (xmlField.isCDATA() != isCDATA) {
    toWrite=new XMLField(xmlField.getName());
    toWrite.setNamespaceResolver(xmlField.getNamespaceResolver());
    toWrite.setIsCDATA(isCDATA);
  }
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=xmlField.convertValueBasedOnSchemaType(value,xmlConversionManager);
  }
  if (null == unmarshalRecord.getTransformationRecord()) {
    unmarshalRecord.setTransformationRecord(new XMLTransformationRecord("String_Node_Str",unmarshalRecord));
  }
  unmarshalRecord.getTransformationRecord().put(toWrite,value);
}

Fixed version (ground truth):
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  Object value=unmarshalRecord.getStringBuffer().toString();
  boolean isCDATA=unmarshalRecord.isBufferCDATA();
  unmarshalRecord.resetStringBuffer();
  XMLField toWrite=xmlField;
  if (xmlField.isCDATA() != isCDATA) {
    toWrite=new XMLField(xmlField.getName());
    toWrite.setNamespaceResolver(xmlField.getNamespaceResolver());
    toWrite.setIsCDATA(isCDATA);
  }
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=xmlField.convertValueBasedOnSchemaType(value,xmlConversionManager,unmarshalRecord);
  }
  if (null == unmarshalRecord.getTransformationRecord()) {
    unmarshalRecord.setTransformationRecord(new XMLTransformationRecord("String_Node_Str",unmarshalRecord));
  }
  unmarshalRecord.getTransformationRecord().put(toWrite,value);
}
Program: 67792
Project: 67792
Buggy source:
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  Object objectValue=xmlField.convertValueBasedOnSchemaType(value,xmlConversionManager);
  if (null == unmarshalRecord.getTransformationRecord()) {
    unmarshalRecord.setTransformationRecord(new XMLTransformationRecord("String_Node_Str",unmarshalRecord));
  }
  unmarshalRecord.getTransformationRecord().put(xmlField,objectValue);
}

Fixed version (ground truth):
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  Object objectValue=xmlField.convertValueBasedOnSchemaType(value,xmlConversionManager,unmarshalRecord);
  if (null == unmarshalRecord.getTransformationRecord()) {
    unmarshalRecord.setTransformationRecord(new XMLTransformationRecord("String_Node_Str",unmarshalRecord));
  }
  unmarshalRecord.getTransformationRecord().put(xmlField,objectValue);
}
Program: 67794
Project: 67794
Buggy source:
/** 
 * Handle endElement operation.  Here we will create and populate an  org.eclipse.persistence.internal.oxm.Reference instance to be used during  the mapping resolution stage.  In particular, the primary key value for this element will be added to the Reference object's map of target primary key values - based on the target key field name.  Note  that if a reference already exists for the xmlCollectionReferenceMapping's  source object instance, we will simply add to the target pk value list.   The Reference object is stored on the ReferenceResolver associated with  the UnmarshalRecord's session.
 */
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  if (!xmlField.getLastXPathFragment().nameIsText()) {
    return;
  }
  Object value=unmarshalRecord.getStringBuffer().toString();
  unmarshalRecord.resetStringBuffer();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=xmlField.convertValueBasedOnSchemaType(value,xmlConversionManager);
  }
  xmlCollectionReferenceMapping.buildReference(unmarshalRecord,xmlField,value,unmarshalRecord.getSession());
}

Fixed version (ground truth):
/** 
 * Handle endElement operation.  Here we will create and populate an  org.eclipse.persistence.internal.oxm.Reference instance to be used during  the mapping resolution stage.  In particular, the primary key value for this element will be added to the Reference object's map of target primary key values - based on the target key field name.  Note  that if a reference already exists for the xmlCollectionReferenceMapping's  source object instance, we will simply add to the target pk value list.   The Reference object is stored on the ReferenceResolver associated with  the UnmarshalRecord's session.
 */
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  if (!xmlField.getLastXPathFragment().nameIsText()) {
    return;
  }
  Object value=unmarshalRecord.getStringBuffer().toString();
  unmarshalRecord.resetStringBuffer();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=xmlField.convertValueBasedOnSchemaType(value,xmlConversionManager,unmarshalRecord);
  }
  xmlCollectionReferenceMapping.buildReference(unmarshalRecord,xmlField,value,unmarshalRecord.getSession());
}
Program: 67796
Project: 67796
Buggy source:
/** 
 * Handle attribute operation.  Here we will create and populate an  org.eclipse.persistence.internal.oxm.Reference instance to be used during  the mapping resolution stage.  In particular, the primary key value for this element will be added to the Reference object's map of target primary key values - based on the target key field name.  Note  that if a reference already exists for the xmlCollectionReferenceMapping's  source object instance, we will simply add to the target pk value list.   The Reference object is stored on the ReferenceResolver associated with  the UnmarshalRecord's session.
 */
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  if (value != null) {
    Object realValue=xmlField.convertValueBasedOnSchemaType(value,(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager());
    xmlCollectionReferenceMapping.buildReference(unmarshalRecord,xmlField,realValue,unmarshalRecord.getSession());
  }
}

Fixed version (ground truth):
/** 
 * Handle attribute operation.  Here we will create and populate an  org.eclipse.persistence.internal.oxm.Reference instance to be used during  the mapping resolution stage.  In particular, the primary key value for this element will be added to the Reference object's map of target primary key values - based on the target key field name.  Note  that if a reference already exists for the xmlCollectionReferenceMapping's  source object instance, we will simply add to the target pk value list.   The Reference object is stored on the ReferenceResolver associated with  the UnmarshalRecord's session.
 */
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  if (value != null) {
    Object realValue=xmlField.convertValueBasedOnSchemaType(value,(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager(),unmarshalRecord);
    xmlCollectionReferenceMapping.buildReference(unmarshalRecord,xmlField,realValue,unmarshalRecord.getSession());
  }
}
Program: 67797
Project: 67797
Buggy source:
private void addUnmarshalValue(UnmarshalRecord unmarshalRecord,Object value,Object collection){
  if ((null == value) || EMPTY_STRING.equals(value)) {
    return;
  }
  XMLField xmlField=(XMLField)xmlCompositeDirectCollectionMapping.getField();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=xmlField.convertValueBasedOnSchemaType(value,xmlConversionManager);
  }
  if (xmlCompositeDirectCollectionMapping.hasValueConverter()) {
    if (xmlCompositeDirectCollectionMapping.getValueConverter() instanceof XMLConverter) {
      value=((XMLConverter)xmlCompositeDirectCollectionMapping.getValueConverter()).convertDataValueToObjectValue(value,unmarshalRecord.getSession(),unmarshalRecord.getUnmarshaller());
    }
 else {
      value=xmlCompositeDirectCollectionMapping.getValueConverter().convertDataValueToObjectValue(value,unmarshalRecord.getSession());
    }
  }
  unmarshalRecord.addAttributeValue(this,value,collection);
}

Fixed version (ground truth):
private void addUnmarshalValue(UnmarshalRecord unmarshalRecord,Object value,Object collection){
  if ((null == value) || EMPTY_STRING.equals(value)) {
    return;
  }
  XMLField xmlField=(XMLField)xmlCompositeDirectCollectionMapping.getField();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=xmlField.convertValueBasedOnSchemaType(value,xmlConversionManager,unmarshalRecord);
  }
  if (xmlCompositeDirectCollectionMapping.hasValueConverter()) {
    if (xmlCompositeDirectCollectionMapping.getValueConverter() instanceof XMLConverter) {
      value=((XMLConverter)xmlCompositeDirectCollectionMapping.getValueConverter()).convertDataValueToObjectValue(value,unmarshalRecord.getSession(),unmarshalRecord.getUnmarshaller());
    }
 else {
      value=xmlCompositeDirectCollectionMapping.getValueConverter().convertDataValueToObjectValue(value,unmarshalRecord.getSession());
    }
  }
  unmarshalRecord.addAttributeValue(this,value,collection);
}
Program: 67800
Project: 67800
Buggy source:
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  unmarshalRecord.removeNullCapableValue(this);
  XMLField xmlField=(XMLField)xmlDirectMapping.getField();
  if (!xmlField.getLastXPathFragment().nameIsText()) {
    return;
  }
  Object value=unmarshalRecord.getStringBuffer().toString();
  if (value.equals(EMPTY_STRING)) {
    value=null;
  }
  unmarshalRecord.resetStringBuffer();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=xmlField.convertValueBasedOnSchemaType(value,xmlConversionManager);
  }
  Object convertedValue=xmlDirectMapping.getAttributeValue(value,unmarshalRecord.getSession(),unmarshalRecord);
  unmarshalRecord.setAttributeValue(convertedValue,xmlDirectMapping);
}

Fixed version (ground truth):
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  unmarshalRecord.removeNullCapableValue(this);
  XMLField xmlField=(XMLField)xmlDirectMapping.getField();
  if (!xmlField.getLastXPathFragment().nameIsText()) {
    return;
  }
  Object value=unmarshalRecord.getStringBuffer().toString();
  if (value.equals(EMPTY_STRING)) {
    value=null;
  }
  unmarshalRecord.resetStringBuffer();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=xmlField.convertValueBasedOnSchemaType(value,xmlConversionManager,unmarshalRecord);
  }
  Object convertedValue=xmlDirectMapping.getAttributeValue(value,unmarshalRecord.getSession(),unmarshalRecord);
  unmarshalRecord.setAttributeValue(convertedValue,xmlDirectMapping);
}
Program: 67801
Project: 67801
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  if (xmlDirectMapping.isReadOnly()) {
    return false;
  }
  Object objectValue=marshalContext.getAttributeValue(object,xmlDirectMapping);
  Object fieldValue=xmlDirectMapping.getFieldValue(objectValue,session,marshalRecord);
  if (null == fieldValue) {
    return xmlDirectMapping.getNullPolicy().directMarshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
  }
 else {
    QName schemaType=getSchemaType((XMLField)xmlDirectMapping.getField(),fieldValue,session);
    String stringValue=getValueToWrite(schemaType,fieldValue,(XMLConversionManager)session.getDatasourcePlatform().getConversionManager());
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    if (xPathFragment.isAttribute()) {
      marshalRecord.attribute(xPathFragment,namespaceResolver,stringValue);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    }
 else {
      marshalRecord.closeStartGroupingElements(groupingFragment);
      if (xmlDirectMapping.isCDATA()) {
        marshalRecord.cdata(stringValue);
      }
 else {
        marshalRecord.characters(stringValue);
      }
    }
    return true;
  }
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  if (xmlDirectMapping.isReadOnly()) {
    return false;
  }
  Object objectValue=marshalContext.getAttributeValue(object,xmlDirectMapping);
  Object fieldValue=xmlDirectMapping.getFieldValue(objectValue,session,marshalRecord);
  if (null == fieldValue) {
    return xmlDirectMapping.getNullPolicy().directMarshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
  }
 else {
    QName schemaType=getSchemaType((XMLField)xmlDirectMapping.getField(),fieldValue,session);
    String stringValue=getValueToWrite(schemaType,fieldValue,(XMLConversionManager)session.getDatasourcePlatform().getConversionManager(),namespaceResolver);
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    if (xPathFragment.isAttribute()) {
      marshalRecord.attribute(xPathFragment,namespaceResolver,stringValue);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    }
 else {
      marshalRecord.closeStartGroupingElements(groupingFragment);
      if (xmlDirectMapping.isCDATA()) {
        marshalRecord.cdata(stringValue);
      }
 else {
        marshalRecord.characters(stringValue);
      }
    }
    return true;
  }
}
Program: 67802
Project: 67802
Buggy source:
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  unmarshalRecord.removeNullCapableValue(this);
  XMLField xmlField=(XMLField)xmlDirectMapping.getField();
  Object realValue=xmlField.convertValueBasedOnSchemaType(value,(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager());
  Object convertedValue=xmlDirectMapping.getAttributeValue(realValue,unmarshalRecord.getSession(),unmarshalRecord);
  xmlDirectMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(),convertedValue);
}

Fixed version (ground truth):
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  unmarshalRecord.removeNullCapableValue(this);
  XMLField xmlField=(XMLField)xmlDirectMapping.getField();
  Object realValue=xmlField.convertValueBasedOnSchemaType(value,(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager(),unmarshalRecord);
  Object convertedValue=xmlDirectMapping.getAttributeValue(realValue,unmarshalRecord.getSession(),unmarshalRecord);
  xmlDirectMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(),convertedValue);
}
Program: 67803
Project: 67803
Buggy source:
/** 
 * Handle endElement operation.  Here we will create and populate an  org.eclipse.persistence.internal.oxm.Reference instance to be used during  the mapping resolution stage.  In particular, the primary key value for this element will be added to the Reference object's list of target primary key values.  Note that if a reference already exists  for the xmlObjectReferenceMapping's source object instance, we will simply add to the target pk value list.  The Reference object will  is stored on the ReferenceResolver associated with the UnmarshalRecord's session.
 */
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  if (!xmlField.getLastXPathFragment().nameIsText()) {
    return;
  }
  Object value=unmarshalRecord.getStringBuffer().toString();
  unmarshalRecord.resetStringBuffer();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=xmlField.convertValueBasedOnSchemaType(value,xmlConversionManager);
  }
  xmlObjectReferenceMapping.buildReference(unmarshalRecord,xmlField,value,unmarshalRecord.getSession());
}

Fixed version (ground truth):
/** 
 * Handle endElement operation.  Here we will create and populate an  org.eclipse.persistence.internal.oxm.Reference instance to be used during  the mapping resolution stage.  In particular, the primary key value for this element will be added to the Reference object's list of target primary key values.  Note that if a reference already exists  for the xmlObjectReferenceMapping's source object instance, we will simply add to the target pk value list.  The Reference object will  is stored on the ReferenceResolver associated with the UnmarshalRecord's session.
 */
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  if (!xmlField.getLastXPathFragment().nameIsText()) {
    return;
  }
  Object value=unmarshalRecord.getStringBuffer().toString();
  unmarshalRecord.resetStringBuffer();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=xmlField.convertValueBasedOnSchemaType(value,xmlConversionManager,unmarshalRecord);
  }
  xmlObjectReferenceMapping.buildReference(unmarshalRecord,xmlField,value,unmarshalRecord.getSession());
}
Program: 67804
Project: 67804
Buggy source:
/** 
 * Handle the marshal operation for this NodeValue's XMLField.  The target object's primary key value that is mapped to this NodeValue's XMLField  (in the XMLObjectReferenceMapping's source-target key field association list) is retrieved and written out. 
 */
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  if (xmlObjectReferenceMapping.isReadOnly()) {
    return false;
  }
  Object targetObject=marshalContext.getAttributeValue(object,xmlObjectReferenceMapping);
  Object fieldValue=xmlObjectReferenceMapping.buildFieldValue(targetObject,xmlField,session);
  if (fieldValue == null) {
    return false;
  }
  QName schemaType=getSchemaType(xmlField,fieldValue,session);
  String stringValue=getValueToWrite(schemaType,fieldValue,(XMLConversionManager)session.getDatasourcePlatform().getConversionManager());
  XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
  if (xPathFragment.isAttribute()) {
    marshalRecord.attribute(xPathFragment,namespaceResolver,stringValue);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    marshalRecord.closeStartGroupingElements(groupingFragment);
    marshalRecord.characters(stringValue);
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Handle the marshal operation for this NodeValue's XMLField.  The target object's primary key value that is mapped to this NodeValue's XMLField  (in the XMLObjectReferenceMapping's source-target key field association list) is retrieved and written out. 
 */
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  if (xmlObjectReferenceMapping.isReadOnly()) {
    return false;
  }
  Object targetObject=marshalContext.getAttributeValue(object,xmlObjectReferenceMapping);
  Object fieldValue=xmlObjectReferenceMapping.buildFieldValue(targetObject,xmlField,session);
  if (fieldValue == null) {
    return false;
  }
  QName schemaType=getSchemaType(xmlField,fieldValue,session);
  String stringValue=getValueToWrite(schemaType,fieldValue,(XMLConversionManager)session.getDatasourcePlatform().getConversionManager(),namespaceResolver);
  XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
  if (xPathFragment.isAttribute()) {
    marshalRecord.attribute(xPathFragment,namespaceResolver,stringValue);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    marshalRecord.closeStartGroupingElements(groupingFragment);
    marshalRecord.characters(stringValue);
  }
  return true;
}
Program: 67805
Project: 67805
Buggy source:
/** 
 * Handle attribute operation.  Here we will create and populate an  org.eclipse.persistence.internal.oxm.Reference instance to be used during  the mapping resolution stage.  In particular, the primary key value for this element will be added to the Reference object's list of target primary key values.  Note that if a reference already exists  for the xmlObjectReferenceMapping's source object instance, we will simply add to the target pk value list.  The Reference object will  is stored on the ReferenceResolver associated with the UnmarshalRecord's session.
 */
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  if (value != null) {
    Object realValue=xmlField.convertValueBasedOnSchemaType(value,(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager());
    xmlObjectReferenceMapping.buildReference(unmarshalRecord,xmlField,realValue,unmarshalRecord.getSession());
  }
}

Fixed version (ground truth):
/** 
 * Handle attribute operation.  Here we will create and populate an  org.eclipse.persistence.internal.oxm.Reference instance to be used during  the mapping resolution stage.  In particular, the primary key value for this element will be added to the Reference object's list of target primary key values.  Note that if a reference already exists  for the xmlObjectReferenceMapping's source object instance, we will simply add to the target pk value list.  The Reference object will  is stored on the ReferenceResolver associated with the UnmarshalRecord's session.
 */
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  if (value != null) {
    Object realValue=xmlField.convertValueBasedOnSchemaType(value,(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager(),unmarshalRecord);
    xmlObjectReferenceMapping.buildReference(unmarshalRecord,xmlField,realValue,unmarshalRecord.getSession());
  }
}
Program: 67806
Project: 67806
Buggy source:
protected String getValueToWrite(QName schemaType,Object value,XMLConversionManager xmlConversionManager){
  return (String)xmlConversionManager.convertObject(value,ClassConstants.STRING,schemaType);
}

Fixed version (ground truth):
protected String getValueToWrite(QName schemaType,Object value,XMLConversionManager xmlConversionManager,NamespaceResolver namespaceResolver){
  if (schemaType != null && XMLConstants.QNAME_QNAME.equals(schemaType)) {
    return getStringForQName((QName)value,namespaceResolver);
  }
  return (String)xmlConversionManager.convertObject(value,ClassConstants.STRING,schemaType);
}
Program: 67808
Project: 67808
Buggy source:
/** 
 * INTERNAL:
 */
public Object convertValueBasedOnSchemaType(Object value,XMLConversionManager xmlConversionManager){
  if (getSchemaType() != null) {
    Class fieldType=getType();
    if (fieldType == null) {
      fieldType=getJavaClass(getSchemaType());
    }
    return xmlConversionManager.convertObject(value,fieldType,getSchemaType());
  }
  return value;
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public Object convertValueBasedOnSchemaType(Object value,XMLConversionManager xmlConversionManager,XMLRecord record){
  if (getSchemaType() != null) {
    if (XMLConstants.QNAME_QNAME.equals(getSchemaType())) {
      return buildQNameFromString((String)value,record);
    }
 else {
      Class fieldType=getType();
      if (fieldType == null) {
        fieldType=getJavaClass(getSchemaType());
      }
      return xmlConversionManager.convertObject(value,fieldType,getSchemaType());
    }
  }
  return value;
}
Program: 67809
Project: 67809
Buggy source:
/** 
 * INTERNAL:
 */
public Object convertValueBasedOnSchemaType(Object value,XMLConversionManager xmlConversionManager){
  Object convertedValue=value;
  for (int i=0; i < schemaTypes.size(); i++) {
    QName nextQName=(QName)schemaTypes.get(i);
    try {
      if (nextQName != null) {
        Class javaClass=getType();
        javaClass=getJavaClass(nextQName);
        convertedValue=xmlConversionManager.convertObject(value,javaClass,nextQName);
        break;
      }
    }
 catch (    ConversionException ce) {
      if (i == (schemaTypes.size() - 1)) {
        throw ce;
      }
    }
  }
  return convertedValue;
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public Object convertValueBasedOnSchemaType(Object value,XMLConversionManager xmlConversionManager,XMLRecord record){
  Object convertedValue=value;
  for (int i=0; i < schemaTypes.size(); i++) {
    QName nextQName=(QName)schemaTypes.get(i);
    try {
      if (nextQName != null) {
        if (XMLConstants.QNAME_QNAME.equals(nextQName)) {
          buildQNameFromString((String)value,record);
          break;
        }
 else {
          Class javaClass=getType();
          javaClass=getJavaClass(nextQName);
          convertedValue=xmlConversionManager.convertObject(value,javaClass,nextQName);
          break;
        }
      }
    }
 catch (    ConversionException ce) {
      if (i == (schemaTypes.size() - 1)) {
        throw ce;
      }
    }
  }
  return convertedValue;
}
Program: 67810
Project: 67810
Buggy source:
private Object convertValue(Element node,XMLField key,Object value){
  XMLConversionManager xmlCnvMgr=(XMLConversionManager)session.getDatasourcePlatform().getConversionManager();
  if (key.isTypedTextField() && (node != null)) {
    String schemaType=node.getAttributeNS(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.SCHEMA_TYPE_ATTRIBUTE);
    if ((null != schemaType) && (!schemaType.equals("String_Node_Str"))) {
      QName qname=null;
      int index=schemaType.indexOf(':');
      if (index == -1) {
        qname=new QName(schemaType);
        Class convertClass=key.getJavaClass(qname);
        return xmlCnvMgr.convertObject(value,convertClass);
      }
 else {
        String prefix=schemaType.substring(0,index);
        String localPart=schemaType.substring(index + 1);
        XMLPlatform xmlPlatform=XMLPlatformFactory.getInstance().getXMLPlatform();
        String url=xmlPlatform.resolveNamespacePrefix(node,prefix);
        qname=new QName(url,localPart);
        Class convertClass=key.getJavaClass(qname);
        return xmlCnvMgr.convertObject(value,convertClass,qname);
      }
    }
  }
  return key.convertValueBasedOnSchemaType(value,xmlCnvMgr);
}

Fixed version (ground truth):
private Object convertValue(Element node,XMLField key,Object value){
  XMLConversionManager xmlCnvMgr=(XMLConversionManager)session.getDatasourcePlatform().getConversionManager();
  if (key.isTypedTextField() && (node != null)) {
    String schemaType=node.getAttributeNS(XMLConstants.SCHEMA_INSTANCE_URL,XMLConstants.SCHEMA_TYPE_ATTRIBUTE);
    if ((null != schemaType) && (!schemaType.equals("String_Node_Str"))) {
      QName qname=null;
      int index=schemaType.indexOf(':');
      if (index == -1) {
        qname=new QName(schemaType);
        Class convertClass=key.getJavaClass(qname);
        return xmlCnvMgr.convertObject(value,convertClass);
      }
 else {
        String prefix=schemaType.substring(0,index);
        String localPart=schemaType.substring(index + 1);
        XMLPlatform xmlPlatform=XMLPlatformFactory.getInstance().getXMLPlatform();
        String url=xmlPlatform.resolveNamespacePrefix(node,prefix);
        qname=new QName(url,localPart);
        Class convertClass=key.getJavaClass(qname);
        return xmlCnvMgr.convertObject(value,convertClass,qname);
      }
    }
  }
  return key.convertValueBasedOnSchemaType(value,xmlCnvMgr,this);
}
Program: 67811
Project: 67811
Buggy source:
private Object getValueFromAttribute(Attr node,XMLField key){
  return key.convertValueBasedOnSchemaType(node.getNodeValue(),(XMLConversionManager)session.getDatasourcePlatform().getConversionManager());
}

Fixed version (ground truth):
private Object getValueFromAttribute(Attr node,XMLField key){
  return key.convertValueBasedOnSchemaType(node.getNodeValue(),(XMLConversionManager)session.getDatasourcePlatform().getConversionManager(),this);
}
Program: 67812
Project: 67812
Buggy source:
public boolean isElement(Object obj){
  if (obj instanceof JAXBElement) {
    return true;
  }
  Session session=context.getSession(obj);
  if (session == null) {
    return false;
  }
  XMLDescriptor descriptor=(XMLDescriptor)session.getDescriptor(obj);
  if (descriptor == null) {
    return false;
  }
  return descriptor.getDefaultRootElement() != null;
}

Fixed version (ground truth):
public boolean isElement(Object obj){
  if (obj instanceof JAXBElement) {
    return true;
  }
  try {
    Session session=context.getSession(obj);
    if (session == null) {
      return false;
    }
    XMLDescriptor descriptor=(XMLDescriptor)session.getDescriptor(obj);
    if (descriptor == null) {
      return false;
    }
    return descriptor.getDefaultRootElement() != null;
  }
 catch (  XMLMarshalException e) {
    return false;
  }
}
Program: 67813
Project: 67813
Buggy source:
public QName getElementName(Object obj){
  if (!isElement(obj)) {
    return null;
  }
  XMLDescriptor descriptor=(XMLDescriptor)context.getSession(obj).getDescriptor(obj);
  String rootElem=descriptor.getDefaultRootElement();
  int prefixIndex=rootElem.indexOf("String_Node_Str");
  if (prefixIndex == -1) {
    return new QName(rootElem);
  }
 else {
    String prefix=rootElem.substring(0,prefixIndex);
    String localPart=rootElem.substring(prefixIndex + 1);
    String URI=descriptor.getNamespaceResolver().resolveNamespacePrefix(prefix);
    return new QName(URI,localPart);
  }
}

Fixed version (ground truth):
public QName getElementName(Object obj){
  if (!isElement(obj)) {
    return null;
  }
  if (obj instanceof JAXBElement) {
    return ((JAXBElement)obj).getName();
  }
  try {
    XMLDescriptor descriptor=(XMLDescriptor)context.getSession(obj).getDescriptor(obj);
    String rootElem=descriptor.getDefaultRootElement();
    int prefixIndex=rootElem.indexOf("String_Node_Str");
    if (prefixIndex == -1) {
      return new QName(rootElem);
    }
 else {
      String prefix=rootElem.substring(0,prefixIndex);
      String localPart=rootElem.substring(prefixIndex + 1);
      String URI=descriptor.getNamespaceResolver().resolveNamespacePrefix(prefix);
      return new QName(URI,localPart);
    }
  }
 catch (  XMLMarshalException e) {
    return null;
  }
}
Program: 67817
Project: 67817
Buggy source:
/** 
 * INTERNAL: Create and return a new unit of work with the session as its parent.
 */
public UnitOfWorkImpl(AbstractSession parent,ReferenceMode referenceMode){
  super();
  this.isLoggingOff=parent.isLoggingOff();
  this.referenceMode=referenceMode;
  this.shouldDiscoverNewObjects=true;
  this.name=parent.getName();
  this.parent=parent;
  this.project=parent.getProject();
  this.profiler=parent.getProfiler();
  this.isInProfile=parent.isInProfile;
  this.sessionLog=parent.getSessionLog();
  this.eventManager=parent.getEventManager().clone(this);
  this.exceptionHandler=parent.getExceptionHandler();
  this.pessimisticLockTimeoutDefault=parent.getPessimisticLockTimeoutDefault();
  this.setReadOnlyClasses(parent.copyReadOnlyClasses());
  this.validationLevel=Partial;
  this.shouldThrowConformExceptions=DO_NOT_THROW_CONFORM_EXCEPTIONS;
  this.lifecycle=Birth;
  this.shouldCheckWriteLock=parent.getDatasourceLogin().shouldSynchronizedReadOnWrite() || parent.getDatasourceLogin().shouldSynchronizeWrites();
  this.isNestedUnitOfWork=parent.isUnitOfWork();
  this.eventManager.postAcquireUnitOfWork();
  incrementProfile(SessionProfiler.UowCreated);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Create and return a new unit of work with the session as its parent.
 */
public UnitOfWorkImpl(AbstractSession parent,ReferenceMode referenceMode){
  super();
  this.isLoggingOff=parent.isLoggingOff();
  this.referenceMode=referenceMode;
  this.shouldDiscoverNewObjects=true;
  this.name=parent.getName();
  this.parent=parent;
  this.project=parent.getProject();
  this.profiler=parent.getProfiler();
  this.isInProfile=parent.isInProfile;
  this.sessionLog=parent.getSessionLog();
  this.eventManager=parent.getEventManager().clone(this);
  this.exceptionHandler=parent.getExceptionHandler();
  this.pessimisticLockTimeoutDefault=parent.getPessimisticLockTimeoutDefault();
  this.queryTimeoutDefault=parent.getQueryTimeoutDefault();
  this.setReadOnlyClasses(parent.copyReadOnlyClasses());
  this.validationLevel=Partial;
  this.shouldThrowConformExceptions=DO_NOT_THROW_CONFORM_EXCEPTIONS;
  this.lifecycle=Birth;
  this.shouldCheckWriteLock=parent.getDatasourceLogin().shouldSynchronizedReadOnWrite() || parent.getDatasourceLogin().shouldSynchronizeWrites();
  this.isNestedUnitOfWork=parent.isUnitOfWork();
  this.eventManager.postAcquireUnitOfWork();
  incrementProfile(SessionProfiler.UowCreated);
}
Program: 67818
Project: 67818
Buggy source:
/** 
 * INTERNAL: This is different from 'prepareForExecution' in that this is called on the original query, and the other is called on the copy of the query. This query is copied for concurrency so this prepare can only setup things that will apply to any future execution of this query. Resolve the queryTimeout using the DescriptorQueryManager if required.
 */
protected void prepare() throws QueryException {
  if (getQueryTimeout() == DescriptorQueryManager.DefaultTimeout) {
    if (getDescriptor() == null) {
      setQueryTimeout(DescriptorQueryManager.NoTimeout);
    }
 else {
      setQueryTimeout(getDescriptor().getQueryManager().getQueryTimeout());
    }
  }
  this.argumentFields=buildArgumentFields();
  getQueryMechanism().prepare();
}

Fixed version (ground truth):
/** 
 * INTERNAL: This is different from 'prepareForExecution' in that this is called on the original query, and the other is called on the copy of the query. This query is copied for concurrency so this prepare can only setup things that will apply to any future execution of this query. Resolve the queryTimeout using the DescriptorQueryManager if required.
 */
protected void prepare() throws QueryException {
  if (getQueryTimeout() == DescriptorQueryManager.DefaultTimeout) {
    if (getDescriptor() == null) {
      setQueryTimeout(DescriptorQueryManager.NoTimeout);
    }
 else {
      setQueryTimeout(getDescriptor().getQueryManager().getQueryTimeout());
    }
  }
  if (getQueryTimeout() == DescriptorQueryManager.DefaultTimeout || getQueryTimeout() == DescriptorQueryManager.NoTimeout) {
    setQueryTimeout(session.getQueryTimeoutDefault());
  }
  this.argumentFields=buildArgumentFields();
  getQueryMechanism().prepare();
}
Program: 67819
Project: 67819
Buggy source:
/** 
 * INTERNAL: Copy all setting from the query. This is used to morph queries from one type to the other. By default this calls prepareFromQuery, but additional properties may be required to be copied as prepareFromQuery only copies properties that affect the SQL.
 */
public void copyFromQuery(DatabaseQuery query){
  prepareFromQuery(query);
  this.cascadePolicy=query.cascadePolicy;
  this.flushOnExecute=query.flushOnExecute;
  this.arguments=query.arguments;
  this.argumentTypes=query.argumentTypes;
  this.argumentTypeNames=query.argumentTypeNames;
  this.argumentValues=query.argumentValues;
  this.queryTimeout=query.queryTimeout;
  this.redirector=query.redirector;
  this.sessionName=query.sessionName;
  this.shouldBindAllParameters=query.shouldBindAllParameters;
  this.shouldCacheStatement=query.shouldCacheStatement;
  this.shouldMaintainCache=query.shouldMaintainCache;
  this.shouldPrepare=query.shouldPrepare;
  this.shouldUseWrapperPolicy=query.shouldUseWrapperPolicy;
  this.properties=query.properties;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Copy all setting from the query. This is used to morph queries from one type to the other. By default this calls prepareFromQuery, but additional properties may be required to be copied as prepareFromQuery o nly copies properties that affect the SQL.
 */
public void copyFromQuery(DatabaseQuery query){
  prepareFromQuery(query);
  this.cascadePolicy=query.cascadePolicy;
  this.flushOnExecute=query.flushOnExecute;
  this.arguments=query.arguments;
  this.argumentTypes=query.argumentTypes;
  this.argumentTypeNames=query.argumentTypeNames;
  this.argumentValues=query.argumentValues;
  this.queryTimeout=query.queryTimeout;
  this.redirector=query.redirector;
  this.sessionName=query.sessionName;
  this.shouldBindAllParameters=query.shouldBindAllParameters;
  this.shouldCacheStatement=query.shouldCacheStatement;
  this.shouldMaintainCache=query.shouldMaintainCache;
  this.shouldPrepare=query.shouldPrepare;
  this.shouldUseWrapperPolicy=query.shouldUseWrapperPolicy;
  this.properties=query.properties;
}
Program: 67821
Project: 67821
Buggy source:
public void beforeUnmarshal(Object target,Object parent){
  try {
    if (target instanceof SDODataObject) {
      String className=target.getClass().getName();
      String interfaceName=className.substring(0,className.length() - 4);
      Class interfaceClass=target.getClass().getClassLoader().loadClass(interfaceName);
      Type type=aHelperContext.getTypeHelper().getType(interfaceClass);
      SDODataObject aDataObject=(SDODataObject)target;
      aDataObject._setHelperContext(aHelperContext);
      aDataObject._setType(type);
    }
 else     if (target instanceof SDOChangeSummary) {
      if (!isCSUnmarshalListener) {
        ((SDOChangeSummary)target).setHelperContext(aHelperContext);
      }
    }
  }
 catch (  ClassNotFoundException e) {
    throw SDOException.classNotFound(e,null,null);
  }
}

Fixed version (ground truth):
public void beforeUnmarshal(Object target,Object parent){
  if (target instanceof SDODataObject) {
    Type type=((SDOTypeHelper)aHelperContext.getTypeHelper()).getTypeForImplClass(target.getClass());
    SDODataObject aDataObject=(SDODataObject)target;
    aDataObject._setHelperContext(aHelperContext);
    aDataObject._setType(type);
  }
 else   if (target instanceof SDOChangeSummary) {
    if (!isCSUnmarshalListener) {
      ((SDOChangeSummary)target).setHelperContext(aHelperContext);
    }
  }
}
Program: 67822
Project: 67822
Buggy source:
public Class loadClass(String className,SDOType type) throws ClassNotFoundException {
  Class javaClass=null;
  javaClass=(Class)generatedClasses.get(className);
  if (javaClass != null) {
    return javaClass;
  }
  try {
    javaClass=getParent().loadClass(className);
  }
 catch (  ClassNotFoundException e) {
    javaClass=createGeneric(className,type);
    if (javaClass == null) {
      throw e;
    }
  }
catch (  NoClassDefFoundError error) {
    javaClass=createGeneric(className,type);
    if (javaClass == null) {
      throw error;
    }
  }
  return javaClass;
}

Fixed version (ground truth):
public Class loadClass(String className,SDOType type) throws ClassNotFoundException {
  Class javaClass=null;
  javaClass=(Class)generatedClasses.get(className);
  if (javaClass != null) {
    return javaClass;
  }
  try {
    javaClass=getParent().loadClass(className);
  }
 catch (  ClassNotFoundException e) {
    javaClass=createGeneric(className,type);
    if (javaClass == null) {
      throw e;
    }
  }
catch (  NoClassDefFoundError error) {
    javaClass=createGeneric(className,type);
    if (javaClass == null) {
      throw error;
    }
  }
  if (!type.isDataType() && null != aHelperContext && null != aHelperContext.getTypeHelper()) {
    ((SDOTypeHelper)aHelperContext.getTypeHelper()).getImplClassesToSDOType().put(javaClass,type);
  }
  return javaClass;
}
Program: 67825
Project: 67825
Buggy source:
protected void buildConfigs(){
  this.addConfig(NO_SERVER_ID,"String_Node_Str");
  this.addConfig(OC4J__ID,"String_Node_Str");
  this.addConfig(OC4J_11_1_1_ID,"String_Node_Str");
  this.addConfig(OC4J_10_1_3_ID,"String_Node_Str");
  this.addConfig(WEBLOGIC_9_ID,"String_Node_Str");
  this.addConfig(WEBLOGIC_10_ID,"String_Node_Str");
  this.addConfig(WEBSPHERE_6_1_ID,"String_Node_Str");
  this.addConfig(JBOSS_ID,"String_Node_Str");
  this.addConfig(SUNAS_ID,"String_Node_Str");
  this.addConfig(CUSTOM_SERVER_ID,"String_Node_Str");
}

Fixed version (ground truth):
protected void buildConfigs(){
  this.addConfig(NO_SERVER_ID,"String_Node_Str");
  this.addConfig(WEBLOGIC_9_ID,"String_Node_Str");
  this.addConfig(WEBLOGIC_10_ID,"String_Node_Str");
  this.addConfig(WEBSPHERE_6_1_ID,"String_Node_Str");
  this.addConfig(JBOSS_ID,"String_Node_Str");
  this.addConfig(SUNAS_ID,"String_Node_Str");
  this.addConfig(CUSTOM_SERVER_ID,"String_Node_Str");
}
Program: 67826
Project: 67826
Buggy source:
protected void buidPlatforms(){
  this.addPlatform(NO_SERVER_ID,"String_Node_Str");
  this.addPlatform(OC4J_11_1_1_ID,"String_Node_Str");
  this.addPlatform(OC4J_10_1_3_ID,"String_Node_Str");
  this.addPlatform(OC4J__ID,"String_Node_Str");
  this.addPlatform(WEBLOGIC_9_ID,"String_Node_Str");
  this.addPlatform(WEBLOGIC_10_ID,"String_Node_Str");
  this.addPlatform(WEBSPHERE_6_1_ID,"String_Node_Str");
  this.addPlatform(JBOSS_ID,"String_Node_Str");
  this.addPlatform(SUNAS_ID,"String_Node_Str");
  this.addPlatform(CUSTOM_SERVER_ID,"String_Node_Str");
}

Fixed version (ground truth):
protected void buidPlatforms(){
  this.addPlatform(NO_SERVER_ID,"String_Node_Str");
  this.addPlatform(WEBLOGIC_9_ID,"String_Node_Str");
  this.addPlatform(WEBLOGIC_10_ID,"String_Node_Str");
  this.addPlatform(WEBSPHERE_6_1_ID,"String_Node_Str");
  this.addPlatform(JBOSS_ID,"String_Node_Str");
  this.addPlatform(SUNAS_ID,"String_Node_Str");
  this.addPlatform(CUSTOM_SERVER_ID,"String_Node_Str");
}
Program: 67827
Project: 67827
Buggy source:
public String getQualifiedName(){
  return jPkg.getName();
}

Fixed version (ground truth):
public String getQualifiedName(){
  if (jPkg != null) {
    return jPkg.getName();
  }
 else {
    return null;
  }
}
Program: 67828
Project: 67828
Buggy source:
public String getName(){
  return jPkg.getName();
}

Fixed version (ground truth):
public String getName(){
  if (jPkg != null) {
    return jPkg.getName();
  }
 else {
    return null;
  }
}
Program: 67829
Project: 67829
Buggy source:
/** 
 * Assumes JavaType is a JavaClassImpl instance
 */
public JavaAnnotation getAnnotation(JavaClass arg0){
  if (arg0 != null) {
    Class annotationClass=((JavaClassImpl)arg0).getJavaClass();
    if (jPkg.isAnnotationPresent(annotationClass)) {
      return new JavaAnnotationImpl(jPkg.getAnnotation(annotationClass));
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Assumes JavaType is a JavaClassImpl instance
 */
public JavaAnnotation getAnnotation(JavaClass arg0){
  if (arg0 != null) {
    Class annotationClass=((JavaClassImpl)arg0).getJavaClass();
    if (jPkg != null && jPkg.isAnnotationPresent(annotationClass)) {
      return new JavaAnnotationImpl(jPkg.getAnnotation(annotationClass));
    }
  }
  return null;
}
Program: 67830
Project: 67830
Buggy source:
public Collection getAnnotations(){
  ArrayList<JavaAnnotation> annotationCollection=new ArrayList<JavaAnnotation>();
  Annotation[] annotations=jPkg.getAnnotations();
  for (  Annotation annotation : annotations) {
    annotationCollection.add(new JavaAnnotationImpl(annotation));
  }
  return annotationCollection;
}

Fixed version (ground truth):
public Collection getAnnotations(){
  ArrayList<JavaAnnotation> annotationCollection=new ArrayList<JavaAnnotation>();
  if (jPkg != null) {
    Annotation[] annotations=jPkg.getAnnotations();
    for (    Annotation annotation : annotations) {
      annotationCollection.add(new JavaAnnotationImpl(annotation));
    }
  }
  return annotationCollection;
}
Program: 67831
Project: 67831
Buggy source:
/** 
 * Return the executor entity manager factory. This lazy initializes from the "performance" persistent unit using the default provider, and configures the TopLink properties to connect to the executor's session's login.
 */
public EntityManagerFactory getEntityManagerFactory(){
  if (entityManagerFactory == null) {
    Map properties=new HashMap();
    properties.put("String_Node_Str",getSession().getLogin().getDriverClassName());
    properties.put("String_Node_Str",getSession().getLogin().getConnectionString());
    properties.put("String_Node_Str",getSession().getLogin().getUserName());
    properties.put("String_Node_Str",getSession().getLogin().getPassword());
    properties.put("String_Node_Str",getSession().getSessionLog().getLevelString());
    entityManagerFactory=Persistence.createEntityManagerFactory("String_Node_Str",properties);
  }
  return entityManagerFactory;
}

Fixed version (ground truth):
/** 
 * Return the executor entity manager factory. This lazy initializes from the "performance" persistent unit using the default provider, and configures the TopLink properties to connect to the executor's session's login.
 */
public EntityManagerFactory getEntityManagerFactory(){
  if (entityManagerFactory == null) {
    Map properties=new HashMap();
    properties.put(PersistenceUnitProperties.JDBC_DRIVER,getSession().getLogin().getDriverClassName());
    properties.put(PersistenceUnitProperties.JDBC_URL,getSession().getLogin().getConnectionString());
    properties.put(PersistenceUnitProperties.JDBC_USER,getSession().getLogin().getUserName());
    properties.put(PersistenceUnitProperties.JDBC_PASSWORD,getSession().getLogin().getPassword());
    properties.put(PersistenceUnitProperties.LOGGING_LEVEL,getSession().getSessionLog().getLevelString());
    entityManagerFactory=Persistence.createEntityManagerFactory("String_Node_Str",properties);
  }
  return entityManagerFactory;
}