nus-yam/ex-repair huggingface dataset:
Program: 64482
Project: 64482
Buggy source:
/** 
 * Marshal any 'self' mapped attributes.
 * @param xPathFragment
 * @param marshalRecord
 * @param object
 * @param session
 * @param namespaceResolver
 * @param marshaller
 * @return
 */
public boolean marshalSelfAttributes(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,CoreAbstractSession session,NamespaceResolver namespaceResolver,XMLMarshaller marshaller){
  Object objectValue=xmlCompositeObjectMapping.getAttributeValueFromObject(object);
  objectValue=xmlCompositeObjectMapping.convertObjectValueToDataValue(objectValue,session,marshaller);
  Descriptor descriptor=(Descriptor)session.getDescriptor(objectValue);
  if (descriptor != null) {
    TreeObjectBuilder objectBuilder=(TreeObjectBuilder)descriptor.getObjectBuilder();
    return objectBuilder.marshalAttributes(marshalRecord,objectValue,session);
  }
 else {
    if (this.getMapping().getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT || this.getMapping().getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) {
      if (objectValue instanceof Node) {
        Node rootNode=(Node)objectValue;
        NamedNodeMap attributes=rootNode.getAttributes();
        for (int i=0; i < attributes.getLength(); i++) {
          Attr next=(Attr)attributes.item(i);
          if (!(XMLConstants.XMLNS_URL.equals(next.getNamespaceURI()))) {
            marshalRecord.node(next,namespaceResolver);
          }
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Marshal any 'self' mapped attributes.
 * @param xPathFragment
 * @param marshalRecord
 * @param object
 * @param session
 * @param namespaceResolver
 * @param marshaller
 * @return
 */
public boolean marshalSelfAttributes(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,CoreAbstractSession session,NamespaceResolver namespaceResolver,XMLMarshaller marshaller){
  Object objectValue=xmlCompositeObjectMapping.getAttributeValueFromObject(object);
  objectValue=xmlCompositeObjectMapping.convertObjectValueToDataValue(objectValue,session,marshaller);
  Descriptor descriptor=(Descriptor)session.getDescriptor(objectValue);
  if (descriptor != null) {
    TreeObjectBuilder objectBuilder=(TreeObjectBuilder)descriptor.getObjectBuilder();
    return objectBuilder.marshalAttributes(marshalRecord,objectValue,session);
  }
 else {
    UnmarshalKeepAsElementPolicy keepAsElementPolicy=getMapping().getKeepAsElementPolicy();
    if (null != keepAsElementPolicy && (keepAsElementPolicy.isKeepAllAsElement() || keepAsElementPolicy.isKeepUnknownAsElement())) {
      if (objectValue instanceof Node) {
        Node rootNode=(Node)objectValue;
        NamedNodeMap attributes=rootNode.getAttributes();
        for (int i=0; i < attributes.getLength(); i++) {
          Attr next=(Attr)attributes.item(i);
          if (!(XMLConstants.XMLNS_URL.equals(next.getNamespaceURI()))) {
            marshalRecord.node(next,namespaceResolver);
          }
        }
      }
    }
  }
  return false;
}
Program: 64485
Project: 64485
Buggy source:
public UnmarshalKeepAsElementPolicy getKeepAsElementPolicy();

Fixed version (ground truth):
public UNMARSHAL_KEEP_AS_ELEMENT_POLICY getKeepAsElementPolicy();
Program: 64486
Project: 64486
Buggy source:
public UnmarshalKeepAsElementPolicy getKeepAsElementPolicy();

Fixed version (ground truth):
public UNMARSHAL_KEEP_AS_ELEMENT_POLICY getKeepAsElementPolicy();
Program: 64487
Project: 64487
Buggy source:
@Test public void testService(){
  try {
    QName qname=new QName(SERVICE_NAMESPACE,SERVICE_PORT);
    Service service=Service.create(new QName(TEST_NAMESPACE,SERVICE));
    service.addPort(qname,SOAPBinding.SOAP11HTTP_BINDING,"String_Node_Str" + host + "String_Node_Str"+ port+ "String_Node_Str");
    Dispatch<SOAPMessage> sourceDispatch=service.createDispatch(qname,SOAPMessage.class,Service.Mode.MESSAGE);
    SOAPMessage request=createSOAPMessage(REQUEST_MSG);
    SOAPMessage response=sourceDispatch.invoke(request);
    assertNotNull("String_Node_Str",response);
    SOAPBody responseBody=response.getSOAPPart().getEnvelope().getBody();
    Document resultDoc=responseBody.extractContentAsDocument();
    Document controlDoc=xmlParser.parse(new StringReader(RESPONSE_MSG));
    assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(resultDoc),comparer.isNodeEqual(controlDoc,resultDoc));
  }
 catch (  Exception x) {
    fail("String_Node_Str" + x.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testService(){
  try {
    QName qname=new QName(SERVICE_NAMESPACE,SERVICE_PORT);
    Service service=Service.create(new QName(TEST_NAMESPACE,SERVICE));
    service.addPort(qname,SOAPBinding.SOAP11HTTP_BINDING,"String_Node_Str" + host + "String_Node_Str"+ port+ "String_Node_Str");
    Dispatch<SOAPMessage> sourceDispatch=service.createDispatch(qname,SOAPMessage.class,Service.Mode.MESSAGE);
    SOAPMessage request=createSOAPMessage(REQUEST_MSG);
    SOAPMessage response=sourceDispatch.invoke(request);
    assertNotNull("String_Node_Str",response);
    SOAPBody responseBody=response.getSOAPPart().getEnvelope().getBody();
    Document resultDoc=responseBody.extractContentAsDocument();
    NodeList elts=resultDoc.getDocumentElement().getElementsByTagNameNS(SERVICE_NAMESPACE,"String_Node_Str");
    assertTrue("String_Node_Str",((elts != null && elts.getLength() > 0) && elts.getLength() == 1));
    Node testNode=elts.item(0);
    assertTrue("String_Node_Str",testNode.getLocalName().equalsIgnoreCase("String_Node_Str"));
    Document controlDoc=xmlParser.parse(new StringReader(RESPONSE_MSG));
    elts=controlDoc.getDocumentElement().getElementsByTagNameNS(SERVICE_NAMESPACE,"String_Node_Str");
    Node ctrlNode=elts.item(0);
    assertTrue("String_Node_Str" + documentToString(ctrlNode) + "String_Node_Str"+ documentToString(testNode),comparer.isNodeEqual(ctrlNode,testNode));
  }
 catch (  Exception x) {
    fail("String_Node_Str" + x.getMessage());
  }
}
Program: 64488
Project: 64488
Buggy source:
@Test public void testService(){
  try {
    QName qname=new QName("String_Node_Str","String_Node_Str");
    Service service=Service.create(new QName("String_Node_Str","String_Node_Str"));
    service.addPort(qname,SOAPBinding.SOAP11HTTP_BINDING,"String_Node_Str" + host + "String_Node_Str"+ port+ "String_Node_Str");
    Dispatch<SOAPMessage> sourceDispatch=service.createDispatch(qname,SOAPMessage.class,Service.Mode.MESSAGE);
    SOAPMessage request=createSOAPMessage(SOAP_SIMPLESP_REQUEST);
    SOAPMessage response=sourceDispatch.invoke(request);
    assertNotNull("String_Node_Str",response);
    SOAPBody responseBody=response.getSOAPPart().getEnvelope().getBody();
    Document resultDoc=responseBody.extractContentAsDocument();
    Document controlDoc=xmlParser.parse(new StringReader(SOAP_SIMPLESP_RESPONSE));
    assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(resultDoc),comparer.isNodeEqual(controlDoc,resultDoc));
  }
 catch (  Exception x) {
    fail("String_Node_Str" + x.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testService(){
  try {
    QName qname=new QName("String_Node_Str","String_Node_Str");
    Service service=Service.create(new QName("String_Node_Str","String_Node_Str"));
    service.addPort(qname,SOAPBinding.SOAP11HTTP_BINDING,"String_Node_Str" + host + "String_Node_Str"+ port+ "String_Node_Str");
    Dispatch<SOAPMessage> sourceDispatch=service.createDispatch(qname,SOAPMessage.class,Service.Mode.MESSAGE);
    SOAPMessage request=createSOAPMessage(SOAP_SIMPLESP_REQUEST);
    SOAPMessage response=sourceDispatch.invoke(request);
    assertNotNull("String_Node_Str",response);
    SOAPBody responseBody=response.getSOAPPart().getEnvelope().getBody();
    Document resultDoc=responseBody.extractContentAsDocument();
    NodeList elts=resultDoc.getDocumentElement().getElementsByTagNameNS("String_Node_Str","String_Node_Str");
    assertTrue("String_Node_Str",((elts != null && elts.getLength() > 0) && elts.getLength() == 1));
    Node testNode=elts.item(0);
    assertTrue("String_Node_Str",testNode.getLocalName().equalsIgnoreCase("String_Node_Str"));
    Document controlDoc=xmlParser.parse(new StringReader(SOAP_SIMPLESP_RESPONSE));
    elts=controlDoc.getDocumentElement().getElementsByTagNameNS("String_Node_Str","String_Node_Str");
    Node ctrlNode=elts.item(0);
    assertTrue("String_Node_Str" + documentToString(ctrlNode) + "String_Node_Str"+ documentToString(testNode),comparer.isNodeEqual(ctrlNode,testNode));
  }
 catch (  Exception x) {
    fail("String_Node_Str" + x.getMessage());
  }
}
Program: 64489
Project: 64489
Buggy source:
@Test public void testService(){
  try {
    QName qname=new QName("String_Node_Str","String_Node_Str");
    Service service=Service.create(new QName("String_Node_Str","String_Node_Str"));
    service.addPort(qname,SOAPBinding.SOAP11HTTP_BINDING,"String_Node_Str" + host + "String_Node_Str"+ port+ "String_Node_Str");
    Dispatch<SOAPMessage> sourceDispatch=service.createDispatch(qname,SOAPMessage.class,Service.Mode.MESSAGE);
    SOAPMessage request=createSOAPMessage(SOAP_COUNTINFO_REQUEST);
    SOAPMessage response=sourceDispatch.invoke(request);
    assertNotNull("String_Node_Str",response);
    SOAPBody responseBody=response.getSOAPPart().getEnvelope().getBody();
    Document resultDoc=responseBody.extractContentAsDocument();
    resultDoc.normalizeDocument();
    Document controlDoc=xmlParser.parse(new StringReader(SOAP_COUNTINFO_RESPONSE));
    assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(resultDoc),comparer.isNodeEqual(controlDoc,resultDoc));
  }
 catch (  Exception x) {
    fail("String_Node_Str" + x.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testService(){
  try {
    QName qname=new QName("String_Node_Str","String_Node_Str");
    Service service=Service.create(new QName("String_Node_Str","String_Node_Str"));
    service.addPort(qname,SOAPBinding.SOAP11HTTP_BINDING,"String_Node_Str" + host + "String_Node_Str"+ port+ "String_Node_Str");
    Dispatch<SOAPMessage> sourceDispatch=service.createDispatch(qname,SOAPMessage.class,Service.Mode.MESSAGE);
    SOAPMessage request=createSOAPMessage(SOAP_COUNTINFO_REQUEST);
    SOAPMessage response=sourceDispatch.invoke(request);
    assertNotNull("String_Node_Str",response);
    SOAPBody responseBody=response.getSOAPPart().getEnvelope().getBody();
    Document resultDoc=responseBody.extractContentAsDocument();
    NodeList elts=resultDoc.getDocumentElement().getElementsByTagNameNS("String_Node_Str","String_Node_Str");
    assertTrue("String_Node_Str",((elts != null && elts.getLength() > 0) && elts.getLength() == 1));
    Node testNode=elts.item(0);
    assertTrue("String_Node_Str",testNode.getLocalName().equalsIgnoreCase("String_Node_Str"));
    Document controlDoc=xmlParser.parse(new StringReader(SOAP_COUNTINFO_RESPONSE));
    elts=controlDoc.getDocumentElement().getElementsByTagNameNS("String_Node_Str","String_Node_Str");
    Node ctrlNode=elts.item(0);
    assertTrue("String_Node_Str" + documentToString(ctrlNode) + "String_Node_Str"+ documentToString(testNode),comparer.isNodeEqual(ctrlNode,testNode));
  }
 catch (  Exception x) {
    fail("String_Node_Str" + x.getMessage());
  }
}
Program: 64491
Project: 64491
Buggy source:
/** 
 * Process @XmlElement annotation on a given property.
 * @param property
 */
private void processXmlElement(Property property,TypeInfo info){
  if (helper.isAnnotationPresent(property.getElement(),XmlElement.class)) {
    XmlElement element=(XmlElement)helper.getAnnotation(property.getElement(),XmlElement.class);
    property.setIsRequired(element.required());
    property.setNillable(element.nillable());
    if (element.type() != XmlElement.DEFAULT.class && !(property.isSwaAttachmentRef())) {
      property.setOriginalType(property.getType());
      if (helper.isCollectionType(property.getType())) {
        property.setGenericType(helper.getJavaClass(element.type()));
      }
 else {
        property.setType(helper.getJavaClass(element.type()));
      }
      property.setHasXmlElementType(true);
    }
    if (!element.defaultValue().equals(ELEMENT_DECL_DEFAULT)) {
      property.setDefaultValue(element.defaultValue());
    }
  }
}

Fixed version (ground truth):
/** 
 * Process @XmlElement annotation on a given property.
 * @param property
 */
private void processXmlElement(Property property,TypeInfo info){
  if (helper.isAnnotationPresent(property.getElement(),XmlElement.class)) {
    XmlElement element=(XmlElement)helper.getAnnotation(property.getElement(),XmlElement.class);
    property.setIsRequired(element.required());
    property.setNillable(element.nillable());
    if (element.type() != XmlElement.DEFAULT.class && !(property.isSwaAttachmentRef())) {
      property.setOriginalType(property.getType());
      if (helper.isCollectionType(property.getType()) || property.getType().isArray()) {
        property.setGenericType(helper.getJavaClass(element.type()));
      }
 else {
        property.setType(helper.getJavaClass(element.type()));
      }
      property.setHasXmlElementType(true);
    }
    if (!element.defaultValue().equals(ELEMENT_DECL_DEFAULT)) {
      property.setDefaultValue(element.defaultValue());
    }
  }
}
Program: 64492
Project: 64492
Buggy source:
public static void setUp(String stageDir,boolean useLogger) throws WSDLException {
  if (builder == null) {
    builder=new DBWSBuilder();
  }
}

Fixed version (ground truth):
public static void setUp(String stageDir,boolean useLogger) throws WSDLException {
  comparer.setIgnoreOrder(true);
  if (builder == null) {
    builder=new DBWSBuilder();
  }
}
Program: 64497
Project: 64497
Buggy source:
public JAXBMarshaller createMarshaller(JAXBContext jaxbContext) throws javax.xml.bind.JAXBException {
  JAXBMarshaller marshaller=new JAXBMarshaller(xmlContext.createMarshaller(),new JAXBIntrospector(xmlContext));
  if (generator != null && generator.hasMarshalCallbacks()) {
    for (Iterator callIt=generator.getMarshalCallbacks().keySet().iterator(); callIt.hasNext(); ) {
      MarshalCallback cb=(MarshalCallback)generator.getMarshalCallbacks().get(callIt.next());
      cb.initialize(generator.getClass().getClassLoader());
    }
    marshaller.setMarshalCallbacks(generator.getMarshalCallbacks());
  }
  marshaller.setJaxbContext(jaxbContext);
  if (properties != null) {
    setPropertyOnMarshaller(JAXBContextProperties.MEDIA_TYPE,marshaller);
    setPropertyOnMarshaller(JAXBContextProperties.JSON_ATTRIBUTE_PREFIX,marshaller);
    setPropertyOnMarshaller(JAXBContextProperties.NAMESPACE_PREFIX_MAPPER,marshaller);
    setPropertyOnMarshaller(JAXBContextProperties.JSON_INCLUDE_ROOT,marshaller);
    setPropertyOnMarshaller(JAXBContextProperties.JSON_VALUE_WRAPPER,marshaller);
    setPropertyOnMarshaller(JAXBContextProperties.JSON_NAMESPACE_SEPARATOR,marshaller);
  }
  return marshaller;
}

Fixed version (ground truth):
public JAXBMarshaller createMarshaller(JAXBContext jaxbContext) throws javax.xml.bind.JAXBException {
  JAXBMarshaller marshaller=new JAXBMarshaller(xmlContext.createMarshaller(),new JAXBIntrospector(xmlContext));
  marshaller.setJaxbContext(jaxbContext);
  if (generator != null && generator.hasMarshalCallbacks()) {
    for (Iterator callIt=generator.getMarshalCallbacks().keySet().iterator(); callIt.hasNext(); ) {
      MarshalCallback cb=(MarshalCallback)generator.getMarshalCallbacks().get(callIt.next());
      cb.initialize(generator.getClass().getClassLoader());
    }
    marshaller.setMarshalCallbacks(generator.getMarshalCallbacks());
  }
  if (properties != null) {
    setPropertyOnMarshaller(JAXBContextProperties.MEDIA_TYPE,marshaller);
    setPropertyOnMarshaller(JAXBContextProperties.JSON_ATTRIBUTE_PREFIX,marshaller);
    setPropertyOnMarshaller(JAXBContextProperties.NAMESPACE_PREFIX_MAPPER,marshaller);
    setPropertyOnMarshaller(JAXBContextProperties.JSON_INCLUDE_ROOT,marshaller);
    setPropertyOnMarshaller(JAXBContextProperties.JSON_VALUE_WRAPPER,marshaller);
    setPropertyOnMarshaller(JAXBContextProperties.JSON_NAMESPACE_SEPARATOR,marshaller);
  }
  return marshaller;
}
Program: 64498
Project: 64498
Buggy source:
public void beforeMarshal(Object obj){
  if (classBasedMarshalEvents != null) {
    MarshalCallback callback=(MarshalCallback)classBasedMarshalEvents.get(obj.getClass().getName());
    if (callback != null && callback.getBeforeMarshalCallback() != null) {
      try {
        if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
          try {
            AccessController.doPrivileged(new PrivilegedMethodInvoker(callback.getBeforeMarshalCallback(),obj,new Object[]{marshaller}));
          }
 catch (          PrivilegedActionException ex) {
            if (ex.getCause() instanceof IllegalAccessException) {
              throw (IllegalAccessException)ex.getCause();
            }
            if (ex.getCause() instanceof InvocationTargetException) {
              throw (InvocationTargetException)ex.getCause();
            }
            throw (RuntimeException)ex.getCause();
          }
        }
 else {
          PrivilegedAccessHelper.invokeMethod(callback.getBeforeMarshalCallback(),obj,new Object[]{marshaller});
        }
      }
 catch (      Exception ex) {
      }
    }
  }
  if (listener != null) {
    listener.beforeMarshal(obj);
  }
}

Fixed version (ground truth):
public void beforeMarshal(Object obj){
  if (classBasedMarshalEvents != null) {
    MarshalCallback callback=(MarshalCallback)classBasedMarshalEvents.get(obj.getClass().getName());
    if (callback != null && callback.getBeforeMarshalCallback() != null) {
      try {
        if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
          try {
            AccessController.doPrivileged(new PrivilegedMethodInvoker(callback.getBeforeMarshalCallback(),obj,new Object[]{marshaller}));
          }
 catch (          PrivilegedActionException ex) {
            if (ex.getCause() instanceof IllegalAccessException) {
              throw (IllegalAccessException)ex.getCause();
            }
            if (ex.getCause() instanceof InvocationTargetException) {
              throw (InvocationTargetException)ex.getCause();
            }
            throw (RuntimeException)ex.getCause();
          }
        }
 else {
          PrivilegedAccessHelper.invokeMethod(callback.getBeforeMarshalCallback(),obj,new Object[]{marshaller});
        }
      }
 catch (      Exception ex) {
      }
    }
  }
  if (listener != null) {
    if (obj.getClass().equals(XMLRoot.class)) {
      obj=jaxbContext.createJAXBElementFromXMLRoot((XMLRoot)obj,((XMLRoot)obj).getDeclaredType());
    }
    listener.beforeMarshal(obj);
  }
}
Program: 64499
Project: 64499
Buggy source:
public JAXBMarshalListener(javax.xml.bind.Marshaller marshaller){
  this.marshaller=marshaller;
}

Fixed version (ground truth):
public JAXBMarshalListener(JAXBContext context,javax.xml.bind.Marshaller marshaller){
  jaxbContext=context;
  this.marshaller=marshaller;
}
Program: 64500
Project: 64500
Buggy source:
public void afterMarshal(Object obj){
  if (classBasedMarshalEvents != null) {
    MarshalCallback callback=(MarshalCallback)classBasedMarshalEvents.get(obj.getClass().getName());
    if (callback != null && callback.getAfterMarshalCallback() != null) {
      try {
        if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
          try {
            AccessController.doPrivileged(new PrivilegedMethodInvoker(callback.getAfterMarshalCallback(),obj,new Object[]{marshaller}));
          }
 catch (          PrivilegedActionException ex) {
            if (ex.getCause() instanceof IllegalAccessException) {
              throw (IllegalAccessException)ex.getCause();
            }
            if (ex.getCause() instanceof InvocationTargetException) {
              throw (InvocationTargetException)ex.getCause();
            }
            throw (RuntimeException)ex.getCause();
          }
        }
 else {
          PrivilegedAccessHelper.invokeMethod(callback.getAfterMarshalCallback(),obj,new Object[]{marshaller});
        }
      }
 catch (      Exception ex) {
      }
    }
  }
  if (listener != null) {
    listener.afterMarshal(obj);
  }
}

Fixed version (ground truth):
public void afterMarshal(Object obj){
  if (classBasedMarshalEvents != null) {
    MarshalCallback callback=(MarshalCallback)classBasedMarshalEvents.get(obj.getClass().getName());
    if (callback != null && callback.getAfterMarshalCallback() != null) {
      try {
        if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
          try {
            AccessController.doPrivileged(new PrivilegedMethodInvoker(callback.getAfterMarshalCallback(),obj,new Object[]{marshaller}));
          }
 catch (          PrivilegedActionException ex) {
            if (ex.getCause() instanceof IllegalAccessException) {
              throw (IllegalAccessException)ex.getCause();
            }
            if (ex.getCause() instanceof InvocationTargetException) {
              throw (InvocationTargetException)ex.getCause();
            }
            throw (RuntimeException)ex.getCause();
          }
        }
 else {
          PrivilegedAccessHelper.invokeMethod(callback.getAfterMarshalCallback(),obj,new Object[]{marshaller});
        }
      }
 catch (      Exception ex) {
      }
    }
  }
  if (listener != null) {
    if (obj.getClass().equals(XMLRoot.class)) {
      obj=jaxbContext.createJAXBElementFromXMLRoot((XMLRoot)obj,((XMLRoot)obj).getDeclaredType());
    }
    listener.afterMarshal(obj);
  }
}
Program: 64501
Project: 64501
Buggy source:
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);
}

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(jaxbContext,this));
  }
  ((JAXBMarshalListener)xmlMarshaller.getMarshalListener()).setClassBasedMarshalEvents(callbacks);
}
Program: 64502
Project: 64502
Buggy source:
public void setListener(Marshaller.Listener listener){
  if (xmlMarshaller.getMarshalListener() == null) {
    xmlMarshaller.setMarshalListener(new JAXBMarshalListener(this));
  }
  ((JAXBMarshalListener)xmlMarshaller.getMarshalListener()).setListener(listener);
}

Fixed version (ground truth):
public void setListener(Marshaller.Listener listener){
  if (xmlMarshaller.getMarshalListener() == null) {
    xmlMarshaller.setMarshalListener(new JAXBMarshalListener(jaxbContext,this));
  }
  ((JAXBMarshalListener)xmlMarshaller.getMarshalListener()).setListener(listener);
}
Program: 64504
Project: 64504
Buggy source:
private Object createJAXBElementOrUnwrapIfRequired(Object value){
  if (value instanceof XMLRoot) {
    JAXBElement jaxbElement=createJAXBElementFromXMLRoot((XMLRoot)value,Object.class);
    jaxbElement.setNil(((XMLRoot)value).isNil());
    return jaxbElement;
  }
 else   if (value instanceof WrappedValue) {
    return ((WrappedValue)value).getValue();
  }
  return value;
}

Fixed version (ground truth):
private Object createJAXBElementOrUnwrapIfRequired(Object value){
  if (value instanceof XMLRoot) {
    JAXBElement jaxbElement=jaxbContext.createJAXBElementFromXMLRoot((XMLRoot)value,Object.class);
    jaxbElement.setNil(((XMLRoot)value).isNil());
    return jaxbElement;
  }
 else   if (value instanceof WrappedValue) {
    return ((WrappedValue)value).getValue();
  }
  return value;
}
Program: 64505
Project: 64505
Buggy source:
/** 
 * Set the unqualified name of the field.
 */
public abstract void setName(String name);

Fixed version (ground truth):
/** 
 * Set the unqualified name of the field.
 */
public void setName(String name);
Program: 64506
Project: 64506
Buggy source:
/** 
 * Return the unqualified name of the field.
 */
public abstract String getName();

Fixed version (ground truth):
/** 
 * Return the unqualified name of the field.
 */
public String getName();
Program: 64507
Project: 64507
Buggy source:
public abstract Class getType();

Fixed version (ground truth):
public Class getType();
Program: 64508
Project: 64508
Buggy source:
/** 
 * Set the Java class type that corresponds to the field. The JDBC type is determined from the class type, this is used to optimize performance, and for binding.
 */
public abstract void setType(Class type);

Fixed version (ground truth):
/** 
 * Set the Java class type that corresponds to the field. The JDBC type is determined from the class type, this is used to optimize performance, and for binding.
 */
public void setType(Class type);
Program: 64509
Project: 64509
Buggy source:
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  Object value=unmarshalRecord.getCharacters().toString();
  boolean isCDATA=unmarshalRecord.isBufferCDATA();
  unmarshalRecord.resetStringBuffer();
  XMLField toWrite=xmlField;
  if (xmlField.isCDATA() != isCDATA) {
    toWrite=new XMLField(xmlField.getName());
    toWrite.setNamespaceResolver(xmlField.getNamespaceResolver());
    toWrite.setIsCDATA(isCDATA);
  }
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,xmlConversionManager,unmarshalRecord);
  }
  if (null == unmarshalRecord.getTransformationRecord()) {
    unmarshalRecord.setTransformationRecord(new XMLTransformationRecord("String_Node_Str",unmarshalRecord));
  }
  unmarshalRecord.getTransformationRecord().put(toWrite,value);
}

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

