nus-yam/ex-repair huggingface dataset:
Program: 64946
Project: 64946
Buggy source:
@Override public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  Object fieldValue=xmlCollectionReferenceMapping.buildFieldValue(value,xmlField,session);
  if (fieldValue == null) {
    if (null != value) {
      XMLField f2=(XMLField)xmlCollectionReferenceMapping.getSourceToTargetKeyFieldAssociations().get(xmlField);
      fieldValue=marshalRecord.getMarshaller().getXMLContext().getValueByXPath(value,f2.getXPath(),f2.getNamespaceResolver(),Object.class);
    }
    if (null == fieldValue) {
      return false;
    }
  }
  QName schemaType=getSchemaType(xmlField,fieldValue,session);
  if (xPathFragment.isAttribute()) {
    marshalRecord.attribute(xPathFragment,namespaceResolver,fieldValue,schemaType);
    marshalRecord.closeStartElement();
  }
 else {
    marshalRecord.closeStartElement();
    marshalRecord.characters(schemaType,fieldValue,null,false);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  Object fieldValue=xmlCollectionReferenceMapping.buildFieldValue(value,xmlField,session);
  if (fieldValue == null) {
    if (null != value) {
      XMLField f2=(XMLField)xmlCollectionReferenceMapping.getSourceToTargetKeyFieldAssociations().get(xmlField);
      fieldValue=marshalRecord.getMarshaller().getXMLContext().getValueByXPath(value,f2.getXPath(),f2.getNamespaceResolver(),Object.class);
    }
    if (null == fieldValue) {
      return false;
    }
  }
  QName schemaType=xmlField.getSchemaTypeForValue(fieldValue,session);
  if (xPathFragment.isAttribute()) {
    marshalRecord.attribute(xPathFragment,namespaceResolver,fieldValue,schemaType);
    marshalRecord.closeStartElement();
  }
 else {
    marshalRecord.closeStartElement();
    marshalRecord.characters(schemaType,fieldValue,null,false);
  }
  return true;
}
Program: 64947
Project: 64947
Buggy source:
public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  if (xmlCollectionReferenceMapping.usesSingleNode()) {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    if (xPathFragment.isAttribute()) {
      marshalRecord.attribute(xPathFragment,namespaceResolver,(String)value,null);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    }
 else {
      marshalRecord.closeStartGroupingElements(groupingFragment);
      marshalRecord.characters(null,(String)value,null,false);
    }
  }
 else {
    QName schemaType;
    Object fieldValue=xmlCollectionReferenceMapping.buildFieldValue(value,xmlField,session);
    if (fieldValue == null) {
      return false;
    }
    schemaType=getSchemaType(xmlField,fieldValue,session);
    marshalRecord.openStartElement(xPathFragment,namespaceResolver);
    XPathFragment nextFragment=xPathFragment.getNextFragment();
    if (nextFragment.isAttribute()) {
      marshalRecord.attribute(nextFragment,namespaceResolver,fieldValue,schemaType);
      marshalRecord.closeStartElement();
    }
 else {
      marshalRecord.predicateAttribute(xPathFragment,namespaceResolver);
      marshalRecord.closeStartElement();
      marshalRecord.characters(schemaType,fieldValue,null,false);
    }
    marshalRecord.endElement(xPathFragment,namespaceResolver);
  }
  return true;
}

Fixed version (ground truth):
public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  if (xmlCollectionReferenceMapping.usesSingleNode()) {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    if (xPathFragment.isAttribute()) {
      marshalRecord.attribute(xPathFragment,namespaceResolver,(String)value,null);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    }
 else {
      marshalRecord.closeStartGroupingElements(groupingFragment);
      marshalRecord.characters(null,(String)value,null,false);
    }
  }
 else {
    QName schemaType;
    Object fieldValue=xmlCollectionReferenceMapping.buildFieldValue(value,xmlField,session);
    if (fieldValue == null) {
      return false;
    }
    schemaType=xmlField.getSchemaTypeForValue(fieldValue,session);
    marshalRecord.openStartElement(xPathFragment,namespaceResolver);
    XPathFragment nextFragment=xPathFragment.getNextFragment();
    if (nextFragment.isAttribute()) {
      marshalRecord.attribute(nextFragment,namespaceResolver,fieldValue,schemaType);
      marshalRecord.closeStartElement();
    }
 else {
      marshalRecord.predicateAttribute(xPathFragment,namespaceResolver);
      marshalRecord.closeStartElement();
      marshalRecord.characters(schemaType,fieldValue,null,false);
    }
    marshalRecord.endElement(xPathFragment,namespaceResolver);
  }
  return true;
}
Program: 64950
Project: 64950
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlCompositeCollectionMapping.isReadOnly()) {
    return false;
  }
  Object collection=xmlCompositeCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    AbstractNullPolicy wrapperNP=xmlCompositeCollectionMapping.getWrapperNullPolicy();
    if (wrapperNP != null && wrapperNP.getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {
      marshalRecord.nilSimple(namespaceResolver);
      return true;
    }
 else {
      return false;
    }
  }
  ContainerPolicy cp=getContainerPolicy();
  Object iterator=cp.iteratorFor(collection);
  if (null != iterator && cp.hasNext(iterator)) {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    return marshalRecord.emptyCollection(xPathFragment,namespaceResolver,xmlCompositeCollectionMapping.getWrapperNullPolicy() != null);
  }
  marshalRecord.startCollection();
  while (cp.hasNext(iterator)) {
    Object objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  marshalRecord.endCollection();
  return true;
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlCompositeCollectionMapping.isReadOnly()) {
    return false;
  }
  Object collection=xmlCompositeCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    AbstractNullPolicy wrapperNP=xmlCompositeCollectionMapping.getWrapperNullPolicy();
    if (wrapperNP != null && wrapperNP.getMarshalNullRepresentation() == XMLNullRepresentationType.XSI_NIL) {
      marshalRecord.nilSimple(namespaceResolver);
      return true;
    }
 else {
      return false;
    }
  }
  ContainerPolicy cp=getContainerPolicy();
  Object iterator=cp.iteratorFor(collection);
  if (null != iterator && cp.hasNext(iterator)) {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    return marshalRecord.emptyCollection(xPathFragment,namespaceResolver,xmlCompositeCollectionMapping.getWrapperNullPolicy() != null);
  }
  marshalRecord.startCollection();
  while (cp.hasNext(iterator)) {
    Object objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  marshalRecord.endCollection();
  return true;
}
Program: 64954
Project: 64954
Buggy source:
public XMLCompositeObjectMappingNodeValue(XMLCompositeObjectMapping xmlCompositeObjectMapping){
  super();
  this.xmlCompositeObjectMapping=xmlCompositeObjectMapping;
}

