nus-yam/ex-repair huggingface dataset:
Program: 63861
Project: 63861
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(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
    int sizeBefore=getNamespaceResolverSize(desc);
    jaxbMarshaller.marshal(objectToWrite,eventWriter);
    eventWriter.flush();
    int sizeAfter=getNamespaceResolverSize(desc);
    assertEquals(sizeBefore,sizeAfter);
    Document testDocument=getTestDocument(writer.toString());
    writer.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);
    try {
      jaxbMarshaller.marshal(objectToWrite,eventWriter);
    }
 catch (    Exception e) {
      assertMarshalException(e);
      return;
    }
    eventWriter.flush();
    int sizeAfter=getNamespaceResolverSize(desc);
    assertEquals(sizeBefore,sizeAfter);
    Document testDocument=getTestDocument(writer.toString());
    writer.close();
    objectToXMLDocumentTest(testDocument);
  }
}
Program: 63862
Project: 63862
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(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  jaxbMarshaller.marshal(objectToWrite,writer);
  int sizeAfter=getNamespaceResolverSize(desc);
  assertEquals(sizeBefore,sizeAfter);
  Document testDocument=getTestDocument(writer.toString());
  writer.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");
  try {
    jaxbMarshaller.marshal(objectToWrite,writer);
  }
 catch (  Exception e) {
    assertMarshalException(e);
    return;
  }
  int sizeAfter=getNamespaceResolverSize(desc);
  assertEquals(sizeBefore,sizeAfter);
  Document testDocument=getTestDocument(writer.toString());
  writer.close();
  objectToXMLDocumentTest(testDocument);
}
Program: 63863
Project: 63863
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(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
    int sizeBefore=getNamespaceResolverSize(desc);
    jaxbMarshaller.marshal(objectToWrite,streamWriter);
    streamWriter.flush();
    int sizeAfter=getNamespaceResolverSize(desc);
    assertEquals(sizeBefore,sizeAfter);
    Document testDocument=getTestDocument(writer.toString());
    writer.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);
    try {
      jaxbMarshaller.marshal(objectToWrite,streamWriter);
    }
 catch (    Exception e) {
      assertMarshalException(e);
      return;
    }
    streamWriter.flush();
    int sizeAfter=getNamespaceResolverSize(desc);
    assertEquals(sizeBefore,sizeAfter);
    Document testDocument=getTestDocument(writer.toString());
    writer.close();
    objectToXMLDocumentTest(testDocument);
  }
}
Program: 63864
Project: 63864
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(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);
}

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");
  try {
    jaxbMarshaller.marshal(objectToWrite,builder);
  }
 catch (  Exception e) {
    assertMarshalException(e);
    return;
  }
  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: 63865
Project: 63865
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(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);
    Document testDocument=getTestDocument(writer.toString());
    writer.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);
    try {
      ((org.eclipse.persistence.jaxb.JAXBMarshaller)jaxbMarshaller).marshal(objectToWrite,record);
    }
 catch (    Exception e) {
      assertMarshalException(e);
      return;
    }
    streamWriter.flush();
    int sizeAfter=getNamespaceResolverSize(desc);
    assertEquals(sizeBefore,sizeAfter);
    Document testDocument=getTestDocument(writer.toString());
    writer.close();
    objectToXMLDocumentTest(testDocument);
  }
}
Program: 63866
Project: 63866
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(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=getTestDocument(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");
  try {
    jaxbMarshaller.marshal(objectToWrite,stream);
  }
 catch (  Exception e) {
    assertMarshalException(e);
    return;
  }
  jaxbMarshaller.setProperty(Marshaller.JAXB_ENCODING,originalEncoding);
  int sizeAfter=getNamespaceResolverSize(desc);
  assertEquals(sizeBefore,sizeAfter);
  InputStream is=new ByteArrayInputStream(stream.toByteArray());
  Document testDocument=getTestDocument(is);
  stream.close();
  is.close();
  objectToXMLDocumentTest(testDocument);
}
Program: 63867
Project: 63867
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(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);
}

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();
  try {
    jaxbMarshaller.marshal(objectToWrite,testDocument);
  }
 catch (  Exception e) {
    assertMarshalException(e);
    return;
  }
  int sizeAfter=getNamespaceResolverSize(desc);
  assertEquals(sizeBefore,sizeAfter);
  objectToXMLDocumentTest(testDocument);
}
Program: 63869
Project: 63869
Buggy source:
public void testJSONMarshalToOutputStream() throws Exception {
  getJSONMarshaller().setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  ByteArrayOutputStream os=new ByteArrayOutputStream();
  getJSONMarshaller().marshal(getWriteControlObject(),os);
  compareStringToControlFile("String_Node_Str",new String(os.toByteArray()));
  os.close();
}