Fixed version (ground truth):
public Field getXMLField(){
  return xmlField;
}
Program: 64511
Project: 64511
Buggy source:
public void setXMLField(XMLField xmlField){
  this.xmlField=xmlField;
}

Fixed version (ground truth):
public void setXMLField(Field xmlField){
  this.xmlField=xmlField;
}
Program: 64512
Project: 64512
Buggy source:
protected void updateNamespaces(QName qname,MarshalRecord marshalRecord,XMLField xmlField){
  if (qname != null) {
    if (xmlField != null) {
      if (xmlField.isTypedTextField()) {
        if (xmlField.getSchemaType() == null) {
          if (qname.equals(XMLConstants.STRING_QNAME)) {
            return;
          }
        }
 else {
          if (xmlField.isSchemaType(qname)) {
            return;
          }
        }
      }
 else {
        return;
      }
    }
    String prefix=marshalRecord.getNamespaceResolver().resolveNamespaceURI(qname.getNamespaceURI());
    if ((prefix == null) || prefix.length() == 0) {
      if (XMLConstants.SCHEMA_URL.equals(qname.getNamespaceURI())) {
        prefix=marshalRecord.getNamespaceResolver().generatePrefix(XMLConstants.SCHEMA_PREFIX);
      }
 else {
        prefix=marshalRecord.getNamespaceResolver().generatePrefix();
      }
      marshalRecord.namespaceDeclaration(prefix,qname.getNamespaceURI());
    }
    String typeValue=null;
    if (marshalRecord.isNamespaceAware()) {
      typeValue=prefix + marshalRecord.getNamespaceSeparator() + qname.getLocalPart();
    }
 else {
      typeValue=qname.getLocalPart();
    }
    addTypeAttribute(marshalRecord,typeValue);
  }
}