Fixed version (ground truth):
public XMLCompositeObjectMappingNodeValue(XMLCompositeObjectMapping xmlCompositeObjectMapping){
  this.xmlCompositeObjectMapping=xmlCompositeObjectMapping;
}
Program: 64956
Project: 64956
Buggy source:
/** 
 * Build a valid instance of BigDecimal from the given sourceObject
 * @param sourceObject    Valid instance of String, BigInteger, any Number
 */
protected BigDecimal convertObjectToBigDecimal(Object sourceObject) throws ConversionException {
  if (sourceObject instanceof String) {
    String sourceString=(String)sourceObject;
    if (sourceString.length() == 0) {
      return null;
    }
  }
  return super.convertObjectToBigDecimal(sourceObject);
}

Fixed version (ground truth):
/** 
 * Build a valid instance of BigDecimal from the given sourceObject
 * @param sourceObject    Valid instance of String, BigInteger, any Number
 */
protected BigDecimal convertObjectToBigDecimal(Object sourceObject) throws ConversionException {
  if (sourceObject instanceof String) {
    String sourceString=(String)sourceObject;
    if (sourceString.length() == 0) {
      return null;
    }
    try {
      return new BigDecimal(sourceString);
    }
 catch (    NumberFormatException exception) {
      throw ConversionException.couldNotBeConverted(sourceObject,ClassConstants.BIGDECIMAL,exception);
    }
  }
  return super.convertObjectToBigDecimal(sourceObject);
}
Program: 64957
Project: 64957
Buggy source:
public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object objectValue,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  Object fieldValue=xmlDirectMapping.getFieldValue(objectValue,session,marshalRecord);
  if (null == fieldValue) {
    return xmlDirectMapping.getNullPolicy().directMarshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
  }
 else {
    QName schemaType=getSchemaType((XMLField)xmlDirectMapping.getField(),fieldValue,session);
    XPathFragment groupingFragment=null;
    boolean isQName=false;
    if (XMLConstants.QNAME_QNAME.equals(schemaType)) {
      groupingFragment=openGroupingElementsForQName((QName)fieldValue,marshalRecord);
      isQName=true;
    }
    if (groupingFragment == null) {
      groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    }
    if (xPathFragment.hasAttribute) {
      marshalRecord.attribute(xPathFragment,namespaceResolver,fieldValue,schemaType);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    }
 else {
      marshalRecord.closeStartGroupingElements(groupingFragment);
      marshalRecord.characters(schemaType,fieldValue,null,xmlDirectMapping.isCDATA());
    }
    if (isQName) {
      XPathFragment fragment=getLastGroupingFragment();
      if (fragment != groupingFragment) {
        marshalRecord.endElement(groupingFragment,namespaceResolver);
        return false;
      }
    }
    return true;
  }
}

Fixed version (ground truth):
public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object objectValue,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  Object fieldValue=xmlDirectMapping.getFieldValue(objectValue,session,marshalRecord);
  if (null == fieldValue) {
    return xmlDirectMapping.getNullPolicy().directMarshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
  }
 else {
    QName schemaType=((XMLField)xmlDirectMapping.getField()).getSchemaTypeForValue(fieldValue,session);
    XPathFragment groupingFragment=null;
    boolean isQName=false;
    if (XMLConstants.QNAME_QNAME.equals(schemaType)) {
      groupingFragment=openGroupingElementsForQName((QName)fieldValue,marshalRecord);
      isQName=true;
    }
    if (groupingFragment == null) {
      groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    }
    if (xPathFragment.hasAttribute) {
      marshalRecord.attribute(xPathFragment,namespaceResolver,fieldValue,schemaType);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    }
 else {
      marshalRecord.closeStartGroupingElements(groupingFragment);
      marshalRecord.characters(schemaType,fieldValue,null,xmlDirectMapping.isCDATA());
    }
    if (isQName) {
      XPathFragment fragment=getLastGroupingFragment();
      if (fragment != groupingFragment) {
        marshalRecord.endElement(groupingFragment,namespaceResolver);
        return false;
      }
    }
    return true;
  }
}
Program: 64958
Project: 64958
Buggy source:
public XMLDirectMappingNodeValue(XMLDirectMapping xmlDirectMapping){
  super();
  this.xmlDirectMapping=xmlDirectMapping;
}

Fixed version (ground truth):
public XMLDirectMappingNodeValue(XMLDirectMapping xmlDirectMapping){
  this.xmlDirectMapping=xmlDirectMapping;
}
Program: 64960
Project: 64960
Buggy source:
/** 
 * Returns the super class of this <code>JavaClass</code>.
 * @return <code>JavaClass</code> representing the super class of this <code>JavaClass</code>.
 */
