nus-yam/ex-repair huggingface dataset:
Program: 65193
Project: 65193
Buggy source:
public void testCreateMarshallerSetMediaTypeJSONString() throws JAXBException {
  Class[] classes=new Class[1];
  classes[0]=Employee.class;
  JAXBContext ctx=JAXBContextFactory.createContext(classes,null);
  Marshaller m=ctx.createMarshaller();
  m.setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  assertEquals(MediaType.APPLICATION_JSON,((JAXBMarshaller)m).getXMLMarshaller().getMediaType());
}

Fixed version (ground truth):
public void testCreateMarshallerSetMediaTypeJSONString() throws JAXBException {
  Class[] classes=new Class[1];
  classes[0]=Employee.class;
  JAXBContext ctx=JAXBContextFactory.createContext(classes,null);
  Marshaller m=ctx.createMarshaller();
  m.setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  assertEquals(MediaType.APPLICATION_JSON,m.getProperty(MarshallerProperties.MEDIA_TYPE));
  assertEquals(MediaType.APPLICATION_JSON,((JAXBMarshaller)m).getXMLMarshaller().getMediaType());
}
Program: 65194
Project: 65194
Buggy source:
public void testCreateContextWithNullMediaType() throws JAXBException {
  Class[] classes=new Class[1];
  classes[0]=Employee.class;
  Map props=new HashMap();
  props.put(JAXBContextProperties.MEDIA_TYPE,null);
  JAXBContext ctx=JAXBContextFactory.createContext(classes,null);
  JAXBMarshaller m=(JAXBMarshaller)ctx.createMarshaller();
  assertEquals("String_Node_Str",m.getProperty(MarshallerProperties.MEDIA_TYPE));
  assertEquals(MediaType.APPLICATION_XML,((JAXBMarshaller)m).getXMLMarshaller().getMediaType());
  JAXBUnmarshaller u=(JAXBUnmarshaller)ctx.createUnmarshaller();
  assertEquals("String_Node_Str",u.getProperty(UnmarshallerProperties.MEDIA_TYPE));
  assertEquals(MediaType.APPLICATION_XML,((JAXBUnmarshaller)u).getXMLUnmarshaller().getMediaType());
}

Fixed version (ground truth):
public void testCreateContextWithNullMediaType() throws JAXBException {
  Class[] classes=new Class[1];
  classes[0]=Employee.class;
  Map props=new HashMap();
  props.put(JAXBContextProperties.MEDIA_TYPE,null);
  JAXBContext ctx=JAXBContextFactory.createContext(classes,null);
  JAXBMarshaller m=(JAXBMarshaller)ctx.createMarshaller();
  assertEquals(MediaType.APPLICATION_XML,m.getProperty(MarshallerProperties.MEDIA_TYPE));
  assertEquals(MediaType.APPLICATION_XML,((JAXBMarshaller)m).getXMLMarshaller().getMediaType());
  JAXBUnmarshaller u=(JAXBUnmarshaller)ctx.createUnmarshaller();
  assertEquals(MediaType.APPLICATION_XML,u.getProperty(UnmarshallerProperties.MEDIA_TYPE));
  assertEquals(MediaType.APPLICATION_XML,((JAXBUnmarshaller)u).getXMLUnmarshaller().getMediaType());
}
Program: 65195
Project: 65195
Buggy source:
public void testCreateContextWithNoMediaType() throws JAXBException {
  Class[] classes=new Class[1];
  classes[0]=Employee.class;
  JAXBContext ctx=JAXBContextFactory.createContext(classes,null);
  JAXBMarshaller m=(JAXBMarshaller)ctx.createMarshaller();
  assertEquals("String_Node_Str",m.getProperty(MarshallerProperties.MEDIA_TYPE));
  assertEquals(MediaType.APPLICATION_XML,((JAXBMarshaller)m).getXMLMarshaller().getMediaType());
  JAXBUnmarshaller u=(JAXBUnmarshaller)ctx.createUnmarshaller();
  assertEquals("String_Node_Str",u.getProperty(UnmarshallerProperties.MEDIA_TYPE));
  assertEquals(MediaType.APPLICATION_XML,((JAXBUnmarshaller)u).getXMLUnmarshaller().getMediaType());
}