Fixed version (ground truth):
protected void updateNamespaces(QName qname,MarshalRecord marshalRecord,Field xmlField){
  if (qname != null) {
    if (xmlField != null) {
      if (xmlField.isTypedTextField()) {
        if (xmlField.getSchemaType() == null) {
          if (qname.equals(XMLConstants.STRING_QNAME)) {
            return;
          }
        }
 else {
          if (xmlField.isSchemaType(qname)) {
            return;
          }
        }
      }
 else {
        return;
      }
    }
    String prefix=marshalRecord.getNamespaceResolver().resolveNamespaceURI(qname.getNamespaceURI());
    if ((prefix == null) || prefix.length() == 0) {
      if (XMLConstants.SCHEMA_URL.equals(qname.getNamespaceURI())) {
        prefix=marshalRecord.getNamespaceResolver().generatePrefix(XMLConstants.SCHEMA_PREFIX);
      }
 else {
        prefix=marshalRecord.getNamespaceResolver().generatePrefix();
      }
      marshalRecord.namespaceDeclaration(prefix,qname.getNamespaceURI());
    }
    String typeValue=null;
    if (marshalRecord.isNamespaceAware()) {
      typeValue=prefix + marshalRecord.getNamespaceSeparator() + qname.getLocalPart();
    }
 else {
      typeValue=qname.getLocalPart();
    }
    addTypeAttribute(marshalRecord,typeValue);
  }
}
Program: 64513
Project: 64513
Buggy source:
/** 
 * Return a reference for the given mapping and source object, that doesn't already contain an entry for the provided field. 
 * @return
 */