public JavaClass getSuperclass(){
  if (this.javaType != null) {
    if (!(this.javaType.getSuperType().equals(XMLProcessor.DEFAULT))) {
      if (javaModel != null) {
        return this.javaModel.getClass(javaType.getSuperType());
      }
      return this.javaModel.getClass(javaType.getSuperType());
    }
  }
  return this.javaModel.getClass(JAVA_LANG_OBJECT);
}

Fixed version (ground truth):
/** 
 * Returns the super class of this <code>JavaClass</code>.
 * @return <code>JavaClass</code> representing the super class of this <code>JavaClass</code>.
 */
public JavaClass getSuperclass(){
  if (this.javaModel == null) {
    return null;
  }
  if (this.javaType != null) {
    if (!(this.javaType.getSuperType().equals(XMLProcessor.DEFAULT))) {
      return this.javaModel.getClass(javaType.getSuperType());
    }
  }
  return this.javaModel.getClass(JAVA_LANG_OBJECT);
}
Program: 64961
Project: 64961
Buggy source:
/** 
 * Handle endElement operation.  Here we will create and populate an  org.eclipse.persistence.internal.oxm.Reference instance to be used during  the mapping resolution stage.  In particular, the primary key value for this element will be added to the Reference object's list of target primary key values.  Note that if a reference already exists  for the xmlObjectReferenceMapping's source object instance, we will simply add to the target pk value list.  The Reference object will  is stored on the ReferenceResolver associated with the UnmarshalRecord's session.
 */
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  if (!xmlField.getLastXPathFragment().nameIsText()) {
    return;
  }
  Object value=unmarshalRecord.getCharacters().toString();
  unmarshalRecord.resetStringBuffer();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,xmlConversionManager,unmarshalRecord);
  }
  xmlObjectReferenceMapping.buildReference(unmarshalRecord,xmlField,value,unmarshalRecord.getSession());
}

Fixed version (ground truth):
/** 
 * Handle endElement operation.  Here we will create and populate an  org.eclipse.persistence.internal.oxm.Reference instance to be used during  the mapping resolution stage.  In particular, the primary key value for this element will be added to the Reference object's list of target primary key values.  Note that if a reference already exists  for the xmlObjectReferenceMapping's source object instance, we will simply add to the target pk value list.  The Reference object will  is stored on the ReferenceResolver associated with the UnmarshalRecord's session.
 */
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  if (!xmlField.getLastXPathFragment().nameIsText()) {
    return;
  }
  Object value=unmarshalRecord.getCharacters().toString().trim();
  unmarshalRecord.resetStringBuffer();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,xmlConversionManager,unmarshalRecord);
  }
  xmlObjectReferenceMapping.buildReference(unmarshalRecord,xmlField,value,unmarshalRecord.getSession());
}
Program: 64962
Project: 64962
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(WithoutXmlRootElementTestCases.class);
  suite.addTestSuite(WithXmlRootElementTestCases.class);
  suite.addTestSuite(WithXmlRootElementSetTestCases.class);
  suite.addTestSuite(WithoutXmlRootElementSetTestCases.class);
  suite.addTestSuite(WithXmlRootElementJAXBElementTestCases.class);
  suite.addTestSuite(WithXmlRootElementJAXBElementNoRootTestCases.class);
  suite.addTestSuite(WithoutXmlRootElementJAXBElementTestCases.class);
  suite.addTestSuite(WithXmlRootElementJAXBElementSetTestCases.class);
  suite.addTestSuite(WithoutXmlRootElementJAXBElementSetTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(WithoutXmlRootElementTestCases.class);
  suite.addTestSuite(WithXmlRootElementTestCases.class);
  suite.addTestSuite(WithXmlRootElementSetTestCases.class);
  suite.addTestSuite(WithoutXmlRootElementSetTestCases.class);
  suite.addTestSuite(WithXmlRootElementJAXBElementTestCases.class);
  suite.addTestSuite(WithXmlRootElementJAXBElementNoRootTestCases.class);
  suite.addTestSuite(WithoutXmlRootElementJAXBElementTestCases.class);
  suite.addTestSuite(WithXmlRootElementJAXBElementSetTestCases.class);
  suite.addTestSuite(WithoutXmlRootElementJAXBElementSetTestCases.class);
  suite.addTestSuite(WithoutXmlRootElementArrayTestCases.class);
  suite.addTestSuite(WithXmlRootElementArrayTestCases.class);
  return suite;
}
Program: 64963
Project: 64963
Buggy source:
/** 
 * A convenience method to get the domain class (i.e. <i>Customer</i>) from  the parameter/return type (i.e. <i>Customer</i>, <i>List&lt;Customer></i>, <i>JAXBElement&lt;Customer></i>, <i>JAXBElement&lt;? extends Customer></i>,  <i>List&lt;JAXBElement&lt;Customer>></i>, or  <i>List&lt;JAXBElement&lt;? extends Customer>></i>).
 * @param genericType - The parameter/return type of the JAX-RS operation.
 * @return The corresponding domain class.
 */
protected Class<?> getDomainClass(Type genericType){
  if (genericType instanceof Class && genericType != JAXBElement.class) {
    return (Class<?>)genericType;
  }
 else   if (genericType instanceof ParameterizedType) {
    Type type=((ParameterizedType)genericType).getActualTypeArguments()[0];
    if (type instanceof ParameterizedType) {
      Type rawType=((ParameterizedType)type).getRawType();
      if (rawType == JAXBElement.class) {
        return getDomainClass(type);
      }
    }
 else     if (type instanceof WildcardType) {
      Type[] upperTypes=((WildcardType)type).getUpperBounds();
      if (upperTypes.length > 0) {
        Type upperType=upperTypes[0];
        if (upperType instanceof Class) {
          return (Class<?>)upperType;
        }
      }
    }
 else     if (JAXBElement.class == type) {
      return Object.class;
    }
    return (Class<?>)type;
  }
 else {
    return Object.class;
  }
}

