nus-yam/ex-repair huggingface dataset:
Program: 65814
Project: 65814
Buggy source:
private void generateSchema(String uri,List typesWithSameUri){
  generatedSchema=new Schema();
  generatedSchema.setTargetNamespace(uri);
  generatedSchema.setDefaultNamespace(uri);
  generatedSchema.setAttributeFormDefault(false);
  generatedSchema.setElementFormDefault(true);
  String javaPackage=null;
  for (int i=0; i < typesWithSameUri.size(); i++) {
    SDOType nextType=(SDOType)typesWithSameUri.get(i);
    if ((nextType.getBaseTypes() != null) && (nextType.getBaseTypes().size() > 1)) {
    }
    if (!nextType.isDataType()) {
      String fullName=nextType.getInstanceClassName();
      if (fullName != null) {
        String nextPackage=null;
        int lastDot=fullName.lastIndexOf('.');
        if (lastDot != -1) {
          nextPackage=fullName.substring(0,lastDot);
        }
        if (nextPackage != null) {
          javaPackage=nextPackage;
        }
      }
    }
    if (nextType.isDataType()) {
      SimpleType generatedType=generateSimpleType(nextType);
      generatedSchema.addTopLevelSimpleTypes(generatedType);
    }
 else {
      ComplexType generatedType=generateComplexType(nextType);
      generatedSchema.addTopLevelComplexTypes(generatedType);
      Element element=buildElementForComplexType(generatedSchema,generatedType);
      if (element != null) {
        generatedSchema.addTopLevelElement(element);
      }
    }
  }
  if (javaPackage != null) {
    getPrefixForURI(SDOConstants.SDOJAVA_URL);
    generatedSchema.getAttributesMap().put(SDOConstants.SDOJAVA_PACKAGE_QNAME,javaPackage);
  }
}

Fixed version (ground truth):
private void generateSchema(String uri,List typesWithSameUri){
  generatedSchema=new Schema();
  generatedSchema.setTargetNamespace(uri);
  generatedSchema.setDefaultNamespace(uri);
  generatedSchema.setAttributeFormDefault(false);
  generatedSchema.setElementFormDefault(true);
  String javaPackage=null;
  for (int i=0; i < typesWithSameUri.size(); i++) {
    SDOType nextType=(SDOType)typesWithSameUri.get(i);
    if (nextType.isSubType()) {
    }
    if (!nextType.isDataType()) {
      String fullName=nextType.getInstanceClassName();
      if (fullName != null) {
        String nextPackage=null;
        int lastDot=fullName.lastIndexOf('.');
        if (lastDot != -1) {
          nextPackage=fullName.substring(0,lastDot);
        }
        if (nextPackage != null) {
          javaPackage=nextPackage;
        }
      }
    }
    if (nextType.isDataType()) {
      SimpleType generatedType=generateSimpleType(nextType);
      generatedSchema.addTopLevelSimpleTypes(generatedType);
    }
 else {
      ComplexType generatedType=generateComplexType(nextType);
      generatedSchema.addTopLevelComplexTypes(generatedType);
      Element element=buildElementForComplexType(generatedSchema,generatedType);
      if (element != null) {
        generatedSchema.addTopLevelElement(element);
      }
    }
  }
  if (javaPackage != null) {
    getPrefixForURI(SDOConstants.SDOJAVA_URL);
    generatedSchema.getAttributesMap().put(SDOConstants.SDOJAVA_PACKAGE_QNAME,javaPackage);
  }
}
Program: 65815
Project: 65815
Buggy source:
private void updateCollisionProperty(SDOType owningType,SDOProperty p){
  owningType.setSequenced(true);
  SDOType baseType=owningType;
  while ((baseType.getBaseTypes() != null) && (baseType.getBaseTypes().size() > 0)) {
    baseType=(SDOType)baseType.getBaseTypes().get(0);
    baseType.setSequenced(true);
  }
  p.setNameCollision(true);
  p.setType(SDOConstants.SDO_OBJECT);
  p.setContainment(true);
  p.setMany(true);
  p.setInstanceProperty(SDOConstants.XMLELEMENT_PROPERTY,Boolean.TRUE);
}

Fixed version (ground truth):
private void updateCollisionProperty(SDOType owningType,SDOProperty p){
  owningType.setSequenced(true);
  SDOType baseType=owningType;
  while (baseType.isSubType()) {
    baseType=(SDOType)baseType.getBaseTypes().get(0);
    baseType.setSequenced(true);
  }
  p.setNameCollision(true);
  p.setType(SDOConstants.SDO_OBJECT);
  p.setContainment(true);
  p.setMany(true);
  p.setInstanceProperty(SDOConstants.XMLELEMENT_PROPERTY,Boolean.TRUE);
}
Program: 65817
Project: 65817
Buggy source:
private void initializeTypes(List types){
  List descriptorsToAdd=new ArrayList(types);
  for (int i=0; i < types.size(); i++) {
    SDOType nextType=(SDOType)types.get(i);
    if (!nextType.isDataType()) {
      nextType.postInitialize();
    }
  }
  for (int i=0; i < types.size(); i++) {
    SDOType nextType=(SDOType)types.get(i);
    if ((!nextType.isDataType() && nextType.getBaseTypes() == null || nextType.getBaseTypes().size() == 0) && nextType.getSubTypes().size() > 0) {
      nextType.setupInheritance(null);
    }
 else     if (!nextType.isDataType() && nextType.getBaseTypes().size() > 0 && !types.contains(nextType.getBaseTypes().get(0))) {
      SDOType baseType=(SDOType)nextType.getBaseTypes().get(0);
      while (baseType != null && !baseType.isDataType()) {
        descriptorsToAdd.add(baseType);
        if (baseType.getBaseTypes().size() == 0) {
          descriptorsToAdd.add(baseType);
          baseType.setupInheritance(null);
          baseType=null;
        }
 else {
          baseType=(SDOType)baseType.getBaseTypes().get(0);
        }
      }
    }
  }
  ((SDOXMLHelper)aHelperContext.getXMLHelper()).addDescriptors(descriptorsToAdd);
}

