nus-yam/ex-repair huggingface dataset:
Program: 65691
Project: 65691
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(DynamicJAXBContextCreationTestCases.class);
  suite.addTestSuite(DynamicJAXBFromSessionsXMLTestCases.class);
  suite.addTestSuite(DynamicJAXBFromXSDTestCases.class);
  suite.addTestSuite(DynamicJAXBFromOXMTestCases.class);
  suite.addTestSuite(DynamicJAXBCollectionTestCases.class);
  suite.addTestSuite(DynamicJAXBUsingXMLNamesTestCases.class);
  suite.addTestSuite(DynamicJAXBRefreshTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(DynamicJAXBContextCreationTestCases.class);
  suite.addTestSuite(DynamicJAXBFromSessionsXMLTestCases.class);
  suite.addTestSuite(DynamicJAXBFromXSDTestCases.class);
  suite.addTestSuite(DynamicJAXBFromOXMTestCases.class);
  suite.addTestSuite(DynamicJAXBCollectionTestCases.class);
  suite.addTestSuite(DynamicJAXBUsingXMLNamesTestCases.class);
  suite.addTestSuite(DynamicJAXBRefreshTestCases.class);
  suite.addTestSuite(EmptyContextTestCases.class);
  return suite;
}
Program: 65694
Project: 65694
Buggy source:
public Object unmarshal(XMLReader xmlReader,InputSource inputSource,Class clazz){
  try {
    SAXDocumentBuilder saxDocumentBuilder=new SAXDocumentBuilder();
    xmlReader.setContentHandler(saxDocumentBuilder);
    xmlReader.parse(inputSource);
    return xmlToObject(new DOMRecord(saxDocumentBuilder.getDocument()),clazz);
  }
 catch (  IOException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
catch (  SAXException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
}

Fixed version (ground truth):
public Object unmarshal(XMLReader xmlReader,InputSource inputSource,Class clazz){
  try {
    SAXDocumentBuilder saxDocumentBuilder=new SAXDocumentBuilder();
    xmlReader.setContentHandler(saxDocumentBuilder);
    xmlReader.parse(inputSource);
    return xmlToObject(new DOMRecord(saxDocumentBuilder.getDocument()),clazz);
  }
 catch (  IOException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
catch (  SAXException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
 finally {
    xmlUnmarshaller.getStringBuffer().reset();
  }
}
Program: 65698
Project: 65698
Buggy source:
public void startCDATA(){
  if (xPathNode.getUnmarshalNodeValue() != null) {
    this.isBufferCDATA=true;
  }
}

Fixed version (ground truth):
public void startCDATA(){
  if (null != xPathNode && xPathNode.getUnmarshalNodeValue() != null) {
    this.isBufferCDATA=true;
  }
}
Program: 65700
Project: 65700
Buggy source:
/** 
 * INTERNAL:
 */
public void cdata(String value){
  try {
    if (isStartElementOpen) {
      isStartElementOpen=false;
      writer.write('>');
    }
    writer.write("String_Node_Str");
    writer.write(value);
    writer.write("String_Node_Str");
  }
 catch (  IOException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void cdata(String value){
  writeStringValueCharacters(value);
}
Program: 65702
Project: 65702
Buggy source:
public boolean isOwningNode(XPathFragment xPathFragment){
  return choiceElementNodeValue.isOwningNode(xPathFragment);
}

Fixed version (ground truth):
public boolean isOwningNode(XPathFragment xPathFragment){
  if (isMixedNodeValue) {
    if (xPathFragment.nameIsText()) {
      return true;
    }
 else {
      return false;
    }
  }
  return choiceElementNodeValue.isOwningNode(xPathFragment);
}
Program: 65704
Project: 65704
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlChoiceCollectionMapping.isReadOnly()) {
    return false;
  }
  Object value=xmlChoiceCollectionMapping.getAttributeValueFromObject(object);
  if (value == null) {
    return false;
  }
  ContainerPolicy cp=getContainerPolicy();
  Object iterator=cp.iteratorFor(value);
  if (cp.hasNext(iterator)) {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    return false;
  }
  while (cp.hasNext(iterator)) {
    Object nextValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,nextValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  return true;
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlChoiceCollectionMapping.isReadOnly()) {
    return false;
  }
  Object value=xmlChoiceCollectionMapping.getAttributeValueFromObject(object);
  if (value == null) {
    return false;
  }
  ContainerPolicy cp=getContainerPolicy();
  Object iterator=cp.iteratorFor(value);
  if (cp.hasNext(iterator)) {
    if (xPathFragment != null) {
      XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    }
  }
 else {
    return false;
  }
  while (cp.hasNext(iterator)) {
    Object nextValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,nextValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  return true;
}
Program: 65705
Project: 65705
Buggy source:
public boolean isOwningNode(XPathFragment xPathFragment){
  return choiceElementNodeValue.isOwningNode(xPathFragment);
}

Fixed version (ground truth):
public boolean isOwningNode(XPathFragment xPathFragment){
  if (isMixedNodeValue) {
    if (xPathFragment.nameIsText()) {
      return true;
    }
 else {
      return false;
    }
  }
  return choiceElementNodeValue.isOwningNode(xPathFragment);
}
Program: 65708
Project: 65708
Buggy source:
/** 
 * INTERNAL: To validate mappings declaration
 */
@Override public void validateBeforeInitialization(AbstractSession session) throws DescriptorException {
  super.validateBeforeInitialization(session);
  if ((this.indirectionPolicy instanceof WeavedObjectBasicIndirectionPolicy) && !ClassConstants.PersistenceWeavedLazy_Class.isAssignableFrom(getDescriptor().getJavaClass())) {
    WeavedObjectBasicIndirectionPolicy policy=(WeavedObjectBasicIndirectionPolicy)this.indirectionPolicy;
    Object[] args=new Object[2];
    args[0]=getAttributeName();
    args[1]=getDescriptor().getJavaClass();
    session.log(SessionLog.WARNING,SessionLog.EJB_OR_METADATA,"String_Node_Str",args);
    setIndirectionPolicy(new NoIndirectionPolicy());
  }
  if (getAttributeAccessor() instanceof InstanceVariableAttributeAccessor) {
    Class attributeType=((InstanceVariableAttributeAccessor)getAttributeAccessor()).getAttributeType();
    this.indirectionPolicy.validateDeclaredAttributeType(attributeType,session.getIntegrityChecker());
  }
 else   if (getAttributeAccessor().isMethodAttributeAccessor()) {
    Class returnType=((MethodAttributeAccessor)getAttributeAccessor()).getGetMethodReturnType();
    this.indirectionPolicy.validateGetMethodReturnType(returnType,session.getIntegrityChecker());
    Class parameterType=((MethodAttributeAccessor)getAttributeAccessor()).getSetMethodParameterType();
    this.indirectionPolicy.validateSetMethodParameterType(parameterType,session.getIntegrityChecker());
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: To validate mappings declaration
 */
@Override public void validateBeforeInitialization(AbstractSession session) throws DescriptorException {
  super.validateBeforeInitialization(session);
  if ((this.indirectionPolicy instanceof WeavedObjectBasicIndirectionPolicy) && !ClassConstants.PersistenceWeavedLazy_Class.isAssignableFrom(getDescriptor().getJavaClass())) {
    Object[] args=new Object[2];
    args[0]=getAttributeName();
    args[1]=getDescriptor().getJavaClass();
    session.log(SessionLog.WARNING,SessionLog.EJB_OR_METADATA,"String_Node_Str",args);
    setIndirectionPolicy(new NoIndirectionPolicy());
  }
  if (getAttributeAccessor() instanceof InstanceVariableAttributeAccessor) {
    Class attributeType=((InstanceVariableAttributeAccessor)getAttributeAccessor()).getAttributeType();
    this.indirectionPolicy.validateDeclaredAttributeType(attributeType,session.getIntegrityChecker());
  }
 else   if (getAttributeAccessor().isMethodAttributeAccessor()) {
    Class returnType=((MethodAttributeAccessor)getAttributeAccessor()).getGetMethodReturnType();
    this.indirectionPolicy.validateGetMethodReturnType(returnType,session.getIntegrityChecker());
    Class parameterType=((MethodAttributeAccessor)getAttributeAccessor()).getSetMethodParameterType();
    this.indirectionPolicy.validateSetMethodParameterType(parameterType,session.getIntegrityChecker());
  }
}
Program: 65709
Project: 65709
Buggy source:
private String getTypeValueToWrite(XMLRecord record,XMLSchemaReference xmlRef,boolean addToNamespaceResolver){
  String typeValue=xmlRef.getSchemaContext();
  if (typeValue == null) {
    QName contextAsQName=xmlRef.getSchemaContextAsQName();
    if (contextAsQName != null) {
      String uri=contextAsQName.getNamespaceURI();
      String localPart=contextAsQName.getLocalPart();
      String prefix=record.getNamespaceResolver().resolveNamespaceURI(uri);
      if (prefix == null) {
        String defaultUri=record.getNamespaceResolver().getDefaultNamespaceURI();
        if (defaultUri != null && defaultUri.equals(uri)) {
          return localPart;
        }
 else {
          prefix=record.getNamespaceResolver().generatePrefix();
          writeNamespace(record,prefix,uri,addToNamespaceResolver);
          return prefix + XMLConstants.COLON + localPart;
        }
      }
 else {
        return prefix + XMLConstants.COLON + localPart;
      }
    }
    return null;
  }
 else {
    return typeValue.substring(1);
  }
}

Fixed version (ground truth):
private String getTypeValueToWrite(XMLRecord record,XMLDescriptor descriptorToWrite,XMLSchemaReference xmlRef,boolean addToNamespaceResolver){
  String typeValue=xmlRef.getSchemaContext();
  if (typeValue == null) {
    QName contextAsQName=xmlRef.getSchemaContextAsQName();
    if (contextAsQName != null) {
      String uri=contextAsQName.getNamespaceURI();
      String localPart=contextAsQName.getLocalPart();
      String prefix=record.getNamespaceResolver().resolveNamespaceURI(uri);
      if (prefix == null) {
        String defaultUri=record.getNamespaceResolver().getDefaultNamespaceURI();
        if (defaultUri != null && defaultUri.equals(uri)) {
          return localPart;
        }
 else {
          prefix=record.getNamespaceResolver().generatePrefix();
          writeNamespace(record,prefix,uri,addToNamespaceResolver);
          return prefix + XMLConstants.COLON + localPart;
        }
      }
 else {
        return prefix + XMLConstants.COLON + localPart;
      }
    }
    return null;
  }
 else {
    return updateTypeValue(typeValue,descriptorToWrite.getNonNullNamespaceResolver(),record,addToNamespaceResolver);
  }
}
Program: 65711
Project: 65711
Buggy source:
/** 
 * INTERNAL: Ensure the container policy is post initialized
 */
@Override public void postInitialize(AbstractSession session){
  super.postInitialize(session);
  this.containerPolicy.postInitialize(session);
  if (this.referenceDescriptor != null && this.mustDeleteReferenceObjectsOneByOne == null) {
    this.mustDeleteReferenceObjectsOneByOne=this.referenceDescriptor.hasDependencyOnParts() || this.referenceDescriptor.usesOptimisticLocking() || (this.referenceDescriptor.hasInheritance() && this.referenceDescriptor.getInheritancePolicy().shouldReadSubclasses())|| this.referenceDescriptor.hasMultipleTables()|| this.containerPolicy.propagatesEventsToCollection()|| this.referenceDescriptor.hasRelationshipsExceptBackpointer(descriptor);
  }
 else {
    this.mustDeleteReferenceObjectsOneByOne=false;
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Ensure the container policy is post initialized
 */
@Override public void postInitialize(AbstractSession session){
  super.postInitialize(session);
  this.containerPolicy.postInitialize(session);
  if (this.referenceDescriptor != null && this.mustDeleteReferenceObjectsOneByOne == null) {
    this.mustDeleteReferenceObjectsOneByOne=this.referenceDescriptor.hasDependencyOnParts() || this.referenceDescriptor.usesOptimisticLocking() || (this.referenceDescriptor.hasInheritance() && this.referenceDescriptor.getInheritancePolicy().shouldReadSubclasses())|| this.referenceDescriptor.hasMultipleTables()|| this.containerPolicy.propagatesEventsToCollection()|| this.referenceDescriptor.hasRelationshipsExceptBackpointer(descriptor);
  }
 else   if (this.mustDeleteReferenceObjectsOneByOne == null) {
    this.mustDeleteReferenceObjectsOneByOne=false;
  }
}
Program: 65713
Project: 65713
Buggy source:
public JSONAttributes setTree(Tree tree){
  reset();
  this.tree=tree;
  return this;
}

Fixed version (ground truth):
public JSONAttributes setTree(Tree tree,String attributePrefix){
  reset();
  this.tree=tree;
  this.attributePrefix=attributePrefix;
  return this;
}
Program: 65714
Project: 65714
Buggy source:
private void parseRoot(Tree tree) throws SAXException {
  if (tree.getType() == JSONLexer.OBJECT) {
    int children=tree.getChildCount();
    if (children == 1) {
      parse((CommonTree)tree.getChild(0));
    }
 else {
      contentHandler.startElement("String_Node_Str","String_Node_Str",null,attributes.setTree(tree));
      for (int x=0, size=tree.getChildCount(); x < size; x++) {
        parse((CommonTree)tree.getChild(x));
      }
      contentHandler.endElement("String_Node_Str","String_Node_Str",null);
    }
  }
}

Fixed version (ground truth):
private void parseRoot(Tree tree) throws SAXException {
  if (tree.getType() == JSONLexer.OBJECT) {
    int children=tree.getChildCount();
    if (children == 1) {
      parse((CommonTree)tree.getChild(0));
    }
 else {
      contentHandler.startElement("String_Node_Str","String_Node_Str",null,attributes.setTree(tree,attributePrefix));
      for (int x=0, size=tree.getChildCount(); x < size; x++) {
        parse((CommonTree)tree.getChild(x));
      }
      contentHandler.endElement("String_Node_Str","String_Node_Str",null);
    }
  }
}
Program: 65717
Project: 65717
Buggy source:
/** 
 * INTERNAL:
 */
public void openStartElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  try {
    Level position=null;
    if (levels.isEmpty()) {
      levels.push(new Level(true));
    }
 else {
      position=levels.peek();
      levels.push(new Level(true));
      if (position.isFirst()) {
        position.setFirst(false);
      }
 else {
        writer.write(',');
      }
    }
    this.addPositionalNodes(xPathFragment,namespaceResolver);
    if (!isLastEventText) {
      if (numberOfTabs > 0) {
        writer.write(Helper.cr());
      }
      for (int x=0; x < numberOfTabs; x++) {
        writer.write(TAB);
      }
    }
    if (position == null || !position.isCollection() || position.isEmptyCollection()) {
      isStartElementOpen=true;
      writer.write('"');
      writer.write(xPathFragment.getLocalName());
      writer.write("String_Node_Str");
      if (position != null && position.isCollection()) {
        writer.write('[');
      }
      if (position != null && position.isEmptyCollection()) {
        position.setEmptyCollection(false);
      }
    }
    XPathFragment next=xPathFragment.getNextFragment();
    if (!(xPathFragment.isAttribute() || xPathFragment.nameIsText() || (next != null && next.nameIsText()))) {
      writer.write('{');
    }
    numberOfTabs++;
    isLastEventText=false;
  }
 catch (  IOException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void openStartElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  try {
    Level position=null;
    if (levels.isEmpty()) {
      levels.push(new Level(true));
    }
 else {
      position=levels.peek();
      levels.push(new Level(true));
      if (position.isFirst()) {
        position.setFirst(false);
      }
 else {
        writer.write(',');
      }
    }
    this.addPositionalNodes(xPathFragment,namespaceResolver);
    if (!isLastEventText) {
      if (numberOfTabs > 0) {
        writer.write(Helper.cr());
      }
      for (int x=0; x < numberOfTabs; x++) {
        writer.write(TAB);
      }
    }
    if (position == null || !position.isCollection() || position.isEmptyCollection()) {
      isStartElementOpen=true;
      writer.write('"');
      if (xPathFragment.isAttribute() && attributePrefix != null) {
        writer.write(attributePrefix);
      }
      writer.write(xPathFragment.getLocalName());
      writer.write("String_Node_Str");
      if (position != null && position.isCollection()) {
        writer.write('[');
      }
      if (position != null && position.isEmptyCollection()) {
        position.setEmptyCollection(false);
      }
    }
    XPathFragment next=xPathFragment.getNextFragment();
    if (!(xPathFragment.isAttribute() || xPathFragment.nameIsText() || (next != null && next.nameIsText()))) {
      writer.write('{');
    }
    numberOfTabs++;
    isLastEventText=false;
  }
 catch (  IOException e) {
    throw XMLMarshalException.marshalException(e);
  }
}
Program: 65718
Project: 65718
Buggy source:
/** 
 * INTERNAL:
 */
private void openStartElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver,boolean addOpenBrace){
  try {
    Level position=null;
    if (levels.isEmpty()) {
      levels.push(new Level(true));
    }
 else {
      position=levels.peek();
      levels.push(new Level(true));
      if (position.isFirst()) {
        position.setFirst(false);
      }
 else {
        writer.write(',');
        writer.write(' ');
      }
    }
    if (position == null || !position.isCollection() || position.isEmptyCollection()) {
      super.openStartElement(xPathFragment,namespaceResolver);
      isStartElementOpen=true;
      writer.write('"');
      writer.write(xPathFragment.getLocalName());
      writer.write("String_Node_Str");
      if ((xPathFragment.getNextFragment() == null || xPathFragment.getNextFragment().nameIsText()) && position != null && position.isCollection()) {
        writer.write('[');
      }
      if (position != null && position.isEmptyCollection()) {
        position.setEmptyCollection(false);
      }
    }
    if (addOpenBrace) {
      XPathFragment next=xPathFragment.getNextFragment();
      if (!(xPathFragment.isAttribute() || xPathFragment.nameIsText() || (next != null && next.nameIsText()))) {
        writer.write('{');
      }
    }
  }
 catch (  IOException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
private void openStartElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver,boolean addOpenBrace){
  try {
    Level position=null;
    if (levels.isEmpty()) {
      levels.push(new Level(true));
    }
 else {
      position=levels.peek();
      levels.push(new Level(true));
      if (position.isFirst()) {
        position.setFirst(false);
      }
 else {
        writer.write(',');
        writer.write(' ');
      }
    }
    if (position == null || !position.isCollection() || position.isEmptyCollection()) {
      super.openStartElement(xPathFragment,namespaceResolver);
      isStartElementOpen=true;
      writer.write('"');
      if (xPathFragment.isAttribute() && attributePrefix != null) {
        writer.write(attributePrefix);
      }
      writer.write(xPathFragment.getLocalName());
      writer.write("String_Node_Str");
      if ((xPathFragment.getNextFragment() == null || xPathFragment.getNextFragment().nameIsText()) && position != null && position.isCollection()) {
        writer.write('[');
      }
      if (position != null && position.isEmptyCollection()) {
        position.setEmptyCollection(false);
      }
    }
    if (addOpenBrace) {
      XPathFragment next=xPathFragment.getNextFragment();
      if (!(xPathFragment.isAttribute() || xPathFragment.nameIsText() || (next != null && next.nameIsText()))) {
        writer.write('{');
      }
    }
  }
 catch (  IOException e) {
    throw XMLMarshalException.marshalException(e);
  }
}
Program: 65719
Project: 65719
Buggy source:
public void attribute(XPathFragment xPathFragment,NamespaceResolver namespaceResolver,Object value,QName schemaType){
  if (xPathFragment.getNamespaceURI() != null && xPathFragment.getNamespaceURI() == XMLConstants.XMLNS_URL) {
    return;
  }
  openStartElement(xPathFragment,namespaceResolver);
  characters(schemaType,value,false);
  endElement(xPathFragment,namespaceResolver);
}

Fixed version (ground truth):
public void attribute(XPathFragment xPathFragment,NamespaceResolver namespaceResolver,Object value,QName schemaType){
  if (xPathFragment.getNamespaceURI() != null && xPathFragment.getNamespaceURI() == XMLConstants.XMLNS_URL) {
    return;
  }
  xPathFragment.setAttribute(true);
  openStartElement(xPathFragment,namespaceResolver);
  characters(schemaType,value,false);
  endElement(xPathFragment,namespaceResolver);
}
Program: 65720
Project: 65720
Buggy source:
/** 
 * INTERNAL: Subclasses that need to add field to an expresison should override this method.
 */
@Override public void postInitialize(AbstractSession session){
  if (includeTenantCriteria) {
    Expression expression=getDescriptor().getQueryManager().getAdditionalJoinExpression();
    ExpressionBuilder builder=(expression == null) ? new ExpressionBuilder() : expression.getBuilder();
    for (    DatabaseField discriminatorField : tenantDiscriminatorFields.keySet()) {
      String property=tenantDiscriminatorFields.get(discriminatorField);
      DatabaseField newField=new DatabaseField();
      newField.setName(property,session.getPlatform());
      Expression tenantIdExpression=builder.and(builder.getField(discriminatorField).equal(builder.getProperty(newField)));
      if (expression == null) {
        expression=tenantIdExpression;
      }
 else {
        expression=expression.and(tenantIdExpression);
      }
    }
    getDescriptor().getQueryManager().setAdditionalJoinExpression(expression);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Subclasses that need to add field to an expresison should override this method.
 */
public void postInitialize(AbstractSession session){
  if (includeTenantCriteria) {
    Expression expression=getDescriptor().getQueryManager().getAdditionalJoinExpression();
    ExpressionBuilder builder=(expression == null) ? new ExpressionBuilder() : expression.getBuilder();
    for (    DatabaseField discriminatorField : tenantDiscriminatorFields.keySet()) {
      String property=tenantDiscriminatorFields.get(discriminatorField);
      DatabaseField newField=new DatabaseField();
      newField.setName(property,session.getPlatform());
      Expression tenantIdExpression=builder.and(builder.getField(discriminatorField).equal(builder.getProperty(newField)));
      if (expression == null) {
        expression=tenantIdExpression;
      }
 else {
        expression=expression.and(tenantIdExpression);
      }
    }
    getDescriptor().getQueryManager().setAdditionalJoinExpression(expression);
  }
}
Program: 65721
Project: 65721
Buggy source:
/** 
 * INTERNAL:
 */
@Override public void addToTableDefinition(TableDefinition tableDefinition){
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void addToTableDefinition(TableDefinition tableDefinition){
}
Program: 65722
Project: 65722
Buggy source:
/** 
 * INTERNAL: Allow the descriptor to initialize any dependencies on this session.
 */
@Override public void preInitialize(AbstractSession session) throws DescriptorException {
  for (  DatabaseField discriminatorField : tenantDiscriminatorFields.keySet()) {
    getDescriptor().getFields().add(getDescriptor().buildField(discriminatorField));
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Allow the descriptor to initialize any dependencies on this session.
 */
public void preInitialize(AbstractSession session) throws DescriptorException {
  for (  DatabaseField discriminatorField : tenantDiscriminatorFields.keySet()) {
    getDescriptor().getFields().add(getDescriptor().buildField(discriminatorField));
  }
}
Program: 65723
Project: 65723
Buggy source:
/** 
 * INTERNAL:
 */
@Override public MultitenantPolicy clone(ClassDescriptor descriptor){
  SingleTableMultitenantPolicy clonedPolicy=new SingleTableMultitenantPolicy(descriptor);
  clonedPolicy.includeTenantCriteria=includeTenantCriteria;
  clonedPolicy.tenantDiscriminatorFields=tenantDiscriminatorFields;
  return clonedPolicy;
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public MultitenantPolicy clone(ClassDescriptor descriptor){
  SingleTableMultitenantPolicy clonedPolicy=new SingleTableMultitenantPolicy(descriptor);
  clonedPolicy.includeTenantCriteria=includeTenantCriteria;
  clonedPolicy.tenantDiscriminatorFields=tenantDiscriminatorFields;
  return clonedPolicy;
}
Program: 65724
Project: 65724
Buggy source:
/** 
 * INTERNAL: Initialize the mappings as a separate step. This is done as a separate step to ensure that inheritance has been first resolved.
 */
@Override public void initialize(AbstractSession session) throws DescriptorException {
  if (hasTenantDiscriminatorFields()) {
    for (    DatabaseField discriminatorField : tenantDiscriminatorFields.keySet()) {
      DatabaseMapping mapping=getDescriptor().getObjectBuilder().getMappingForField(discriminatorField);
      if (mapping != null && !mapping.isReadOnly()) {
        throw ValidationException.nonReadOnlyMappedTenantDiscriminatorField(getDescriptor().getJavaClassName(),discriminatorField.getQualifiedName());
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Initialize the mappings as a separate step. This is done as a separate step to ensure that inheritance has been first resolved.
 */
public void initialize(AbstractSession session) throws DescriptorException {
  if (hasTenantDiscriminatorFields()) {
    for (    DatabaseField discriminatorField : tenantDiscriminatorFields.keySet()) {
      DatabaseMapping mapping=getDescriptor().getObjectBuilder().getMappingForField(discriminatorField);
      if (mapping != null && !mapping.isReadOnly()) {
        throw ValidationException.nonReadOnlyMappedTenantDiscriminatorField(getDescriptor().getJavaClassName(),discriminatorField.getQualifiedName());
      }
    }
  }
}
Program: 65725
Project: 65725
Buggy source:
public JSONAttributes setTree(Tree tree,String attributePrefix){
  reset();
  this.tree=tree;
  this.attributePrefix=attributePrefix;
  return this;
}

Fixed version (ground truth):
public JSONAttributes setTree(Tree tree,String attributePrefix,NamespaceResolver nr,String namespaceSeperator,boolean namespaceAware){
  reset();
  this.tree=tree;
  this.attributePrefix=attributePrefix;
  this.namespaces=nr;
  this.namespaceSeperator=namespaceSeperator;
  this.namespaceAware=namespaceAware;
  return this;
}
Program: 65726
Project: 65726
Buggy source:
private void parseRoot(Tree tree) throws SAXException {
  if (tree.getType() == JSONLexer.OBJECT) {
    int children=tree.getChildCount();
    if (children == 1) {
      parse((CommonTree)tree.getChild(0));
    }
 else {
      contentHandler.startElement("String_Node_Str","String_Node_Str",null,attributes.setTree(tree,attributePrefix));
      for (int x=0, size=tree.getChildCount(); x < size; x++) {
        parse((CommonTree)tree.getChild(x));
      }
      contentHandler.endElement("String_Node_Str","String_Node_Str",null);
    }
  }
}

Fixed version (ground truth):
private void parseRoot(Tree tree) throws SAXException {
  if (tree.getType() == JSONLexer.OBJECT) {
    int children=tree.getChildCount();
    if (children == 1) {
      parse((CommonTree)tree.getChild(0));
    }
 else {
      contentHandler.startElement(XMLConstants.EMPTY_STRING,XMLConstants.EMPTY_STRING,null,attributes.setTree(tree,attributePrefix,namespaces,namespaceSeperator,namespaceAware));
      for (int x=0, size=tree.getChildCount(); x < size; x++) {
        parse((CommonTree)tree.getChild(x));
      }
      contentHandler.endElement(XMLConstants.EMPTY_STRING,XMLConstants.EMPTY_STRING,null);
    }
  }
}
Program: 65729
Project: 65729
Buggy source:
public JSONReader(Properties props){
  if (props != null) {
    attributePrefix=props.getProperty("String_Node_Str");
    if (attributePrefix == "String_Node_Str") {
      attributePrefix=null;
    }
  }
}

Fixed version (ground truth):
public JSONReader(String attrPrefix,NamespaceResolver nr,boolean namespaceAware){
  this.attributePrefix=attrPrefix;
  if (attributePrefix == XMLConstants.EMPTY_STRING) {
    attributePrefix=null;
  }
  namespaces=nr;
  this.namespaceAware=namespaceAware;
}
Program: 65730
Project: 65730
Buggy source:
/** 
 * Set the MediaType for this xmlMarshaller. See org.eclipse.persistence.oxm.MediaType for the media types supported by EclipseLink MOXy
 * @param mediaType
 */
public void setMediaType(MediaType mediaType){
  this.mediaType=mediaType;
}

Fixed version (ground truth):
/** 
 * Set the MediaType for this xmlMarshaller. See org.eclipse.persistence.oxm.MediaType for the media types supported by EclipseLink MOXy
 * @param mediaType
 */
public void setMediaType(MediaType mediaType){
  this.mediaType=mediaType;
  namespaceAware=(mediaType == MediaType.APPLICATION_XML || namespaceResolver != null);
}
Program: 65731
Project: 65731
Buggy source:
private void initialize(){
  XMLPlatform xmlPlatform=XMLPlatformFactory.getInstance().getXMLPlatform();
  transformer=xmlPlatform.newXMLTransformer();
  setEncoding(XMLConstants.DEFAULT_XML_ENCODING);
  setFormattedOutput(true);
  marshalProperties=new Properties();
}

Fixed version (ground truth):
private void initialize(){
  XMLPlatform xmlPlatform=XMLPlatformFactory.getInstance().getXMLPlatform();
  transformer=xmlPlatform.newXMLTransformer();
  setEncoding(XMLConstants.DEFAULT_XML_ENCODING);
  setFormattedOutput(true);
  marshalProperties=new Properties();
  namespaceAware=(mediaType == MediaType.APPLICATION_XML);
}
Program: 65732
Project: 65732
Buggy source:
protected XMLUnmarshaller(XMLContext xmlContext,Map<String,Boolean> parserFeatures){
  setXMLContext(xmlContext);
  stringBuffer=new StrBuffer();
  initialize(parserFeatures);
}

Fixed version (ground truth):
protected XMLUnmarshaller(XMLContext xmlContext,Map<String,Boolean> parserFeatures){
  setXMLContext(xmlContext);
  stringBuffer=new StrBuffer();
  initialize(parserFeatures);
  namespaceAware=(mediaType == MediaType.APPLICATION_XML);
}
Program: 65733
Project: 65733
Buggy source:
/** 
 * Namespaces will be ignored during unmarshal operations when this method returns false.
 * @return if this unmarshaller should process namespace information
 */
public boolean isNamespaceAware(){
  return mediaType == MediaType.APPLICATION_XML;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Namespaces will be ignored during unmarshal operations when this method returns false.
 * @return if this unmarshaller should process namespace information
 */
public boolean isNamespaceAware(){
  return namespaceAware;
}
Program: 65736
Project: 65736
Buggy source:
public void attribute(XPathFragment xPathFragment,NamespaceResolver namespaceResolver,Object value,QName schemaType){
  if (xPathFragment.getNamespaceURI() != null && xPathFragment.getNamespaceURI() == XMLConstants.XMLNS_URL) {
    return;
  }
  xPathFragment.setAttribute(true);
  openStartElement(xPathFragment,namespaceResolver);
  characters(schemaType,value,false);
  endElement(xPathFragment,namespaceResolver);
}

Fixed version (ground truth):
public void attribute(XPathFragment xPathFragment,NamespaceResolver namespaceResolver,Object value,QName schemaType){
  if (xPathFragment.getNamespaceURI() != null && xPathFragment.getNamespaceURI() == XMLConstants.XMLNS_URL) {
    return;
  }
  xPathFragment.setAttribute(true);
  xPathFragment.setAttribute(true);
  openStartElement(xPathFragment,namespaceResolver);
  characters(schemaType,value,false);
  endElement(xPathFragment,namespaceResolver);
}
Program: 65737
Project: 65737
Buggy source:
/** 
 * INTERNAL:
 */
public void setMarshaller(XMLMarshaller marshaller){
  super.setMarshaller(marshaller);
  attributePrefix=(String)marshaller.getProperty("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void setMarshaller(XMLMarshaller marshaller){
  super.setMarshaller(marshaller);
  attributePrefix=marshaller.getAttributePrefix();
  namespaces=marshaller.getNamespaceResolver();
  namespaceAware=marshaller.isNamespaceAware();
}
Program: 65739
Project: 65739
Buggy source:
/** 
 * INTERNAL: Allow the descriptor to initialize any dependencies on this session.
 */
public void preInitialize(AbstractSession session) throws DescriptorException {
  if (isInitialized(PREINITIALIZED)) {
    return;
  }
  setInitializationStage(PREINITIALIZED);
  for (Enumeration mappingsEnum=getMappings().elements(); mappingsEnum.hasMoreElements(); ) {
    try {
      DatabaseMapping mapping=(DatabaseMapping)mappingsEnum.nextElement();
      mapping.preInitialize(session);
    }
 catch (    DescriptorException exception) {
      session.getIntegrityChecker().handleError(exception);
    }
  }
  validateBeforeInitialization(session);
  preInitializeInheritancePolicy(session);
  if (hasInheritance()) {
    getInheritancePolicy().preInitialize(session);
  }
 else {
    setInternalDefaultTable();
  }
  verifyTableQualifiers(session.getDatasourcePlatform());
  initializeProperties(session);
  if (hasInterfacePolicy()) {
    preInterfaceInitialization(session);
  }
  getCachePolicy().assignDefaultValues(session);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Allow the descriptor to initialize any dependencies on this session.
 */
public void preInitialize(AbstractSession session) throws DescriptorException {
  if (isInitialized(PREINITIALIZED)) {
    return;
  }
  setInitializationStage(PREINITIALIZED);
  for (Enumeration mappingsEnum=getMappings().elements(); mappingsEnum.hasMoreElements(); ) {
    try {
      DatabaseMapping mapping=(DatabaseMapping)mappingsEnum.nextElement();
      mapping.preInitialize(session);
    }
 catch (    DescriptorException exception) {
      session.getIntegrityChecker().handleError(exception);
    }
  }
  validateBeforeInitialization(session);
  preInitializeInheritancePolicy(session);
  verifyTableQualifiers(session.getDatasourcePlatform());
  initializeProperties(session);
  if (hasInterfacePolicy()) {
    preInterfaceInitialization(session);
  }
  getCachePolicy().assignDefaultValues(session);
}
Program: 65742
Project: 65742
Buggy source:
@Test public void testRemoveNew() throws SQLException {
  final JPAEnvironment env=getEnvironment();
  final EntityManager em=env.getEntityManager();
  try {
    Department dep=new Department(1,"String_Node_Str");
    env.beginTransaction(em);
    em.remove(dep);
    env.commitTransactionAndClear(em);
    verifyAbsenceOnDatabase(1);
  }
  finally {
    closeEntityManager(em);
  }
}

Fixed version (ground truth):
@Test public void testRemoveNew() throws SQLException {
  final JPAEnvironment env=getEnvironment();
  final EntityManager em=env.getEntityManager();
  env.evictAll(em);
  try {
    Department dep=new Department(1,"String_Node_Str");
    env.beginTransaction(em);
    em.remove(dep);
    env.commitTransactionAndClear(em);
    verifyAbsenceOnDatabase(1);
  }
  finally {
    closeEntityManager(em);
  }
}
Program: 65743
Project: 65743
Buggy source:
private void collectDeclarationIdentificationVariables(Map<String,List<IdentificationVariable>> identificationVariables){
  for (  Declaration declaration : queryContext.getDeclarations()) {
    IdentificationVariable identificationVariable=declaration.identificationVariable;
    addIdentificationVariable(identificationVariable,identificationVariables);
    for (    IdentificationVariable joinIdentificationVariable : declaration.joins.values()) {
      addIdentificationVariable(joinIdentificationVariable,identificationVariables);
    }
  }
}

Fixed version (ground truth):
private void collectDeclarationIdentificationVariables(JPQLQueryContext queryContext,Map<String,List<IdentificationVariable>> identificationVariables){
  for (  Declaration declaration : queryContext.getActualDeclarationResolver().getDeclarations()) {
    IdentificationVariable identificationVariable=declaration.identificationVariable;
    addIdentificationVariable(identificationVariable,identificationVariables);
    for (    IdentificationVariable joinIdentificationVariable : declaration.joins.values()) {
      addIdentificationVariable(joinIdentificationVariable,identificationVariables);
    }
  }
}
Program: 65744
Project: 65744
Buggy source:
private void validateIdentificationVariables(){
  Map<String,List<IdentificationVariable>> identificationVariables=new HashMap<String,List<IdentificationVariable>>();
  collectDeclarationIdentificationVariables(identificationVariables);
  for (  Map.Entry<String,List<IdentificationVariable>> entry : identificationVariables.entrySet()) {
    List<IdentificationVariable> variables=entry.getValue();
    if (variables.size() > 1) {
      for (      IdentificationVariable variable : variables) {
        addProblem(variable,IdentificationVariable_Invalid_Duplicate,variable.getText());
      }
    }
  }
  for (  IdentificationVariable identificationVariable : usedIdentificationVariables) {
    String variableName=identificationVariable.getText();
    if (ExpressionTools.stringIsNotEmpty(variableName) && !identificationVariables.containsKey(variableName.toUpperCase())) {
      addProblem(identificationVariable,IdentificationVariable_Invalid_NotDeclared,variableName);
    }
  }
}

Fixed version (ground truth):
private void validateIdentificationVariables(){
  Map<String,List<IdentificationVariable>> identificationVariables=new HashMap<String,List<IdentificationVariable>>();
  collectDeclarationIdentificationVariables(queryContext.getCurrentContext(),identificationVariables);
  for (  Map.Entry<String,List<IdentificationVariable>> entry : identificationVariables.entrySet()) {
    List<IdentificationVariable> variables=entry.getValue();
    if (variables.size() > 1) {
      for (      IdentificationVariable variable : variables) {
        addProblem(variable,IdentificationVariable_Invalid_Duplicate,variable.getText());
      }
    }
  }
  identificationVariables.clear();
  collectAllDeclarationIdentificationVariables(identificationVariables);
  for (  IdentificationVariable identificationVariable : usedIdentificationVariables) {
    String variableName=identificationVariable.getText();
    if (ExpressionTools.stringIsNotEmpty(variableName) && !identificationVariables.containsKey(variableName.toUpperCase())) {
      addProblem(identificationVariable,IdentificationVariable_Invalid_NotDeclared,variableName);
    }
  }
}
Program: 65745
Project: 65745
Buggy source:
public void endElement(String namespaceURI,String localName,String qName) throws SAXException {
  if (super.nodes.size() == 2) {
    Element endedElement=(Element)nodes.get(nodes.size() - 1);
    if (stringBuffer.length() > 0) {
      Text text=getInitializedDocument().createTextNode(stringBuffer.toString());
      endedElement.appendChild(text);
      stringBuffer.reset();
    }
    owningRecord.getXMLReader().setContentHandler(owningRecord);
    owningRecord.endElement(namespaceURI,localName,qName);
  }
 else {
    super.endElement(namespaceURI,localName,qName);
  }
}

Fixed version (ground truth):
public void endElement(String namespaceURI,String localName,String qName) throws SAXException {
  if (super.nodes.size() == 2) {
    Element endedElement=(Element)nodes.get(nodes.size() - 1);
    if (stringBuffer.length() > 0) {
      Text text=getInitializedDocument().createTextNode(stringBuffer.toString());
      endedElement.appendChild(text);
      stringBuffer.reset();
      processNamespacesForText(text.getTextContent(),endedElement);
    }
    owningRecord.getXMLReader().setContentHandler(owningRecord);
    owningRecord.endElement(namespaceURI,localName,qName);
  }
 else {
    super.endElement(namespaceURI,localName,qName);
  }
}
Program: 65747
Project: 65747
Buggy source:
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  builder.setOwningRecord(unmarshalRecord);
  try {
    String namespaceURI=XMLConstants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + XMLConstants.COLON + qName;
    }
    builder.startElement(namespaceURI,xPathFragment.getLocalName(),qName,atts);
    XMLReader xmlReader=unmarshalRecord.getXMLReader();
    xmlReader.setContentHandler(builder);
    xmlReader.setLexicalHandler(null);
  }
 catch (  SAXException ex) {
  }
  return true;
}

Fixed version (ground truth):
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  builder.setOwningRecord(unmarshalRecord);
  try {
    String namespaceURI=XMLConstants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + XMLConstants.COLON + qName;
    }
    if (!(unmarshalRecord.getPrefixesForFragment().isEmpty())) {
      for (      Entry<String,String> next : 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) {
  }
  return true;
}
Program: 65748
Project: 65748
Buggy source:
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  unmarshalRecord.removeNullCapableValue(this);
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  builder.setOwningRecord(unmarshalRecord);
  try {
    String namespaceURI=XMLConstants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + XMLConstants.COLON + qName;
    }
    builder.startElement(namespaceURI,xPathFragment.getLocalName(),qName,atts);
    XMLReader xmlReader=unmarshalRecord.getXMLReader();
    xmlReader.setContentHandler(builder);
    xmlReader.setLexicalHandler(null);
  }
 catch (  SAXException ex) {
  }
  return true;
}

Fixed version (ground truth):
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  unmarshalRecord.removeNullCapableValue(this);
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  builder.setOwningRecord(unmarshalRecord);
  try {
    String namespaceURI=XMLConstants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + XMLConstants.COLON + qName;
    }
    if (!(unmarshalRecord.getPrefixesForFragment().isEmpty())) {
      for (      Entry<String,String> next : 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) {
  }
  return true;
}
Program: 65749
Project: 65749
Buggy source:
protected void setupHandlerForKeepAsElementPolicy(UnmarshalRecord unmarshalRecord,XPathFragment xPathFragment,Attributes atts){
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  builder.setOwningRecord(unmarshalRecord);
  try {
    String namespaceURI=XMLConstants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + XMLConstants.COLON + qName;
    }
    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);
  try {
    String namespaceURI=XMLConstants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + XMLConstants.COLON + qName;
    }
    if (!(unmarshalRecord.getPrefixesForFragment().isEmpty())) {
      for (      Entry<String,String> next : 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: 65750
Project: 65750
Buggy source:
public void startPrefixMapping(String prefix,String uri) throws SAXException {
  getUnmarshalNamespaceResolver().push(prefix,uri);
}

Fixed version (ground truth):
public void startPrefixMapping(String prefix,String uri) throws SAXException {
  getUnmarshalNamespaceResolver().push(prefix,uri);
  prefixesForFragment.put(prefix,uri);
}
Program: 65752
Project: 65752
Buggy source:
public UnmarshalRecord(TreeObjectBuilder treeObjectBuilder){
  super();
  this.xPathFragment=new XPathFragment();
  this.childRecordPool=new ArrayList<UnmarshalRecord>();
  initialize(treeObjectBuilder);
}

Fixed version (ground truth):
public UnmarshalRecord(TreeObjectBuilder treeObjectBuilder){
  super();
  this.xPathFragment=new XPathFragment();
  this.childRecordPool=new ArrayList<UnmarshalRecord>();
  this.prefixesForFragment=new HashMap<String,String>();
  initialize(treeObjectBuilder);
}
Program: 65753
Project: 65753
Buggy source:
public String getURI(int index){
  return attrs.get(index).getNamespaceURI();
}

Fixed version (ground truth):
public String getURI(int index){
  String uri=attrs.get(index).getNamespaceURI();
  if (uri == null) {
    uri=XMLConstants.EMPTY_STRING;
  }
  return uri;
}
Program: 65756
Project: 65756
Buggy source:
public XPathFragment(){
  super();
}

Fixed version (ground truth):
public XPathFragment(){
  super();
  setNamespaceAware(true);
}