Fixed version (ground truth):
public void testJSONMarshalToOutputStream() throws Exception {
  getJSONMarshaller().setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  ByteArrayOutputStream os=new ByteArrayOutputStream();
  try {
    getJSONMarshaller().marshal(getWriteControlObject(),os);
  }
 catch (  Exception e) {
    assertMarshalException(e);
    return;
  }
  compareStringToControlFile("String_Node_Str",new String(os.toByteArray()));
  os.close();
}
Program: 63870
Project: 63870
Buggy source:
public void testJSONMarshalToStringWriter_FORMATTED() throws Exception {
  getJSONMarshaller().setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  getJSONMarshaller().setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
  StringWriter sw=new StringWriter();
  getJSONMarshaller().marshal(getWriteControlObject(),sw);
  log(sw.toString());
  compareStringToControlFile("String_Node_Str",sw.toString(),getWriteControlJSONFormatted(),shouldRemoveWhitespaceFromControlDocJSON());
}

Fixed version (ground truth):
public void testJSONMarshalToStringWriter_FORMATTED() throws Exception {
  getJSONMarshaller().setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  getJSONMarshaller().setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
  StringWriter sw=new StringWriter();
  try {
    getJSONMarshaller().marshal(getWriteControlObject(),sw);
  }
 catch (  Exception e) {
    assertMarshalException(e);
    return;
  }
  log(sw.toString());
  compareStringToControlFile("String_Node_Str",sw.toString(),getWriteControlJSONFormatted(),shouldRemoveWhitespaceFromControlDocJSON());
}
Program: 63871
Project: 63871
Buggy source:
public void testJSONMarshalToStringWriter() throws Exception {
  getJSONMarshaller().setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  StringWriter sw=new StringWriter();
  getJSONMarshaller().marshal(getWriteControlObject(),sw);
  log(sw.toString());
  compareStringToControlFile("String_Node_Str",sw.toString());
}

Fixed version (ground truth):
public void testJSONMarshalToStringWriter() throws Exception {
  getJSONMarshaller().setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  StringWriter sw=new StringWriter();
  try {
    getJSONMarshaller().marshal(getWriteControlObject(),sw);
  }
 catch (  Exception e) {
    assertMarshalException(e);
    return;
  }
  log(sw.toString());
  compareStringToControlFile("String_Node_Str",sw.toString());
}
Program: 63872
Project: 63872
Buggy source:
public void testJSONMarshalToOutputStream_FORMATTED() throws Exception {
  getJSONMarshaller().setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  getJSONMarshaller().setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
  ByteArrayOutputStream os=new ByteArrayOutputStream();
  getJSONMarshaller().marshal(getWriteControlObject(),os);
  compareStringToControlFile("String_Node_Str",new String(os.toByteArray()),getWriteControlJSONFormatted(),shouldRemoveWhitespaceFromControlDocJSON());
  os.close();
}

Fixed version (ground truth):
public void testJSONMarshalToOutputStream_FORMATTED() throws Exception {
  getJSONMarshaller().setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
  getJSONMarshaller().setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
  ByteArrayOutputStream os=new ByteArrayOutputStream();
  try {
    getJSONMarshaller().marshal(getWriteControlObject(),os);
  }
 catch (  Exception e) {
    assertMarshalException(e);
    return;
  }
  compareStringToControlFile("String_Node_Str",new String(os.toByteArray()),getWriteControlJSONFormatted(),shouldRemoveWhitespaceFromControlDocJSON());
  os.close();
}
Program: 63873
Project: 63873
Buggy source:
/** 
 * Gets the.
 * @param key the key
 * @return the object
 */
public static Object get(String key){
  Object value=storage.get().get(key);
  if (REQUEST_UNIQUE_ID.equals(key)) {
    if (value == null) {
      return UNKNOWN_REQUEST_UNIQUE_ID;
    }
 else {
      return (String)value;
    }
  }
  return value;
}

Fixed version (ground truth):
/** 
 * Gets the.
 * @param key the key
 * @return the object
 */
public static Object get(String key){
  Object value=storage.get().get(key);
  if (REQUEST_UNIQUE_ID.equals(key)) {
    if (value == null) {
      return "String_Node_Str";
    }
  }
  return value;
}
Program: 63874
Project: 63874
Buggy source:
/** 
 * Destroy.
 */
public static void destroy(){
  storage.remove();
}

Fixed version (ground truth):
/** 
 * Destroy.
 */
public static void destroy(){
  if (storage != null) {
    if (storage.get() != null) {
      storage.get().clear();
    }
    storage.remove();
  }
}
Program: 63875
Project: 63875
Buggy source:
/** 
 * A part of the facade over the JPA API Call jpa merge on the given object and commit If the passed object is a list, we will iterate through the list and merge each member
 * @param tenantId
 * @param entity
 * @return
 */