Fixed version (ground truth):
public void testCreateContextWithNoMediaType() throws JAXBException {
  Class[] classes=new Class[1];
  classes[0]=Employee.class;
  JAXBContext ctx=JAXBContextFactory.createContext(classes,null);
  JAXBMarshaller m=(JAXBMarshaller)ctx.createMarshaller();
  assertEquals(MediaType.APPLICATION_XML,m.getProperty(MarshallerProperties.MEDIA_TYPE));
  assertEquals(MediaType.APPLICATION_XML,((JAXBMarshaller)m).getXMLMarshaller().getMediaType());
  JAXBUnmarshaller u=(JAXBUnmarshaller)ctx.createUnmarshaller();
  assertEquals(MediaType.APPLICATION_XML,u.getProperty(UnmarshallerProperties.MEDIA_TYPE));
  assertEquals(MediaType.APPLICATION_XML,((JAXBUnmarshaller)u).getXMLUnmarshaller().getMediaType());
}
Program: 65196
Project: 65196
Buggy source:
public void testCreateUnmarshallerSetMediaTypeJSONString() throws JAXBException {
  Class[] classes=new Class[1];
  classes[0]=Employee.class;
  JAXBContext ctx=JAXBContextFactory.createContext(classes,null);
  Unmarshaller u=ctx.createUnmarshaller();
  u.setProperty(UnmarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  assertEquals(MediaType.APPLICATION_JSON,((JAXBUnmarshaller)u).getXMLUnmarshaller().getMediaType());
}

Fixed version (ground truth):
public void testCreateUnmarshallerSetMediaTypeJSONString() throws JAXBException {
  Class[] classes=new Class[1];
  classes[0]=Employee.class;
  JAXBContext ctx=JAXBContextFactory.createContext(classes,null);
  Unmarshaller u=ctx.createUnmarshaller();
  u.setProperty(UnmarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  assertEquals(MediaType.APPLICATION_JSON,u.getProperty(MarshallerProperties.MEDIA_TYPE));
  assertEquals(MediaType.APPLICATION_JSON,((JAXBUnmarshaller)u).getXMLUnmarshaller().getMediaType());
}
Program: 65201
Project: 65201
Buggy source:
@SuppressWarnings("String_Node_Str") @Test public void strongRefCursorTest(){
}

Fixed version (ground truth):
@Test public void strongRefCursorTest(){
  Invocation invocation=new Invocation("String_Node_Str");
  invocation.setParameter("String_Node_Str","String_Node_Str");
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  Document doc=xmlPlatform.createDocument();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(MIKE_NAMES_XML));
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}
Program: 65203
Project: 65203
Buggy source:
@AfterClass public static void tearDown(){
  if (ddlDrop) {
    runDdl(conn,DROP_STRONGLY_TYPED_REF_CURSOR_TEST_PACKAGE,ddlDebug);
    runDdl(conn,DROP_STRONGLY_TYPED_REF_CURSOR_TABLE,ddlDebug);
  }
}

Fixed version (ground truth):
@AfterClass public static void tearDown(){
  if (ddlDrop) {
    runDdl(conn,DROP_STRONGLY_TYPED_REF_CURSOR_TEST_PACKAGE,ddlDebug);
    runDdl(conn,DROP_STRONGLY_TYPED_REF_CURSOR_TABLE,ddlDebug);
    runDdl(conn,DROP_TAB1_SHADOW_TYPE,ddlDebug);
  }
}
Program: 65204
Project: 65204
Buggy source:
/** 
 * Indicates if a given DatabaseType is considered 'complex', i.e. is one of PLSQLRecordType, PLSQLCollectionType, VArrayType,  ObjectType, or NestedTableType
 */
public static boolean isTypeComplex(DatabaseType dbType){
  return dbType.isPLSQLType() || (dbType.isPLSQLCursorType() && !((PLSQLCursorType)dbType).isWeaklyTyped()) || dbType.isVArrayType()|| dbType.isObjectType()|| dbType.isObjectTableType();
}

Fixed version (ground truth):
/** 
 * Indicates if a given DatabaseType is considered 'complex', i.e. is one of PLSQLRecordType, PLSQLCollectionType, VArrayType,  ObjectType, or NestedTableType
 */
public static boolean isTypeComplex(DatabaseType dbType){
  return dbType.isPLSQLType() || dbType.isVArrayType() || dbType.isObjectType()|| dbType.isObjectTableType();
}
Program: 65205
Project: 65205
Buggy source:
public DynamicXMLMetadataSource(String persistenceUnitName,Server session,String packageName){
  ObjectFactory objectFactory=new ObjectFactory();
  xmlBindings=new XmlBindings();
  xmlBindings.setPackageName(packageName);
  JavaTypes javaTypes=new JavaTypes();
  xmlBindings.setJavaTypes(javaTypes);
  XmlSchema xmlSchema=new XmlSchema();
  XmlNs atomNs=new XmlNs();
  atomNs.setPrefix(LINK_PREFIX);
  atomNs.setNamespaceUri(LINK_NAMESPACE_URI);
  xmlSchema.getXmlNs().add(atomNs);
  xmlBindings.setXmlSchema(xmlSchema);
  for (  ClassDescriptor ormDescriptor : session.getProject().getOrderedDescriptors()) {
    String descriptorPackageName=ormDescriptor.getJavaClassName().substring(0,ormDescriptor.getJavaClassName().lastIndexOf('.'));
    if (descriptorPackageName.equals(packageName)) {
      javaTypes.getJavaType().add(createJAXBType(ormDescriptor,objectFactory));
    }
  }
}

Fixed version (ground truth):
public DynamicXMLMetadataSource(String persistenceUnitName,Server session,String packageName){
  System.out.println("String_Node_Str" + packageName);
  ObjectFactory objectFactory=new ObjectFactory();
  xmlBindings=new XmlBindings();
  xmlBindings.setPackageName(packageName);
  JavaTypes javaTypes=new JavaTypes();
  xmlBindings.setJavaTypes(javaTypes);
  XmlSchema xmlSchema=new XmlSchema();
  XmlNs atomNs=new XmlNs();
  atomNs.setPrefix(LINK_PREFIX);
  atomNs.setNamespaceUri(LINK_NAMESPACE_URI);
  xmlSchema.getXmlNs().add(atomNs);
  xmlBindings.setXmlSchema(xmlSchema);
  for (  ClassDescriptor ormDescriptor : session.getProject().getOrderedDescriptors()) {
    System.out.println("String_Node_Str" + packageName);
    System.out.println("String_Node_Str" + ormDescriptor);
    System.out.println("String_Node_Str" + ormDescriptor.getJavaClassName());
    String descriptorPackageName="String_Node_Str";
    if (ormDescriptor.getJavaClassName().lastIndexOf('.') > 0) {
      descriptorPackageName=ormDescriptor.getJavaClassName().substring(0,ormDescriptor.getJavaClassName().lastIndexOf('.'));
    }
    if (descriptorPackageName.equals(packageName)) {
      javaTypes.getJavaType().add(createJAXBType(ormDescriptor,objectFactory));
    }
  }
}
Program: 65206
Project: 65206
Buggy source:
@Test public void testWarningLogs(){
  assertTrue("String_Node_Str",dbwsLogger.hasWarnings());
  List<String> warnings=dbwsLogger.getWarnings();
  assertTrue("String_Node_Str" + warnings.size() + "String_Node_Str",warnings.size() == 2);
  assertTrue("String_Node_Str" + WARNING_MSG_1 + "String_Node_Str"+ warnings.get(0)+ "String_Node_Str",WARNING_MSG_1.equals(warnings.get(0)));
  assertTrue("String_Node_Str" + WARNING_MSG_2 + "String_Node_Str"+ warnings.get(1)+ "String_Node_Str",WARNING_MSG_2.equals(warnings.get(1)));
}

Fixed version (ground truth):
@Test public void testWarningLogs(){
  assertTrue("String_Node_Str",dbwsLogger.hasWarnings());
  List<String> warnings=dbwsLogger.getWarnings();
  assertTrue("String_Node_Str" + warnings.size() + "String_Node_Str",warnings.size() == 2);
  assertTrue("String_Node_Str" + WARNING_MSG_1 + "String_Node_Str"+ warnings.get(0)+ "String_Node_Str",WARNING_MSG_1.equalsIgnoreCase(warnings.get(0)));
  assertTrue("String_Node_Str" + WARNING_MSG_2 + "String_Node_Str"+ warnings.get(1)+ "String_Node_Str",WARNING_MSG_2.equalsIgnoreCase(warnings.get(1)));
}
Program: 65208
Project: 65208
Buggy source:
public void marshalWithoutRootElement(TreeObjectBuilder treeObjectBuilder,Object object,XMLDescriptor descriptor,XMLRoot root,boolean isXMLRoot){
  treeObjectBuilder.addXsiTypeAndClassIndicatorIfRequired(this,descriptor,null,descriptor.getDefaultRootElementField(),root,object,isXMLRoot,true);
  treeObjectBuilder.marshalAttributes(this,object,session);
}

Fixed version (ground truth):
public void marshalWithoutRootElement(TreeObjectBuilder treeObjectBuilder,Object object,XMLDescriptor descriptor,XMLRoot root,boolean isXMLRoot){
  if (treeObjectBuilder != null) {
    treeObjectBuilder.addXsiTypeAndClassIndicatorIfRequired(this,descriptor,null,descriptor.getDefaultRootElementField(),root,object,isXMLRoot,true);
    treeObjectBuilder.marshalAttributes(this,object,session);
  }
}
Program: 65210
Project: 65210
Buggy source:
public String resolveNamespacePrefix(Node contextNode,String namespacePrefix) throws XMLPlatformException {
  if (null == namespacePrefix) {
    if (null == contextNode.getPrefix()) {
      return contextNode.getNamespaceURI();
    }
  }
 else   if (namespacePrefix.equals(contextNode.getPrefix())) {
    return contextNode.getNamespaceURI();
  }
  if (contextNode.getNodeType() == Node.ELEMENT_NODE) {
    Element contextElement=(Element)contextNode;
    Attr namespaceDeclaration=contextElement.getAttributeNode("String_Node_Str" + namespacePrefix);
    if (null != namespaceDeclaration) {
      return namespaceDeclaration.getValue();
    }
  }
  Node parentNode=contextNode.getParentNode();
  if (parentNode != null && parentNode.getNodeType() == Node.ELEMENT_NODE) {
    return resolveNamespacePrefix(parentNode,namespacePrefix);
  }
  return null;
}

Fixed version (ground truth):
public String resolveNamespacePrefix(Node contextNode,String namespacePrefix) throws XMLPlatformException {
  if (null == namespacePrefix) {
    if (null == contextNode.getPrefix()) {
      return contextNode.getNamespaceURI();
    }
  }
 else   if (namespacePrefix.equals(contextNode.getPrefix())) {
    return contextNode.getNamespaceURI();
  }
  if (contextNode.getNodeType() == Node.ELEMENT_NODE) {
    Element contextElement=(Element)contextNode;
    Attr namespaceDeclaration=null;
    if (namespacePrefix != null) {
      namespaceDeclaration=contextElement.getAttributeNode("String_Node_Str" + namespacePrefix);
    }
 else {
      namespaceDeclaration=contextElement.getAttributeNode(XMLConstants.XMLNS);
    }
    if (null != namespaceDeclaration) {
      return namespaceDeclaration.getValue();
    }
  }
  Node parentNode=contextNode.getParentNode();
  if (parentNode != null && parentNode.getNodeType() == Node.ELEMENT_NODE) {
    return resolveNamespacePrefix(parentNode,namespacePrefix);
  }
  return null;
}
Program: 65211
Project: 65211
Buggy source:
/** 
 * Create the control XmlAnyAttributeSubTypeMapModel.
 */
public Object getControlObject(){
  XmlAnyAttributeSubTypeMapModel anyAttributeSubTypeMapModel=new XmlAnyAttributeSubTypeMapModel();
  HashMap children=new HashMap();
  QName qname=new QName(OTHER_NS,CHILD1_NAME);
  children.put(qname,NAME_1);
  qname=new QName(OTHER_NS,CHILD2_NAME);
  children.put(qname,NAME_2);
  anyAttributeSubTypeMapModel.children=children;
  return anyAttributeSubTypeMapModel;
}

Fixed version (ground truth):
/** 
 * Create the control XmlAnyAttributeSubTypeMapModel.
 */
public Object getControlObject(){
  XmlAnyAttributeSubTypeMapModel anyAttributeSubTypeMapModel=new XmlAnyAttributeSubTypeMapModel();
  LinkedHashMap children=new LinkedHashMap();
  QName qname=new QName(OTHER_NS,CHILD1_NAME);
  children.put(qname,NAME_1);
  qname=new QName(OTHER_NS,CHILD2_NAME);
  children.put(qname,NAME_2);
  anyAttributeSubTypeMapModel.children=children;
  return anyAttributeSubTypeMapModel;
}
Program: 65212
Project: 65212
Buggy source:
public HashMap<QName,String> getChildren(){
  return children;
}

Fixed version (ground truth):
public Map<QName,String> getChildren(){
  return children;
}
Program: 65213
Project: 65213
Buggy source:
public boolean equals(Object obj){
  if (obj == null) {
    return false;
  }
  XmlAnyAttributeSubTypeMapModel modelObj;
  try {
    modelObj=(XmlAnyAttributeSubTypeMapModel)obj;
  }
 catch (  ClassCastException e) {
    return false;
  }
  HashMap thisChildren=this.children;
  HashMap otherChildren=modelObj.children;
  if (thisChildren == null) {
    return (otherChildren == null || otherChildren.size() == 0);
  }
  if (otherChildren == null) {
    return (thisChildren.size() == 0);
  }
  if (thisChildren.size() != otherChildren.size()) {
    return false;
  }
  Iterator values1=thisChildren.keySet().iterator();
  while (values1.hasNext()) {
    Object key1=values1.next();
    Object value1=thisChildren.get(key1);
    Object value2=otherChildren.get(key1);
    if (!(value1.equals(value2))) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean equals(Object obj){
  if (obj == null) {
    return false;
  }
  XmlAnyAttributeSubTypeMapModel modelObj;
  try {
    modelObj=(XmlAnyAttributeSubTypeMapModel)obj;
  }
 catch (  ClassCastException e) {
    return false;
  }
  Map thisChildren=this.children;
  Map otherChildren=modelObj.children;
  if (thisChildren == null) {
    return (otherChildren == null || otherChildren.size() == 0);
  }
  if (otherChildren == null) {
    return (thisChildren.size() == 0);
  }
  if (thisChildren.size() != otherChildren.size()) {
    return false;
  }
  Iterator values1=thisChildren.keySet().iterator();
  while (values1.hasNext()) {
    Object key1=values1.next();
    Object value1=thisChildren.get(key1);
    Object value2=otherChildren.get(key1);
    if (!(value1.equals(value2))) {
      return false;
    }
  }
  return true;
}
Program: 65214
Project: 65214
Buggy source:
public void setChildren(HashMap<QName,String> children){
  this.children=children;
}

Fixed version (ground truth):
public void setChildren(Map<QName,String> children){
  this.children=children;
}
Program: 65216
Project: 65216
Buggy source:
public Object unmarshalEntity(String type,String tenantId,MediaType acceptedMedia,InputStream in) throws JAXBException {
  Unmarshaller unmarshaller=getJAXBContext().createUnmarshaller();
  unmarshaller.setProperty(JAXBContext.JSON_INCLUDE_ROOT,Boolean.FALSE);
  unmarshaller.setProperty(MEDIA_TYPE,acceptedMedia.toString());
  unmarshaller.setAdapter(new LinkAdapter(getBaseURI().toString(),this));
  JAXBElement<?> element=unmarshaller.unmarshal(new StreamSource(in),getClass(type));
  return element.getValue();
}

Fixed version (ground truth):
public Object unmarshalEntity(String type,String tenantId,MediaType acceptedMedia,InputStream in) throws JAXBException {
  Unmarshaller unmarshaller=getJAXBContext().createUnmarshaller();
  unmarshaller.setProperty(UnmarshallerProperties.JSON_INCLUDE_ROOT,Boolean.FALSE);
  unmarshaller.setProperty(UnmarshallerProperties.MEDIA_TYPE,acceptedMedia.toString());
  unmarshaller.setAdapter(new LinkAdapter(getBaseURI().toString(),this));
  JAXBElement<?> element=unmarshaller.unmarshal(new StreamSource(in),getClass(type));
  return element.getValue();
}
Program: 65217
Project: 65217
Buggy source:
protected SessionBeanCall unmarshallSessionBeanCall(InputStream data) throws JAXBException {
  Class[] jaxbClasses=new Class[]{SessionBeanCall.class};
  JAXBContext context=(JAXBContext)JAXBContextFactory.createContext(jaxbClasses,null);
  Unmarshaller unmarshaller=context.createUnmarshaller();
  unmarshaller.setProperty(JAXBContext.JSON_INCLUDE_ROOT,Boolean.FALSE);
  unmarshaller.setProperty(MEDIA_TYPE,MediaType.APPLICATION_JSON);
  StreamSource ss=new StreamSource(data);
  return unmarshaller.unmarshal(ss,SessionBeanCall.class).getValue();
}

Fixed version (ground truth):
protected SessionBeanCall unmarshallSessionBeanCall(InputStream data) throws JAXBException {
  Class[] jaxbClasses=new Class[]{SessionBeanCall.class};
  JAXBContext context=(JAXBContext)JAXBContextFactory.createContext(jaxbClasses,null);
  Unmarshaller unmarshaller=context.createUnmarshaller();
  unmarshaller.setProperty(UnmarshallerProperties.JSON_INCLUDE_ROOT,Boolean.FALSE);
  unmarshaller.setProperty(UnmarshallerProperties.MEDIA_TYPE,MediaType.APPLICATION_JSON);
  StreamSource ss=new StreamSource(data);
  return unmarshaller.unmarshal(ss,SessionBeanCall.class).getValue();
}
Program: 65218
Project: 65218
Buggy source:
protected String marshallMetadata(Object metadata,String mediaType) throws JAXBException {
  Class[] jaxbClasses=new Class[]{Link.class,Attribute.class,Descriptor.class,LinkTemplate.class,PersistenceUnit.class,Query.class};
  JAXBContext context=(JAXBContext)JAXBContextFactory.createContext(jaxbClasses,null);
  Marshaller marshaller=context.createMarshaller();
  marshaller.setProperty(JAXBContext.JSON_INCLUDE_ROOT,Boolean.FALSE);
  marshaller.setProperty(MEDIA_TYPE,mediaType);
  StringWriter writer=new StringWriter();
  marshaller.marshal(metadata,writer);
  return writer.toString();
}

Fixed version (ground truth):
protected String marshallMetadata(Object metadata,String mediaType) throws JAXBException {
  Class[] jaxbClasses=new Class[]{Link.class,Attribute.class,Descriptor.class,LinkTemplate.class,PersistenceUnit.class,Query.class};
  JAXBContext context=(JAXBContext)JAXBContextFactory.createContext(jaxbClasses,null);
  Marshaller marshaller=context.createMarshaller();
  marshaller.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT,Boolean.FALSE);
  marshaller.setProperty(MarshallerProperties.MEDIA_TYPE,mediaType);
  StringWriter writer=new StringWriter();
  marshaller.marshal(metadata,writer);
  return writer.toString();
}
Program: 65219
Project: 65219
Buggy source:
public static Marshaller createMarshaller(PersistenceContext context,MediaType mediaType) throws JAXBException {
  Marshaller marshaller=context.getJAXBContext().createMarshaller();
  marshaller.setProperty(MEDIA_TYPE,mediaType.toString());
  marshaller.setProperty(org.eclipse.persistence.jaxb.JAXBContext.JSON_INCLUDE_ROOT,false);
  marshaller.setAdapter(new LinkAdapter(context.getBaseURI().toString(),context));
  marshaller.setListener(new Marshaller.Listener(){
    @Override public void beforeMarshal(    Object source){
      if (source instanceof DynamicEntity) {
        DynamicEntityImpl sourceImpl=(DynamicEntityImpl)source;
        PropertyChangeListener listener=sourceImpl._persistence_getPropertyChangeListener();
        sourceImpl._persistence_setPropertyChangeListener(null);
        ((DynamicEntity)source).set("String_Node_Str",source);
        sourceImpl._persistence_setPropertyChangeListener(listener);
      }
    }
  }
);
  return marshaller;
}

Fixed version (ground truth):
public static Marshaller createMarshaller(PersistenceContext context,MediaType mediaType) throws JAXBException {
  Marshaller marshaller=context.getJAXBContext().createMarshaller();
  marshaller.setProperty(MarshallerProperties.MEDIA_TYPE,mediaType.toString());
  marshaller.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT,false);
  marshaller.setAdapter(new LinkAdapter(context.getBaseURI().toString(),context));
  marshaller.setListener(new Marshaller.Listener(){
    @Override public void beforeMarshal(    Object source){
      if (source instanceof DynamicEntity) {
        DynamicEntityImpl sourceImpl=(DynamicEntityImpl)source;
        PropertyChangeListener listener=sourceImpl._persistence_getPropertyChangeListener();
        sourceImpl._persistence_setPropertyChangeListener(null);
        ((DynamicEntity)source).set("String_Node_Str",source);
        sourceImpl._persistence_setPropertyChangeListener(listener);
      }
    }
  }
);
  return marshaller;
}
Program: 65220
Project: 65220
Buggy source:
public void testObjectToXMLEventWriter() throws Exception {
  if (XML_OUTPUT_FACTORY != null) {
    StringWriter writer=new StringWriter();
    XMLOutputFactory factory=XMLOutputFactory.newInstance();
    factory.setProperty(factory.IS_REPAIRING_NAMESPACES,new Boolean(false));
    XMLEventWriter eventWriter=factory.createXMLEventWriter(writer);
    Object objectToWrite=getWriteControlObject();
    XMLDescriptor desc=null;
    if (objectToWrite instanceof XMLRoot) {
      desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(((XMLRoot)objectToWrite).getObject().getClass());
    }
 else {
      desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(objectToWrite.getClass());
    }
    jaxbMarshaller.setProperty(org.eclipse.persistence.jaxb.JAXBContext.MEDIA_TYPE,"String_Node_Str");
    int sizeBefore=getNamespaceResolverSize(desc);
    jaxbMarshaller.marshal(objectToWrite,eventWriter);
    eventWriter.flush();
    int sizeAfter=getNamespaceResolverSize(desc);
    assertEquals(sizeBefore,sizeAfter);
    StringReader reader=new StringReader(writer.toString());
    InputSource inputSource=new InputSource(reader);
    Document testDocument=parser.parse(inputSource);
    writer.close();
    reader.close();
    objectToXMLDocumentTest(testDocument);
  }
}

Fixed version (ground truth):
public void testObjectToXMLEventWriter() throws Exception {
  if (XML_OUTPUT_FACTORY != null) {
    StringWriter writer=new StringWriter();
    XMLOutputFactory factory=XMLOutputFactory.newInstance();
    factory.setProperty(factory.IS_REPAIRING_NAMESPACES,new Boolean(false));
    XMLEventWriter eventWriter=factory.createXMLEventWriter(writer);
    Object objectToWrite=getWriteControlObject();
    XMLDescriptor desc=null;
    if (objectToWrite instanceof XMLRoot) {
      desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(((XMLRoot)objectToWrite).getObject().getClass());
    }
 else {
      desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(objectToWrite.getClass());
    }
    jaxbMarshaller.setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
    int sizeBefore=getNamespaceResolverSize(desc);
    jaxbMarshaller.marshal(objectToWrite,eventWriter);
    eventWriter.flush();
    int sizeAfter=getNamespaceResolverSize(desc);
    assertEquals(sizeBefore,sizeAfter);
    StringReader reader=new StringReader(writer.toString());
    InputSource inputSource=new InputSource(reader);
    Document testDocument=parser.parse(inputSource);
    writer.close();
    reader.close();
    objectToXMLDocumentTest(testDocument);
  }
}
Program: 65221
Project: 65221
Buggy source:
public void objectToXMLStringWriter(Object objectToWrite) throws Exception {
  StringWriter writer=new StringWriter();
  XMLDescriptor desc=null;
  if (objectToWrite instanceof XMLRoot) {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(((XMLRoot)objectToWrite).getObject().getClass());
  }
 else {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(objectToWrite.getClass());
  }
  int sizeBefore=getNamespaceResolverSize(desc);
  jaxbMarshaller.setProperty(org.eclipse.persistence.jaxb.JAXBContext.MEDIA_TYPE,"String_Node_Str");
  jaxbMarshaller.marshal(objectToWrite,writer);
  int sizeAfter=getNamespaceResolverSize(desc);
  assertEquals(sizeBefore,sizeAfter);
  StringReader reader=new StringReader(writer.toString());
  InputSource inputSource=new InputSource(reader);
  Document testDocument=parser.parse(inputSource);
  writer.close();
  reader.close();
  objectToXMLDocumentTest(testDocument);
}

Fixed version (ground truth):
public void objectToXMLStringWriter(Object objectToWrite) throws Exception {
  StringWriter writer=new StringWriter();
  XMLDescriptor desc=null;
  if (objectToWrite instanceof XMLRoot) {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(((XMLRoot)objectToWrite).getObject().getClass());
  }
 else {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(objectToWrite.getClass());
  }
  int sizeBefore=getNamespaceResolverSize(desc);
  jaxbMarshaller.setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  jaxbMarshaller.marshal(objectToWrite,writer);
  int sizeAfter=getNamespaceResolverSize(desc);
  assertEquals(sizeBefore,sizeAfter);
  StringReader reader=new StringReader(writer.toString());
  InputSource inputSource=new InputSource(reader);
  Document testDocument=parser.parse(inputSource);
  writer.close();
  reader.close();
  objectToXMLDocumentTest(testDocument);
}
Program: 65222
Project: 65222
Buggy source:
public void testObjectToXMLStreamWriter() throws Exception {
  if (XML_OUTPUT_FACTORY != null) {
    StringWriter writer=new StringWriter();
    XMLOutputFactory factory=XMLOutputFactory.newInstance();
    factory.setProperty(factory.IS_REPAIRING_NAMESPACES,new Boolean(false));
    XMLStreamWriter streamWriter=factory.createXMLStreamWriter(writer);
    Object objectToWrite=getWriteControlObject();
    XMLDescriptor desc=null;
    if (objectToWrite instanceof XMLRoot) {
      desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(((XMLRoot)objectToWrite).getObject().getClass());
    }
 else {
      desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(objectToWrite.getClass());
    }
    jaxbMarshaller.setProperty(org.eclipse.persistence.jaxb.JAXBContext.MEDIA_TYPE,"String_Node_Str");
    int sizeBefore=getNamespaceResolverSize(desc);
    jaxbMarshaller.marshal(objectToWrite,streamWriter);
    streamWriter.flush();
    int sizeAfter=getNamespaceResolverSize(desc);
    assertEquals(sizeBefore,sizeAfter);
    StringReader reader=new StringReader(writer.toString());
    InputSource inputSource=new InputSource(reader);
    Document testDocument=parser.parse(inputSource);
    writer.close();
    reader.close();
    objectToXMLDocumentTest(testDocument);
  }
}

Fixed version (ground truth):
public void testObjectToXMLStreamWriter() throws Exception {
  if (XML_OUTPUT_FACTORY != null) {
    StringWriter writer=new StringWriter();
    XMLOutputFactory factory=XMLOutputFactory.newInstance();
    factory.setProperty(factory.IS_REPAIRING_NAMESPACES,new Boolean(false));
    XMLStreamWriter streamWriter=factory.createXMLStreamWriter(writer);
    Object objectToWrite=getWriteControlObject();
    XMLDescriptor desc=null;
    if (objectToWrite instanceof XMLRoot) {
      desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(((XMLRoot)objectToWrite).getObject().getClass());
    }
 else {
      desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(objectToWrite.getClass());
    }
    jaxbMarshaller.setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
    int sizeBefore=getNamespaceResolverSize(desc);
    jaxbMarshaller.marshal(objectToWrite,streamWriter);
    streamWriter.flush();
    int sizeAfter=getNamespaceResolverSize(desc);
    assertEquals(sizeBefore,sizeAfter);
    StringReader reader=new StringReader(writer.toString());
    InputSource inputSource=new InputSource(reader);
    Document testDocument=parser.parse(inputSource);
    writer.close();
    reader.close();
    objectToXMLDocumentTest(testDocument);
  }
}
Program: 65223
Project: 65223
Buggy source:
public void testObjectToContentHandler() throws Exception {
  SAXDocumentBuilder builder=new SAXDocumentBuilder();
  Object objectToWrite=getWriteControlObject();
  XMLDescriptor desc=null;
  if (objectToWrite instanceof XMLRoot) {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(((XMLRoot)objectToWrite).getObject().getClass());
  }
 else {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(objectToWrite.getClass());
  }
  int sizeBefore=getNamespaceResolverSize(desc);
  jaxbMarshaller.setProperty(org.eclipse.persistence.jaxb.JAXBContext.MEDIA_TYPE,"String_Node_Str");
  jaxbMarshaller.marshal(objectToWrite,builder);
  int sizeAfter=getNamespaceResolverSize(desc);
  assertEquals(sizeBefore,sizeAfter);
  Document controlDocument=getWriteControlDocument();
  Document testDocument=builder.getDocument();
  log("String_Node_Str");
  log("String_Node_Str");
  log(controlDocument);
  log("String_Node_Str");
  log(testDocument);
  assertXMLIdentical(controlDocument,testDocument);
}

Fixed version (ground truth):
public void testObjectToContentHandler() throws Exception {
  SAXDocumentBuilder builder=new SAXDocumentBuilder();
  Object objectToWrite=getWriteControlObject();
  XMLDescriptor desc=null;
  if (objectToWrite instanceof XMLRoot) {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(((XMLRoot)objectToWrite).getObject().getClass());
  }
 else {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(objectToWrite.getClass());
  }
  int sizeBefore=getNamespaceResolverSize(desc);
  jaxbMarshaller.setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  jaxbMarshaller.marshal(objectToWrite,builder);
  int sizeAfter=getNamespaceResolverSize(desc);
  assertEquals(sizeBefore,sizeAfter);
  Document controlDocument=getWriteControlDocument();
  Document testDocument=builder.getDocument();
  log("String_Node_Str");
  log("String_Node_Str");
  log(controlDocument);
  log("String_Node_Str");
  log(testDocument);
  assertXMLIdentical(controlDocument,testDocument);
}
Program: 65224
Project: 65224
Buggy source:
public void testXMLToObjectFromXMLStreamReader() throws Exception {
  if (null != XML_INPUT_FACTORY && isUnmarshalTest()) {
    InputStream instream=ClassLoader.getSystemResourceAsStream(resourceName);
    XMLStreamReader xmlStreamReader=XML_INPUT_FACTORY.createXMLStreamReader(instream);
    jaxbUnmarshaller.setProperty(org.eclipse.persistence.jaxb.JAXBContext.MEDIA_TYPE,"String_Node_Str");
    Object testObject=null;
    if (getUnmarshalClass() != null) {
      testObject=getJAXBUnmarshaller().unmarshal(xmlStreamReader,getUnmarshalClass());
    }
 else {
      testObject=jaxbUnmarshaller.unmarshal(xmlStreamReader);
    }
    instream.close();
    xmlToObjectTest(testObject);
  }
}

Fixed version (ground truth):
public void testXMLToObjectFromXMLStreamReader() throws Exception {
  if (null != XML_INPUT_FACTORY && isUnmarshalTest()) {
    InputStream instream=ClassLoader.getSystemResourceAsStream(resourceName);
    XMLStreamReader xmlStreamReader=XML_INPUT_FACTORY.createXMLStreamReader(instream);
    jaxbUnmarshaller.setProperty(UnmarshallerProperties.MEDIA_TYPE,"String_Node_Str");
    Object testObject=null;
    if (getUnmarshalClass() != null) {
      testObject=getJAXBUnmarshaller().unmarshal(xmlStreamReader,getUnmarshalClass());
    }
 else {
      testObject=jaxbUnmarshaller.unmarshal(xmlStreamReader);
    }
    instream.close();
    xmlToObjectTest(testObject);
  }
}
Program: 65225
Project: 65225
Buggy source:
public void testObjectToXMLStreamWriterRecord() throws Exception {
  if (XML_OUTPUT_FACTORY != null) {
    StringWriter writer=new StringWriter();
    XMLOutputFactory factory=XMLOutputFactory.newInstance();
    factory.setProperty(factory.IS_REPAIRING_NAMESPACES,new Boolean(false));
    XMLStreamWriter streamWriter=factory.createXMLStreamWriter(writer);
    Object objectToWrite=getWriteControlObject();
    XMLDescriptor desc=null;
    if (objectToWrite instanceof XMLRoot) {
      desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(((XMLRoot)objectToWrite).getObject().getClass());
    }
 else {
      desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(objectToWrite.getClass());
    }
    jaxbMarshaller.setProperty(org.eclipse.persistence.jaxb.JAXBContext.MEDIA_TYPE,"String_Node_Str");
    int sizeBefore=getNamespaceResolverSize(desc);
    XMLStreamWriterRecord record=new XMLStreamWriterRecord(streamWriter);
    ((org.eclipse.persistence.jaxb.JAXBMarshaller)jaxbMarshaller).marshal(objectToWrite,record);
    streamWriter.flush();
    int sizeAfter=getNamespaceResolverSize(desc);
    assertEquals(sizeBefore,sizeAfter);
    StringReader reader=new StringReader(writer.toString());
    InputSource inputSource=new InputSource(reader);
    Document testDocument=parser.parse(inputSource);
    writer.close();
    reader.close();
    objectToXMLDocumentTest(testDocument);
  }
}

Fixed version (ground truth):
public void testObjectToXMLStreamWriterRecord() throws Exception {
  if (XML_OUTPUT_FACTORY != null) {
    StringWriter writer=new StringWriter();
    XMLOutputFactory factory=XMLOutputFactory.newInstance();
    factory.setProperty(factory.IS_REPAIRING_NAMESPACES,new Boolean(false));
    XMLStreamWriter streamWriter=factory.createXMLStreamWriter(writer);
    Object objectToWrite=getWriteControlObject();
    XMLDescriptor desc=null;
    if (objectToWrite instanceof XMLRoot) {
      desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(((XMLRoot)objectToWrite).getObject().getClass());
    }
 else {
      desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(objectToWrite.getClass());
    }
    jaxbMarshaller.setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
    int sizeBefore=getNamespaceResolverSize(desc);
    XMLStreamWriterRecord record=new XMLStreamWriterRecord(streamWriter);
    ((org.eclipse.persistence.jaxb.JAXBMarshaller)jaxbMarshaller).marshal(objectToWrite,record);
    streamWriter.flush();
    int sizeAfter=getNamespaceResolverSize(desc);
    assertEquals(sizeBefore,sizeAfter);
    StringReader reader=new StringReader(writer.toString());
    InputSource inputSource=new InputSource(reader);
    Document testDocument=parser.parse(inputSource);
    writer.close();
    reader.close();
    objectToXMLDocumentTest(testDocument);
  }
}
Program: 65227
Project: 65227
Buggy source:
public void testXMLToObjectFromXMLStreamReaderEx() throws Exception {
  if (null != XML_INPUT_FACTORY && isUnmarshalTest()) {
    InputStream instream=ClassLoader.getSystemResourceAsStream(resourceName);
    XMLStreamReader xmlStreamReader=XML_INPUT_FACTORY.createXMLStreamReader(instream);
    ExtendedXMLStreamReaderReader xmlStreamReaderReaderEx=new ExtendedXMLStreamReaderReader();
    XMLStreamReaderInputSource xmlStreamReaderInputSource=new XMLStreamReaderInputSource(xmlStreamReader);
    SAXSource saxSource=new SAXSource(xmlStreamReaderReaderEx,xmlStreamReaderInputSource);
    jaxbUnmarshaller.setProperty(org.eclipse.persistence.jaxb.JAXBContext.MEDIA_TYPE,"String_Node_Str");
    Object testObject=null;
    if (getUnmarshalClass() != null) {
      testObject=jaxbUnmarshaller.unmarshal(saxSource,getUnmarshalClass());
    }
 else {
      testObject=jaxbUnmarshaller.unmarshal(saxSource);
    }
    instream.close();
    xmlToObjectTest(testObject);
  }
}

Fixed version (ground truth):
public void testXMLToObjectFromXMLStreamReaderEx() throws Exception {
  if (null != XML_INPUT_FACTORY && isUnmarshalTest()) {
    InputStream instream=ClassLoader.getSystemResourceAsStream(resourceName);
    XMLStreamReader xmlStreamReader=XML_INPUT_FACTORY.createXMLStreamReader(instream);
    ExtendedXMLStreamReaderReader xmlStreamReaderReaderEx=new ExtendedXMLStreamReaderReader();
    XMLStreamReaderInputSource xmlStreamReaderInputSource=new XMLStreamReaderInputSource(xmlStreamReader);
    SAXSource saxSource=new SAXSource(xmlStreamReaderReaderEx,xmlStreamReaderInputSource);
    jaxbUnmarshaller.setProperty(UnmarshallerProperties.MEDIA_TYPE,"String_Node_Str");
    Object testObject=null;
    if (getUnmarshalClass() != null) {
      testObject=jaxbUnmarshaller.unmarshal(saxSource,getUnmarshalClass());
    }
 else {
      testObject=jaxbUnmarshaller.unmarshal(saxSource);
    }
    instream.close();
    xmlToObjectTest(testObject);
  }
}
Program: 65229
Project: 65229
Buggy source:
public void testObjectToOutputStreamASCIIEncoding() throws Exception {
  Object objectToWrite=getWriteControlObject();
  ByteArrayOutputStream stream=new ByteArrayOutputStream();
  XMLDescriptor desc=null;
  if (objectToWrite instanceof XMLRoot) {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(((XMLRoot)objectToWrite).getObject().getClass());
  }
 else {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(objectToWrite.getClass());
  }
  jaxbMarshaller.setProperty(org.eclipse.persistence.jaxb.JAXBContext.MEDIA_TYPE,"String_Node_Str");
  int sizeBefore=getNamespaceResolverSize(desc);
  String originalEncoding=(String)jaxbMarshaller.getProperty(Marshaller.JAXB_ENCODING);
  jaxbMarshaller.setProperty(Marshaller.JAXB_ENCODING,"String_Node_Str");
  jaxbMarshaller.marshal(objectToWrite,stream);
  jaxbMarshaller.setProperty(Marshaller.JAXB_ENCODING,originalEncoding);
  int sizeAfter=getNamespaceResolverSize(desc);
  assertEquals(sizeBefore,sizeAfter);
  InputStream is=new ByteArrayInputStream(stream.toByteArray());
  Document testDocument=parser.parse(is);
  stream.close();
  is.close();
  objectToXMLDocumentTest(testDocument);
}

Fixed version (ground truth):
public void testObjectToOutputStreamASCIIEncoding() throws Exception {
  Object objectToWrite=getWriteControlObject();
  ByteArrayOutputStream stream=new ByteArrayOutputStream();
  XMLDescriptor desc=null;
  if (objectToWrite instanceof XMLRoot) {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(((XMLRoot)objectToWrite).getObject().getClass());
  }
 else {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(objectToWrite.getClass());
  }
  jaxbMarshaller.setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  int sizeBefore=getNamespaceResolverSize(desc);
  String originalEncoding=(String)jaxbMarshaller.getProperty(Marshaller.JAXB_ENCODING);
  jaxbMarshaller.setProperty(Marshaller.JAXB_ENCODING,"String_Node_Str");
  jaxbMarshaller.marshal(objectToWrite,stream);
  jaxbMarshaller.setProperty(Marshaller.JAXB_ENCODING,originalEncoding);
  int sizeAfter=getNamespaceResolverSize(desc);
  assertEquals(sizeBefore,sizeAfter);
  InputStream is=new ByteArrayInputStream(stream.toByteArray());
  Document testDocument=parser.parse(is);
  stream.close();
  is.close();
  objectToXMLDocumentTest(testDocument);
}
Program: 65230
Project: 65230
Buggy source:
public void testXMLToObjectFromNode() throws Exception {
  if (isUnmarshalTest()) {
    InputStream instream=ClassLoader.getSystemResourceAsStream(resourceName);
    Node node=parser.parse(instream);
    jaxbUnmarshaller.setProperty(org.eclipse.persistence.jaxb.JAXBContext.MEDIA_TYPE,"String_Node_Str");
    Object testObject=null;
    if (getUnmarshalClass() != null) {
      testObject=jaxbUnmarshaller.unmarshal(node,getUnmarshalClass());
    }
 else {
      testObject=jaxbUnmarshaller.unmarshal(node);
    }
    instream.close();
    xmlToObjectTest(testObject);
  }
}

Fixed version (ground truth):
public void testXMLToObjectFromNode() throws Exception {
  if (isUnmarshalTest()) {
    InputStream instream=ClassLoader.getSystemResourceAsStream(resourceName);
    Node node=parser.parse(instream);
    jaxbUnmarshaller.setProperty(UnmarshallerProperties.MEDIA_TYPE,"String_Node_Str");
    Object testObject=null;
    if (getUnmarshalClass() != null) {
      testObject=jaxbUnmarshaller.unmarshal(node,getUnmarshalClass());
    }
 else {
      testObject=jaxbUnmarshaller.unmarshal(node);
    }
    instream.close();
    xmlToObjectTest(testObject);
  }
}
Program: 65231
Project: 65231
Buggy source:
public void testObjectToXMLDocument() throws Exception {
  Object objectToWrite=getWriteControlObject();
  XMLDescriptor desc=null;
  if (objectToWrite instanceof XMLRoot) {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(((XMLRoot)objectToWrite).getObject().getClass());
  }
 else {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(objectToWrite.getClass());
  }
  jaxbMarshaller.setProperty(org.eclipse.persistence.jaxb.JAXBContext.MEDIA_TYPE,"String_Node_Str");
  int sizeBefore=getNamespaceResolverSize(desc);
  Document testDocument=XMLPlatformFactory.getInstance().getXMLPlatform().createDocument();
  jaxbMarshaller.marshal(objectToWrite,testDocument);
  int sizeAfter=getNamespaceResolverSize(desc);
  assertEquals(sizeBefore,sizeAfter);
  objectToXMLDocumentTest(testDocument);
}

Fixed version (ground truth):
public void testObjectToXMLDocument() throws Exception {
  Object objectToWrite=getWriteControlObject();
  XMLDescriptor desc=null;
  if (objectToWrite instanceof XMLRoot) {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(((XMLRoot)objectToWrite).getObject().getClass());
  }
 else {
    desc=(XMLDescriptor)xmlContext.getSession(0).getProject().getDescriptor(objectToWrite.getClass());
  }
  jaxbMarshaller.setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  int sizeBefore=getNamespaceResolverSize(desc);
  Document testDocument=XMLPlatformFactory.getInstance().getXMLPlatform().createDocument();
  jaxbMarshaller.marshal(objectToWrite,testDocument);
  int sizeAfter=getNamespaceResolverSize(desc);
  assertEquals(sizeBefore,sizeAfter);
  objectToXMLDocumentTest(testDocument);
}
Program: 65232
Project: 65232
Buggy source:
public void testXMLToObjectFromXMLEventReader() throws Exception {
  if (null != XML_INPUT_FACTORY && isUnmarshalTest()) {
    InputStream instream=ClassLoader.getSystemResourceAsStream(resourceName);
    XMLEventReader xmlEventReader=XML_INPUT_FACTORY.createXMLEventReader(instream);
    jaxbUnmarshaller.setProperty(org.eclipse.persistence.jaxb.JAXBContext.MEDIA_TYPE,"String_Node_Str");
    Object testObject=null;
    if (getUnmarshalClass() != null) {
      testObject=jaxbUnmarshaller.unmarshal(xmlEventReader,getUnmarshalClass());
    }
 else {
      testObject=jaxbUnmarshaller.unmarshal(xmlEventReader);
    }
    instream.close();
    xmlToObjectTest(testObject);
  }
}

Fixed version (ground truth):
public void testXMLToObjectFromXMLEventReader() throws Exception {
  if (null != XML_INPUT_FACTORY && isUnmarshalTest()) {
    InputStream instream=ClassLoader.getSystemResourceAsStream(resourceName);
    XMLEventReader xmlEventReader=XML_INPUT_FACTORY.createXMLEventReader(instream);
    jaxbUnmarshaller.setProperty(UnmarshallerProperties.MEDIA_TYPE,"String_Node_Str");
    Object testObject=null;
    if (getUnmarshalClass() != null) {
      testObject=jaxbUnmarshaller.unmarshal(xmlEventReader,getUnmarshalClass());
    }
 else {
      testObject=jaxbUnmarshaller.unmarshal(xmlEventReader);
    }
    instream.close();
    xmlToObjectTest(testObject);
  }
}
Program: 65233
Project: 65233
Buggy source:
public void testUnmarshallerHandler() throws Exception {
  if (isUnmarshalTest()) {
    SAXParserFactory saxParserFactory=SAXParserFactory.newInstance();
    saxParserFactory.setNamespaceAware(true);
    SAXParser saxParser=saxParserFactory.newSAXParser();
    XMLReader xmlReader=saxParser.getXMLReader();
    jaxbUnmarshaller.setProperty(org.eclipse.persistence.jaxb.JAXBContext.MEDIA_TYPE,"String_Node_Str");
    JAXBUnmarshallerHandler jaxbUnmarshallerHandler=(JAXBUnmarshallerHandler)jaxbUnmarshaller.getUnmarshallerHandler();
    xmlReader.setContentHandler(jaxbUnmarshallerHandler);
    InputStream inputStream=ClassLoader.getSystemResourceAsStream(resourceName);
    InputSource inputSource=new InputSource(inputStream);
    xmlReader.parse(inputSource);
    xmlToObjectTest(jaxbUnmarshallerHandler.getResult());
  }
}

Fixed version (ground truth):
public void testUnmarshallerHandler() throws Exception {
  if (isUnmarshalTest()) {
    SAXParserFactory saxParserFactory=SAXParserFactory.newInstance();
    saxParserFactory.setNamespaceAware(true);
    SAXParser saxParser=saxParserFactory.newSAXParser();
    XMLReader xmlReader=saxParser.getXMLReader();
    jaxbUnmarshaller.setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
    JAXBUnmarshallerHandler jaxbUnmarshallerHandler=(JAXBUnmarshallerHandler)jaxbUnmarshaller.getUnmarshallerHandler();
    xmlReader.setContentHandler(jaxbUnmarshallerHandler);
    InputStream inputStream=ClassLoader.getSystemResourceAsStream(resourceName);
    InputSource inputSource=new InputSource(inputStream);
    xmlReader.parse(inputSource);
    xmlToObjectTest(jaxbUnmarshallerHandler.getResult());
  }
}
Program: 65234
Project: 65234
Buggy source:
public void testXMLToObjectFromURL() throws Exception {
  if (isUnmarshalTest()) {
    java.net.URL url=ClassLoader.getSystemResource(resourceName);
    jaxbUnmarshaller.setProperty(org.eclipse.persistence.jaxb.JAXBContext.MEDIA_TYPE,"String_Node_Str");
    Object testObject=null;
    if (getUnmarshalClass() != null) {
      testObject=((JAXBUnmarshaller)jaxbUnmarshaller).unmarshal(new StreamSource(url.openStream()),getUnmarshalClass());
    }
 else {
      testObject=jaxbUnmarshaller.unmarshal(url);
    }
    xmlToObjectTest(testObject);
  }
}

Fixed version (ground truth):
public void testXMLToObjectFromURL() throws Exception {
  if (isUnmarshalTest()) {
    java.net.URL url=ClassLoader.getSystemResource(resourceName);
    jaxbUnmarshaller.setProperty(UnmarshallerProperties.MEDIA_TYPE,"String_Node_Str");
    Object testObject=null;
    if (getUnmarshalClass() != null) {
      testObject=((JAXBUnmarshaller)jaxbUnmarshaller).unmarshal(new StreamSource(url.openStream()),getUnmarshalClass());
    }
 else {
      testObject=jaxbUnmarshaller.unmarshal(url);
    }
    xmlToObjectTest(testObject);
  }
}