Fixed version (ground truth):
/** 
 * A convenience method to get the domain class (i.e. <i>Customer</i>) from  the parameter/return type (i.e. <i>Customer</i>, <i>List&lt;Customer></i>, <i>JAXBElement&lt;Customer></i>, <i>JAXBElement&lt;? extends Customer></i>,  <i>List&lt;JAXBElement&lt;Customer>></i>, or  <i>List&lt;JAXBElement&lt;? extends Customer>></i>).
 * @param genericType - The parameter/return type of the JAX-RS operation.
 * @return The corresponding domain class.
 */
protected Class<?> getDomainClass(Type genericType){
  if (genericType instanceof Class && genericType != JAXBElement.class) {
    Class<?> clazz=(Class<?>)genericType;
    if (clazz.isArray()) {
      return clazz.getComponentType();
    }
    return clazz;
  }
 else   if (genericType instanceof ParameterizedType) {
    Type type=((ParameterizedType)genericType).getActualTypeArguments()[0];
    if (type instanceof ParameterizedType) {
      Type rawType=((ParameterizedType)type).getRawType();
      if (rawType == JAXBElement.class) {
        return getDomainClass(type);
      }
    }
 else     if (type instanceof WildcardType) {
      Type[] upperTypes=((WildcardType)type).getUpperBounds();
      if (upperTypes.length > 0) {
        Type upperType=upperTypes[0];
        if (upperType instanceof Class) {
          return (Class<?>)upperType;
        }
      }
    }
 else     if (JAXBElement.class == type) {
      return Object.class;
    }
    return (Class<?>)type;
  }
 else {
    return Object.class;
  }
}
Program: 64967
Project: 64967
Buggy source:
@AfterClass public static void tearDown(){
  if (ddlDrop) {
    runDdl(conn,DROP_USERS_BODY,ddlDebug);
    runDdl(conn,DROP_USERS_PKG,ddlDebug);
    runDdl(conn,DROP_USERS_ID_LIST_TYPE,ddlDebug);
    runDdl(conn,DROP_USERS_TABLE,ddlDebug);
  }
}