public Reference getReference(ObjectReferenceMapping mapping,Object sourceObject,XMLField xmlField){
  XMLField targetField=(XMLField)mapping.getSourceToTargetKeyFieldAssociations().get(xmlField);
  String tgtXpath=null;
  if (!(mapping.getReferenceClass() == null || mapping.getReferenceClass() == Object.class)) {
    if (targetField != null) {
      tgtXpath=targetField.getXPath();
    }
  }
  for (int x=0; x < references.size(); x++) {
    Reference reference=(Reference)references.get(x);
    if (reference.getMapping() == mapping && reference.getSourceObject() == sourceObject) {
      if (reference.getPrimaryKeyMap().get(tgtXpath) == null) {
        return reference;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return a reference for the given mapping and source object, that doesn't already contain an entry for the provided field. 
 * @return
 */
public Reference getReference(ObjectReferenceMapping mapping,Object sourceObject,Field xmlField){
  Field targetField=(Field)mapping.getSourceToTargetKeyFieldAssociations().get(xmlField);
  String tgtXpath=null;
  if (!(mapping.getReferenceClass() == null || mapping.getReferenceClass() == Object.class)) {
    if (targetField != null) {
      tgtXpath=targetField.getXPath();
    }
  }
  for (int x=0; x < references.size(); x++) {
    Reference reference=(Reference)references.get(x);
    if (reference.getMapping() == mapping && reference.getSourceObject() == sourceObject) {
      if (reference.getPrimaryKeyMap().get(tgtXpath) == null) {
        return reference;
      }
    }
  }
  return null;
}
Program: 64516
Project: 64516
Buggy source:
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session){
  super.initialize(session);
  Descriptor xmlDescriptor=(Descriptor)getDescriptor();
  if (xmlDescriptor.hasInheritance()) {
    CoreInheritancePolicy inheritancePolicy=xmlDescriptor.getInheritancePolicy();
    if (!inheritancePolicy.hasClassExtractor()) {
      XMLField classIndicatorField=new XMLField(inheritancePolicy.getClassIndicatorFieldName());
      classIndicatorField.setNamespaceResolver(xmlDescriptor.getNamespaceResolver());
    }
  }
  if (!xmlDescriptor.isLazilyInitialized()) {
    lazyInitialize();
  }
}

Fixed version (ground truth):
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session){
  super.initialize(session);
  Descriptor xmlDescriptor=(Descriptor)getDescriptor();
  if (xmlDescriptor.hasInheritance()) {
    CoreInheritancePolicy inheritancePolicy=xmlDescriptor.getInheritancePolicy();
    if (!inheritancePolicy.hasClassExtractor()) {
      Field classIndicatorField=new XMLField(inheritancePolicy.getClassIndicatorFieldName());
      classIndicatorField.setNamespaceResolver(xmlDescriptor.getNamespaceResolver());
    }
  }
  if (!xmlDescriptor.isLazilyInitialized()) {
    lazyInitialize();
  }
}
Program: 64518
Project: 64518
Buggy source:
private QName getSchemaType(XMLField xmlField,Object value,CoreAbstractSession session){
  QName schemaType=null;
  if (xmlField.isTypedTextField()) {
    schemaType=xmlField.getXMLType(value.getClass());
  }
 else   if (xmlField.isUnionField()) {
    return getSchemaTypeForUnion((XMLUnionField)xmlField,value,session);
  }
 else   if (xmlField.getSchemaType() != null) {
    schemaType=xmlField.getSchemaType();
  }
  return schemaType;
}

Fixed version (ground truth):
private QName getSchemaType(Field xmlField,Object value,CoreAbstractSession session){
  QName schemaType=null;
  if (xmlField.isTypedTextField()) {
    schemaType=xmlField.getXMLType(value.getClass());
  }
 else   if (xmlField.isUnionField()) {
    return getSchemaTypeForUnion((XMLUnionField)xmlField,value,session);
  }
 else   if (xmlField.getSchemaType() != null) {
    schemaType=xmlField.getSchemaType();
  }
  return schemaType;
}
Program: 64522
Project: 64522
Buggy source:
/** 
 * INTERNAL: Return an instance of the container class. Null should never be returned. A ValidationException is thrown on error.
 */
public Object containerInstance();

Fixed version (ground truth):
/** 
 * INTERNAL: Return an instance of the container class with the specified initial capacity. Null should never be returned. A ValidationException is thrown on error.
 */
public Object containerInstance(int initialCapacity);
Program: 64524
Project: 64524
Buggy source:
/** 
 * Indicates if element contains a given annotation.
 * @param element
 * @param annotationClass
 * @return
 */
public boolean isAnnotationPresent(JavaHasAnnotations element,Class annotationClass){
  if (element == null || annotationClass == null) {
    return false;
  }
  return (element.getAnnotation(jModel.getClass(annotationClass)) != null);
}

Fixed version (ground truth):
/** 
 * Indicates if element contains a given annotation.
 * @param element
 * @param annotationClass
 * @return
 */
public boolean isAnnotationPresent(JavaHasAnnotations element,Class annotationClass){
  if (element == null || annotationClass == null) {
    return false;
  }
  JavaClass annoJavaClass=annotationJavaClasses.get(annotationClass);
  if (annoJavaClass != null) {
    return (element.getAnnotation(annoJavaClass) != null);
  }
 else {
    annoJavaClass=jModel.getClass(annotationClass);
    annotationJavaClasses.put(annotationClass,annoJavaClass);
    return (element.getAnnotation(annoJavaClass) != null);
  }
}
Program: 64525
Project: 64525
Buggy source:
/** 
 * Get an annotation of type annotationClass if it's present on the AnnotatedElement elem.
 */
public Annotation getAnnotation(AnnotatedElement elem,Class annotationClass){
  return elem.getAnnotation(annotationClass);
}

Fixed version (ground truth):
/** 
 * Get an annotation of type annotationClass if it's present on the AnnotatedElement elem.
 */
public Annotation getAnnotation(AnnotatedElement elem,Class annotationClass){
  if (allAnnotationsMap.get(elem) == null) {
    getAnnotationsFromElement(elem);
  }
  return allAnnotationsMap.get(elem).get(annotationClass);
}
Program: 64526
Project: 64526
Buggy source:
/** 
 * Return true if the annotation annotationClass exists on the annotatedElement elem.
 */
public boolean isAnnotationPresent(AnnotatedElement elem,Class annotationClass){
  return elem.isAnnotationPresent(annotationClass);
}

Fixed version (ground truth):
/** 
 * Return true if the annotation annotationClass exists on the annotatedElement elem.
 */
public boolean isAnnotationPresent(AnnotatedElement elem,Class annotationClass){
  if (allAnnotationsMap.get(elem) == null) {
    getAnnotationsFromElement(elem);
  }
  return allAnnotationsMap.get(elem).keySet().contains(annotationClass);
}
Program: 64527
Project: 64527
Buggy source:
/** 
 * Get all annotations that exist on the AnnotatedElement elem
 */
public Annotation[] getAnnotations(AnnotatedElement elem){
  return elem.getAnnotations();
}

Fixed version (ground truth):
/** 
 * Get all annotations that exist on the AnnotatedElement elem
 */
public Annotation[] getAnnotations(AnnotatedElement elem){
  if (allAnnotationsMap.get(elem) == null) {
    getAnnotationsFromElement(elem);
  }
  Collection<Annotation> annos=allAnnotationsMap.get(elem).values();
  return (Annotation[])annos.toArray(new Annotation[annos.size()]);
}
Program: 64528
Project: 64528
Buggy source:
public JavaAnnotation getAnnotation(JavaClass arg0){
  if (arg0 != null && !isMetadataComplete) {
    Class annotationClass=((JavaClassImpl)arg0).getJavaClass();
    if (javaModelImpl.getAnnotationHelper().isAnnotationPresent(getAnnotatedElement(),annotationClass)) {
      return new JavaAnnotationImpl(javaModelImpl.getAnnotationHelper().getAnnotation(getAnnotatedElement(),annotationClass));
    }
  }
  return null;
}

Fixed version (ground truth):
public JavaAnnotation getAnnotation(JavaClass arg0){
  if (arg0 != null && !isMetadataComplete) {
    Class annotationClass=((JavaClassImpl)arg0).getJavaClass();
    Annotation anno=javaModelImpl.getAnnotationHelper().getAnnotation(getAnnotatedElement(),annotationClass);
    if (anno != null) {
      return new JavaAnnotationImpl(anno);
    }
  }
  return null;
}
Program: 64531
Project: 64531
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  suite.addTest(new EntityManagerJUnitTestCase("String_Node_Str"));
  return suite;
}
Program: 64533
Project: 64533
Buggy source:
@Override protected List addExtraNamespacesToNamespaceResolver(XMLDescriptor desc,XMLRecord marshalRecord,CoreAbstractSession session,boolean allowOverride,boolean ignoreEqualResolvers){
  if (rootXPathNode.getNonAttributeChildren() == null) {
    return null;
  }
 else {
    return super.addExtraNamespacesToNamespaceResolver(desc,marshalRecord,session,allowOverride,ignoreEqualResolvers);
  }
}

Fixed version (ground truth):
@Override protected List addExtraNamespacesToNamespaceResolver(Descriptor desc,XMLRecord marshalRecord,CoreAbstractSession session,boolean allowOverride,boolean ignoreEqualResolvers){
  if (rootXPathNode.getNonAttributeChildren() == null) {
    return null;
  }
 else {
    return super.addExtraNamespacesToNamespaceResolver(desc,marshalRecord,session,allowOverride,ignoreEqualResolvers);
  }
}
Program: 64536
Project: 64536
Buggy source:
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session){
  super.initialize(session);
  XMLDescriptor xmlDescriptor=(XMLDescriptor)getDescriptor();
  if (xmlDescriptor.hasInheritance()) {
    InheritancePolicy inheritancePolicy=xmlDescriptor.getInheritancePolicy();
    if (!inheritancePolicy.hasClassExtractor()) {
      XMLField classIndicatorField=new XMLField(inheritancePolicy.getClassIndicatorFieldName());
      classIndicatorField.setNamespaceResolver(xmlDescriptor.getNamespaceResolver());
    }
  }
  if (!xmlDescriptor.isLazilyInitialized()) {
    lazyInitialize();
  }
}

