nus-yam/ex-repair huggingface dataset:
Program: 63542
Project: 63542
Buggy source:
protected void setupHandlerForKeepAsElementPolicy(UnmarshalRecord unmarshalRecord,XPathFragment xPathFragment,Attributes atts){
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  builder.setOwningRecord(unmarshalRecord);
  try {
    String namespaceURI=Constants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + unmarshalRecord.getNamespaceSeparator() + qName;
    }
    if (!(unmarshalRecord.getPrefixesForFragment().isEmpty())) {
      for (      Entry<String,String> next : ((Map<String,String>)unmarshalRecord.getPrefixesForFragment()).entrySet()) {
        builder.startPrefixMapping(next.getKey(),next.getValue());
      }
    }
    builder.startElement(namespaceURI,xPathFragment.getLocalName(),qName,atts);
    XMLReader xmlReader=unmarshalRecord.getXMLReader();
    xmlReader.setContentHandler(builder);
    xmlReader.setLexicalHandler(null);
  }
 catch (  SAXException ex) {
  }
}

Fixed version (ground truth):
protected void setupHandlerForKeepAsElementPolicy(UnmarshalRecord unmarshalRecord,XPathFragment xPathFragment,Attributes atts){
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  builder.setOwningRecord(unmarshalRecord);
  builder.setMixedContent(xPathNode.getUnmarshalNodeValue().isMixedContentNodeValue());
  try {
    String namespaceURI=Constants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + unmarshalRecord.getNamespaceSeparator() + qName;
    }
    if (!(unmarshalRecord.getPrefixesForFragment().isEmpty())) {
      for (      Entry<String,String> next : ((Map<String,String>)unmarshalRecord.getPrefixesForFragment()).entrySet()) {
        builder.startPrefixMapping(next.getKey(),next.getValue());
      }
    }
    builder.startElement(namespaceURI,xPathFragment.getLocalName(),qName,atts);
    XMLReader xmlReader=unmarshalRecord.getXMLReader();
    xmlReader.setContentHandler(builder);
    xmlReader.setLexicalHandler(null);
  }
 catch (  SAXException ex) {
  }
}
Program: 63543
Project: 63543
Buggy source:
/** 
 * {@inheritDoc}
 */