@SuppressWarnings("String_Node_Str") public Object merge(Map<String,String> tenantId,Object entity){
  EntityManager em=getEmf().createEntityManager(tenantId);
  Object mergedEntity=null;
  try {
    transaction.beginTransaction(em);
    if (entity instanceof List) {
      List<Object> mergeList=new ArrayList<Object>();
      for (      Object o : (List)entity) {
        mergeList.add(em.merge(o));
      }
      mergedEntity=mergeList;
    }
 else {
      mergedEntity=em.merge(entity);
    }
    transaction.commitTransaction(em);
    return mergedEntity;
  }
 catch (  RollbackException ex) {
    throw JPARSException.exceptionOccurred((String)DataStorage.get(DataStorage.REQUEST_UNIQUE_ID),AbstractResource.getHttpStatusCode(ex),ex);
  }
catch (  Exception ex) {
    transaction.rollbackTransaction(em);
    throw JPARSException.exceptionOccurred((String)DataStorage.get(DataStorage.REQUEST_UNIQUE_ID),AbstractResource.getHttpStatusCode(ex),ex);
  }
 finally {
    em.close();
  }
}

Fixed version (ground truth):
/** 
 * A part of the facade over the JPA API Call jpa merge on the given object and commit If the passed object is a list, we will iterate through the list and merge each member
 * @param tenantId
 * @param entity
 * @return
 */
@SuppressWarnings("String_Node_Str") public Object merge(Map<String,String> tenantId,Object entity){
  EntityManager em=getEmf().createEntityManager(tenantId);
  Object mergedEntity=null;
  try {
    transaction.beginTransaction(em);
    if (entity instanceof List) {
      List<Object> mergeList=new ArrayList<Object>();
      for (      Object o : (List)entity) {
        mergeList.add(em.merge(o));
      }
      mergedEntity=mergeList;
    }
 else {
      mergedEntity=em.merge(entity);
    }
    transaction.commitTransaction(em);
    return mergedEntity;
  }
 catch (  RollbackException ex) {
    throw JPARSException.exceptionOccurred(ex);
  }
catch (  Exception ex) {
    transaction.rollbackTransaction(em);
    throw JPARSException.exceptionOccurred(ex);
  }
 finally {
    em.close();
  }
}
Program: 63877
Project: 63877
Buggy source:
/** 
 * Instantiates a new persistence context.
 * @param emfName the emf name
 * @param emf the emf
 * @param defaultURI the default uri
 */
public PersistenceContext(String emfName,EntityManagerFactoryImpl emf,URI defaultURI){
  super();
  this.emf=emf;
  this.name=emfName;
  if (getServerSession().hasExternalTransactionController()) {
    transaction=new JTATransactionWrapper();
  }
 else {
    transaction=new ResourceLocalTransactionWrapper();
  }
  try {
    this.jaxbContext=createDynamicJAXBContext(emf.getDatabaseSession());
  }
 catch (  JAXBException jaxbe) {
    JPARSLogger.exception("String_Node_Str",new Object[]{(String)DataStorage.get(DataStorage.REQUEST_UNIQUE_ID),emfName,jaxbe.toString()},jaxbe);
    emf.close();
  }
catch (  IOException e) {
    JPARSLogger.exception("String_Node_Str",new Object[]{(String)DataStorage.get(DataStorage.REQUEST_UNIQUE_ID),emfName,e.toString()},e);
    emf.close();
  }
  setBaseURI(defaultURI);
}

Fixed version (ground truth):
/** 
 * Instantiates a new persistence context.
 * @param emfName the emf name
 * @param emf the emf
 * @param defaultURI the default uri
 */
public PersistenceContext(String emfName,EntityManagerFactoryImpl emf,URI defaultURI){
  super();
  this.emf=emf;
  this.name=emfName;
  if (getServerSession().hasExternalTransactionController()) {
    transaction=new JTATransactionWrapper();
  }
 else {
    transaction=new ResourceLocalTransactionWrapper();
  }
  try {
    this.jaxbContext=createDynamicJAXBContext(emf.getDatabaseSession());
  }
 catch (  JAXBException jaxbe) {
    JPARSLogger.exception("String_Node_Str",new Object[]{DataStorage.get(DataStorage.REQUEST_UNIQUE_ID),emfName,jaxbe.toString()},jaxbe);
    emf.close();
  }
catch (  IOException e) {
    JPARSLogger.exception("String_Node_Str",new Object[]{DataStorage.get(DataStorage.REQUEST_UNIQUE_ID),emfName,e.toString()},e);
    emf.close();
  }
  setBaseURI(defaultURI);
}
Program: 63878
Project: 63878
Buggy source:
/** 
 * A part of the facade over the JPA API Delete the given entity in JPA and commit the changes
 */