Fixed version (ground truth):
private void initializeTypes(List types){
  List descriptorsToAdd=new ArrayList(types);
  for (int i=0; i < types.size(); i++) {
    SDOType nextType=(SDOType)types.get(i);
    if (!nextType.isDataType()) {
      nextType.postInitialize();
    }
  }
  for (int i=0; i < types.size(); i++) {
    SDOType nextType=(SDOType)types.get(i);
    if ((!nextType.isDataType() && !nextType.isSubType()) && nextType.isBaseType()) {
      nextType.setupInheritance(null);
    }
 else     if (!nextType.isDataType() && nextType.isSubType() && !types.contains(nextType.getBaseTypes().get(0))) {
      SDOType baseType=(SDOType)nextType.getBaseTypes().get(0);
      while (baseType != null && !baseType.isDataType()) {
        descriptorsToAdd.add(baseType);
        if (baseType.getBaseTypes().size() == 0) {
          descriptorsToAdd.add(baseType);
          baseType.setupInheritance(null);
          baseType=null;
        }
 else {
          baseType=(SDOType)baseType.getBaseTypes().get(0);
        }
      }
    }
  }
  ((SDOXMLHelper)aHelperContext.getXMLHelper()).addDescriptors(descriptorsToAdd);
}
Program: 65818
Project: 65818
Buggy source:
private boolean isBaseTypeBytes(Type theType){
  List baseTypes=((SDOType)theType).getBaseTypes();
  if (baseTypes.size() > 0) {
    Type nextType=(Type)baseTypes.get(0);
    if (nextType == SDOConstants.SDO_BYTES) {
      return true;
    }
 else {
      return isBaseTypeBytes(nextType);
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isBaseTypeBytes(Type theType){
  if (((SDOType)theType).isSubType()) {
    List baseTypes=((SDOType)theType).getBaseTypes();
    Type nextType=(Type)baseTypes.get(0);
    if (nextType == SDOConstants.SDO_BYTES) {
      return true;
    }
 else {
      return isBaseTypeBytes(nextType);
    }
  }
  return false;
}
Program: 65819
Project: 65819
Buggy source:
public Class getJavaWrapperTypeForSDOType(Type type){
  SDOType sdoType=(SDOType)type;
  if (sdoType.getInstanceClass() != null) {
    return sdoType.getInstanceClass();
  }
  Class javaClass=null;
  if (sdoType.getBaseTypes() != null) {
    for (int i=0; i < sdoType.getBaseTypes().size(); i++) {
      Type baseType=(Type)sdoType.getBaseTypes().get(i);
      javaClass=getJavaWrapperTypeForSDOType(baseType);
      if (javaClass != null) {
        return javaClass;
      }
    }
  }
  return javaClass;
}

Fixed version (ground truth):
public Class getJavaWrapperTypeForSDOType(Type type){
  SDOType sdoType=(SDOType)type;
  if (sdoType.getInstanceClass() != null) {
    return sdoType.getInstanceClass();
  }
  Class javaClass=null;
  if (sdoType.isSubType()) {
    for (int i=0; i < sdoType.getBaseTypes().size(); i++) {
      Type baseType=(Type)sdoType.getBaseTypes().get(i);
      javaClass=getJavaWrapperTypeForSDOType(baseType);
      if (javaClass != null) {
        return javaClass;
      }
    }
  }
  return javaClass;
}
Program: 65821
Project: 65821
Buggy source:
public Node getNodeForObject(Object obj){
  AbstractSession session=context.getSession(obj);
  XMLDescriptor xmlDescriptor=(XMLDescriptor)session.getDescriptor(obj);
  if (xmlDescriptor.shouldPreserveDocument()) {
    Object pk=xmlDescriptor.getObjectBuilder().extractPrimaryKeyFromObject(obj,session);
    if ((pk == null) || (pk instanceof CacheId) && (((CacheId)pk).getPrimaryKey().length == 0)) {
      pk=new CacheId(new Object[]{new WeakObjectWrapper(obj)});
    }
    CacheKey cacheKey=session.getIdentityMapAccessorInstance().getCacheKeyForObject(pk,xmlDescriptor.getJavaClass(),xmlDescriptor,false);
    if (cacheKey != null && cacheKey.getRecord() != null) {
      return ((DOMRecord)cacheKey.getRecord()).getDOM();
    }
  }
  return null;
}

Fixed version (ground truth):
public Node getNodeForObject(Object obj){
  if (obj == null) {
    return null;
  }
  AbstractSession session=context.getSession(obj);
  XMLDescriptor xmlDescriptor=(XMLDescriptor)session.getDescriptor(obj);
  if (xmlDescriptor.shouldPreserveDocument()) {
    Object pk=xmlDescriptor.getObjectBuilder().extractPrimaryKeyFromObject(obj,session);
    if ((pk == null) || (pk instanceof CacheId) && (((CacheId)pk).getPrimaryKey().length == 0)) {
      pk=new CacheId(new Object[]{new WeakObjectWrapper(obj)});
    }
    CacheKey cacheKey=session.getIdentityMapAccessorInstance().getCacheKeyForObject(pk,xmlDescriptor.getJavaClass(),xmlDescriptor,false);
    if (cacheKey != null && cacheKey.getRecord() != null) {
      return ((DOMRecord)cacheKey.getRecord()).getDOM();
    }
  }
  return null;
}
Program: 65822
Project: 65822
Buggy source:
public void addObjectToCache(Object obj,Node node,XMLMapping selfRecordMapping){
  if (node.getNodeType() != Node.ELEMENT_NODE) {
    return;
  }
  AbstractSession session=context.getSession(obj);
  XMLDescriptor xmlDescriptor=(XMLDescriptor)session.getDescriptor(obj);
  DOMRecord row=new DOMRecord((Element)node);
  row.setSession(session);
  Object pk=xmlDescriptor.getObjectBuilder().extractPrimaryKeyFromRow(row,session);
  if (xmlDescriptor.shouldPreserveDocument() || xmlDescriptor.getPrimaryKeyFieldNames().size() > 0) {
    if ((pk == null) || (((CacheId)pk).getPrimaryKey().length == 0)) {
      pk=new CacheId(new Object[]{new WeakObjectWrapper(obj)});
    }
    CacheKey key=session.getIdentityMapAccessorInstance().acquireDeferredLock(pk,xmlDescriptor.getJavaClass(),xmlDescriptor);
    if ((xmlDescriptor).shouldPreserveDocument()) {
      key.setRecord(row);
    }
    key.setObject(obj);
    key.releaseDeferredLock();
  }
}

Fixed version (ground truth):
public void addObjectToCache(Object obj,Node node,XMLMapping selfRecordMapping){
  if (obj == null || node.getNodeType() != Node.ELEMENT_NODE) {
    return;
  }
  AbstractSession session=context.getSession(obj);
  XMLDescriptor xmlDescriptor=(XMLDescriptor)session.getDescriptor(obj);
  DOMRecord row=new DOMRecord((Element)node);
  row.setSession(session);
  Object pk=xmlDescriptor.getObjectBuilder().extractPrimaryKeyFromRow(row,session);
  if (xmlDescriptor.shouldPreserveDocument() || xmlDescriptor.getPrimaryKeyFieldNames().size() > 0) {
    if ((pk == null) || (((CacheId)pk).getPrimaryKey().length == 0)) {
      pk=new CacheId(new Object[]{new WeakObjectWrapper(obj)});
    }
    CacheKey key=session.getIdentityMapAccessorInstance().acquireDeferredLock(pk,xmlDescriptor.getJavaClass(),xmlDescriptor);
    if ((xmlDescriptor).shouldPreserveDocument()) {
      key.setRecord(row);
    }
    key.setObject(obj);
    key.releaseDeferredLock();
  }
}
Program: 65823
Project: 65823
Buggy source:
/** 
 * INTERNAL:
 */
@Override public void writeFromObjectIntoRow(Object object,AbstractRecord row,AbstractSession session,WriteType writeType) throws DescriptorException {
  if (this.isReadOnly()) {
    return;
  }
  Object attributeValue=this.getAttributeValueFromObject(object);
  if (attributeValue == null) {
    row.put(this.getField(),null);
    return;
  }
  ContainerPolicy cp=this.getContainerPolicy();
  Vector nestedRows=new Vector(cp.sizeFor(attributeValue));
  for (Object iter=cp.iteratorFor(attributeValue); cp.hasNext(iter); ) {
    Object element=cp.next(iter,session);
    if (hasConverter()) {
      if (getConverter() instanceof XMLConverter) {
        element=((XMLConverter)getConverter()).convertObjectValueToDataValue(element,session,((XMLRecord)row).getMarshaller());
      }
 else {
        element=getConverter().convertObjectValueToDataValue(element,session);
      }
    }
    nestedRows.addElement(buildCompositeRow(element,session,row,writeType));
  }
  Object fieldValue=null;
  if (!nestedRows.isEmpty()) {
    fieldValue=this.getDescriptor().buildFieldValueFromNestedRows(nestedRows,getStructureName(),session);
  }
  row.put(this.getField(),fieldValue);
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
@Override public void writeFromObjectIntoRow(Object object,AbstractRecord row,AbstractSession session,WriteType writeType) throws DescriptorException {
  if (this.isReadOnly()) {
    return;
  }
  Object attributeValue=this.getAttributeValueFromObject(object);
  if (attributeValue == null) {
    row.put(this.getField(),null);
    return;
  }
  ContainerPolicy cp=this.getContainerPolicy();
  Vector nestedRows=new Vector(cp.sizeFor(attributeValue));
  for (Object iter=cp.iteratorFor(attributeValue); cp.hasNext(iter); ) {
    Object element=cp.next(iter,session);
    if (hasConverter()) {
      if (getConverter() instanceof XMLConverter) {
        element=((XMLConverter)getConverter()).convertObjectValueToDataValue(element,session,((XMLRecord)row).getMarshaller());
      }
 else {
        element=getConverter().convertObjectValueToDataValue(element,session);
      }
    }
    if (element == null) {
      XMLNullRepresentationType nullRepresentation=getNullPolicy().getMarshalNullRepresentation();
      if (nullRepresentation == XMLNullRepresentationType.XSI_NIL) {
        nestedRows.add(XMLRecord.NIL);
      }
 else       if (nullRepresentation == XMLNullRepresentationType.EMPTY_NODE) {
        Node emptyNode=XPathEngine.getInstance().createUnownedElement(((XMLRecord)row).getDOM(),(XMLField)field);
        DOMRecord nestedRow=new DOMRecord(emptyNode);
        nestedRows.add(nestedRow);
      }
    }
 else {
      nestedRows.addElement(buildCompositeRow(element,session,row,writeType));
    }
  }
  Object fieldValue=null;
  if (!nestedRows.isEmpty()) {
    fieldValue=this.getDescriptor().buildFieldValueFromNestedRows(nestedRows,getStructureName(),session);
  }
  row.put(this.getField(),fieldValue);
}
Program: 65824
Project: 65824
Buggy source:
/** 
 * INTERNAL: When using the DOM Platform, this method is responsible for marshalling null values for the XML Composite Object Mapping.
 * @param record
 * @param object
 * @param field
 * @return true if this method caused any objects to be marshaled, else false.
 */
public boolean compositeObjectMarshal(XMLRecord record,Object object,XMLField field,AbstractSession session){
  if (getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {
    Node root=record.getDOM();
    Element nested=(Element)XPathEngine.getInstance().create(field,root,session);
    nested.setAttributeNS(XMLConstants.SCHEMA_INSTANCE_URL,XSI_NIL_ATTRIBUTE,TRUE);
    return true;
  }
 else {
    if (getMarshalNullRepresentation().equals(XMLNullRepresentationType.EMPTY_NODE)) {
      Node root=record.getDOM();
      XPathEngine.getInstance().create(field,root,session);
      return true;
    }
 else {
      return false;
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: When using the DOM Platform, this method is responsible for marshalling null values for the XML Composite Object Mapping.
 * @param record
 * @param object
 * @param field
 * @return true if this method caused any objects to be marshaled, else false.
 */
public boolean compositeObjectMarshal(XMLRecord record,Object object,XMLField field,AbstractSession session){
  if (getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {
    record.put(field,XMLRecord.NIL);
    return true;
  }
 else {
    if (getMarshalNullRepresentation().equals(XMLNullRepresentationType.EMPTY_NODE)) {
      Node element=XPathEngine.getInstance().createUnownedElement(record.getDOM(),field);
      DOMRecord nestedRow=new DOMRecord(element);
      record.put(field,nestedRow);
      return true;
    }
 else {
      return false;
    }
  }
}
Program: 65825
Project: 65825
Buggy source:
public void setSchema(Schema schema){
  xmlParser.setXMLSchema(schema);
  saxParserFactory.setSchema(schema);
  try {
    saxParser=saxParserFactory.newSAXParser();
    XMLReader newXmlReader=new XMLReader(saxParser.getXMLReader());
    newXmlReader.setFeature(VALIDATING,xmlReader.getFeature(VALIDATING));
    newXmlReader.setEntityResolver(xmlReader.getEntityResolver());
    newXmlReader.setErrorHandler(xmlReader.getErrorHandler());
    xmlReader=newXmlReader;
    xmlParser.setXMLSchema(schema);
  }
 catch (  Exception e) {
    throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
  }
}

Fixed version (ground truth):
public void setSchema(Schema schema){
  xmlParser.setXMLSchema(schema);
  if (saxParserFactory == null) {
    saxParserFactory=createSAXParserFactory();
  }
  saxParserFactory.setSchema(schema);
  try {
    saxParser=saxParserFactory.newSAXParser();
    XMLReader newXmlReader=new XMLReader(saxParser.getXMLReader());
    newXmlReader.setFeature(VALIDATING,xmlReader.getFeature(VALIDATING));
    newXmlReader.setEntityResolver(xmlReader.getEntityResolver());
    newXmlReader.setErrorHandler(xmlReader.getErrorHandler());
    xmlReader=newXmlReader;
    xmlParser.setXMLSchema(schema);
  }
 catch (  Exception e) {
    throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
  }
}
Program: 65826
Project: 65826
Buggy source:
private void setValidatorHandler(XMLReader xmlReader){
  Schema schema=null;
  try {
    schema=saxParserFactory.getSchema();
  }
 catch (  UnsupportedOperationException e) {
  }
  if (null != schema) {
    ValidatorHandler validatorHandler=schema.newValidatorHandler();
    xmlReader.setValidatorHandler(validatorHandler);
    validatorHandler.setErrorHandler(getErrorHandler());
  }
}

Fixed version (ground truth):
private void setValidatorHandler(XMLReader xmlReader){
  Schema schema=null;
  try {
    schema=getSAXParserFactory().getSchema();
  }
 catch (  UnsupportedOperationException e) {
  }
  if (null != schema) {
    ValidatorHandler validatorHandler=schema.newValidatorHandler();
    xmlReader.setValidatorHandler(validatorHandler);
    validatorHandler.setErrorHandler(getErrorHandler());
  }
}
Program: 65827
Project: 65827
Buggy source:
public SAXUnmarshaller(XMLUnmarshaller xmlUnmarshaller,Map<String,Boolean> parserFeatures) throws XMLMarshalException {
  super();
  try {
    saxParserFactory=SAXParserFactory.newInstance();
    saxParserFactory.setNamespaceAware(true);
    saxParserFactory.setFeature(XMLReader.NAMESPACE_PREFIXES_FEATURE,true);
    try {
      saxParserFactory.setFeature(XMLReader.REPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE_FEATURE,true);
    }
 catch (    org.xml.sax.SAXNotRecognizedException ex) {
    }
catch (    org.xml.sax.SAXNotSupportedException ex) {
    }
    if (null != parserFeatures) {
      for (      Map.Entry<String,Boolean> parserFeature : parserFeatures.entrySet()) {
        try {
          saxParserFactory.setFeature(parserFeature.getKey(),parserFeature.getValue());
        }
 catch (        org.xml.sax.SAXNotRecognizedException ex) {
        }
catch (        org.xml.sax.SAXNotSupportedException ex) {
        }
      }
    }
    saxParser=saxParserFactory.newSAXParser();
    xmlReader=new XMLReader(saxParser.getXMLReader());
    xmlReader.setErrorHandler(new DefaultErrorHandler());
    xmlParser=XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser();
    xmlParser.setNamespaceAware(true);
    xmlParser.setValidationMode(XMLParser.NONVALIDATING);
    this.xmlUnmarshaller=xmlUnmarshaller;
  }
 catch (  Exception e) {
    throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
  }
}

Fixed version (ground truth):
public SAXUnmarshaller(XMLUnmarshaller xmlUnmarshaller,Map<String,Boolean> parserFeatures) throws XMLMarshalException {
  super();
  try {
    if (null != parserFeatures) {
      saxParserFactory=createSAXParserFactory();
      for (      Map.Entry<String,Boolean> parserFeature : parserFeatures.entrySet()) {
        try {
          saxParserFactory.setFeature(parserFeature.getKey(),parserFeature.getValue());
        }
 catch (        org.xml.sax.SAXNotRecognizedException ex) {
        }
catch (        org.xml.sax.SAXNotSupportedException ex) {
        }
      }
    }
    saxParser=getSAXParserFactory().newSAXParser();
    xmlReader=new XMLReader(saxParser.getXMLReader());
    xmlReader.setErrorHandler(new DefaultErrorHandler());
    xmlParser=XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser();
    xmlParser.setNamespaceAware(true);
    xmlParser.setValidationMode(XMLParser.NONVALIDATING);
    this.xmlUnmarshaller=xmlUnmarshaller;
  }
 catch (  Exception e) {
    throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
  }
}
Program: 65828
Project: 65828
Buggy source:
/** 
 * Each mapping is recursed to assign values from the Record to the attributes in the domain object.
 */
public void buildAttributesIntoObject(Object domainObject,CacheKey cacheKey,AbstractRecord databaseRow,ObjectBuildingQuery query,JoinedAttributeManager joinManager,boolean forRefresh,AbstractSession targetSession) throws DatabaseException {
  List mappings=this.descriptor.getMappings();
  boolean readAllMappings=query.shouldReadAllMappings();
  boolean isTargetProtected=targetSession.isProtectedSession();
  int size=mappings.size();
  for (int index=0; index < size; index++) {
    DatabaseMapping mapping=(DatabaseMapping)mappings.get(index);
    if (readAllMappings || query.shouldReadMapping(mapping)) {
      mapping.readFromRowIntoObject(databaseRow,joinManager,domainObject,cacheKey,query,targetSession,isTargetProtected);
    }
  }
  if (this.descriptor.getEventManager().hasAnyEventListeners()) {
    org.eclipse.persistence.descriptors.DescriptorEvent event=new org.eclipse.persistence.descriptors.DescriptorEvent(domainObject);
    event.setQuery(query);
    event.setSession(query.getSession());
    event.setRecord(databaseRow);
    if (forRefresh) {
      event.setEventCode(DescriptorEventManager.PostRefreshEvent);
    }
 else {
      event.setEventCode(DescriptorEventManager.PostBuildEvent);
    }
    this.descriptor.getEventManager().executeEvent(event);
  }
}

Fixed version (ground truth):
/** 
 * Each mapping is recursed to assign values from the Record to the attributes in the domain object.
 */
public void buildAttributesIntoObject(Object domainObject,CacheKey cacheKey,AbstractRecord databaseRow,ObjectBuildingQuery query,JoinedAttributeManager joinManager,boolean forRefresh,AbstractSession targetSession) throws DatabaseException {
  List mappings=this.descriptor.getMappings();
  boolean readAllMappings=query.shouldReadAllMappings();
  boolean isTargetProtected=targetSession.isProtectedSession();
  int size=mappings.size();
  for (int index=0; index < size; index++) {
    DatabaseMapping mapping=(DatabaseMapping)mappings.get(index);
    if (readAllMappings || query.shouldReadMapping(mapping)) {
      mapping.readFromRowIntoObject(databaseRow,joinManager,domainObject,cacheKey,query,targetSession,isTargetProtected);
    }
  }
  if (this.descriptor.hasEventManager()) {
    DescriptorEventManager descriptorEventManager=this.descriptor.getDescriptorEventManager();
    if (descriptorEventManager.hasAnyEventListeners()) {
      org.eclipse.persistence.descriptors.DescriptorEvent event=new org.eclipse.persistence.descriptors.DescriptorEvent(domainObject);
      event.setQuery(query);
      event.setSession(query.getSession());
      event.setRecord(databaseRow);
      if (forRefresh) {
        event.setEventCode(DescriptorEventManager.PostRefreshEvent);
      }
 else {
        event.setEventCode(DescriptorEventManager.PostBuildEvent);
      }
      descriptorEventManager.executeEvent(event);
    }
  }
}
Program: 65832
Project: 65832
Buggy source:
public void testCreateContextFromXSDNode() throws Exception {
  InputStream inputStream=ClassLoader.getSystemResourceAsStream(EXAMPLE_XSD);
  DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
  docFactory.setNamespaceAware(true);
  DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
  Document xsdDocument=docBuilder.parse(inputStream);
  Element xsdElement=xsdDocument.getDocumentElement();
  DynamicJAXBContext jaxbContext=DynamicJAXBContextFactory.createContextFromXSD(xsdElement,null,null,null);
  DynamicEntity emp=jaxbContext.newDynamicEntity(EMPLOYEE_CLASS_NAME);
  assertNotNull(emp);
}

Fixed version (ground truth):
public void testCreateContextFromXSDNode() throws Exception {
  InputStream inputStream=ClassLoader.getSystemResourceAsStream(EXAMPLE_XSD);
  DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
  docFactory.setNamespaceAware(true);
  DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
  Document xsdDocument=docBuilder.parse(inputStream);
  Element xsdElement=xsdDocument.getDocumentElement();
  DynamicJAXBContext jaxbContext=DynamicJAXBContextFactory.createContextFromXSD(xsdElement,null,null,null);
  DynamicEntity emp=jaxbContext.newDynamicEntity(EMPLOYEE_CLASS_NAME);
  assertNotNull(emp);
  Exception caughtException=null;
  try {
    jaxbContext.refeshMetadata();
  }
 catch (  JAXBException e) {
    if (e.getLinkedException() instanceof UnsupportedOperationException) {
      caughtException=e;
    }
  }
  assertNotNull(caughtException);
}
Program: 65833
Project: 65833
Buggy source:
public XMLBinderPolicy(){
  nodesToObjects=new WeakHashMap();
  objectsToNodes=new WeakHashMap();
  setNodeOrderingPolicy(new RelativePositionOrderingPolicy());
}

Fixed version (ground truth):
public XMLBinderPolicy(){
  nodesToObjects=new IdentityHashMap();
  objectsToNodes=new IdentityHashMap();
  setNodeOrderingPolicy(new RelativePositionOrderingPolicy());
}
Program: 65835
Project: 65835
Buggy source:
public void setSchema(Schema schema){
  saxParserFactory.setSchema(schema);
  try {
    saxParser=saxParserFactory.newSAXParser();
    XMLReader newXmlReader=new XMLReader(saxParser.getXMLReader());
    newXmlReader.setFeature(VALIDATING,xmlReader.getFeature(VALIDATING));
    newXmlReader.setEntityResolver(xmlReader.getEntityResolver());
    newXmlReader.setErrorHandler(xmlReader.getErrorHandler());
    xmlReader=newXmlReader;
    xmlParser.setXMLSchema(schema);
  }
 catch (  Exception e) {
    throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
  }
}

Fixed version (ground truth):
public void setSchema(Schema schema){
  xmlParser.setXMLSchema(schema);
  saxParserFactory.setSchema(schema);
  try {
    saxParser=saxParserFactory.newSAXParser();
    XMLReader newXmlReader=new XMLReader(saxParser.getXMLReader());
    newXmlReader.setFeature(VALIDATING,xmlReader.getFeature(VALIDATING));
    newXmlReader.setEntityResolver(xmlReader.getEntityResolver());
    newXmlReader.setErrorHandler(xmlReader.getErrorHandler());
    xmlReader=newXmlReader;
    xmlParser.setXMLSchema(schema);
  }
 catch (  Exception e) {
    throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
  }
}
Program: 65836
Project: 65836
Buggy source:
public Schema getSchema(){
  Schema schema=null;
  try {
    schema=saxParserFactory.getSchema();
  }
 catch (  UnsupportedOperationException ex) {
  }
  return schema;
}

Fixed version (ground truth):
public Schema getSchema(){
  Schema schema=null;
  try {
    schema=xmlParser.getXMLSchema();
  }
 catch (  UnsupportedOperationException ex) {
  }
  return schema;
}
Program: 65837
Project: 65837
Buggy source:
public ErrorHandler getErrorHandler(){
  return xmlReader.getErrorHandler();
}

Fixed version (ground truth):
public ErrorHandler getErrorHandler(){
  return xmlParser.getErrorHandler();
}
Program: 65838
Project: 65838
Buggy source:
/** 
 * If a Schema was set on the unmarshaller then wrap the ContentHandler in a ValidatorHandler.
 */
private void setContentHandler(XMLReader xmlReader,ContentHandler contentHandler){
  Schema schema=null;
  try {
    schema=saxParserFactory.getSchema();
  }
 catch (  UnsupportedOperationException e) {
  }
  if (null == schema) {
    xmlReader.setContentHandler(contentHandler);
  }
 else {
    ValidatorHandler validatorHandler=schema.newValidatorHandler();
    validatorHandler.setContentHandler(contentHandler);
    xmlReader.setContentHandler(validatorHandler);
  }
}

Fixed version (ground truth):
/** 
 * If a Schema was set on the unmarshaller then wrap the ContentHandler in a ValidatorHandler.
 */
private void setContentHandler(XMLReader xmlReader,ContentHandler contentHandler){
  setValidatorHandler(xmlReader);
  xmlReader.setContentHandler(contentHandler);
}
Program: 65839
Project: 65839
Buggy source:
public void setContentHandler(ContentHandler handler){
  reader.setContentHandler(handler);
}

Fixed version (ground truth):
public void setContentHandler(ContentHandler handler){
  if (validatorHandler != null) {
    validatorHandler.setContentHandler(handler);
  }
 else {
    reader.setContentHandler(handler);
  }
}
Program: 65840
Project: 65840
Buggy source:
public void setErrorHandler(ErrorHandler handler){
  reader.setErrorHandler(handler);
}

Fixed version (ground truth):
public void setErrorHandler(ErrorHandler handler){
  if (validatorHandler != null) {
    validatorHandler.setErrorHandler(handler);
  }
 else {
    reader.setErrorHandler(handler);
  }
}
Program: 65841
Project: 65841
Buggy source:
public void testFailOnSecondErrorSAXSource() throws Exception {
  unmarshaller.setEventHandler(new CustomErrorValidationEventHandler());
  SAXParserFactory spf=SAXParserFactory.newInstance();
  SAXParser sp=spf.newSAXParser();
  XMLReader xr=sp.getXMLReader();
  InputStream stream=ClassLoader.getSystemResourceAsStream(DOUBLE_ERROR_XML);
  Source source=new SAXSource(xr,new InputSource(stream));
  try {
    unmarshaller.setSchema(this.schema);
    unmarshaller.unmarshal(source);
  }
 catch (  UnmarshalException ex) {
    assertTrue(true);
    return;
  }
catch (  UnsupportedOperationException uoe) {
    assertTrue(true);
    return;
  }
  fail("String_Node_Str");
}

Fixed version (ground truth):
public void testFailOnSecondErrorSAXSource() throws Exception {
  unmarshaller.setEventHandler(new CustomErrorValidationEventHandler());
  SAXParserFactory spf=SAXParserFactory.newInstance();
  spf.setNamespaceAware(true);
  SAXParser sp=spf.newSAXParser();
  XMLReader xr=sp.getXMLReader();
  InputStream stream=ClassLoader.getSystemResourceAsStream(DOUBLE_ERROR_XML);
  Source source=new SAXSource(xr,new InputSource(stream));
  try {
    unmarshaller.setSchema(this.schema);
    unmarshaller.unmarshal(source);
  }
 catch (  UnmarshalException ex) {
    assertTrue(true);
    return;
  }
catch (  UnsupportedOperationException uoe) {
    assertTrue(true);
    return;
  }
  fail("String_Node_Str");
}
Program: 65842
Project: 65842
Buggy source:
public void testFailOnSecondErrorSAXSourceWithClass() throws Exception {
  unmarshaller.setEventHandler(new CustomErrorValidationEventHandler());
  SAXParserFactory spf=SAXParserFactory.newInstance();
  SAXParser sp=spf.newSAXParser();
  XMLReader xr=sp.getXMLReader();
  InputStream stream=ClassLoader.getSystemResourceAsStream(DOUBLE_ERROR_XML);
  Source source=new SAXSource(xr,new InputSource(stream));
  try {
    unmarshaller.setSchema(this.schema);
    unmarshaller.unmarshal(source,Employee.class);
  }
 catch (  UnmarshalException ex) {
    assertTrue(true);
    return;
  }
catch (  UnsupportedOperationException uoe) {
    assertTrue(true);
    return;
  }
  fail("String_Node_Str");
}

Fixed version (ground truth):
public void testFailOnSecondErrorSAXSourceWithClass() throws Exception {
  unmarshaller.setEventHandler(new CustomErrorValidationEventHandler());
  SAXParserFactory spf=SAXParserFactory.newInstance();
  spf.setNamespaceAware(true);
  SAXParser sp=spf.newSAXParser();
  XMLReader xr=sp.getXMLReader();
  InputStream stream=ClassLoader.getSystemResourceAsStream(DOUBLE_ERROR_XML);
  Source source=new SAXSource(xr,new InputSource(stream));
  try {
    unmarshaller.setSchema(this.schema);
    unmarshaller.unmarshal(source,Employee.class);
  }
 catch (  UnmarshalException ex) {
    assertTrue(true);
    return;
  }
catch (  UnsupportedOperationException uoe) {
    assertTrue(true);
    return;
  }
  fail("String_Node_Str");
}
Program: 65843
Project: 65843
Buggy source:
@Override protected void setUp() throws Exception {
  Class[] classes={Employee.class};
  JAXBContext jc=JAXBContextFactory.createContext(classes,null);
  unmarshaller=(JAXBUnmarshaller)jc.createUnmarshaller();
  SchemaFactory sf=SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
  InputStream stream=ClassLoader.getSystemResourceAsStream(SCHEMA);
  Schema schema=sf.newSchema(new StreamSource(stream));
  stream.close();
  this.schema=schema;
}

Fixed version (ground truth):
@Override protected void setUp() throws Exception {
  Class[] classes={Employee.class};
  JAXBContext jc=JAXBContextFactory.createContext(classes,null);
  unmarshaller=(JAXBUnmarshaller)jc.createUnmarshaller();
  SchemaFactory sf=SchemaFactory.newInstance(XMLConstants.SCHEMA_URL);
  InputStream stream=ClassLoader.getSystemResourceAsStream(SCHEMA);
  Schema schema=sf.newSchema(new StreamSource(stream));
  stream.close();
  this.schema=schema;
}
Program: 65844
Project: 65844
Buggy source:
public void testFailOnSecondErrorSAXSourceWithType() throws Exception {
  unmarshaller.setEventHandler(new CustomErrorValidationEventHandler());
  SAXParserFactory spf=SAXParserFactory.newInstance();
  SAXParser sp=spf.newSAXParser();
  XMLReader xr=sp.getXMLReader();
  InputStream stream=ClassLoader.getSystemResourceAsStream(DOUBLE_ERROR_XML);
  Source source=new SAXSource(xr,new InputSource(stream));
  try {
    unmarshaller.setSchema(this.schema);
    unmarshaller.unmarshal(source,(Type)Employee.class);
  }
 catch (  UnmarshalException ex) {
    assertTrue(true);
    return;
  }
catch (  UnsupportedOperationException uoe) {
    assertTrue(true);
    return;
  }
  fail("String_Node_Str");
}

Fixed version (ground truth):
public void testFailOnSecondErrorSAXSourceWithType() throws Exception {
  unmarshaller.setEventHandler(new CustomErrorValidationEventHandler());
  SAXParserFactory spf=SAXParserFactory.newInstance();
  spf.setNamespaceAware(true);
  SAXParser sp=spf.newSAXParser();
  XMLReader xr=sp.getXMLReader();
  InputStream stream=ClassLoader.getSystemResourceAsStream(DOUBLE_ERROR_XML);
  Source source=new SAXSource(xr,new InputSource(stream));
  try {
    unmarshaller.setSchema(this.schema);
    unmarshaller.unmarshal(source,(Type)Employee.class);
  }
 catch (  UnmarshalException ex) {
    assertTrue(true);
    return;
  }
catch (  UnsupportedOperationException uoe) {
    assertTrue(true);
    return;
  }
  fail("String_Node_Str");
}
Program: 65846
Project: 65846
Buggy source:
public CharSequence getCharacters(){
  if (null != characters) {
    return characters;
  }
  return getUnmarshaller().getStringBuffer();
}

Fixed version (ground truth):
public CharSequence getCharacters(){
  return getUnmarshaller().getStringBuffer();
}
Program: 65847
Project: 65847
Buggy source:
public void characters(CharSequence characters) throws SAXException {
  try {
    if (null != selfRecords) {
      for (int x=0, selfRecordsSize=selfRecords.size(); x < selfRecordsSize; x++) {
        UnmarshalRecord selfRecord=selfRecords.get(x);
        if (selfRecord != null) {
          selfRecord.characters(characters);
        }
 else {
          getFragmentBuilder().characters(characters);
        }
      }
    }
    if (-1 != unmappedLevel && unmappedLevel <= levelIndex) {
      return;
    }
    XPathNode textNode=xPathNode.getTextNode();
    if (null == textNode) {
      textNode=xPathNode.getAnyNode();
      if (textNode != null) {
        xpathNodeIsMixedContent=true;
        this.xPathFragment.setLocalName(null);
        this.xPathFragment.setNamespaceURI(null);
        if (0 == characters.length()) {
          return;
        }
        if (!textNode.isWhitespaceAware() && characters.toString().trim().length() == 0) {
          return;
        }
      }
    }
    if (null != textNode) {
      xPathNode=textNode;
      unmarshalContext.characters(this);
    }
    if (null != xPathNode.getUnmarshalNodeValue()) {
      this.characters=characters;
    }
  }
 catch (  EclipseLinkException e) {
    if (null == xmlReader.getErrorHandler()) {
      throw e;
    }
 else {
      SAXParseException saxParseException=new SAXParseException(null,null,null,0,0,e);
      xmlReader.getErrorHandler().error(saxParseException);
    }
  }
}

Fixed version (ground truth):
public void characters(CharSequence characters) throws SAXException {
  if (null != characters) {
    String string=characters.toString();
    characters(string.toCharArray(),0,string.length());
  }
}
Program: 65848
Project: 65848
Buggy source:
public void resetStringBuffer(){
  this.getStringBuffer().reset();
  this.isBufferCDATA=false;
  this.characters=null;
}

Fixed version (ground truth):
public void resetStringBuffer(){
  this.getStringBuffer().reset();
  this.isBufferCDATA=false;
}
Program: 65850
Project: 65850
Buggy source:
public XMLCompositeDirectCollectionMapping generateEnumCollectionMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,EnumTypeInfo info){
  XMLCompositeDirectCollectionMapping mapping=new XMLCompositeDirectCollectionMapping();
  mapping.setAttributeName(property.getPropertyName());
  mapping.setReuseContainer(true);
  if (property.isMethodProperty()) {
    if (property.getGetMethodName() == null) {
      String paramTypeAsString=property.getType().getName();
      mapping.setAttributeAccessor(new JAXBSetMethodAttributeAccessor(paramTypeAsString,helper.getClassLoader()));
      mapping.setIsReadOnly(true);
      mapping.setSetMethodName(property.getSetMethodName());
    }
 else     if (property.getSetMethodName() == null) {
      mapping.setGetMethodName(property.getGetMethodName());
      mapping.setIsWriteOnly(true);
    }
 else {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  mapping.setValueConverter(buildJAXBEnumTypeConverter(mapping,info));
  JavaClass collectionType=property.getType();
  if (collectionType.isArray() || areEquals(collectionType,Collection.class) || areEquals(collectionType,List.class)) {
    collectionType=jotArrayList;
  }
 else   if (areEquals(collectionType,Set.class)) {
    collectionType=jotHashSet;
  }
  mapping.useCollectionClassName(collectionType.getRawName());
  mapping.setField(getXPathForField(property,namespaceInfo,true));
  if (property.isXmlList()) {
    mapping.setUsesSingleNode(true);
  }
  return mapping;
}

Fixed version (ground truth):
public XMLCompositeDirectCollectionMapping generateEnumCollectionMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,EnumTypeInfo info){
  XMLCompositeDirectCollectionMapping mapping=generateDirectCollectionMapping(property,descriptor,namespaceInfo);
  mapping.setValueConverter(buildJAXBEnumTypeConverter(mapping,info));
  return mapping;
}
Program: 65852
Project: 65852
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);
  suite.addTest(new TestSuite(SDOTypeHelperDelegateInitializeTestCases.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));
  suite.addTest(new TestSuite(SDOTypeHelperAppInfoTestCases.class));
  return suite;
}
Program: 65854
Project: 65854
Buggy source:
private void initOpenProps(){
  getGlobalAttributes().put(SDOConstants.MIME_TYPE_QNAME,SDOConstants.MIME_TYPE_PROPERTY);
  getGlobalAttributes().put(SDOConstants.MIME_TYPE_PROPERTY_QNAME,SDOConstants.MIME_TYPE_PROPERTY_PROPERTY);
  Property xmlSchemaTypeProperty=aHelperContext.getTypeHelper().getOpenContentProperty(SDOConstants.SDO_URL,SDOConstants.XML_SCHEMA_TYPE_NAME);
  getGlobalAttributes().put(SDOConstants.SCHEMA_TYPE_QNAME,xmlSchemaTypeProperty);
  getGlobalAttributes().put(SDOConstants.JAVA_CLASS_QNAME,SDOConstants.JAVA_CLASS_PROPERTY);
  getGlobalAttributes().put(SDOConstants.XML_ELEMENT_QNAME,SDOConstants.XMLELEMENT_PROPERTY);
  Property xmlDataTypeProperty=aHelperContext.getTypeHelper().getOpenContentProperty(SDOConstants.SDOXML_URL,SDOConstants.SDOXML_DATATYPE);
  getGlobalAttributes().put(SDOConstants.XML_DATATYPE_QNAME,xmlDataTypeProperty);
  getGlobalAttributes().put(SDOConstants.XML_ID_PROPERTY_QNAME,SDOConstants.ID_PROPERTY);
  getGlobalAttributes().put(SDOConstants.DOCUMENTATION_PROPERTY_QNAME,SDOConstants.DOCUMENTATION_PROPERTY);
}

Fixed version (ground truth):
private void initOpenProps(){
  getGlobalAttributes().put(SDOConstants.MIME_TYPE_QNAME,SDOConstants.MIME_TYPE_PROPERTY);
  getGlobalAttributes().put(SDOConstants.MIME_TYPE_PROPERTY_QNAME,SDOConstants.MIME_TYPE_PROPERTY_PROPERTY);
  Property xmlSchemaTypeProperty=aHelperContext.getTypeHelper().getOpenContentProperty(SDOConstants.SDO_URL,SDOConstants.XML_SCHEMA_TYPE_NAME);
  getGlobalAttributes().put(SDOConstants.SCHEMA_TYPE_QNAME,xmlSchemaTypeProperty);
  getGlobalAttributes().put(SDOConstants.JAVA_CLASS_QNAME,SDOConstants.JAVA_CLASS_PROPERTY);
  getGlobalAttributes().put(SDOConstants.XML_ELEMENT_QNAME,SDOConstants.XMLELEMENT_PROPERTY);
  Property xmlDataTypeProperty=aHelperContext.getTypeHelper().getOpenContentProperty(SDOConstants.SDOXML_URL,SDOConstants.SDOXML_DATATYPE);
  getGlobalAttributes().put(SDOConstants.XML_DATATYPE_QNAME,xmlDataTypeProperty);
  getGlobalAttributes().put(SDOConstants.XML_ID_PROPERTY_QNAME,SDOConstants.ID_PROPERTY);
  getGlobalAttributes().put(SDOConstants.DOCUMENTATION_PROPERTY_QNAME,SDOConstants.DOCUMENTATION_PROPERTY);
  getGlobalAttributes().put(SDOConstants.APPINFO_PROPERTY_QNAME,SDOConstants.APPINFO_PROPERTY);
}
Program: 65857
Project: 65857
Buggy source:
/** 
 * The XML bindings metadata will be loaded from an InputSource.
 */
public XMLMetadataSource(InputSource xmlBindings){
  xmlBindingsSource=new SAXSource(xmlBindings);
}

Fixed version (ground truth):
/** 
 * XML bindings metatdata will be loaded either as a URL or as a classpath reference
 */
public XMLMetadataSource(String xmlBindings){
  if (xmlBindings == null) {
    throw new IllegalArgumentException();
  }
  try {
    this.xmlBindingsURL=new URL(xmlBindings);
  }
 catch (  MalformedURLException ex) {
    xmlBindingsLocation=xmlBindings;
  }
}
Program: 65858
Project: 65858
Buggy source:
@Override public XmlBindings getXmlBindings(Map<String,?> properties,ClassLoader classLoader){
  try {
    JAXBContext jaxbContext=CompilerHelper.getXmlBindingsModelContext();
    Unmarshaller unmarshaller=jaxbContext.createUnmarshaller();
    if (null != xmlBindingsSource) {
      return (XmlBindings)unmarshaller.unmarshal(xmlBindingsSource);
    }
    if (null != xmlBindingsURL) {
      return (XmlBindings)unmarshaller.unmarshal(xmlBindingsURL);
    }
  }
 catch (  JAXBException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
@Override public XmlBindings getXmlBindings(Map<String,?> properties,ClassLoader classLoader){
  try {
    JAXBContext jaxbContext=CompilerHelper.getXmlBindingsModelContext();
    Unmarshaller unmarshaller=jaxbContext.createUnmarshaller();
    if (null != xmlBindingsSource) {
      return (XmlBindings)unmarshaller.unmarshal(xmlBindingsSource);
    }
    if (null != xmlBindingsURL) {
      return (XmlBindings)unmarshaller.unmarshal(xmlBindingsURL);
    }
    if (null != xmlBindingsLocation) {
      URL url=classLoader.getResource(xmlBindingsLocation);
      if (url == null) {
        throw org.eclipse.persistence.exceptions.JAXBException.unableToLoadMetadataFromLocation(xmlBindingsLocation);
      }
      return (XmlBindings)unmarshaller.unmarshal(url);
    }
  }
 catch (  JAXBException e) {
    throw org.eclipse.persistence.exceptions.JAXBException.couldNotUnmarshalMetadata(e);
  }
  return null;
}
Program: 65859
Project: 65859
Buggy source:
public void setUp() throws Exception {
  setupParser();
  setupControlDocs();
  InputStream bindingsFileXSDInputStream=getClass().getClassLoader().getResourceAsStream("String_Node_Str");
  if (bindingsFileXSDInputStream == null) {
    bindingsFileXSDInputStream=getClass().getClassLoader().getResourceAsStream("String_Node_Str");
  }
  if (bindingsFileXSDInputStream == null) {
    fail("String_Node_Str");
  }
  bindingsFileXSDSource=new StreamSource(bindingsFileXSDInputStream);
}

Fixed version (ground truth):
public void setUp() throws Exception {
  setupParser();
  setupControlDocs();
  InputStream bindingsFileXSDInputStream=getClass().getClassLoader().getResourceAsStream(ECLIPSELINK_OXM_XSD);
  if (bindingsFileXSDInputStream == null) {
    bindingsFileXSDInputStream=getClass().getClassLoader().getResourceAsStream("String_Node_Str" + ECLIPSELINK_OXM_XSD);
  }
  if (bindingsFileXSDInputStream == null) {
    fail("String_Node_Str" + ECLIPSELINK_OXM_XSD);
  }
  bindingsFileXSDSource=new StreamSource(bindingsFileXSDInputStream);
}
Program: 65860
Project: 65860
Buggy source:
protected void validateBindingsFileAgainstSchema(Source src){
  String result=null;
  SchemaFactory sFact=SchemaFactory.newInstance(XMLConstants.SCHEMA_URL);
  Schema theSchema;
  try {
    InputStream bindingsFileXSDInputStream=getClass().getClassLoader().getResourceAsStream("String_Node_Str");
    if (bindingsFileXSDInputStream == null) {
      bindingsFileXSDInputStream=getClass().getClassLoader().getResourceAsStream("String_Node_Str");
    }
    if (bindingsFileXSDInputStream == null) {
      fail("String_Node_Str");
    }
    Source bindingsFileXSDSource=new StreamSource(bindingsFileXSDInputStream);
    theSchema=sFact.newSchema(bindingsFileXSDSource);
    Validator validator=theSchema.newValidator();
    validator.validate(src);
  }
 catch (  Exception e) {
    e.printStackTrace();
    if (e.getMessage() == null) {
      result="String_Node_Str";
    }
    result=e.getMessage();
  }
  assertTrue("String_Node_Str" + result,result == null);
}

Fixed version (ground truth):
protected void validateBindingsFileAgainstSchema(Source src){
  String result=null;
  SchemaFactory sFact=SchemaFactory.newInstance(XMLConstants.SCHEMA_URL);
  Schema theSchema;
  try {
    InputStream bindingsFileXSDInputStream=getClass().getClassLoader().getResourceAsStream(ECLIPSELINK_OXM_XSD);
    if (bindingsFileXSDInputStream == null) {
      bindingsFileXSDInputStream=getClass().getClassLoader().getResourceAsStream("String_Node_Str" + ECLIPSELINK_OXM_XSD);
    }
    if (bindingsFileXSDInputStream == null) {
      fail("String_Node_Str" + ECLIPSELINK_OXM_XSD);
    }
    Source bindingsFileXSDSource=new StreamSource(bindingsFileXSDInputStream);
    theSchema=sFact.newSchema(bindingsFileXSDSource);
    Validator validator=theSchema.newValidator();
    validator.validate(src);
  }
 catch (  Exception e) {
    e.printStackTrace();
    if (e.getMessage() == null) {
      result="String_Node_Str";
    }
    result=e.getMessage();
  }
  assertTrue("String_Node_Str" + result,result == null);
}