Fixed version (ground truth):
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session){
  super.initialize(session);
  Descriptor xmlDescriptor=(Descriptor)getDescriptor();
  if (xmlDescriptor.hasInheritance()) {
    CoreInheritancePolicy inheritancePolicy=xmlDescriptor.getInheritancePolicy();
    if (!inheritancePolicy.hasClassExtractor()) {
      XMLField classIndicatorField=new XMLField(inheritancePolicy.getClassIndicatorFieldName());
      classIndicatorField.setNamespaceResolver(xmlDescriptor.getNamespaceResolver());
    }
  }
  if (!xmlDescriptor.isLazilyInitialized()) {
    lazyInitialize();
  }
}
Program: 64541
Project: 64541
Buggy source:
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  try {
    XMLDescriptor workingDescriptor=findReferenceDescriptor(xPathFragment,unmarshalRecord,atts,xmlAnyObjectMapping,xmlAnyObjectMapping.getKeepAsElementPolicy());
    UnmarshalKeepAsElementPolicy policy=xmlAnyObjectMapping.getKeepAsElementPolicy();
    if (((workingDescriptor == null) && (policy == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT)) || (policy == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) {
      setupHandlerForKeepAsElementPolicy(unmarshalRecord,xPathFragment,atts);
    }
 else     if (workingDescriptor != null) {
      processChild(xPathFragment,unmarshalRecord,atts,workingDescriptor,xmlAnyObjectMapping);
    }
 else {
      AnyMappingContentHandler handler=new AnyMappingContentHandler(unmarshalRecord,xmlAnyObjectMapping.usesXMLRoot());
      String qnameString=xPathFragment.getLocalName();
      if (xPathFragment.getPrefix() != null) {
        qnameString=xPathFragment.getPrefix() + XMLConstants.COLON + qnameString;
      }
      handler.startElement(xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),qnameString,atts);
      XMLReader xmlReader=unmarshalRecord.getXMLReader();
      xmlReader.setContentHandler(handler);
      xmlReader.setLexicalHandler(handler);
      return true;
    }
  }
 catch (  SAXException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
  return true;
}