public void delete(Map<String,String> tenantId,String type,Object id){
  EntityManager em=getEmf().createEntityManager(tenantId);
  try {
    transaction.beginTransaction(em);
    Object entity=em.find(getClass(type),id);
    if (entity != null) {
      em.remove(entity);
    }
    transaction.commitTransaction(em);
  }
 catch (  RollbackException ex) {
    throw JPARSException.exceptionOccurred((String)DataStorage.get(DataStorage.REQUEST_UNIQUE_ID),AbstractResource.getHttpStatusCode(ex),ex);
  }
catch (  Exception ex) {
    transaction.rollbackTransaction(em);
    throw JPARSException.exceptionOccurred((String)DataStorage.get(DataStorage.REQUEST_UNIQUE_ID),AbstractResource.getHttpStatusCode(ex),ex);
  }
 finally {
    em.close();
  }
}

Fixed version (ground truth):
/** 
 * A part of the facade over the JPA API Delete the given entity in JPA and commit the changes
 */
public void delete(Map<String,String> tenantId,String type,Object id){
  EntityManager em=getEmf().createEntityManager(tenantId);
  try {
    transaction.beginTransaction(em);
    Object entity=em.find(getClass(type),id);
    if (entity != null) {
      em.remove(entity);
    }
    transaction.commitTransaction(em);
  }
 catch (  RollbackException ex) {
    throw JPARSException.exceptionOccurred(ex);
  }
catch (  Exception ex) {
    transaction.rollbackTransaction(em);
    throw JPARSException.exceptionOccurred(ex);
  }
 finally {
    em.close();
  }
}
Program: 63879
Project: 63879
Buggy source:
/** 
 * A convenience method to create a new dynamic entity of the given type
 * @param tenantId
 * @param type
 * @return
 */
public DynamicEntity newEntity(Map<String,String> tenantId,String type){
  JPADynamicHelper helper=new JPADynamicHelper(getEmf());
  DynamicEntity entity=null;
  try {
    entity=helper.newDynamicEntity(type);
  }
 catch (  IllegalArgumentException e) {
    ClassDescriptor descriptor=getDescriptor(type);
    if (descriptor != null) {
      DynamicType jaxbType=(DynamicType)descriptor.getProperty(DynamicType.DESCRIPTOR_PROPERTY);
      if (jaxbType != null) {
        return jaxbType.newDynamicEntity();
      }
    }
    JPARSLogger.fine("String_Node_Str",new Object[]{(String)DataStorage.get(DataStorage.REQUEST_UNIQUE_ID),type,e.toString()});
    throw e;
  }
  return entity;
}

Fixed version (ground truth):
/** 
 * A convenience method to create a new dynamic entity of the given type
 * @param tenantId
 * @param type
 * @return
 */
public DynamicEntity newEntity(Map<String,String> tenantId,String type){
  JPADynamicHelper helper=new JPADynamicHelper(getEmf());
  DynamicEntity entity=null;
  try {
    entity=helper.newDynamicEntity(type);
  }
 catch (  IllegalArgumentException e) {
    ClassDescriptor descriptor=getDescriptor(type);
    if (descriptor != null) {
      DynamicType jaxbType=(DynamicType)descriptor.getProperty(DynamicType.DESCRIPTOR_PROPERTY);
      if (jaxbType != null) {
        return jaxbType.newDynamicEntity();
      }
    }
    JPARSLogger.fine("String_Node_Str",new Object[]{DataStorage.get(DataStorage.REQUEST_UNIQUE_ID),type,e.toString()});
    throw e;
  }
  return entity;
}
Program: 63880
Project: 63880
Buggy source:
/** 
 * Query execute update.
 * @param tenantId the tenant id
 * @param name the name
 * @param parameters the parameters
 * @param hints the hints
 * @return the int
 */
public int queryExecuteUpdate(Map<String,String> tenantId,String name,Map<?,?> parameters,Map<String,?> hints){
  EntityManager em=getEmf().createEntityManager(tenantId);
  try {
    Query query=constructQuery(em,name,parameters,hints);
    transaction.beginTransaction(em);
    int result=query.executeUpdate();
    transaction.commitTransaction(em);
    return result;
  }
 catch (  RollbackException ex) {
    throw JPARSException.exceptionOccurred((String)DataStorage.get(DataStorage.REQUEST_UNIQUE_ID),AbstractResource.getHttpStatusCode(ex),ex);
  }
catch (  Exception ex) {
    transaction.rollbackTransaction(em);
    throw JPARSException.exceptionOccurred((String)DataStorage.get(DataStorage.REQUEST_UNIQUE_ID),AbstractResource.getHttpStatusCode(ex),ex);
  }
 finally {
    em.close();
  }
}