Fixed version (ground truth):
@AfterClass public static void tearDown(){
  if (ddlDrop) {
    runDdl(conn,DROP_USERS_BODY,ddlDebug);
    runDdl(conn,DROP_USERS_PKG,ddlDebug);
    runDdl(conn,DROP_USERS_ID_LIST_TYPE,ddlDebug);
    runDdl(conn,DROP_USERS_TABLE,ddlDebug);
    runDdl(conn,DROP_TEST_NUMBER_BODY,ddlDebug);
    runDdl(conn,DROP_TEST_NUMBER_PACKAGE,ddlDebug);
    runDdl(conn,DROP_NUMBER_WRAPPER_TYPE,ddlDebug);
    runDdl(conn,DROP_NUMTAB_TYPE,ddlDebug);
  }
}
Program: 64972
Project: 64972
Buggy source:
private boolean isNumericOrBooleanType(QName schemaType){
  if (schemaType == null) {
    return false;
  }
 else   if (schemaType.equals(XMLConstants.BOOLEAN_QNAME) || schemaType.equals(XMLConstants.INTEGER_QNAME) || schemaType.equals(XMLConstants.INT_QNAME)|| schemaType.equals(XMLConstants.DECIMAL_QNAME)|| schemaType.equals(XMLConstants.FLOAT_QNAME)|| schemaType.equals(XMLConstants.DOUBLE_QNAME)|| schemaType.equals(XMLConstants.SHORT_QNAME)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean isNumericOrBooleanType(QName schemaType){
  if (schemaType == null) {
    return false;
  }
 else   if (schemaType.equals(XMLConstants.BOOLEAN_QNAME) || schemaType.equals(XMLConstants.INTEGER_QNAME) || schemaType.equals(XMLConstants.INT_QNAME)|| schemaType.equals(XMLConstants.BYTE_QNAME)|| schemaType.equals(XMLConstants.DECIMAL_QNAME)|| schemaType.equals(XMLConstants.FLOAT_QNAME)|| schemaType.equals(XMLConstants.DOUBLE_QNAME)|| schemaType.equals(XMLConstants.SHORT_QNAME)|| schemaType.equals(XMLConstants.LONG_QNAME)|| schemaType.equals(XMLConstants.NEGATIVE_INTEGER_QNAME)|| schemaType.equals(XMLConstants.NON_NEGATIVE_INTEGER_QNAME)|| schemaType.equals(XMLConstants.NON_POSITIVE_INTEGER_QNAME)|| schemaType.equals(XMLConstants.POSITIVE_INTEGER_QNAME)|| schemaType.equals(XMLConstants.UNSIGNED_BYTE_QNAME)|| schemaType.equals(XMLConstants.UNSIGNED_INT_QNAME)|| schemaType.equals(XMLConstants.UNSIGNED_LONG_QNAME)|| schemaType.equals(XMLConstants.UNSIGNED_SHORT_QNAME)) {
    return true;
  }
  return false;
}
Program: 64973
Project: 64973
Buggy source:
public boolean equals(Object object){
  try {
    if (null == object) {
      return false;
    }
 else     if (this == object) {
      return true;
    }
    XPathFragment xPathFragment=(XPathFragment)object;
    if (null == predicate && null != xPathFragment.predicate) {
      return false;
    }
    if (null != predicate && !predicate.equals(xPathFragment.predicate)) {
      return false;
    }
    if (namespaceAware && xPathFragment.isNamespaceAware()) {
      if (namespaceURI == null) {
        if (xPathFragment.namespaceURI != null) {
          return false;
        }
      }
 else {
        if (xPathFragment.namespaceURI == null) {
          return false;
        }
 else         if (namespaceURI != xPathFragment.namespaceURI && !(namespaceURI.equals(xPathFragment.namespaceURI))) {
          return false;
        }
      }
    }
    return ((nameIsText && xPathFragment.nameIsText) || (localName == xPathFragment.localName) || ((localName != null) && localName.equals(xPathFragment.localName))) && (this.indexValue == xPathFragment.indexValue) && (nameIsText == xPathFragment.nameIsText);
  }
 catch (  ClassCastException e) {
    return false;
  }
}

Fixed version (ground truth):
public boolean equals(Object object){
  if (null == object) {
    return false;
  }
 else   if (this == object) {
    return true;
  }
  try {
    XPathFragment xPathFragment=(XPathFragment)object;
    if (nameIsText && xPathFragment.nameIsText) {
      return true;
    }
    if (nameIsText != xPathFragment.nameIsText) {
      return false;
    }
    if ((null == localName && null != xPathFragment.localName) || (null != localName && null == xPathFragment.localName)) {
      return false;
    }
    if (null != localName && !localName.equals(xPathFragment.localName)) {
      return false;
    }
    if (namespaceAware && xPathFragment.isNamespaceAware()) {
      if ((null == namespaceURI && null != xPathFragment.namespaceURI) || (null != namespaceURI && null == xPathFragment.namespaceURI)) {
        return false;
      }
      if (null != namespaceURI && !namespaceURI.equals(xPathFragment.namespaceURI)) {
        return false;
      }
    }
    if (indexValue != xPathFragment.indexValue) {
      return false;
    }
    if (null == predicate && null != xPathFragment.predicate) {
      return false;
    }
    if (null != predicate && !predicate.equals(xPathFragment.predicate)) {
      return false;
    }
  }
 catch (  ClassCastException e) {
    return false;
  }
  return true;
}
Program: 64976
Project: 64976
Buggy source:
/** 
 * This constructor initializes various settings on the XML marshaller, and stores the provided JAXBIntrospector instance for usage in marshal() calls.
 * @param newXMLMarshaller
 * @param newIntrospector
 */
public JAXBMarshaller(XMLMarshaller newXMLMarshaller,JAXBIntrospector newIntrospector){
  super();
  validationEventHandler=JAXBContext.DEFAULT_VALIDATION_EVENT_HANDER;
  xmlMarshaller=newXMLMarshaller;
  xmlMarshaller.setEncoding("String_Node_Str");
  xmlMarshaller.setFormattedOutput(false);
  JAXBMarshalListener listener=new JAXBMarshalListener(this);
  xmlMarshaller.setMarshalListener(listener);
  xmlMarshaller.getProperties().put(XMLConstants.JAXB_MARSHALLER,this);
}

Fixed version (ground truth):
/** 
 * This constructor initializes various settings on the XML marshaller, and stores the provided JAXBIntrospector instance for usage in marshal() calls.
 * @param newXMLMarshaller
 * @param newIntrospector
 */
public JAXBMarshaller(XMLMarshaller newXMLMarshaller,JAXBIntrospector newIntrospector){
  super();
  validationEventHandler=JAXBContext.DEFAULT_VALIDATION_EVENT_HANDER;
  xmlMarshaller=newXMLMarshaller;
  xmlMarshaller.setEncoding("String_Node_Str");
  xmlMarshaller.setFormattedOutput(false);
  xmlMarshaller.getProperties().put(XMLConstants.JAXB_MARSHALLER,this);
}
Program: 64977
Project: 64977
Buggy source:
public void setMarshalCallbacks(java.util.HashMap callbacks){
  ((JAXBMarshalListener)xmlMarshaller.getMarshalListener()).setClassBasedMarshalEvents(callbacks);
}

Fixed version (ground truth):
public void setMarshalCallbacks(java.util.HashMap callbacks){
  if (callbacks == null || callbacks.isEmpty()) {
    return;
  }
  if (xmlMarshaller.getMarshalListener() == null) {
    xmlMarshaller.setMarshalListener(new JAXBMarshalListener(this));
  }
  ((JAXBMarshalListener)xmlMarshaller.getMarshalListener()).setClassBasedMarshalEvents(callbacks);
}
Program: 64978
Project: 64978
Buggy source:
public void setListener(Marshaller.Listener listener){
  ((JAXBMarshalListener)xmlMarshaller.getMarshalListener()).setListener(listener);
}

Fixed version (ground truth):
public void setListener(Marshaller.Listener listener){
  if (xmlMarshaller.getMarshalListener() == null) {
    xmlMarshaller.setMarshalListener(new JAXBMarshalListener(this));
  }
  ((JAXBMarshalListener)xmlMarshaller.getMarshalListener()).setListener(listener);
}
Program: 64981
Project: 64981
Buggy source:
/** 
 * A convenience method to get the domain class (i.e. <i>Customer</i>) from  the parameter/return type (i.e. <i>Customer</i> or <i>List&lt;Customer></i>).
 * @param genericType - The parameter/return type of the JAX-RS operation.
 * @return The corresponding domain class.
 */
protected Class<?> getDomainClass(Type genericType){
  if (genericType instanceof Class) {
    return (Class<?>)genericType;
  }
 else   if (genericType instanceof ParameterizedType) {
    return (Class<?>)((ParameterizedType)genericType).getActualTypeArguments()[0];
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * A convenience method to get the domain class (i.e. <i>Customer</i>) from  the parameter/return type (i.e. <i>Customer</i>, <i>List&lt;Customer></i>, <i>JAXBElement&lt;Customer></i>, <i>JAXBElement&lt;? extends Customer></i>,  <i>List&lt;JAXBElement&lt;Customer>></i>, or  <i>List&lt;JAXBElement&lt;? extends Customer>></i>).
 * @param genericType - The parameter/return type of the JAX-RS operation.
 * @return The corresponding domain class.
 */
protected Class<?> getDomainClass(Type genericType){
  if (genericType instanceof Class && genericType != JAXBElement.class) {
    return (Class<?>)genericType;
  }
 else   if (genericType instanceof ParameterizedType) {
    Type type=((ParameterizedType)genericType).getActualTypeArguments()[0];
    if (type instanceof ParameterizedType) {
      Type rawType=((ParameterizedType)type).getRawType();
      if (rawType == JAXBElement.class) {
        return getDomainClass(type);
      }
    }
 else     if (type instanceof WildcardType) {
      Type[] upperTypes=((WildcardType)type).getUpperBounds();
      if (upperTypes.length > 0) {
        Type upperType=upperTypes[0];
        if (upperType instanceof Class) {
          return (Class<?>)upperType;
        }
      }
    }
 else     if (JAXBElement.class == type) {
      return Object.class;
    }
    return (Class<?>)type;
  }
 else {
    return Object.class;
  }
}
Program: 64985
Project: 64985
Buggy source:
@Override protected Collection<JAXBElement<WithXmlRootElementRoot>> getControlObject(){
  Collection<JAXBElement<WithXmlRootElementRoot>> set=new LinkedHashSet<JAXBElement<WithXmlRootElementRoot>>(2);
  WithXmlRootElementRoot foo=new WithXmlRootElementRoot();
  foo.setName("String_Node_Str");
  JAXBElement<WithXmlRootElementRoot> jbe1=new JAXBElement<WithXmlRootElementRoot>(new QName("String_Node_Str"),WithXmlRootElementRoot.class,foo);
  set.add(jbe1);
  WithXmlRootElementRoot bar=new WithXmlRootElementRoot();
  bar.setName("String_Node_Str");
  JAXBElement<WithXmlRootElementRoot> jbe2=new JAXBElement<WithXmlRootElementRoot>(new QName("String_Node_Str"),WithXmlRootElementRoot.class,bar);
  set.add(jbe2);
  return set;
}

Fixed version (ground truth):
@Override protected Collection<JAXBElement<WithXmlRootElementRoot>> getControlObject(){
  Collection<JAXBElement<WithXmlRootElementRoot>> set=new ArrayList<JAXBElement<WithXmlRootElementRoot>>(2);
  WithXmlRootElementRoot foo=new WithXmlRootElementRoot();
  foo.setName("String_Node_Str");
  JAXBElement<WithXmlRootElementRoot> jbe1=new JAXBElement<WithXmlRootElementRoot>(new QName("String_Node_Str"),WithXmlRootElementRoot.class,foo);
  set.add(jbe1);
  WithXmlRootElementRoot bar=new WithXmlRootElementRoot();
  bar.setName("String_Node_Str");
  JAXBElement<WithXmlRootElementRoot> jbe2=new JAXBElement<WithXmlRootElementRoot>(new QName("String_Node_Str"),WithXmlRootElementRoot.class,bar);
  set.add(jbe2);
  return set;
}
Program: 64986
Project: 64986
Buggy source:
@Override protected Collection<JAXBElement<WithXmlRootElementRoot>> getControlObject(){
  Collection<JAXBElement<WithXmlRootElementRoot>> list=new LinkedHashSet<JAXBElement<WithXmlRootElementRoot>>(2);
  WithXmlRootElementRoot foo=new WithXmlRootElementRoot();
  foo.setName("String_Node_Str");
  JAXBElement<WithXmlRootElementRoot> jbe1=new JAXBElement<WithXmlRootElementRoot>(new QName("String_Node_Str"),WithXmlRootElementRoot.class,foo);
  list.add(jbe1);
  WithXmlRootElementRoot bar=new WithXmlRootElementRoot();
  bar.setName("String_Node_Str");
  JAXBElement<WithXmlRootElementRoot> jbe2=new JAXBElement<WithXmlRootElementRoot>(new QName("String_Node_Str"),WithXmlRootElementRoot.class,bar);
  list.add(jbe2);
  return list;
}

Fixed version (ground truth):
@Override protected Collection<JAXBElement<WithXmlRootElementRoot>> getControlObject(){
  Collection<JAXBElement<WithXmlRootElementRoot>> list=new ArrayList<JAXBElement<WithXmlRootElementRoot>>(2);
  WithXmlRootElementRoot foo=new WithXmlRootElementRoot();
  foo.setName("String_Node_Str");
  JAXBElement<WithXmlRootElementRoot> jbe1=new JAXBElement<WithXmlRootElementRoot>(new QName("String_Node_Str"),WithXmlRootElementRoot.class,foo);
  list.add(jbe1);
  WithXmlRootElementRoot bar=new WithXmlRootElementRoot();
  bar.setName("String_Node_Str");
  JAXBElement<WithXmlRootElementRoot> jbe2=new JAXBElement<WithXmlRootElementRoot>(new QName("String_Node_Str"),WithXmlRootElementRoot.class,bar);
  list.add(jbe2);
  return list;
}
Program: 64987
Project: 64987
Buggy source:
@Override protected Collection<JAXBElement<WithoutXmlRootElementRoot>> getControlObject(){
  Collection<JAXBElement<WithoutXmlRootElementRoot>> list=new LinkedHashSet<JAXBElement<WithoutXmlRootElementRoot>>(2);
  WithoutXmlRootElementRoot foo=new WithoutXmlRootElementRoot();
  foo.setName("String_Node_Str");
  JAXBElement<WithoutXmlRootElementRoot> jbe1=new JAXBElement<WithoutXmlRootElementRoot>(new QName("String_Node_Str"),WithoutXmlRootElementRoot.class,foo);
  list.add(jbe1);
  WithoutXmlRootElementRoot bar=new WithoutXmlRootElementRoot();
  bar.setName("String_Node_Str");
  JAXBElement<WithoutXmlRootElementRoot> jbe2=new JAXBElement<WithoutXmlRootElementRoot>(new QName("String_Node_Str"),WithoutXmlRootElementRoot.class,bar);
  list.add(jbe2);
  return list;
}

Fixed version (ground truth):
@Override public Collection<JAXBElement<WithoutXmlRootElementRoot>> getControlObject(){
  Collection<JAXBElement<WithoutXmlRootElementRoot>> list=new ArrayList<JAXBElement<WithoutXmlRootElementRoot>>(2);
  WithoutXmlRootElementRoot foo=new WithoutXmlRootElementRoot();
  foo.setName("String_Node_Str");
  JAXBElement<WithoutXmlRootElementRoot> jbe1=new JAXBElement<WithoutXmlRootElementRoot>(new QName("String_Node_Str"),WithoutXmlRootElementRoot.class,foo);
  list.add(jbe1);
  WithoutXmlRootElementRoot bar=new WithoutXmlRootElementRoot();
  bar.setName("String_Node_Str");
  JAXBElement<WithoutXmlRootElementRoot> jbe2=new JAXBElement<WithoutXmlRootElementRoot>(new QName("String_Node_Str"),WithoutXmlRootElementRoot.class,bar);
  list.add(jbe2);
  return list;
}
Program: 64988
Project: 64988
Buggy source:
@Override public Object getReadControlObject(){
  JAXBElement elem=new JAXBElement(new QName("String_Node_Str"),WithoutXmlRootElementRoot.class,getControlObject());
  return elem;
}

Fixed version (ground truth):
@Override public Object getReadControlObject(){
  JAXBElement elem=new JAXBElement(new QName("String_Node_Str"),WithoutXmlRootElementRoot.class,new ArrayList<WithoutXmlRootElementRoot>(getControlObject()));
  return elem;
}
Program: 64989
Project: 64989
Buggy source:
public void compareJAXBElementObjects(JAXBElement controlObj,JAXBElement testObj,boolean namespaceAware){
  assertEquals(controlObj.getName().getLocalPart(),testObj.getName().getLocalPart());
  if (namespaceAware) {
    assertEquals(controlObj.getName().getNamespaceURI(),testObj.getName().getNamespaceURI());
  }
  assertEquals(controlObj.getDeclaredType(),testObj.getDeclaredType());
  Object controlValue=controlObj.getValue();
  Object testValue=testObj.getValue();
  if (controlValue == null) {
    if (testValue == null) {
      return;
    }
    fail("String_Node_Str");
  }
 else {
    if (testValue == null) {
      fail("String_Node_Str");
    }
  }
  if (controlValue.getClass().isArray()) {
    compareArrays(controlValue,testValue);
  }
 else   if (controlValue instanceof Collection) {
    Collection controlCollection=(Collection)controlValue;
    Collection testCollection=(Collection)testValue;
    Iterator<Object> controlIter=controlCollection.iterator();
    Iterator<Object> testIter=testCollection.iterator();
    assertEquals(controlCollection.size(),testCollection.size());
    while (controlIter.hasNext()) {
      Object nextControl=controlIter.next();
      Object nextTest=testIter.next();
      compareValues(nextControl,nextTest);
    }
  }
 else {
    compareValues(controlValue,testValue);
  }
}

Fixed version (ground truth):
public void compareJAXBElementObjects(JAXBElement controlObj,JAXBElement testObj,boolean namespaceAware){
  assertEquals(controlObj.getName().getLocalPart(),testObj.getName().getLocalPart());
  if (namespaceAware) {
    assertEquals(controlObj.getName().getNamespaceURI(),testObj.getName().getNamespaceURI());
  }
  assertEquals(controlObj.getDeclaredType(),testObj.getDeclaredType());
  Object controlValue=controlObj.getValue();
  Object testValue=testObj.getValue();
  if (controlValue == null) {
    if (testValue == null) {
      return;
    }
    fail("String_Node_Str");
  }
 else {
    if (testValue == null) {
      fail("String_Node_Str");
    }
  }
  if (controlValue.getClass().isArray()) {
    compareArrays(controlValue,testValue);
  }
 else   if (controlValue instanceof Collection) {
    Collection controlCollection=(Collection)controlValue;
    Collection testCollection=(Collection)testValue;
    Iterator<Object> controlIter=controlCollection.iterator();
    Iterator<Object> testIter=testCollection.iterator();
    assertEquals(controlCollection.getClass(),testCollection.getClass());
    assertEquals(controlCollection.size(),testCollection.size());
    while (controlIter.hasNext()) {
      Object nextControl=controlIter.next();
      Object nextTest=testIter.next();
      compareValues(nextControl,nextTest);
    }
  }
 else {
    compareValues(controlValue,testValue);
  }
}
Program: 64999
Project: 64999
Buggy source:
private XPathFragment getLastGroupingFragment(){
  XPathFragment fragment=((XMLField)this.getMapping().getField()).getXPathFragment();
  if (fragment.isAttribute() || fragment.nameIsText()) {
    return null;
  }
  while (fragment.getNextFragment() != null) {
    if (fragment.getNextFragment().nameIsText() || fragment.getNextFragment().isAttribute()) {
      return fragment;
    }
    fragment=fragment.getNextFragment();
  }
  return fragment;
}

Fixed version (ground truth):
private XPathFragment getLastGroupingFragment(){
  XPathFragment fragment=((XMLField)this.getMapping().getField()).getXPathFragment();
  if (fragment.hasAttribute || fragment.nameIsText) {
    return null;
  }
  while (fragment.getNextFragment() != null) {
    if (fragment.getNextFragment().nameIsText || fragment.getNextFragment().hasAttribute) {
      return fragment;
    }
    fragment=fragment.getNextFragment();
  }
  return fragment;
}
Program: 65000
Project: 65000
Buggy source:
public boolean isOwningNode(XPathFragment xPathFragment){
  return xPathFragment.isAttribute() || xPathFragment.nameIsText();
}

Fixed version (ground truth):
public boolean isOwningNode(XPathFragment xPathFragment){
  return xPathFragment.hasAttribute || xPathFragment.nameIsText;
}
Program: 65001
Project: 65001
Buggy source:
public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object objectValue,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  Object fieldValue=xmlDirectMapping.getFieldValue(objectValue,session,marshalRecord);
  if (null == fieldValue) {
    return xmlDirectMapping.getNullPolicy().directMarshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
  }
 else {
    QName schemaType=getSchemaType((XMLField)xmlDirectMapping.getField(),fieldValue,session);
    XPathFragment groupingFragment=null;
    boolean isQName=false;
    if (XMLConstants.QNAME_QNAME.equals(schemaType)) {
      groupingFragment=openGroupingElementsForQName((QName)fieldValue,marshalRecord);
      isQName=true;
    }
    if (groupingFragment == null) {
      groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    }
    if (xPathFragment.isAttribute()) {
      marshalRecord.attribute(xPathFragment,namespaceResolver,fieldValue,schemaType);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    }
 else {
      marshalRecord.closeStartGroupingElements(groupingFragment);
      marshalRecord.characters(schemaType,fieldValue,null,xmlDirectMapping.isCDATA());
    }
    if (isQName) {
      XPathFragment fragment=getLastGroupingFragment();
      if (fragment != groupingFragment) {
        marshalRecord.endElement(groupingFragment,namespaceResolver);
        return false;
      }
    }
    return true;
  }
}

Fixed version (ground truth):
public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object objectValue,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  Object fieldValue=xmlDirectMapping.getFieldValue(objectValue,session,marshalRecord);
  if (null == fieldValue) {
    return xmlDirectMapping.getNullPolicy().directMarshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
  }
 else {
    QName schemaType=getSchemaType((XMLField)xmlDirectMapping.getField(),fieldValue,session);
    XPathFragment groupingFragment=null;
    boolean isQName=false;
    if (XMLConstants.QNAME_QNAME.equals(schemaType)) {
      groupingFragment=openGroupingElementsForQName((QName)fieldValue,marshalRecord);
      isQName=true;
    }
    if (groupingFragment == null) {
      groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    }
    if (xPathFragment.hasAttribute) {
      marshalRecord.attribute(xPathFragment,namespaceResolver,fieldValue,schemaType);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    }
 else {
      marshalRecord.closeStartGroupingElements(groupingFragment);
      marshalRecord.characters(schemaType,fieldValue,null,xmlDirectMapping.isCDATA());
    }
    if (isQName) {
      XPathFragment fragment=getLastGroupingFragment();
      if (fragment != groupingFragment) {
        marshalRecord.endElement(groupingFragment,namespaceResolver);
        return false;
      }
    }
    return true;
  }
}
Program: 65002
Project: 65002
Buggy source:
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  unmarshalRecord.removeNullCapableValue(this);
  XMLField xmlField=(XMLField)xmlDirectMapping.getField();
  if (!xmlField.getLastXPathFragment().nameIsText()) {
    return;
  }
  Object value;
  if (unmarshalRecord.getCharacters().length() == 0) {
    value=this.getMapping().getNullValue();
  }
 else {
    value=unmarshalRecord.getCharacters().toString();
  }
  unmarshalRecord.resetStringBuffer();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,xmlConversionManager,unmarshalRecord);
  }
  Object convertedValue=xmlDirectMapping.getAttributeValue(value,unmarshalRecord.getSession(),unmarshalRecord);
  unmarshalRecord.setAttributeValue(convertedValue,xmlDirectMapping);
}