Fixed version (ground truth):
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  try {
    Descriptor workingDescriptor=findReferenceDescriptor(xPathFragment,unmarshalRecord,atts,xmlAnyObjectMapping,xmlAnyObjectMapping.getKeepAsElementPolicy());
    UnmarshalKeepAsElementPolicy policy=xmlAnyObjectMapping.getKeepAsElementPolicy();
    if (((workingDescriptor == null) && (policy == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT)) || (policy == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) {
      setupHandlerForKeepAsElementPolicy(unmarshalRecord,xPathFragment,atts);
    }
 else     if (workingDescriptor != null) {
      processChild(xPathFragment,unmarshalRecord,atts,workingDescriptor,xmlAnyObjectMapping);
    }
 else {
      AnyMappingContentHandler handler=new AnyMappingContentHandler(unmarshalRecord,xmlAnyObjectMapping.usesXMLRoot());
      String qnameString=xPathFragment.getLocalName();
      if (xPathFragment.getPrefix() != null) {
        qnameString=xPathFragment.getPrefix() + XMLConstants.COLON + qnameString;
      }
      handler.startElement(xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),qnameString,atts);
      XMLReader xmlReader=unmarshalRecord.getXMLReader();
      xmlReader.setContentHandler(handler);
      xmlReader.setLexicalHandler(handler);
      return true;
    }
  }
 catch (  SAXException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
  return true;
}
Program: 64543
Project: 64543
Buggy source:
@Override protected XMLDescriptor findReferenceDescriptor(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts,Mapping mapping,UnmarshalKeepAsElementPolicy policy){
  XMLDescriptor referenceDescriptor=super.findReferenceDescriptor(xPathFragment,unmarshalRecord,atts,mapping,policy);
  if (referenceDescriptor == null) {
    XMLContext xmlContext=unmarshalRecord.getUnmarshaller().getXMLContext();
    XPathQName xpathQName=new XPathQName(xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),unmarshalRecord.isNamespaceAware());
    referenceDescriptor=xmlContext.getDescriptor(xpathQName);
    if (referenceDescriptor != null && referenceDescriptor.isWrapper()) {
      referenceDescriptor=null;
    }
  }
  return referenceDescriptor;
}

Fixed version (ground truth):
@Override protected Descriptor findReferenceDescriptor(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts,Mapping mapping,UnmarshalKeepAsElementPolicy policy){
  Descriptor referenceDescriptor=super.findReferenceDescriptor(xPathFragment,unmarshalRecord,atts,mapping,policy);
  if (referenceDescriptor == null) {
    XMLContext xmlContext=unmarshalRecord.getUnmarshaller().getXMLContext();
    XPathQName xpathQName=new XPathQName(xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),unmarshalRecord.isNamespaceAware());
    referenceDescriptor=(Descriptor)xmlContext.getDescriptor(xpathQName);
    if (referenceDescriptor != null && referenceDescriptor.isWrapper()) {
      referenceDescriptor=null;
    }
  }
  return referenceDescriptor;
}