Fixed version (ground truth):
/** 
 * Query execute update.
 * @param tenantId the tenant id
 * @param name the name
 * @param parameters the parameters
 * @param hints the hints
 * @return the int
 */
public int queryExecuteUpdate(Map<String,String> tenantId,String name,Map<?,?> parameters,Map<String,?> hints){
  EntityManager em=getEmf().createEntityManager(tenantId);
  try {
    Query query=constructQuery(em,name,parameters,hints);
    transaction.beginTransaction(em);
    int result=query.executeUpdate();
    transaction.commitTransaction(em);
    return result;
  }
 catch (  RollbackException ex) {
    throw JPARSException.exceptionOccurred(ex);
  }
catch (  Exception ex) {
    transaction.rollbackTransaction(em);
    throw JPARSException.exceptionOccurred(ex);
  }
 finally {
    em.close();
  }
}
Program: 63881
Project: 63881
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected List<XmlAdapter> getAdapters() throws JPARSException {
  if (adapters != null) {
    return adapters;
  }
  adapters=new ArrayList<XmlAdapter>();
  try {
    for (    ClassDescriptor desc : this.getServerSession().getDescriptors().values()) {
      if (!desc.isAggregateCollectionDescriptor() && !desc.isAggregateDescriptor()) {
        Class clz=desc.getJavaClass();
        String referenceAdapterName=RestAdapterClassWriter.constructClassNameForReferenceAdapter(clz.getName());
        ClassLoader cl=getServerSession().getDatasourcePlatform().getConversionManager().getLoader();
        Class referenceAdaptorClass=Class.forName(referenceAdapterName,true,cl);
        Class[] argTypes={String.class,PersistenceContext.class};
        Constructor referenceAdaptorConstructor=referenceAdaptorClass.getDeclaredConstructor(argTypes);
        Object[] args=new Object[]{getBaseURI().toString(),this};
        adapters.add((XmlAdapter)referenceAdaptorConstructor.newInstance(args));
      }
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    throw JPARSException.exceptionOccurred((String)DataStorage.get(DataStorage.REQUEST_UNIQUE_ID),AbstractResource.getHttpStatusCode(ex),ex);
  }
  return adapters;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) protected List<XmlAdapter> getAdapters() throws JPARSException {
  if (adapters != null) {
    return adapters;
  }
  adapters=new ArrayList<XmlAdapter>();
  try {
    for (    ClassDescriptor desc : this.getServerSession().getDescriptors().values()) {
      if (!desc.isAggregateCollectionDescriptor() && !desc.isAggregateDescriptor()) {
        Class clz=desc.getJavaClass();
        String referenceAdapterName=RestAdapterClassWriter.constructClassNameForReferenceAdapter(clz.getName());
        ClassLoader cl=getServerSession().getDatasourcePlatform().getConversionManager().getLoader();
        Class referenceAdaptorClass=Class.forName(referenceAdapterName,true,cl);
        Class[] argTypes={String.class,PersistenceContext.class};
        Constructor referenceAdaptorConstructor=referenceAdaptorClass.getDeclaredConstructor(argTypes);
        Object[] args=new Object[]{getBaseURI().toString(),this};
        adapters.add((XmlAdapter)referenceAdaptorConstructor.newInstance(args));
      }
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    throw JPARSException.exceptionOccurred(ex);
  }
  return adapters;
}
Program: 63882
Project: 63882
Buggy source:
/** 
 * Make adjustments to an unmarshalled entity based on what is found in the weaved fields
 * @param entity
 * @return
 */
protected Object wrap(Object entity){
  if ((entity != null) && (PersistenceWeavedRest.class.isAssignableFrom(entity.getClass()))) {
    if (!doesExist(null,entity)) {
      return entity;
    }
    ClassDescriptor descriptor=getJAXBDescriptorForClass(entity.getClass());
    if (entity instanceof FetchGroupTracker) {
      FetchGroup fetchGroup=new FetchGroup();
      for (      DatabaseMapping mapping : descriptor.getMappings()) {
        if (!(mapping instanceof XMLInverseReferenceMapping)) {
          fetchGroup.addAttribute(mapping.getAttributeName());
        }
      }
      (new FetchGroupManager()).setObjectFetchGroup(entity,fetchGroup,null);
      ((FetchGroupTracker)entity)._persistence_setSession(JpaHelper.getDatabaseSession(getEmf()));
    }
 else     if (descriptor.hasRelationships()) {
      for (      DatabaseMapping mapping : descriptor.getMappings()) {
        if (mapping instanceof XMLInverseReferenceMapping) {
          JPARSLogger.fine("String_Node_Str",new Object[]{(String)DataStorage.get(DataStorage.REQUEST_UNIQUE_ID)});
          throw JPARSException.invalidConfiguration((String)DataStorage.get(DataStorage.REQUEST_UNIQUE_ID),Status.INTERNAL_SERVER_ERROR.getStatusCode());
        }
      }
    }
  }
  return entity;
}

Fixed version (ground truth):
/** 
 * Make adjustments to an unmarshalled entity based on what is found in the weaved fields
 * @param entity
 * @return
 */
protected Object wrap(Object entity){
  if ((entity != null) && (PersistenceWeavedRest.class.isAssignableFrom(entity.getClass()))) {
    if (!doesExist(null,entity)) {
      return entity;
    }
    ClassDescriptor descriptor=getJAXBDescriptorForClass(entity.getClass());
    if (entity instanceof FetchGroupTracker) {
      FetchGroup fetchGroup=new FetchGroup();
      for (      DatabaseMapping mapping : descriptor.getMappings()) {
        if (!(mapping instanceof XMLInverseReferenceMapping)) {
          fetchGroup.addAttribute(mapping.getAttributeName());
        }
      }
      (new FetchGroupManager()).setObjectFetchGroup(entity,fetchGroup,null);
      ((FetchGroupTracker)entity)._persistence_setSession(JpaHelper.getDatabaseSession(getEmf()));
    }
 else     if (descriptor.hasRelationships()) {
      for (      DatabaseMapping mapping : descriptor.getMappings()) {
        if (mapping instanceof XMLInverseReferenceMapping) {
          JPARSLogger.fine("String_Node_Str",new Object[]{DataStorage.get(DataStorage.REQUEST_UNIQUE_ID)});
          throw JPARSException.invalidConfiguration(Status.INTERNAL_SERVER_ERROR.getStatusCode());
        }
      }
    }
  }
  return entity;
}
Program: 63884
Project: 63884
Buggy source:
protected Response buildResponse(JPARSException exception){
  String path=null;
  if (uriInfo != null) {
    URI requestURI=uriInfo.getRequestUri();
    if (requestURI != null) {
      path=requestURI.getPath();
    }
  }
  if ((path != null) && (path.contains(AbstractResource.SERVICE_VERSION_2_0))) {
    ErrorResponse errorResponse=new ErrorResponse(PROBLEM_TYPE,exception.getMessage(),String.valueOf(exception.getErrorCode()));
    errorResponse.setRequestUniqueId(exception.getRequestId());
    errorResponse.setHttpStatus(exception.getHttpStatusCode());
    return Response.status(exception.getHttpStatusCode()).entity(errorResponse).type(StreamingOutputMarshaller.getResponseMediaType(headers)).build();
  }
  return Response.status(exception.getHttpStatusCode()).type(StreamingOutputMarshaller.getResponseMediaType(headers)).build();
}

Fixed version (ground truth):
protected Response buildResponse(JPARSException exception){
  String path=null;
  exception.setHttpStatusCode(getHttpStatusCode(exception.getCause()));
  if (uriInfo != null) {
    URI requestURI=uriInfo.getRequestUri();
    if (requestURI != null) {
      path=requestURI.getPath();
    }
  }
  if ((path != null) && (path.contains(AbstractResource.SERVICE_VERSION_2_0))) {
    ErrorResponse errorResponse=new ErrorResponse(PROBLEM_TYPE,exception.getMessage(),String.valueOf(exception.getErrorCode()));
    errorResponse.setRequestUniqueId((String)DataStorage.get(DataStorage.REQUEST_UNIQUE_ID));
    errorResponse.setHttpStatus(exception.getHttpStatusCode());
    return Response.status(exception.getHttpStatusCode()).entity(errorResponse).type(StreamingOutputMarshaller.getResponseMediaType(headers)).build();
  }
  return Response.status(exception.getHttpStatusCode()).type(StreamingOutputMarshaller.getResponseMediaType(headers)).build();
}
Program: 63885
Project: 63885
Buggy source:
public Response toResponse(JPARSException exception){
  JPARSLogger.exception("String_Node_Str",new Object[]{exception.getRequestId()},exception);
  return buildResponse(exception);
}

Fixed version (ground truth):
public Response toResponse(JPARSException exception){
  if (exception.getCause() != null) {
    JPARSLogger.exception("String_Node_Str",new Object[]{DataStorage.get(DataStorage.REQUEST_UNIQUE_ID)},(Exception)exception.getCause());
  }
 else {
    JPARSLogger.exception("String_Node_Str",new Object[]{DataStorage.get(DataStorage.REQUEST_UNIQUE_ID)},exception);
  }
  return buildResponse(exception);
}
Program: 63887
Project: 63887
Buggy source:
@PUT @Path("String_Node_Str") public Response create(@PathParam("String_Node_Str") String version,@PathParam("String_Node_Str") String persistenceUnit,@PathParam("String_Node_Str") String type,@Context HttpHeaders hh,@Context UriInfo uriInfo,InputStream in) throws JAXBException {
  setRequestUniqueId();
  return create(version,persistenceUnit,type,hh,uriInfo,uriInfo.getBaseUri(),in);
}

Fixed version (ground truth):
@PUT @Path("String_Node_Str") public Response create(@PathParam("String_Node_Str") String version,@PathParam("String_Node_Str") String persistenceUnit,@PathParam("String_Node_Str") String type,@Context HttpHeaders hh,@Context UriInfo uriInfo,InputStream in) throws Exception {
  setRequestUniqueId();
  return create(version,persistenceUnit,type,hh,uriInfo,uriInfo.getBaseUri(),in);
}
Program: 63888
Project: 63888
Buggy source:
/** 
 * @return The mapping for the domain object that corresponds to this Setting.
 */
public DatabaseMapping getMapping(){
  return mapping;
}

Fixed version (ground truth):
/** 
 * @return The mapping for the domain object that corresponds to this Setting.
 */
public CoreMapping getMapping(){
  return mapping;
}
Program: 63889
Project: 63889
Buggy source:
/** 
 * @param mapping The mapping for the domain object that corresponds to this Setting.
 */
public void setMapping(DatabaseMapping mapping){
  this.mapping=mapping;
}

Fixed version (ground truth):
/** 
 * @param mapping The mapping for the domain object that corresponds to this Setting.
 */
public void setMapping(CoreMapping mapping){
  this.mapping=mapping;
}
Program: 63890
Project: 63890
Buggy source:
/** 
 * @param value
 * @param updateObject
 * @param container
 */
public void addValue(Object value,boolean updateObject,Object container){
  this.value=value;
  if (updateObject) {
    if (null != children) {
      return;
    }
    ContainerMapping containerMapping=(ContainerMapping)mapping;
    ContainerPolicy containerPolicy=containerMapping.getContainerPolicy();
    if (null == container && !(mapping.isWriteOnly())) {
      container=containerPolicy.containerInstance();
      mapping.setAttributeValueInObject(object,container);
    }
    containerMapping.getContainerPolicy().addInto(value,container,null);
  }
}

Fixed version (ground truth):
/** 
 * @param value
 * @param updateObject
 * @param container
 */
public void addValue(Object value,boolean updateObject,Object container){
  this.value=value;
  if (updateObject) {
    if (null != children) {
      return;
    }
    CoreContainerPolicy containerPolicy=mapping.getContainerPolicy();
    if (null == container && !(mapping.isWriteOnly())) {
      container=containerPolicy.containerInstance();
      mapping.setAttributeValueInObject(object,container);
    }
    containerPolicy.addInto(value,container,null);
  }
}
Program: 63891
Project: 63891
Buggy source:
private void remove(Setting setting){
  DatabaseMapping mapping=setting.getMapping();
  if (null != mapping) {
    Property property=null;
    if (null == setting.getName()) {
      XMLRoot xmlRoot=(XMLRoot)setting.getValue();
      if (null != xmlRoot) {
        property=dataObject.getInstanceProperty(xmlRoot.getLocalName());
        valuesToSettings.remove(new Key(property,setting.getValue()));
      }
    }
 else {
      property=dataObject.getInstanceProperty(mapping.getAttributeName());
      valuesToSettings.remove(new Key(property,setting.getValue()));
    }
    if (property.isMany()) {
      ListWrapper listWrapper=(ListWrapper)dataObject.getList(property);
      listWrapper.remove(setting.getValue(),false,false);
    }
 else {
      dataObject.unset(property,false,false);
    }
  }
 else   if (setting.getName() != null && setting.getName().equals(TEXT_XPATH)) {
    dataObject._setModified(true);
  }
  List<Setting> children=setting.getChildren();
  if (null != children) {
    int childrenSize=children.size();
    for (int x=0; x < childrenSize; x++) {
      remove(children.get(x));
    }
  }
}

Fixed version (ground truth):
private void remove(Setting setting){
  CoreMapping mapping=setting.getMapping();
  if (null != mapping) {
    Property property=null;
    if (null == setting.getName()) {
      XMLRoot xmlRoot=(XMLRoot)setting.getValue();
      if (null != xmlRoot) {
        property=dataObject.getInstanceProperty(xmlRoot.getLocalName());
        valuesToSettings.remove(new Key(property,setting.getValue()));
      }
    }
 else {
      property=dataObject.getInstanceProperty(mapping.getAttributeName());
      valuesToSettings.remove(new Key(property,setting.getValue()));
    }
    if (property.isMany()) {
      ListWrapper listWrapper=(ListWrapper)dataObject.getList(property);
      listWrapper.remove(setting.getValue(),false,false);
    }
 else {
      dataObject.unset(property,false,false);
    }
  }
 else   if (setting.getName() != null && setting.getName().equals(TEXT_XPATH)) {
    dataObject._setModified(true);
  }
  List<Setting> children=setting.getChildren();
  if (null != children) {
    int childrenSize=children.size();
    for (int x=0; x < childrenSize; x++) {
      remove(children.get(x));
    }
  }
}
Program: 63892
Project: 63892
Buggy source:
public void setConverter(Converter valueConverter){
  this.converter=valueConverter;
}

Fixed version (ground truth):
public void setConverter(CONVERTER valueConverter){
  this.converter=valueConverter;
}
Program: 63893
Project: 63893
Buggy source:
public Converter getConverter(){
  return this.converter;
}

Fixed version (ground truth):
public CONVERTER getConverter(){
  return this.converter;
}
Program: 63896
Project: 63896
Buggy source:
public void reference(Reference reference){
  currentSetting.setObject(reference.getSourceObject());
  currentSetting.setMapping((DatabaseMapping)reference.getMapping());
  reference.setSetting(currentSetting);
}

Fixed version (ground truth):
public void reference(Reference reference){
  currentSetting.setObject(reference.getSourceObject());
  currentSetting.setMapping((CoreMapping)reference.getMapping());
  reference.setSetting(currentSetting);
}
Program: 63897
Project: 63897
Buggy source:
public void addAttributeValue(UnmarshalRecord unmarshalRecord,ContainerValue containerValue,Object value,Object collection){
  currentSetting.setMapping((DatabaseMapping)containerValue.getMapping());
  currentSetting.setObject(unmarshalRecord.getCurrentObject());
  currentSetting.addValue(value,true,collection);
}

Fixed version (ground truth):
public void addAttributeValue(UnmarshalRecord unmarshalRecord,ContainerValue containerValue,Object value,Object collection){
  currentSetting.setMapping((CoreMapping)containerValue.getMapping());
  currentSetting.setObject(unmarshalRecord.getCurrentObject());
  currentSetting.addValue(value,true,collection);
}
Program: 63898
Project: 63898
Buggy source:
public void setAttributeValue(UnmarshalRecord unmarshalRecord,Object value,Mapping mapping){
  currentSetting.setMapping((DatabaseMapping)mapping);
  currentSetting.setObject(unmarshalRecord.getCurrentObject());
  currentSetting.setValue(value);
}

Fixed version (ground truth):
public void setAttributeValue(UnmarshalRecord unmarshalRecord,Object value,Mapping mapping){
  currentSetting.setMapping((CoreMapping)mapping);
  currentSetting.setObject(unmarshalRecord.getCurrentObject());
  currentSetting.setValue(value);
}
Program: 63899
Project: 63899
Buggy source:
public void setChoiceFieldToClassAssociations(ArrayList associations){
  if (associations.size() > 0) {
    for (    Object next : associations) {
      XMLChoiceFieldToClassAssociation<XMLField> association=(XMLChoiceFieldToClassAssociation)next;
      this.addChoiceElement(association.getXmlField(),association.getClassName());
      if (association.getConverter() != null) {
        this.addConverter(association.getXmlField(),association.getConverter());
      }
    }
  }
}

Fixed version (ground truth):
public void setChoiceFieldToClassAssociations(ArrayList associations){
  if (associations.size() > 0) {
    for (    Object next : associations) {
      XMLChoiceFieldToClassAssociation<Converter,XMLField> association=(XMLChoiceFieldToClassAssociation)next;
      this.addChoiceElement(association.getXmlField(),association.getClassName());
      if (association.getConverter() != null) {
        this.addConverter(association.getXmlField(),association.getConverter());
      }
    }
  }
}
Program: 63900
Project: 63900
Buggy source:
public void setChoiceFieldToClassAssociations(ArrayList associations){
  if (associations.size() > 0) {
    for (    Object next : associations) {
      XMLChoiceFieldToClassAssociation association=(XMLChoiceFieldToClassAssociation)next;
      this.addChoiceElement((XMLField)association.getXmlField(),association.getClassName());
      if (association.getConverter() != null) {
        this.addConverter((XMLField)association.getXmlField(),association.getConverter());
      }
    }
  }
}

Fixed version (ground truth):
public void setChoiceFieldToClassAssociations(ArrayList associations){
  if (associations.size() > 0) {
    for (    Object next : associations) {
      XMLChoiceFieldToClassAssociation<Converter,XMLField> association=(XMLChoiceFieldToClassAssociation<Converter,XMLField>)next;
      this.addChoiceElement(association.getXmlField(),association.getClassName());
      if (association.getConverter() != null) {
        this.addConverter(association.getXmlField(),association.getConverter());
      }
    }
  }
}