Fixed version (ground truth):
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  unmarshalRecord.removeNullCapableValue(this);
  XMLField xmlField=(XMLField)xmlDirectMapping.getField();
  if (!xmlField.getLastXPathFragment().nameIsText) {
    return;
  }
  Object value;
  if (unmarshalRecord.getCharacters().length() == 0) {
    value=this.getMapping().getNullValue();
  }
 else {
    value=unmarshalRecord.getCharacters().toString();
  }
  unmarshalRecord.resetStringBuffer();
  AbstractSession session=unmarshalRecord.getSession();
  XMLConversionManager xmlConversionManager=(XMLConversionManager)session.getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,xmlConversionManager,unmarshalRecord);
  }
  Object convertedValue=xmlDirectMapping.getAttributeValue(value,unmarshalRecord.getSession(),unmarshalRecord);
  unmarshalRecord.setAttributeValue(convertedValue,xmlDirectMapping);
}
Program: 65004
Project: 65004
Buggy source:
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  unmarshalRecord.removeNullCapableValue(this);
  XMLField xmlField=(XMLField)xmlDirectMapping.getField();
  Object realValue=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager(),unmarshalRecord);
  Object convertedValue=xmlDirectMapping.getAttributeValue(realValue,unmarshalRecord.getSession(),unmarshalRecord);
  xmlDirectMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(),convertedValue);
}

Fixed version (ground truth):
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  unmarshalRecord.removeNullCapableValue(this);
  XMLField xmlField=(XMLField)xmlDirectMapping.getField();
  AbstractSession session=unmarshalRecord.getSession();
  Object realValue=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,(XMLConversionManager)session.getDatasourcePlatform().getConversionManager(),unmarshalRecord);
  Object convertedValue=xmlDirectMapping.getAttributeValue(realValue,session,unmarshalRecord);
  xmlDirectMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(),convertedValue);
}