public JPQLQueryBNF getQueryBNF(){
  return getQueryBNF(EntityTypeExpressionBNF.ID);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public JPQLQueryBNF getQueryBNF(){
  return getQueryBNF(EntityTypeLiteralBNF.ID);
}
Program: 63544
Project: 63544
Buggy source:
/** 
 * INTERNAL: Write fields needed for insert into the template for with null values.
 */
@Override public void writeInsertFieldsIntoRow(AbstractRecord databaseRow,AbstractSession session){
  if (isReadOnly()) {
    return;
  }
  AbstractRecord targetRow=buildTemplateInsertRow(session);
  for (Enumeration keyEnum=targetRow.keys(); keyEnum.hasMoreElements(); ) {
    DatabaseField field=(DatabaseField)keyEnum.nextElement();
    Object value=targetRow.get(field);
    databaseRow.add(field,value);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Write fields needed for insert into the template for with null values.
 */
@Override public void writeInsertFieldsIntoRow(AbstractRecord databaseRow,AbstractSession session){
  if (isReadOnly()) {
    return;
  }
  AbstractRecord targetRow=buildTemplateInsertRow(session);
  for (Enumeration keyEnum=targetRow.keys(); keyEnum.hasMoreElements(); ) {
    DatabaseField field=(DatabaseField)keyEnum.nextElement();
    if (field.isInsertable()) {
      Object value=targetRow.get(field);
      databaseRow.add(field,value);
    }
  }
}
Program: 63545
Project: 63545
Buggy source:
public ComplexAggregateTableCreator(){
  setName("String_Node_Str");
  addTableDefinition(buildCITYSLICKERTable());
  addTableDefinition(buildCOUNTRYDWELLERTable());
  addTableDefinition(buildWORLDTable());
  addTableDefinition(buildHOCKEYCOACHTable());
  addTableDefinition(buildHOCKEYPLAYERTable());
  addTableDefinition(buildHOCKEYTEAMTable());
  addTableDefinition(buildROLETable());
  addTableDefinition(buildPLAYERROLESTable());
  addTableDefinition(buildHockeyCoach_NICKNAMESTable());
  addTableDefinition(buildBODYTable());
}

Fixed version (ground truth):
public ComplexAggregateTableCreator(){
  setName("String_Node_Str");
  addTableDefinition(buildCITYSLICKERTable());
  addTableDefinition(buildCOUNTRYDWELLERTable());
  addTableDefinition(buildWORLDTable());
  addTableDefinition(buildHOCKEYCOACHTable());
  addTableDefinition(buildHOCKEYPLAYERTable());
  addTableDefinition(buildHOCKEYTEAMTable());
  addTableDefinition(buildROLETable());
  addTableDefinition(buildPLAYERROLESTable());
  addTableDefinition(buildHockeyCoach_NICKNAMESTable());
  addTableDefinition(buildBODYTable());
  addTableDefinition(buildPLACETable());
}
Program: 63546
Project: 63546
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  suite.addTest(new ComplexAggregateTestSuite("String_Node_Str"));
  return suite;
}
Program: 63551
Project: 63551
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(XmlInverseRefBidirectionalTestCases.class);
  suite.addTestSuite(XmlInverseRefBidirectional2TestCases.class);
  suite.addTestSuite(XmlInverseRefEmployeeTestCases.class);
  suite.addTestSuite(XmlInverseRefBidirectionalSubTestCases.class);
  suite.addTestSuite(XmlInverseRefObjectsTestCases.class);
  suite.addTestSuite(XmlInverseRefBidirectionalListTestCases.class);
  suite.addTestSuite(XmlInverseRefBidirectionalList2TestCases.class);
  suite.addTestSuite(XmlInverseRefBidirectionalList3TestCases.class);
  suite.addTestSuite(XmlInverseRefBidirectionalList4TestCases.class);
  suite.addTestSuite(XmlInverseRefBidirectionalListObjectsTestCases.class);
  suite.addTestSuite(InverseBindingsTestCases.class);
  suite.addTestSuite(InverseWriteableBindingsTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(XmlInverseRefBidirectionalTestCases.class);
  suite.addTestSuite(XmlInverseRefBidirectional2TestCases.class);
  suite.addTestSuite(XmlInverseRefEmployeeTestCases.class);
  suite.addTestSuite(XmlInverseRefBidirectionalSubTestCases.class);
  suite.addTestSuite(XmlInverseRefObjectsTestCases.class);
  suite.addTestSuite(XmlInverseRefBidirectionalListTestCases.class);
  suite.addTestSuite(XmlInverseRefBidirectionalList2TestCases.class);
  suite.addTestSuite(XmlInverseRefBidirectionalList3TestCases.class);
  suite.addTestSuite(XmlInverseRefBidirectionalList4TestCases.class);
  suite.addTestSuite(XmlInverseRefBidirectionalListObjectsTestCases.class);
  suite.addTestSuite(XmlInverseRefWithWrapperTestCases.class);
  suite.addTestSuite(InverseBindingsTestCases.class);
  suite.addTestSuite(InverseWriteableBindingsTestCases.class);
  return suite;
}
Program: 63552
Project: 63552
Buggy source:
/** 
 * <p>INTERNAL: Perform any post-load descriptor modifications, such as altering attribute classification on a given mapping, or converting class names to classes.  In addition, JAXB and JPA Embeddables will have the descriptor alias set to the class name (w/o package), which will contain an upper case first character, meaning that the OR/OX descriptors will  have to be aligned in some cases. 
 */
protected static void prepareDescriptors(Project oxProject,Project orProject,XRDynamicClassLoader xrdcl){
  if (oxProject.getAliasDescriptors() != null) {
    for (    Object alias : oxProject.getAliasDescriptors().keySet()) {
      if (alias.equals(SIMPLE_XML_FORMAT_STR)) {
        continue;
      }
      XMLDescriptor xdesc=(XMLDescriptor)oxProject.getAliasDescriptors().get(alias);
      for (      DatabaseMapping mapping : xdesc.getMappings()) {
        if (mapping instanceof XMLBinaryDataMapping) {
          ((XMLBinaryDataMapping)mapping).setAttributeClassification(APBYTE);
          ((XMLBinaryDataMapping)mapping).setAttributeClassificationName(APBYTE.getName());
        }
      }
      ClassDescriptor odesc=(ClassDescriptor)orProject.getAliasDescriptors().get(alias);
      if (odesc != null) {
        odesc.convertClassNamesToClasses(xrdcl);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * <p>INTERNAL: Perform any post-load descriptor modifications, such as altering attribute classification on a given mapping, or converting class names to classes.  In addition, JAXB and JPA Embeddables will have the descriptor alias set to the class name (w/o package), which will contain an upper case first character, meaning that the OR/OX descriptors will  have to be aligned in some cases. 
 */
protected static void prepareDescriptors(Project oxProject,Project orProject,XRDynamicClassLoader xrdcl){
  if (orProject.getAliasDescriptors() != null) {
    orProject.getAliasDescriptors().remove("String_Node_Str");
  }
  if (oxProject.getAliasDescriptors() != null) {
    for (    Object alias : oxProject.getAliasDescriptors().keySet()) {
      if (alias.equals(SIMPLE_XML_FORMAT_STR)) {
        continue;
      }
      XMLDescriptor xdesc=(XMLDescriptor)oxProject.getAliasDescriptors().get(alias);
      for (      DatabaseMapping mapping : xdesc.getMappings()) {
        if (mapping instanceof XMLBinaryDataMapping) {
          ((XMLBinaryDataMapping)mapping).setAttributeClassification(APBYTE);
          ((XMLBinaryDataMapping)mapping).setAttributeClassificationName(APBYTE.getName());
        }
      }
      ClassDescriptor odesc=(ClassDescriptor)orProject.getAliasDescriptors().get(alias);
      if (odesc != null) {
        ClassDescriptor orderedDescriptor=getDescriptorForClassName(orProject,odesc.getJavaClassName());
        if (orderedDescriptor != null) {
          orderedDescriptor.setAlias(alias.toString());
          orderedDescriptor.setJavaClassName(odesc.getJavaClassName());
          orderedDescriptor.convertClassNamesToClasses(xrdcl);
          orProject.addAlias(orderedDescriptor.getAlias(),orderedDescriptor);
        }
      }
    }
  }
}
Program: 63553
Project: 63553
Buggy source:
@Test public void getEmpRecordTest(){
  System.out.println(DBWS_OR_STREAM);
  Invocation invocation=new Invocation("String_Node_Str");
  invocation.setParameter("String_Node_Str",69);
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.setFormattedOutput(true);
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(RECORD_XML));
  removeEmptyTextNodes(doc);
  removeEmptyTextNodes(controlDoc);
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}

Fixed version (ground truth):
@Test public void getEmpRecordTest(){
  Invocation invocation=new Invocation("String_Node_Str");
  invocation.setParameter("String_Node_Str",69);
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.setFormattedOutput(true);
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(RECORD_XML));
  removeEmptyTextNodes(doc);
  removeEmptyTextNodes(controlDoc);
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}
Program: 63556
Project: 63556
Buggy source:
public static TableDefinition buildISOLATEDCHILDTable(){
  TableDefinition tabledefinition=new TableDefinition();
  tabledefinition.setName("String_Node_Str");
  FieldDefinition field=new FieldDefinition();
  field.setName("String_Node_Str");
  field.setTypeName("String_Node_Str");
  field.setSize(15);
  field.setShouldAllowNull(false);
  field.setIsPrimaryKey(true);
  field.setUnique(false);
  field.setIsIdentity(true);
  tabledefinition.addField(field);
  FieldDefinition field1=new FieldDefinition();
  field1.setName("String_Node_Str");
  field1.setTypeName("String_Node_Str");
  field1.setSize(15);
  field1.setShouldAllowNull(false);
  field1.setIsPrimaryKey(true);
  field1.setUnique(false);
  field1.setIsIdentity(false);
  field1.setForeignKeyFieldName("String_Node_Str");
  tabledefinition.addField(field1);
  FieldDefinition field2=new FieldDefinition();
  field2.setName("String_Node_Str");
  field2.setTypeName("String_Node_Str");
  field2.setSize(100);
  field2.setShouldAllowNull(false);
  field2.setIsPrimaryKey(true);
  field2.setUnique(false);
  field2.setIsIdentity(false);
  tabledefinition.addField(field2);
  return tabledefinition;
}

Fixed version (ground truth):
public static TableDefinition buildISOLATEDCHILDTable(){
  TableDefinition tabledefinition=new TableDefinition();
  tabledefinition.setName("String_Node_Str");
  FieldDefinition field=new FieldDefinition();
  field.setName("String_Node_Str");
  field.setTypeName("String_Node_Str");
  field.setSize(15);
  field.setShouldAllowNull(false);
  field.setIsPrimaryKey(true);
  field.setUnique(false);
  field.setIsIdentity(true);
  tabledefinition.addField(field);
  FieldDefinition field1=new FieldDefinition();
  field1.setName("String_Node_Str");
  field1.setTypeName("String_Node_Str");
  field1.setSize(15);
  field1.setShouldAllowNull(false);
  field1.setIsPrimaryKey(false);
  field1.setUnique(false);
  field1.setIsIdentity(false);
  field1.setForeignKeyFieldName("String_Node_Str");
  tabledefinition.addField(field1);
  FieldDefinition field2=new FieldDefinition();
  field2.setName("String_Node_Str");
  field2.setTypeName("String_Node_Str");
  field2.setSize(100);
  field2.setShouldAllowNull(false);
  field2.setIsPrimaryKey(false);
  field2.setUnique(false);
  field2.setIsIdentity(false);
  tabledefinition.addField(field2);
  FieldDefinition field3=new FieldDefinition();
  field3.setName("String_Node_Str");
  field3.setTypeName("String_Node_Str");
  field3.setSize(1);
  field3.setShouldAllowNull(false);
  field3.setIsPrimaryKey(false);
  field3.setUnique(false);
  field3.setIsIdentity(false);
  tabledefinition.addField(field3);
  return tabledefinition;
}
Program: 63557
Project: 63557
Buggy source:
public XMLBinder(XMLContext context){
  this.context=new XMLContext(context.getXMLContextState());
  marshaller=this.context.createMarshaller();
  unmarshaller=this.context.createUnmarshaller();
  saxUnmarshaller=new SAXUnmarshaller(unmarshaller,null);
  documentPreservationPolicy=new XMLBinderPolicy();
  reader=new DOMReader(unmarshaller);
}

Fixed version (ground truth):
public XMLBinder(XMLContext context,XMLMarshaller marshaller,XMLUnmarshaller unmarshaller){
  this.context=new XMLContext(context.getXMLContextState());
  this.marshaller=marshaller;
  this.unmarshaller=unmarshaller;
  initialize();
}
Program: 63558
Project: 63558
Buggy source:
/** 
 * Create a new XMLBinder
 * @return an XMLBinder based on this XMLContext
 */
public XMLBinder createBinder(){
  return new XMLBinder(this);
}

Fixed version (ground truth):
/** 
 * Create a new XMLBinder with supplied marshaller and unmarshaller instances.
 * @return an XMLBinder based on this XMLContext,
 */
public XMLBinder createBinder(XMLMarshaller marshaller,XMLUnmarshaller unmarshaller){
  return new XMLBinder(this,marshaller,unmarshaller);
}
Program: 63559
Project: 63559
Buggy source:
public JAXBBinder(XMLContext xmlContext){
  this.xmlContext=xmlContext;
  this.xmlBinder=this.xmlContext.createBinder();
  this.xmlBinder.getDocumentPreservationPolicy().setNodeOrderingPolicy(new RelativePositionOrderingPolicy());
  this.xmlBinder.setErrorHandler(new JAXBErrorHandler(JAXBContext.DEFAULT_VALIDATION_EVENT_HANDER));
}

Fixed version (ground truth):
public JAXBBinder(JAXBContext xmlContext,XMLMarshaller marshaller,XMLUnmarshaller unmarshaller){
  this.jaxbContext=xmlContext;
  this.xmlBinder=this.jaxbContext.getXMLContext().createBinder(marshaller,unmarshaller);
  this.xmlBinder.getDocumentPreservationPolicy().setNodeOrderingPolicy(new RelativePositionOrderingPolicy());
  this.xmlBinder.setErrorHandler(new JAXBErrorHandler(JAXBContext.DEFAULT_VALIDATION_EVENT_HANDER));
}
Program: 63560
Project: 63560
Buggy source:
/** 
 * Create a JAXBBinder.  The JAXBBinder is used to preserve unmapped XML Data.
 * @param nodeClass The DOM Node class to use
 */
public <T>JAXBBinder createBinder(Class<T> nodeClass){
  if (nodeClass.getName().equals("String_Node_Str")) {
    return new JAXBBinder(getXMLContext());
  }
 else {
    throw new UnsupportedOperationException(JAXBException.unsupportedNodeClass(nodeClass.getName()));
  }
}

Fixed version (ground truth):
public JAXBBinder createBinder(JAXBContext context){
  XMLMarshaller marshaller=null;
  XMLUnmarshaller unmarshaller=null;
  try {
    marshaller=createMarshaller(context).getXMLMarshaller();
    unmarshaller=createUnmarshaller(context).getXMLUnmarshaller();
  }
 catch (  javax.xml.bind.JAXBException e) {
    marshaller=context.getXMLContext().createMarshaller();
    unmarshaller=context.getXMLContext().createUnmarshaller();
  }
  return new JAXBBinder(context,marshaller,unmarshaller);
}
Program: 63561
Project: 63561
Buggy source:
/** 
 * INTERNAL: Return if the expression is not a valid primary key expression and add all primary key fields to the set.
 */
@Override public boolean extractFields(boolean requireExactMatch,boolean primaryKey,ClassDescriptor descriptor,List<DatabaseField> searchFields,Set<DatabaseField> foundFields){
  if (this.operator.getSelector() != ExpressionOperator.And) {
    if (requireExactMatch || (this.operator.getSelector() != ExpressionOperator.Or)) {
      return false;
    }
  }
  boolean validExpression=this.firstChild.extractFields(requireExactMatch,primaryKey,descriptor,searchFields,foundFields);
  if (requireExactMatch && (!validExpression)) {
    return false;
  }
  return this.secondChild.extractFields(requireExactMatch,primaryKey,descriptor,searchFields,foundFields);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return if the expression is not a valid primary key expression and add all primary key fields to the set.
 */
@Override public boolean extractFields(boolean requireExactMatch,boolean primaryKey,ClassDescriptor descriptor,List<DatabaseField> searchFields,Set<DatabaseField> foundFields){
  if (this.operator.getSelector() != ExpressionOperator.And) {
    if (requireExactMatch || (this.operator.getSelector() != ExpressionOperator.Or)) {
      return false;
    }
  }
  if (this.secondChild.getSession() == null && this.firstChild.getSession() != null) {
    this.secondChild.getBuilder().setSession(this.firstChild.getSession());
  }
 else   if (this.firstChild.getSession() == null && this.secondChild.getSession() != null) {
    this.firstChild.getBuilder().setSession(this.secondChild.getSession());
  }
  boolean validExpression=this.firstChild.extractFields(requireExactMatch,primaryKey,descriptor,searchFields,foundFields);
  if (requireExactMatch && (!validExpression)) {
    return false;
  }
  return this.secondChild.extractFields(requireExactMatch,primaryKey,descriptor,searchFields,foundFields);
}
Program: 63562
Project: 63562
Buggy source:
/** 
 * INTERNAL: Extract the values from the expression into the row. Ensure that the query is querying the exact primary key. Return false if not on the primary key.
 */
@Override public boolean extractValues(boolean primaryKeyOnly,boolean requireExactMatch,ClassDescriptor descriptor,AbstractRecord primaryKeyRow,AbstractRecord translationRow){
  if (this.operator.getSelector() != ExpressionOperator.And) {
    if (requireExactMatch || (this.operator.getSelector() != ExpressionOperator.Or)) {
      return false;
    }
  }
  boolean validExpression=this.firstChild.extractValues(primaryKeyOnly,requireExactMatch,descriptor,primaryKeyRow,translationRow);
  if (requireExactMatch && (!validExpression)) {
    return false;
  }
  return this.secondChild.extractValues(primaryKeyOnly,requireExactMatch,descriptor,primaryKeyRow,translationRow);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Extract the values from the expression into the row. Ensure that the query is querying the exact primary key. Return false if not on the primary key.
 */
@Override public boolean extractValues(boolean primaryKeyOnly,boolean requireExactMatch,ClassDescriptor descriptor,AbstractRecord primaryKeyRow,AbstractRecord translationRow){
  if (this.operator.getSelector() != ExpressionOperator.And) {
    if (requireExactMatch || (this.operator.getSelector() != ExpressionOperator.Or)) {
      return false;
    }
  }
  if (this.secondChild.getSession() == null && this.firstChild.getSession() != null) {
    this.secondChild.getBuilder().setSession(this.firstChild.getSession());
  }
 else   if (this.firstChild.getSession() == null && this.secondChild.getSession() != null) {
    this.firstChild.getBuilder().setSession(this.secondChild.getSession());
  }
  boolean validExpression=this.firstChild.extractValues(primaryKeyOnly,requireExactMatch,descriptor,primaryKeyRow,translationRow);
  if (requireExactMatch && (!validExpression)) {
    return false;
  }
  return this.secondChild.extractValues(primaryKeyOnly,requireExactMatch,descriptor,primaryKeyRow,translationRow);
}
Program: 63564
Project: 63564
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new JUnitJPQLParameterTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLParameterTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLParameterTestSuite("String_Node_Str"));
  if (!JUnitTestCase.isJPA10()) {
    suite.addTest(new JUnitJPQLParameterTestSuite("String_Node_Str"));
  }
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new JUnitJPQLParameterTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLParameterTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLParameterTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLParameterTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLParameterTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLParameterTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLParameterTestSuite("String_Node_Str"));
  if (!JUnitTestCase.isJPA10()) {
    suite.addTest(new JUnitJPQLParameterTestSuite("String_Node_Str"));
  }
  return suite;
}
Program: 63565
Project: 63565
Buggy source:
public void multipleParameterTest(){
  EntityManager em=createEntityManager();
  Employee employee=(Employee)(getServerSession().readAllObjects(Employee.class).firstElement());
  Vector expectedResult=new Vector();
  expectedResult.add(employee);
  Query query=em.createQuery("String_Node_Str");
  query.setParameter(1,employee.getFirstName());
  query.setParameter(3,employee.getId());
  List result=query.getResultList();
  Assert.assertTrue("String_Node_Str",comparer.compareObjects(result,expectedResult));
}

Fixed version (ground truth):
public void multipleParameterTest(){
  EntityManager em=createEntityManager();
  Employee employee=(Employee)(getServerSession().readAllObjects(Employee.class).firstElement());
  Vector expectedResult=new Vector();
  expectedResult.add(employee);
  Query query=em.createQuery("String_Node_Str");
  query.setParameter(1,employee.getFirstName());
  query.setParameter(3,employee.getId());
  List result=query.getResultList();
  assertTrue("String_Node_Str",comparer.compareObjects(result,expectedResult));
}
Program: 63567
Project: 63567
Buggy source:
/** 
 * This method encodes the given byte[] using the base64-encoding specified in RFC-2045 (Section 6.8).
 * @param data the data
 * @return the base64-encoded <var>data</var>
 */
public final static byte[] base64Encode(byte[] data){
  if (data == null) {
    return null;
  }
  int sidx;
  int didx;
  byte[] dest=new byte[((data.length + 2) / 3) * 4];
  for (sidx=0, didx=0; sidx < (data.length - 2); sidx+=3) {
    dest[didx++]=Base64EncMap[(data[sidx] >>> 2) & 077];
    dest[didx++]=Base64EncMap[((data[sidx + 1] >>> 4) & 017) | ((data[sidx] << 4) & 077)];
    dest[didx++]=Base64EncMap[((data[sidx + 2] >>> 6) & 003) | ((data[sidx + 1] << 2) & 077)];
    dest[didx++]=Base64EncMap[data[sidx + 2] & 077];
  }
  if (sidx < data.length) {
    dest[didx++]=Base64EncMap[(data[sidx] >>> 2) & 077];
    if (sidx < (data.length - 1)) {
      dest[didx++]=Base64EncMap[((data[sidx + 1] >>> 4) & 017) | ((data[sidx] << 4) & 077)];
      dest[didx++]=Base64EncMap[(data[sidx + 1] << 2) & 077];
    }
 else {
      dest[didx++]=Base64EncMap[(data[sidx] << 4) & 077];
    }
  }
  for (; didx < dest.length; didx++) {
    dest[didx]=(byte)'=';
  }
  return dest;
}

Fixed version (ground truth):
/** 
 * This method encodes the given byte[] using the base64-encoding specified in RFC-2045 (Section 6.8).
 * @param data the data
 * @return the base64-encoded <var>data</var>
 */
public static byte[] base64Encode(byte[] data){
  if (data == null) {
    return null;
  }
  int sidx;
  int didx;
  byte[] dest=new byte[((data.length + 2) / 3) * 4];
  for (sidx=0, didx=0; sidx < (data.length - 2); sidx+=3) {
    dest[didx++]=Base64EncMap[(data[sidx] >>> 2) & 077];
    dest[didx++]=Base64EncMap[((data[sidx + 1] >>> 4) & 017) | ((data[sidx] << 4) & 077)];
    dest[didx++]=Base64EncMap[((data[sidx + 2] >>> 6) & 003) | ((data[sidx + 1] << 2) & 077)];
    dest[didx++]=Base64EncMap[data[sidx + 2] & 077];
  }
  if (sidx < data.length) {
    dest[didx++]=Base64EncMap[(data[sidx] >>> 2) & 077];
    if (sidx < (data.length - 1)) {
      dest[didx++]=Base64EncMap[((data[sidx + 1] >>> 4) & 017) | ((data[sidx] << 4) & 077)];
      dest[didx++]=Base64EncMap[(data[sidx + 1] << 2) & 077];
    }
 else {
      dest[didx++]=Base64EncMap[(data[sidx] << 4) & 077];
    }
  }
  for (; didx < dest.length; didx++) {
    dest[didx]=(byte)'=';
  }
  return dest;
}
Program: 63568
Project: 63568
Buggy source:
/** 
 * Base64 constructor comment.
 */
public Base64(){
  super();
}

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

Fixed version (ground truth):
/** 
 * base64Binary data is likely to be long, and decoding requires each character to be accessed twice (once for counting length, another for decoding.) This method decodes the given byte[] using the base64-encoding specified in RFC-2045 (Section 6.8).
 * @param data the base64-encoded data.
 * @return the decoded <var>data</var>.
 */
public static byte[] base64Decode(byte[] data){
  final int buflen=guessLength(data);
  final byte[] out=new byte[buflen];
  int o=0;
  final int len=data.length;
  int i;
  final byte[] quadruplet=new byte[4];
  int q=0;
  for (i=0; i < len; i++) {
    byte ch=data[i];
    byte v=Base64DecMap[ch];
    if (v != -1)     quadruplet[q++]=v;
    if (q == 4) {
      out[o++]=(byte)((quadruplet[0] << 2) | (quadruplet[1] >> 4));
      if (quadruplet[2] != PADDING)       out[o++]=(byte)((quadruplet[1] << 4) | (quadruplet[2] >> 2));
      if (quadruplet[3] != PADDING)       out[o++]=(byte)((quadruplet[2] << 6) | (quadruplet[3]));
      q=0;
    }
  }
  if (buflen == o)   return out;
  byte[] nb=new byte[o];
  System.arraycopy(out,0,nb,0,o);
  return nb;
}
Program: 63570
Project: 63570
Buggy source:
TargetServerProp(){
  super(PersistenceUnitProperties.TARGET_SERVER,TargetServer.DEFAULT);
  this.shouldReturnOriginalValueIfValueToApplyNotFound=true;
  String pcg="String_Node_Str";
  valueArray=new Object[][]{{TargetServer.None,pcg + "String_Node_Str"},{TargetServer.OC4J,pcg + "String_Node_Str"},{TargetServer.SunAS9,pcg + "String_Node_Str"},{TargetServer.Glassfish,pcg + "String_Node_Str"},{TargetServer.WebSphere,pcg + "String_Node_Str"},{TargetServer.WebSphere_6_1,pcg + "String_Node_Str"},{TargetServer.WebSphere_7,pcg + "String_Node_Str"},{TargetServer.WebLogic,pcg + "String_Node_Str"},{TargetServer.WebLogic_9,pcg + "String_Node_Str"},{TargetServer.WebLogic_10,pcg + "String_Node_Str"},{TargetServer.JBoss,pcg + "String_Node_Str"},{TargetServer.SAPNetWeaver_7_1,pcg + "String_Node_Str"}};
}

Fixed version (ground truth):
TargetServerProp(){
  super(PersistenceUnitProperties.TARGET_SERVER,TargetServer.DEFAULT);
  this.shouldReturnOriginalValueIfValueToApplyNotFound=true;
  String pcg="String_Node_Str";
  valueArray=new Object[][]{{TargetServer.None,pcg + "String_Node_Str"},{TargetServer.OC4J,pcg + "String_Node_Str"},{TargetServer.SunAS9,pcg + "String_Node_Str"},{TargetServer.Glassfish,pcg + "String_Node_Str"},{TargetServer.WebSphere,pcg + "String_Node_Str"},{TargetServer.WebSphere_6_1,pcg + "String_Node_Str"},{TargetServer.WebSphere_7,pcg + "String_Node_Str"},{TargetServer.WebSphere_Liberty,pcg + "String_Node_Str"},{TargetServer.WebLogic,pcg + "String_Node_Str"},{TargetServer.WebLogic_9,pcg + "String_Node_Str"},{TargetServer.WebLogic_10,pcg + "String_Node_Str"},{TargetServer.JBoss,pcg + "String_Node_Str"},{TargetServer.SAPNetWeaver_7_1,pcg + "String_Node_Str"}};
}
Program: 63572
Project: 63572
Buggy source:
public ClassDescriptor buildServerPlatformConfigDescriptor(){
  XMLDescriptor descriptor=(XMLDescriptor)super.buildServerPlatformConfigDescriptor();
  descriptor.getInheritancePolicy().addClassIndicator(Oc4jPlatformConfig.class,"String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(SunAS9PlatformConfig.class,"String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(GlassfishPlatformConfig.class,"String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(WebLogic_9_PlatformConfig.class,"String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(WebLogic_10_PlatformConfig.class,"String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(WebSphere_6_1_PlatformConfig.class,"String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(WebSphere_7_0_PlatformConfig.class,"String_Node_Str");
  return descriptor;
}

Fixed version (ground truth):
public ClassDescriptor buildServerPlatformConfigDescriptor(){
  XMLDescriptor descriptor=(XMLDescriptor)super.buildServerPlatformConfigDescriptor();
  descriptor.getInheritancePolicy().addClassIndicator(Oc4jPlatformConfig.class,"String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(SunAS9PlatformConfig.class,"String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(GlassfishPlatformConfig.class,"String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(WebLogic_9_PlatformConfig.class,"String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(WebLogic_10_PlatformConfig.class,"String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(WebSphere_6_1_PlatformConfig.class,"String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(WebSphere_7_0_PlatformConfig.class,"String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(WebSphere_Liberty_Platform_Config.class,"String_Node_Str");
  return descriptor;
}
Program: 63573
Project: 63573
Buggy source:
/** 
 * INTERNAL: Obtain and return the JTA TransactionManager on this platform. This will be called once when the controller is initialized.
 */
protected TransactionManager acquireTransactionManager() throws Exception {
  if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
    try {
      Class clazz=(Class)AccessController.doPrivileged(new PrivilegedClassForName(TX_MANAGER_FACTORY_CLASS));
      Method method=AccessController.doPrivileged(new PrivilegedGetMethod(clazz,TX_MANAGER_FACTORY_METHOD,null,false));
      return (TransactionManager)AccessController.doPrivileged(new PrivilegedMethodInvoker(method,null,null));
    }
 catch (    PrivilegedActionException ex) {
      if (ex.getCause() instanceof ClassNotFoundException) {
        throw (ClassNotFoundException)ex.getCause();
      }
      if (ex.getCause() instanceof NoSuchMethodException) {
        throw (NoSuchMethodException)ex.getCause();
      }
      if (ex.getCause() instanceof IllegalAccessException) {
        throw (IllegalAccessException)ex.getCause();
      }
      if (ex.getCause() instanceof InvocationTargetException) {
        throw (InvocationTargetException)ex.getCause();
      }
      throw (RuntimeException)ex.getCause();
    }
  }
 else {
    Class clazz=PrivilegedAccessHelper.getClassForName(TX_MANAGER_FACTORY_CLASS);
    Method method=PrivilegedAccessHelper.getMethod(clazz,TX_MANAGER_FACTORY_METHOD,null,false);
    return (TransactionManager)PrivilegedAccessHelper.invokeMethod(method,null,null);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Obtain and return the JTA TransactionManager on this platform. This will be called once when the controller is initialized.
 */
protected TransactionManager acquireTransactionManager() throws Exception {
  if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
    try {
      Class clazz=(Class)AccessController.doPrivileged(new PrivilegedClassForName(getTxManagerFactoryClass()));
      Method method=AccessController.doPrivileged(new PrivilegedGetMethod(clazz,getTxManagerFactoryMethod(),null,false));
      return (TransactionManager)AccessController.doPrivileged(new PrivilegedMethodInvoker(method,null,null));
    }
 catch (    PrivilegedActionException ex) {
      if (ex.getCause() instanceof ClassNotFoundException) {
        throw (ClassNotFoundException)ex.getCause();
      }
      if (ex.getCause() instanceof NoSuchMethodException) {
        throw (NoSuchMethodException)ex.getCause();
      }
      if (ex.getCause() instanceof IllegalAccessException) {
        throw (IllegalAccessException)ex.getCause();
      }
      if (ex.getCause() instanceof InvocationTargetException) {
        throw (InvocationTargetException)ex.getCause();
      }
      throw (RuntimeException)ex.getCause();
    }
  }
 else {
    Class clazz=PrivilegedAccessHelper.getClassForName(getTxManagerFactoryClass());
    Method method=PrivilegedAccessHelper.getMethod(clazz,getTxManagerFactoryMethod(),null,false);
    return (TransactionManager)PrivilegedAccessHelper.invokeMethod(method,null,null);
  }
}
Program: 63575
Project: 63575
Buggy source:
private Object getValue(Object value,UnmarshalRecord unmarshalRecord){
  return converter.convertDataValueToObjectValue(value,unmarshalRecord.getSession(),unmarshalRecord.getUnmarshaller());
}

Fixed version (ground truth):
protected Object getValue(Object value,UnmarshalRecord unmarshalRecord){
  Object converted=converter.convertDataValueToObjectValue(value,unmarshalRecord.getSession(),unmarshalRecord.getUnmarshaller());
  if (converted instanceof JAXBElement<?>) {
    ((JAXBElement<?>)converted).setNil(unmarshalRecord.isNil());
  }
  return converted;
}
Program: 63577
Project: 63577
Buggy source:
private boolean marshalSingleValueWithNodeValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object value,CoreAbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext,NodeValue unwrappedNodeValue){
  Object fieldValue=value;
  if (value instanceof Root && !unwrappedNodeValue.isAnyMappingNodeValue()) {
    fieldValue=((Root)value).getObject();
  }
  if (unwrappedNodeValue != null) {
    unwrappedNodeValue.marshalSingleValue(xPathFragment,marshalRecord,object,fieldValue,session,namespaceResolver,marshalContext);
  }
  return true;
}

Fixed version (ground truth):
private boolean marshalSingleValueWithNodeValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object value,CoreAbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext,NodeValue unwrappedNodeValue){
  if (unwrappedNodeValue != null) {
    unwrappedNodeValue.marshalSingleValue(xPathFragment,marshalRecord,object,value,session,namespaceResolver,marshalContext);
  }
  return true;
}
Program: 63583
Project: 63583
Buggy source:
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  if (unmarshalRecord.isNil() && xmlCompositeObjectMapping.getNullPolicy().isNullRepresentedByXsiNil()) {
    unmarshalRecord.resetStringBuffer();
    return;
  }
  if (null == unmarshalRecord.getChildRecord()) {
    SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
    UnmarshalKeepAsElementPolicy keepAsElementPolicy=xmlCompositeObjectMapping.getKeepAsElementPolicy();
    if (null != keepAsElementPolicy && (keepAsElementPolicy.isKeepUnknownAsElement() || keepAsElementPolicy.isKeepAllAsElement()) && builder.getNodes().size() != 0) {
      if (unmarshalRecord.getTypeQName() != null) {
        Class theClass=unmarshalRecord.getConversionManager().javaType(unmarshalRecord.getTypeQName());
        if (theClass != null) {
          endElementProcessText(unmarshalRecord,xmlCompositeObjectMapping,xPathFragment,null);
          return;
        }
      }
      if (builder.getDocument() != null) {
        setOrAddAttributeValueForKeepAsElement(builder,xmlCompositeObjectMapping,xmlCompositeObjectMapping,unmarshalRecord,false,null);
        return;
      }
    }
 else {
      endElementProcessText(unmarshalRecord,xmlCompositeObjectMapping,xPathFragment,null);
      return;
    }
  }
 else {
    Object object=unmarshalRecord.getChildRecord().getCurrentObject();
    setAttributeValue(object,unmarshalRecord);
    unmarshalRecord.setChildRecord(null);
  }
}

Fixed version (ground truth):
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  if (unmarshalRecord.isNil() && xmlCompositeObjectMapping.getNullPolicy().isNullRepresentedByXsiNil() && (unmarshalRecord.getChildRecord() == null)) {
    unmarshalRecord.resetStringBuffer();
    return;
  }
  if (null == unmarshalRecord.getChildRecord()) {
    SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
    UnmarshalKeepAsElementPolicy keepAsElementPolicy=xmlCompositeObjectMapping.getKeepAsElementPolicy();
    if (null != keepAsElementPolicy && (keepAsElementPolicy.isKeepUnknownAsElement() || keepAsElementPolicy.isKeepAllAsElement()) && builder.getNodes().size() != 0) {
      if (unmarshalRecord.getTypeQName() != null) {
        Class theClass=unmarshalRecord.getConversionManager().javaType(unmarshalRecord.getTypeQName());
        if (theClass != null) {
          endElementProcessText(unmarshalRecord,xmlCompositeObjectMapping,xPathFragment,null);
          return;
        }
      }
      if (builder.getDocument() != null) {
        setOrAddAttributeValueForKeepAsElement(builder,xmlCompositeObjectMapping,xmlCompositeObjectMapping,unmarshalRecord,false,null);
        return;
      }
    }
 else {
      endElementProcessText(unmarshalRecord,xmlCompositeObjectMapping,xPathFragment,null);
      return;
    }
  }
 else {
    Object object=unmarshalRecord.getChildRecord().getCurrentObject();
    setAttributeValue(object,unmarshalRecord);
    unmarshalRecord.setChildRecord(null);
  }
}
Program: 63584
Project: 63584
Buggy source:
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  if (unmarshalRecord.isNil() && xmlDirectMapping.getNullPolicy().isNullRepresentedByXsiNil()) {
    unmarshalRecord.resetStringBuffer();
    return;
  }
  unmarshalRecord.removeNullCapableValue(this);
  Field xmlField=(Field)xmlDirectMapping.getField();
  if (!xmlField.getLastXPathFragment().nameIsText) {
    return;
  }
  Object value;
  CharSequence unmarshalRecordCharacters=unmarshalRecord.getCharacters();
  if (unmarshalRecordCharacters.length() == 0) {
    value=xmlDirectMapping.getNullValue();
  }
 else {
    value=unmarshalRecordCharacters.toString();
  }
  unmarshalRecord.resetStringBuffer();
  CoreAbstractSession session=unmarshalRecord.getSession();
  ConversionManager conversionManager=(ConversionManager)session.getDatasourcePlatform().getConversionManager();
  QName typeQName=unmarshalRecord.getTypeQName();
  if (typeQName != null) {
    Class typeClass=xmlField.getJavaClass(typeQName,conversionManager);
    value=conversionManager.convertObject(value,typeClass,typeQName);
  }
 else {
    value=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,conversionManager,unmarshalRecord);
  }
  Object convertedValue=xmlDirectMapping.getAttributeValue(value,session,unmarshalRecord);
  unmarshalRecord.setAttributeValue(convertedValue,xmlDirectMapping);
}

Fixed version (ground truth):
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  if (unmarshalRecord.isNil() && xmlDirectMapping.getNullPolicy().isNullRepresentedByXsiNil()) {
    Object convertedValue=xmlDirectMapping.getAttributeValue(org.eclipse.persistence.oxm.record.XMLRecord.NIL,unmarshalRecord.getSession(),unmarshalRecord);
    unmarshalRecord.setAttributeValue(convertedValue,xmlDirectMapping);
    unmarshalRecord.resetStringBuffer();
    return;
  }
  unmarshalRecord.removeNullCapableValue(this);
  Field xmlField=(Field)xmlDirectMapping.getField();
  if (!xmlField.getLastXPathFragment().nameIsText) {
    return;
  }
  Object value;
  CharSequence unmarshalRecordCharacters=unmarshalRecord.getCharacters();
  if (unmarshalRecordCharacters.length() == 0) {
    value=xmlDirectMapping.getNullValue();
  }
 else {
    value=unmarshalRecordCharacters.toString();
  }
  unmarshalRecord.resetStringBuffer();
  CoreAbstractSession session=unmarshalRecord.getSession();
  ConversionManager conversionManager=(ConversionManager)session.getDatasourcePlatform().getConversionManager();
  QName typeQName=unmarshalRecord.getTypeQName();
  if (typeQName != null) {
    Class typeClass=xmlField.getJavaClass(typeQName,conversionManager);
    value=conversionManager.convertObject(value,typeClass,typeQName);
  }
 else {
    value=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,conversionManager,unmarshalRecord);
  }
  Object convertedValue=xmlDirectMapping.getAttributeValue(value,session,unmarshalRecord);
  unmarshalRecord.setAttributeValue(convertedValue,xmlDirectMapping);
}
Program: 63586
Project: 63586
Buggy source:
/** 
 * Match vendorName in properties specified by _nameToVendorPlatform.
 */
private static String matchVendorNameInProperties(String vendorName,List<String[]> nameToVendorPlatform,SessionLog logger){
  String dbPlatform=null;
  for (Iterator<String[]> iterator=nameToVendorPlatform.iterator(); dbPlatform == null && iterator.hasNext(); ) {
    String[] entry=iterator.next();
    String regExpr=entry[0];
    String value=entry[1];
    if (logger.shouldLog(SessionLog.FINEST)) {
      logger.log(SessionLog.FINEST,"String_Node_Str",regExpr,value);
    }
    if (matchPattern(regExpr,vendorName,logger)) {
      dbPlatform=value;
    }
  }
  return dbPlatform;
}

Fixed version (ground truth):
/** 
 * Match vendorName in properties specified by _nameToVendorPlatform.
 */
private static String matchVendorNameInProperties(String vendorName,List<String[]> nameToVendorPlatform,SessionLog logger){
  String dbPlatform=null;
  for (Iterator<String[]> iterator=nameToVendorPlatform.iterator(); dbPlatform == null && iterator.hasNext(); ) {
    String[] entry=iterator.next();
    String regExpr=entry[0];
    String value=entry[1];
    if (logger.shouldLog(SessionLog.FINEST)) {
      logger.log(SessionLog.FINEST,SessionLog.CONNECTION,"String_Node_Str",regExpr,value);
    }
    if (matchPattern(regExpr,vendorName,logger)) {
      dbPlatform=value;
    }
  }
  return dbPlatform;
}
Program: 63587
Project: 63587
Buggy source:
/** 
 * INTERNAL: This method is used by the DatabaseAccessor to execute and clear the batched statements in the case that a non batchable statement is being executed
 */
public void executeBatchedStatements(AbstractSession session){
  if (this.sqlStrings.isEmpty()) {
    return;
  }
  if (this.sqlStrings.size() == 1) {
    try {
      int rowCount=(Integer)this.databaseAccessor.basicExecuteCall(this.lastCallAppended,null,session,false);
      if (this.usesOptimisticLocking) {
        if (rowCount != 1) {
          throw OptimisticLockException.batchStatementExecutionFailure();
        }
      }
    }
  finally {
      clear();
    }
    return;
  }
  try {
    this.databaseAccessor.writeStatementsCount++;
    this.databaseAccessor.incrementCallCount(session);
    if (session.shouldLog(SessionLog.FINE,SessionLog.SQL)) {
      session.log(SessionLog.FINER,SessionLog.SQL,"String_Node_Str",null,this.databaseAccessor);
      for (      String sql : this.sqlStrings) {
        session.log(SessionLog.FINE,SessionLog.SQL,sql,null,this.databaseAccessor,false);
      }
      session.log(SessionLog.FINER,SessionLog.SQL,"String_Node_Str",null,this.databaseAccessor);
    }
    if (!session.getPlatform().usesJDBCBatchWriting()) {
      PreparedStatement statement=prepareBatchStatement(session);
      this.databaseAccessor.executeBatchedStatement(statement,session);
    }
 else {
      Statement statement=prepareJDK12BatchStatement(session);
      this.executionCount=this.databaseAccessor.executeJDK12BatchStatement(statement,null,session,false);
      if (this.usesOptimisticLocking && (executionCount != statementCount)) {
        throw OptimisticLockException.batchStatementExecutionFailure();
      }
    }
  }
  finally {
    clear();
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: This method is used by the DatabaseAccessor to execute and clear the batched statements in the case that a non batchable statement is being executed
 */
public void executeBatchedStatements(AbstractSession session){
  if (this.sqlStrings.isEmpty()) {
    return;
  }
  DynamicSQLBatchWritingMechanism currentBatch=(DynamicSQLBatchWritingMechanism)this.clone();
  this.clear();
  currentBatch.executeBatch(session);
}