nus-yam/ex-repair huggingface dataset:
Program: 65861
Project: 65861
Buggy source:
public void setUp() throws Exception {
  setupParser();
  setupControlDocs();
  InputStream bindingsFileXSDInputStream=getClass().getClassLoader().getResourceAsStream("String_Node_Str");
  if (bindingsFileXSDInputStream == null) {
    bindingsFileXSDInputStream=getClass().getClassLoader().getResourceAsStream("String_Node_Str");
  }
  if (bindingsFileXSDInputStream == null) {
    fail("String_Node_Str");
  }
  bindingsFileXSDSource=new StreamSource(bindingsFileXSDInputStream);
}

Fixed version (ground truth):
public void setUp() throws Exception {
  setupParser();
  setupControlDocs();
  InputStream bindingsFileXSDInputStream=getClass().getClassLoader().getResourceAsStream(ECLIPSELINK_OXM_XSD);
  if (bindingsFileXSDInputStream == null) {
    bindingsFileXSDInputStream=getClass().getClassLoader().getResourceAsStream("String_Node_Str" + ECLIPSELINK_OXM_XSD);
  }
  if (bindingsFileXSDInputStream == null) {
    fail("String_Node_Str" + ECLIPSELINK_OXM_XSD);
  }
  bindingsFileXSDSource=new StreamSource(bindingsFileXSDInputStream);
}
Program: 65862
Project: 65862
Buggy source:
private void parse(XMLStreamReader xmlStreamReader) throws SAXException {
  try {
    contentHandler.startDocument();
    parseEvent(xmlStreamReader);
    while (depth > 0) {
      xmlStreamReader.next();
      parseEvent(xmlStreamReader);
    }
    contentHandler.endDocument();
  }
 catch (  XMLStreamException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private void parse(XMLStreamReader xmlStreamReader) throws SAXException {
  try {
    contentHandler.startDocument();
    parseEvent(xmlStreamReader);
    while (depth > 0) {
      xmlStreamReader.next();
      parseEvent(xmlStreamReader);
    }
    contentHandler.endDocument();
  }
 catch (  SAXException e) {
    throw e;
  }
catch (  Exception e) {
    throw new SAXException(e);
  }
}
Program: 65863
Project: 65863
Buggy source:
/** 
 * Strategy: 1. Update an Employee to trigger validation on it 2. Assert no lazy relationships are loaded as side effect
 */
public void testTraversableResolverPreventsLoadingOfLazyRelationships(){
  EntityManager em=createBVEntityManager();
  EntityManagerFactory emf=em.getEntityManagerFactory();
  emf.getCache().evictAll();
  EntityTransaction tx=em.getTransaction();
  tx.begin();
  Employee employee=em.find(Employee.class,BeanValidationPopulator.EMPLOYEE_PK);
  employee.setName(BeanValidationPopulator.getFilledStringOfLength(Employee.NAME_MAX_SIZSE - 2));
  tx.commit();
  org.eclipse.persistence.sessions.Project project=JpaHelper.getServerSession(emf).getProject();
  assertTrue("String_Node_Str",!isInstantiated(employee,"String_Node_Str",project));
  assertTrue("String_Node_Str",!isInstantiated(employee,"String_Node_Str",project));
}

Fixed version (ground truth):
/** 
 * Strategy: 1. Update an Employee to trigger validation on it 2. Assert no lazy relationships are loaded as side effect
 */
public void testTraversableResolverPreventsLoadingOfLazyRelationships(){
  EntityManagerFactory emf=createBVEntityManagerFactory();
  EntityManager em=emf.createEntityManager();
  emf.getCache().evictAll();
  EntityTransaction tx=em.getTransaction();
  tx.begin();
  Employee employee=em.find(Employee.class,BeanValidationPopulator.EMPLOYEE_PK);
  employee.setName(BeanValidationPopulator.getFilledStringOfLength(Employee.NAME_MAX_SIZSE - 2));
  tx.commit();
  org.eclipse.persistence.sessions.Project project=JpaHelper.getServerSession(emf).getProject();
  assertTrue("String_Node_Str",!isInstantiated(employee,"String_Node_Str",project));
  assertTrue("String_Node_Str",!isInstantiated(employee,"String_Node_Str",project));
}
Program: 65865
Project: 65865
Buggy source:
protected Map getProperties() throws Exception {
  Map overrides=new HashMap();
  String overridesString="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  DOMSource src=null;
  try {
    Document doc=parser.parse(new ByteArrayInputStream(overridesString.getBytes()));
    src=new DOMSource(doc.getDocumentElement());
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail("String_Node_Str");
  }
  overrides.put("String_Node_Str",src);
  Map props=new HashMap();
  props.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,overrides);
  return props;
}

Fixed version (ground truth):
protected Map getProperties() throws Exception {
  Map overrides=new HashMap();
  String overridesString="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  DOMSource src=null;
  try {
    Document doc=parser.parse(new ByteArrayInputStream(overridesString.getBytes()));
    src=new DOMSource(doc.getDocumentElement());
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail("String_Node_Str");
  }
  overrides.put("String_Node_Str",src);
  Map props=new HashMap();
  props.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,overrides);
  return props;
}
Program: 65866
Project: 65866
Buggy source:
protected Object getControlObject(){
  Address example=new Address();
  example.setName("String_Node_Str");
  example.country="String_Node_Str";
  example.city="String_Node_Str";
  example.street="String_Node_Str";
  return example;
}

Fixed version (ground truth):
protected Object getControlObject(){
  Address example=new Address();
  example.setName("String_Node_Str");
  example.country="String_Node_Str";
  example.city="String_Node_Str";
  example.street="String_Node_Str";
  example.setSomeTransientProperty("String_Node_Str");
  return example;
}
Program: 65869
Project: 65869
Buggy source:
public HashMap getPropertyMapFromArrayList(ArrayList<Property> props){
  HashMap propMap=new HashMap(props.size());
  Iterator propIter=props.iterator();
  while (propIter.hasNext()) {
    Property next=(Property)propIter.next();
    propMap.put(next.getPropertyName(),next);
  }
  return propMap;
}

Fixed version (ground truth):
public HashMap<String,Property> getPropertyMapFromArrayList(ArrayList<Property> props){
  HashMap propMap=new HashMap(props.size());
  Iterator propIter=props.iterator();
  while (propIter.hasNext()) {
    Property next=(Property)propIter.next();
    propMap.put(next.getPropertyName(),next);
  }
  return propMap;
}
Program: 65874
Project: 65874
Buggy source:
public QName getSchemaContextAsQName(NamespaceResolver nsResolver){
  if (schemaContext == null) {
    return null;
  }
  if (schemaContextAsQName == null) {
    int idx=schemaContext.lastIndexOf("String_Node_Str");
    if (idx == -1) {
      idx=0;
    }
    String type=schemaContext.substring(idx + 1);
    idx=type.indexOf(XMLConstants.COLON);
    if (idx != -1) {
      String prefix=type.substring(0,idx);
      String localPart=type.substring(idx + 1);
      String uri=nsResolver.resolveNamespacePrefix(prefix);
      schemaContextAsQName=new QName(uri,localPart);
    }
 else {
      if (nsResolver != null && nsResolver.getDefaultNamespaceURI() != null) {
        schemaContextAsQName=new QName(nsResolver.getDefaultNamespaceURI(),type);
      }
 else {
        schemaContextAsQName=new QName(type);
      }
    }
  }
  return schemaContextAsQName;
}

Fixed version (ground truth):
public QName getSchemaContextAsQName(NamespaceResolver nsResolver){
  if (schemaContext == null) {
    return null;
  }
  if (schemaContextAsQName == null) {
    int idx=schemaContext.lastIndexOf("String_Node_Str");
    String type=schemaContext.substring(idx + 1);
    idx=type.indexOf(XMLConstants.COLON);
    if (idx != -1) {
      String prefix=type.substring(0,idx);
      String localPart=type.substring(idx + 1);
      String uri=nsResolver.resolveNamespacePrefix(prefix);
      schemaContextAsQName=new QName(uri,localPart);
    }
 else {
      if (nsResolver != null && nsResolver.getDefaultNamespaceURI() != null) {
        schemaContextAsQName=new QName(nsResolver.getDefaultNamespaceURI(),type);
      }
 else {
        schemaContextAsQName=new QName(type);
      }
    }
  }
  return schemaContextAsQName;
}
Program: 65875
Project: 65875
Buggy source:
protected Map getProperties2() throws Exception {
  Map overrides=new HashMap();
  String bindings1="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String bindings2="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  DOMSource src1=null;
  DOMSource src2=null;
  try {
    Document doc=parser.parse(new ByteArrayInputStream(bindings1.getBytes()));
    src1=new DOMSource(doc.getDocumentElement());
    Document doc2=parser.parse(new ByteArrayInputStream(bindings2.getBytes()));
    src2=new DOMSource(doc2.getDocumentElement());
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail("String_Node_Str");
  }
  ArrayList<Object> bindingsList=new ArrayList();
  bindingsList.add(src1);
  bindingsList.add(src2);
  overrides.put("String_Node_Str",bindingsList);
  Map props=new HashMap();
  props.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,overrides);
  return props;
}

Fixed version (ground truth):
protected Map getProperties2() throws Exception {
  Map overrides=new HashMap();
  String bindings1="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  String bindings2="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  DOMSource src1=null;
  try {
    Document doc=parser.parse(new ByteArrayInputStream(bindings1.getBytes()));
    src1=new DOMSource(doc.getDocumentElement());
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail("String_Node_Str");
  }
  ArrayList<Object> bindingsList=new ArrayList();
  bindingsList.add(src1);
  bindingsList.add(new XMLMetadataSource(new StringReader(bindings2)));
  overrides.put("String_Node_Str",bindingsList);
  Map props=new HashMap();
  props.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,overrides);
  return props;
}
Program: 65876
Project: 65876
Buggy source:
protected Map getProperties() throws Exception {
  Map overrides=new HashMap();
  InputStream iStream=classLoader.getResourceAsStream("String_Node_Str");
  InputStream iStream2=classLoader.getResourceAsStream("String_Node_Str");
  ArrayList<Object> bindingsList=new ArrayList();
  bindingsList.add(new StreamSource(iStream));
  bindingsList.add(new StreamSource(iStream2));
  overrides.put("String_Node_Str",bindingsList);
  Map props=new HashMap();
  props.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,overrides);
  return props;
}

Fixed version (ground truth):
protected Map getProperties() throws Exception {
  Map overrides=new HashMap();
  InputStream iStream=classLoader.getResourceAsStream("String_Node_Str");
  InputStream iStream2=classLoader.getResourceAsStream("String_Node_Str");
  ArrayList<Object> bindingsList=new ArrayList();
  bindingsList.add(new StreamSource(iStream));
  bindingsList.add(new XMLMetadataSource(iStream2));
  overrides.put("String_Node_Str",bindingsList);
  Map props=new HashMap();
  props.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,overrides);
  return props;
}
Program: 65879
Project: 65879
Buggy source:
/** 
 * Processing a bindings file and add it to a given Map of package name to binding files.
 * @param originalBindings Map of bindings to be updated
 * @param bindingHandle handle to bindings file
 * @param classLoader
 * @return
 */
private static Map<String,List<XmlBindings>> processBindingFile(Map<String,List<XmlBindings>> originalBindings,Object bindingHandle,ClassLoader classLoader){
  Map<String,List<XmlBindings>> bindingMap=originalBindings;
  XmlBindings binding=getXmlBindings(bindingHandle,classLoader);
  if (binding != null) {
    String key=binding.getPackageName();
    if (key.equals(XMLProcessor.DEFAULT)) {
      throw org.eclipse.persistence.exceptions.JAXBException.packageNotSetForBindingException();
    }
    JavaTypes jTypes=binding.getJavaTypes();
    if (jTypes != null) {
      for (      JavaType javaType : jTypes.getJavaType()) {
        String javaTypeName=javaType.getName();
        if (!(javaTypeName.contains(key))) {
          javaType.setName(key + PKG_SEPARATOR + javaTypeName);
        }
      }
    }
    List<XmlBindings> existingBindings=bindingMap.get(key);
    if (existingBindings != null) {
      existingBindings.add(binding);
    }
 else {
      existingBindings=new ArrayList<XmlBindings>();
      existingBindings.add(binding);
      bindingMap.put(key,existingBindings);
    }
  }
  return bindingMap;
}

Fixed version (ground truth):
/** 
 * Processing a bindings file and add it to a given Map of package name to binding files.
 * @param originalBindings Map of bindings to be updated
 * @param bindingHandle handle to bindings file
 * @param classLoader
 * @return
 */
private static Map<String,List<XmlBindings>> processBindingFile(Map<String,List<XmlBindings>> originalBindings,Object bindingHandle,ClassLoader classLoader,Map<String,Object> properties){
  Map<String,List<XmlBindings>> bindingMap=originalBindings;
  XmlBindings binding=getXmlBindings(bindingHandle,classLoader,properties);
  if (binding != null) {
    String key=binding.getPackageName();
    if (key.equals(XMLProcessor.DEFAULT)) {
      throw org.eclipse.persistence.exceptions.JAXBException.packageNotSetForBindingException();
    }
    JavaTypes jTypes=binding.getJavaTypes();
    if (jTypes != null) {
      for (      JavaType javaType : jTypes.getJavaType()) {
        String javaTypeName=javaType.getName();
        if (!(javaTypeName.contains(key))) {
          javaType.setName(key + PKG_SEPARATOR + javaTypeName);
        }
      }
    }
    List<XmlBindings> existingBindings=bindingMap.get(key);
    if (existingBindings != null) {
      existingBindings.add(binding);
    }
 else {
      existingBindings=new ArrayList<XmlBindings>();
      existingBindings.add(binding);
      bindingMap.put(key,existingBindings);
    }
  }
  return bindingMap;
}
Program: 65880
Project: 65880
Buggy source:
private static void mergeJavaAttributes(JavaAttributes attributes,JavaAttributes overrideAttributes,JavaType javaType){
  List<JAXBElement<? extends JavaAttribute>> attributeList=attributes.getJavaAttribute();
  Map<String,JAXBElement> attributeMap=new HashMap<String,JAXBElement>(attributeList.size());
  for (  JAXBElement next : attributeList) {
    attributeMap.put(((JavaAttribute)next.getValue()).getJavaAttribute(),next);
  }
  for (  JAXBElement next : overrideAttributes.getJavaAttribute()) {
    JAXBElement existingAttribute=attributeMap.get(((JavaAttribute)next.getValue()).getJavaAttribute());
    if (existingAttribute != null) {
      throw JAXBException.samePropertyInMultipleFiles(((JavaAttribute)next.getValue()).getJavaAttribute(),javaType.getName());
    }
    attributes.getJavaAttribute().add(next);
  }
}

Fixed version (ground truth):
private static void mergeJavaAttributes(JavaAttributes attributes,JavaAttributes overrideAttributes,JavaType javaType){
  List<JAXBElement<? extends JavaAttribute>> attributeList=attributes.getJavaAttribute();
  Map<String,JAXBElement> attributeMap=new HashMap<String,JAXBElement>(attributeList.size());
  for (  JAXBElement next : attributeList) {
    attributeMap.put(((JavaAttribute)next.getValue()).getJavaAttribute(),next);
  }
  for (  JAXBElement next : overrideAttributes.getJavaAttribute()) {
    JAXBElement existingAttribute=attributeMap.get(((JavaAttribute)next.getValue()).getJavaAttribute());
    if (existingAttribute != null) {
      attributes.getJavaAttribute().remove(existingAttribute);
    }
    attributes.getJavaAttribute().add(next);
  }
}
Program: 65881
Project: 65881
Buggy source:
public Map<QName,Object> getAnyAttributes(){
  return anyAttributes;
}

Fixed version (ground truth):
@XmlAnyAttribute public Map<QName,Object> getAnyAttributes(){
  return anyAttributes;
}
Program: 65887
Project: 65887
Buggy source:
public void testUnmarshalToSubClass() throws Exception {
  if (isUnmarshalTest()) {
    InputStream instream=ClassLoader.getSystemResourceAsStream(resourceName);
    StreamSource ss=new StreamSource(instream);
    JAXBElement testObject=getJAXBUnmarshaller().unmarshal(ss,A.class);
    Object value=testObject.getValue();
    instream.close();
    assertTrue(value instanceof E);
    assertEquals(5,((E)value).getEee());
    log("String_Node_Str");
    log("String_Node_Str");
    log(getReadControlObject().toString());
    log("String_Node_Str");
    log(testObject.toString());
    JAXBElement controlObj=(JAXBElement)getUnmarshalToSubClssControlObject();
    JAXBElement testObj=(JAXBElement)testObject;
    compareJAXBElementObjects(controlObj,testObj);
  }
}

Fixed version (ground truth):
public void testUnmarshalToSubClass() throws Exception {
  if (isUnmarshalTest()) {
    InputStream instream=ClassLoader.getSystemResourceAsStream(resourceName);
    StreamSource ss=new StreamSource(instream);
    JAXBElement testObject=getJAXBUnmarshaller().unmarshal(ss,A.class);
    Object value=testObject.getValue();
    instream.close();
    assertTrue(value instanceof E);
    assertEquals(5,((E)value).getEee());
    log("String_Node_Str");
    log("String_Node_Str");
    log(getReadControlObject().toString());
    log("String_Node_Str");
    log(testObject.toString());
    JAXBElement controlObj=(JAXBElement)getControlObject();
    JAXBElement testObj=(JAXBElement)testObject;
    compareJAXBElementObjects(controlObj,testObj);
  }
}
Program: 65889
Project: 65889
Buggy source:
public XMLBinder(XMLContext context){
  marshaller=context.createMarshaller();
  unmarshaller=context.createUnmarshaller();
  saxUnmarshaller=new SAXUnmarshaller(unmarshaller,null);
  this.context=context;
  documentPreservationPolicy=new XMLBinderPolicy();
  reader=new DOMReader(unmarshaller);
}

Fixed version (ground truth):
public XMLBinder(XMLContext context){
  this.context=new XMLContext(context.getXMLContextState());
  marshaller=this.context.createMarshaller();
  unmarshaller=this.context.createUnmarshaller();
  saxUnmarshaller=new SAXUnmarshaller(unmarshaller,null);
  documentPreservationPolicy=new XMLBinderPolicy();
  reader=new DOMReader(unmarshaller);
}
Program: 65890
Project: 65890
Buggy source:
/** 
 * INTERNAL: Create a start element tag - this call results in a complete start element,  i.e. closeStartElement() does not need to be called after a call to this  method.
 */
private void openAndCloseStartElement(){
  try {
    contentHandler.startElement(xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),xPathFragment.getShortName(),attributes);
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Create a start element tag - this call results in a complete start element,  i.e. closeStartElement() does not need to be called after a call to this  method.
 */
private void openAndCloseStartElement(){
  try {
    String namespaceUri=xPathFragment.getNamespaceURI();
    if (namespaceUri == null) {
      namespaceUri=XMLConstants.EMPTY_STRING;
    }
    contentHandler.startElement(namespaceUri,xPathFragment.getLocalName(),xPathFragment.getShortName(),attributes);
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}
Program: 65891
Project: 65891
Buggy source:
/** 
 * INTERNAL:
 */
public void endElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  if (isStartElementOpen) {
    openAndCloseStartElement();
    isStartElementOpen=false;
  }
  try {
    contentHandler.endElement(xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),xPathFragment.getShortName());
    List<String> currentLevelPrefixMappings=prefixMappings.remove(prefixMappings.size() - 1);
    if (null != currentLevelPrefixMappings) {
      for (      String prefix : currentLevelPrefixMappings) {
        contentHandler.endPrefixMapping(prefix);
      }
    }
    isStartElementOpen=false;
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void endElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  if (isStartElementOpen) {
    openAndCloseStartElement();
    isStartElementOpen=false;
  }
  try {
    String uri=xPathFragment.getNamespaceURI();
    if (uri == null) {
      uri=XMLConstants.EMPTY_STRING;
    }
    contentHandler.endElement(uri,xPathFragment.getLocalName(),xPathFragment.getShortName());
    List<String> currentLevelPrefixMappings=prefixMappings.remove(prefixMappings.size() - 1);
    if (null != currentLevelPrefixMappings) {
      for (      String prefix : currentLevelPrefixMappings) {
        contentHandler.endPrefixMapping(prefix);
      }
    }
    isStartElementOpen=false;
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}
Program: 65892
Project: 65892
Buggy source:
/** 
 * INTERNAL:
 */
public void element(XPathFragment frag){
  if (isStartElementOpen) {
    openAndCloseStartElement();
    isStartElementOpen=false;
  }
  try {
    this.attributes.clear();
    String namespaceURI=frag.getNamespaceURI();
    String localName=frag.getLocalName();
    String shortName=frag.getShortName();
    contentHandler.startElement(namespaceURI,localName,shortName,attributes);
    contentHandler.endElement(namespaceURI,localName,shortName);
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void element(XPathFragment frag){
  if (isStartElementOpen) {
    openAndCloseStartElement();
    isStartElementOpen=false;
  }
  try {
    this.attributes.clear();
    String namespaceURI=frag.getNamespaceURI();
    if (namespaceURI == null) {
      namespaceURI=XMLConstants.EMPTY_STRING;
    }
    String localName=frag.getLocalName();
    String shortName=frag.getShortName();
    contentHandler.startElement(namespaceURI,localName,shortName,attributes);
    contentHandler.endElement(namespaceURI,localName,shortName);
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}
Program: 65893
Project: 65893
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  String platform=System.getProperty("String_Node_Str");
  boolean jaxpPlatform=platform.equalsIgnoreCase("String_Node_Str");
  suite.addTestSuite(XMLMarshallerCreateTestCases.class);
  suite.addTestSuite(XMLMarshalTestCases.class);
  suite.addTestSuite(XMLMarshalNSTestCases.class);
  suite.addTestSuite(XMLMarshalExceptionTestCases.class);
  suite.addTestSuite(XMLMarshalFragmentTestCases.class);
  suite.addTestSuite(XMLUnmarshalTestCases.class);
  if (!jaxpPlatform) {
    suite.addTestSuite(XMLMarshallerValidateRootTestCases.class);
  }
  suite.addTestSuite(XMLMarshallerValidationModeTestCases.class);
  suite.addTestSuite(SetSchemasTestCases.class);
  suite.addTestSuite(SetXmlSchemaTestCases.class);
  suite.addTest(StructureValidationTestSuite.suite());
  suite.addTestSuite(XMLUnmarshallerHandlerTestCases.class);
  suite.addTestSuite(XMLMarshallerNoDefaultRootTestCases.class);
  suite.addTestSuite(XMLContextConstructorUsingXMLSessionConfigLoader.class);
  suite.addTestSuite(XMLContextStoreXMLDescriptorSimpleType.class);
  suite.addTestSuite(UnmarshalChildElementNSTestCases.class);
  suite.addTestSuite(UnmarshalLevelTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  String platform=System.getProperty("String_Node_Str");
  boolean jaxpPlatform=platform.equalsIgnoreCase("String_Node_Str");
  suite.addTestSuite(XMLMarshallerCreateTestCases.class);
  suite.addTestSuite(XMLMarshalTestCases.class);
  suite.addTestSuite(XMLMarshalNSTestCases.class);
  suite.addTestSuite(XMLMarshalExceptionTestCases.class);
  suite.addTestSuite(XMLMarshalFragmentTestCases.class);
  suite.addTestSuite(XMLUnmarshalTestCases.class);
  if (!jaxpPlatform) {
    suite.addTestSuite(XMLMarshallerValidateRootTestCases.class);
  }
  suite.addTestSuite(XMLMarshallerValidationModeTestCases.class);
  suite.addTestSuite(SetSchemasTestCases.class);
  suite.addTestSuite(SetXmlSchemaTestCases.class);
  suite.addTest(StructureValidationTestSuite.suite());
  suite.addTestSuite(XMLUnmarshallerHandlerTestCases.class);
  suite.addTestSuite(XMLMarshallerNoDefaultRootTestCases.class);
  suite.addTestSuite(XMLContextConstructorUsingXMLSessionConfigLoader.class);
  suite.addTestSuite(XMLContextStoreXMLDescriptorSimpleType.class);
  suite.addTestSuite(UnmarshalChildElementNSTestCases.class);
  suite.addTestSuite(UnmarshalLevelTestCases.class);
  suite.addTestSuite(XMLMarshallerContentHandlerTestCases.class);
  return suite;
}
Program: 65895
Project: 65895
Buggy source:
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Object collection){
  Object value=unmarshalRecord.getStringBuffer().toString();
  unmarshalRecord.resetStringBuffer();
  if (xmlCompositeDirectCollectionMapping.usesSingleNode()) {
    StringTokenizer stringTokenizer=new StringTokenizer((String)value);
    while (stringTokenizer.hasMoreTokens()) {
      addUnmarshalValue(unmarshalRecord,stringTokenizer.nextToken(),collection);
    }
  }
 else {
    addUnmarshalValue(unmarshalRecord,value,collection);
  }
}

Fixed version (ground truth):
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Object collection){
  Object value=unmarshalRecord.getStringBuffer().toString();
  unmarshalRecord.resetStringBuffer();
  if (xmlCompositeDirectCollectionMapping.usesSingleNode()) {
    StringTokenizer stringTokenizer=new StringTokenizer((String)value);
    while (stringTokenizer.hasMoreTokens()) {
      addUnmarshalValue(unmarshalRecord,stringTokenizer.nextToken(),collection);
    }
  }
 else {
    XMLField xmlField=(XMLField)xmlCompositeDirectCollectionMapping.getField();
    if (xmlField.getLastXPathFragment().nameIsText()) {
      addUnmarshalValue(unmarshalRecord,value,collection);
    }
  }
}
Program: 65896
Project: 65896
Buggy source:
private boolean isJAXB2ObjectFactory(Class objectFactoryClass){
  try {
    Class xmlRegistry=PrivilegedAccessHelper.getClassForName("String_Node_Str");
    if (objectFactoryClass.isAnnotationPresent(xmlRegistry)) {
      return true;
    }
    return false;
  }
 catch (  Exception ex) {
    return false;
  }
}

Fixed version (ground truth):
private boolean isJAXB2ObjectFactory(Class objectFactoryClass,ClassLoader classLoader){
  try {
    Class xmlRegistry=PrivilegedAccessHelper.getClassForName("String_Node_Str",false,classLoader);
    if (objectFactoryClass.isAnnotationPresent(xmlRegistry)) {
      return true;
    }
    return false;
  }
 catch (  Exception ex) {
    return false;
  }
}
Program: 65897
Project: 65897
Buggy source:
/** 
 * Process an @XmlSeeAlso annotation. TypeInfo instances will be created for each class listed.
 * @param javaClass
 */
private void processXmlSeeAlso(JavaClass javaClass,TypeInfo info){
  Class xmlSeeAlsoClass=null;
  Method valueMethod=null;
  try {
    xmlSeeAlsoClass=PrivilegedAccessHelper.getClassForName("String_Node_Str");
    valueMethod=PrivilegedAccessHelper.getDeclaredMethod(xmlSeeAlsoClass,"String_Node_Str",new Class[]{});
  }
 catch (  ClassNotFoundException ex) {
  }
catch (  NoSuchMethodException ex) {
  }
  if (xmlSeeAlsoClass != null && helper.isAnnotationPresent(javaClass,xmlSeeAlsoClass)) {
    Object seeAlso=helper.getAnnotation(javaClass,xmlSeeAlsoClass);
    Class[] values=null;
    try {
      values=(Class[])PrivilegedAccessHelper.invokeMethod(valueMethod,seeAlso,new Object[]{});
    }
 catch (    Exception ex) {
    }
    List<String> seeAlsoClassNames=new ArrayList<String>();
    for (    Class next : values) {
      seeAlsoClassNames.add(next.getName());
    }
    info.setXmlSeeAlso(seeAlsoClassNames);
  }
}

Fixed version (ground truth):
/** 
 * Process an @XmlSeeAlso annotation. TypeInfo instances will be created for each class listed.
 * @param javaClass
 */
private void processXmlSeeAlso(JavaClass javaClass,TypeInfo info){
  Class xmlSeeAlsoClass=null;
  Method valueMethod=null;
  try {
    xmlSeeAlsoClass=PrivilegedAccessHelper.getClassForName("String_Node_Str",false,helper.getClassLoader());
    valueMethod=PrivilegedAccessHelper.getDeclaredMethod(xmlSeeAlsoClass,"String_Node_Str",new Class[]{});
  }
 catch (  ClassNotFoundException ex) {
  }
catch (  NoSuchMethodException ex) {
  }
  if (xmlSeeAlsoClass != null && helper.isAnnotationPresent(javaClass,xmlSeeAlsoClass)) {
    Object seeAlso=helper.getAnnotation(javaClass,xmlSeeAlsoClass);
    Class[] values=null;
    try {
      values=(Class[])PrivilegedAccessHelper.invokeMethod(valueMethod,seeAlso,new Object[]{});
    }
 catch (    Exception ex) {
    }
    List<String> seeAlsoClassNames=new ArrayList<String>();
    for (    Class next : values) {
      seeAlsoClassNames.add(next.getName());
    }
    info.setXmlSeeAlso(seeAlsoClassNames);
  }
}
Program: 65898
Project: 65898
Buggy source:
public List<JAXBElement> getItemList(){
  accessedViaMethod=true;
  return items;
}

Fixed version (ground truth):
public List<Object> getItemList(){
  accessedViaMethod=true;
  return items;
}
Program: 65899
Project: 65899
Buggy source:
public void setItemList(List<JAXBElement> items){
  this.items=items;
}

Fixed version (ground truth):
public void setItemList(List<Object> items){
  this.items=items;
}
Program: 65903
Project: 65903
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new TestSuite(LoadAndSaveValuePropTestCases.class));
  suite.addTest(new TestSuite(LoadAndSaveWithDefaultsTestCases.class));
  suite.addTest(new TestSuite(LoadAndSaveInheritanceBug6043501TestCases.class));
  suite.addTest(new TestSuite(LoadAndSaveNamespacesBugTestCases.class));
  suite.addTest(new TestSuite(LoadAndSaveBug6130541TestCases.class));
  suite.addTest(new TestSuite(LoadAndSaveAttributeGroupTestCases.class));
  suite.addTest(new TestSuite(LoadAndSaveGroupTestCases.class));
  suite.addTest(new TestSuite(LoadAndSaveWithTypeBug6522867TestCases.class));
  suite.addTest(new TestSuite(org.eclipse.persistence.testing.sdo.helper.xmlhelper.loadandsave.LoadAndSaveWithReadOnlyTestCases.class));
  suite.addTest(new TestSuite(org.eclipse.persistence.testing.sdo.helper.xmlhelper.loadandsave.nillable.ListPropertyNillableElementTestCases.class));
  suite.addTest(new TestSuite(org.eclipse.persistence.testing.sdo.helper.xmlhelper.loadandsave.mixed.LoadAndSaveMixedContentTestCases.class));
  suite.addTest(new TestSuite(org.eclipse.persistence.testing.sdo.helper.xmlhelper.loadandsave.staticclasses.LoadAndSaveStaticClassesTestCases.class));
  suite.addTest(new TestSuite(org.eclipse.persistence.testing.sdo.helper.xmlhelper.loadandsave.LoadAndSaveIncludeWithExtensionTestCases.class));
  suite.addTestSuite(GlobalAttributeTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new TestSuite(LoadAndSaveValuePropTestCases.class));
  suite.addTest(new TestSuite(LoadAndSaveWithDefaultsTestCases.class));
  suite.addTest(new TestSuite(LoadAndSaveInheritanceBug6043501TestCases.class));
  suite.addTest(new TestSuite(LoadAndSaveNamespacesBugTestCases.class));
  suite.addTest(new TestSuite(LoadAndSaveBug6130541TestCases.class));
  suite.addTest(new TestSuite(LoadAndSaveAttributeGroupTestCases.class));
  suite.addTest(new TestSuite(LoadAndSaveGroupTestCases.class));
  suite.addTest(new TestSuite(LoadAndSaveWithTypeBug6522867TestCases.class));
  suite.addTest(new TestSuite(org.eclipse.persistence.testing.sdo.helper.xmlhelper.loadandsave.LoadAndSaveWithReadOnlyTestCases.class));
  suite.addTest(new TestSuite(org.eclipse.persistence.testing.sdo.helper.xmlhelper.loadandsave.nillable.ListPropertyNillableElementTestCases.class));
  suite.addTest(new TestSuite(org.eclipse.persistence.testing.sdo.helper.xmlhelper.loadandsave.mixed.LoadAndSaveMixedContentTestCases.class));
  suite.addTest(new TestSuite(org.eclipse.persistence.testing.sdo.helper.xmlhelper.loadandsave.staticclasses.LoadAndSaveStaticClassesTestCases.class));
  suite.addTest(new TestSuite(org.eclipse.persistence.testing.sdo.helper.xmlhelper.loadandsave.LoadAndSaveIncludeWithExtensionTestCases.class));
  suite.addTestSuite(GlobalAttributeTestCases.class);
  suite.addTest(new TestSuite(LoadAndSaveExceptionBug325353TestCases.class));
  return suite;
}
Program: 65905
Project: 65905
Buggy source:
private Object getValueToWrite(Object value,XMLField xmlField,AbstractSession session){
  if (value instanceof Node) {
    return value;
  }
  return getNonNodeValueToWrite(value,xmlField,session);
}

Fixed version (ground truth):
private Object getValueToWrite(Object value,XMLField xmlField,AbstractSession session){
  if (value instanceof Node || value == XMLRecord.NIL) {
    return value;
  }
  return getNonNodeValueToWrite(value,xmlField,session);
}
Program: 65908
Project: 65908
Buggy source:
public void writeSingleValue(Object value,Object parent,XMLRecord row,AbstractSession session){
  Object fieldValue=getFieldValue(value,session,row);
  writeValueIntoRow(row,getField(),fieldValue);
}

Fixed version (ground truth):
public void writeSingleValue(Object value,Object parent,XMLRecord row,AbstractSession session){
  Object fieldValue=getFieldValue(value,session,row);
  if (fieldValue == null && getNullPolicy() != null) {
    getNullPolicy().directMarshal(this.getField(),row,parent);
  }
 else {
    writeValueIntoRow(row,getField(),fieldValue);
  }
}
Program: 65909
Project: 65909
Buggy source:
/** 
 * INTERNAL:  When using the SAX or DOM Platform, this method is responsible for marshalling null values for the XML Direct Mapping.
 * @param xPathFragment
 * @param marshalRecord
 * @param object
 * @param session
 * @param namespaceResolver
 * @return true if this method caused any nodes to be marshaled, else false.
 */
public boolean directMarshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Session session,NamespaceResolver namespaceResolver){
  if (xPathFragment.isAttribute()) {
    if (getMarshalNullRepresentation().equals(XMLNullRepresentationType.EMPTY_NODE)) {
      XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
      marshalRecord.attribute(xPathFragment,namespaceResolver,XMLConstants.EMPTY_STRING);
      marshalRecord.closeStartGroupingElements(groupingFragment);
      return true;
    }
 else {
      return false;
    }
  }
 else {
    if (getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {
      XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
      String xsiPrefix=processNamespaceResolverForXSIPrefix(namespaceResolver,marshalRecord);
      StringBuilder qName=new StringBuilder(XMLConstants.ATTRIBUTE);
      qName.append(xsiPrefix).append(COLON_W_SCHEMA_NIL_ATTRIBUTE);
      XPathFragment nilFragment=new XPathFragment(qName.toString());
      nilFragment.setNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);
      marshalRecord.attribute(nilFragment,namespaceResolver,TRUE);
      marshalRecord.closeStartGroupingElements(groupingFragment);
      return true;
    }
 else {
      if (getMarshalNullRepresentation().equals(XMLNullRepresentationType.EMPTY_NODE)) {
        XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
        marshalRecord.closeStartGroupingElements(groupingFragment);
        return true;
      }
 else {
        return false;
      }
    }
  }
}

Fixed version (ground truth):
public void directMarshal(DatabaseField field,XMLRecord record,Object object){
  Object fieldValue=null;
  if (getMarshalNullRepresentation() == XMLNullRepresentationType.EMPTY_NODE) {
    fieldValue=XMLConstants.EMPTY_STRING;
  }
 else {
    if (!(((XMLField)field).getLastXPathFragment().isAttribute())) {
      if (getMarshalNullRepresentation() == XMLNullRepresentationType.XSI_NIL) {
        fieldValue=XMLRecord.NIL;
      }
    }
  }
  record.put(field,fieldValue);
}
Program: 65910
Project: 65910
Buggy source:
public boolean directMarshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Session session,NamespaceResolver namespaceResolver){
  if (!isSet(object)) {
    return false;
  }
 else {
    return super.directMarshal(xPathFragment,marshalRecord,object,session,namespaceResolver);
  }
}

Fixed version (ground truth):
public void directMarshal(DatabaseField field,XMLRecord record,Object object){
  if (!isSet(object)) {
    return;
  }
  super.directMarshal(field,record,object);
}
Program: 65911
Project: 65911
Buggy source:
/** 
 * INTERNAL: Create a start element tag - this call results in a complete start element,  i.e. closeStartElement() does not need to be called after a call to this  method.
 */
private void openAndCloseStartElement(){
  try {
    level++;
    contentHandler.startElement(xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),xPathFragment.getShortName(),attributes);
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Create a start element tag - this call results in a complete start element,  i.e. closeStartElement() does not need to be called after a call to this  method.
 */
private void openAndCloseStartElement(){
  try {
    contentHandler.startElement(xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),xPathFragment.getShortName(),attributes);
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}
Program: 65912
Project: 65912
Buggy source:
/** 
 * INTERNAL:
 */
public void openStartElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  super.openStartElement(xPathFragment,namespaceResolver);
  if (isStartElementOpen) {
    openAndCloseStartElement();
  }
  this.isStartElementOpen=true;
  this.xPathFragment=xPathFragment;
  this.attributes.clear();
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void openStartElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  super.openStartElement(xPathFragment,namespaceResolver);
  currentLevelPrefixMappings=Collections.EMPTY_LIST;
  prefixMappingsDeque.push(currentLevelPrefixMappings);
  if (isStartElementOpen) {
    openAndCloseStartElement();
  }
  this.isStartElementOpen=true;
  this.xPathFragment=xPathFragment;
  this.attributes.clear();
}
Program: 65913
Project: 65913
Buggy source:
/** 
 * INTERNAL:
 */
public void startPrefixMapping(String prefix,String namespaceURI){
  try {
    contentHandler.startPrefixMapping(prefix,namespaceURI);
    List<String> currentLevelPrefixMappings=prefixMappings.get(level);
    if (null == currentLevelPrefixMappings) {
      currentLevelPrefixMappings=new ArrayList<String>();
      prefixMappings.put(level,currentLevelPrefixMappings);
    }
    currentLevelPrefixMappings.add(prefix);
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void startPrefixMapping(String prefix,String namespaceURI){
  try {
    contentHandler.startPrefixMapping(prefix,namespaceURI);
    if (Collections.EMPTY_LIST == currentLevelPrefixMappings) {
      currentLevelPrefixMappings=new ArrayList<String>();
    }
    currentLevelPrefixMappings.add(prefix);
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}
Program: 65914
Project: 65914
Buggy source:
/** 
 * INTERNAL:
 */
public void endElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  if (isStartElementOpen) {
    openAndCloseStartElement();
    isStartElementOpen=false;
  }
  try {
    contentHandler.endElement(xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),xPathFragment.getShortName());
    level--;
    List<String> currentLevelPrefixMappings=prefixMappings.get(level);
    if (null != currentLevelPrefixMappings) {
      for (      String prefix : currentLevelPrefixMappings) {
        contentHandler.endPrefixMapping(prefix);
      }
      currentLevelPrefixMappings.clear();
    }
    isStartElementOpen=false;
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void endElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  if (isStartElementOpen) {
    openAndCloseStartElement();
    isStartElementOpen=false;
  }
  try {
    contentHandler.endElement(xPathFragment.getNamespaceURI(),xPathFragment.getLocalName(),xPathFragment.getShortName());
    List<String> currentLevelPrefixMappings=prefixMappingsDeque.pop();
    if (null != currentLevelPrefixMappings && Collections.EMPTY_LIST != currentLevelPrefixMappings) {
      for (      String prefix : currentLevelPrefixMappings) {
        contentHandler.endPrefixMapping(prefix);
      }
    }
    isStartElementOpen=false;
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}
Program: 65915
Project: 65915
Buggy source:
public ContentHandlerRecord(){
  level=0;
  prefixMappings=new HashMap<Integer,List<String>>();
  attributes=new AttributesImpl();
}

Fixed version (ground truth):
public ContentHandlerRecord(){
  prefixMappingsDeque=new ArrayDeque<List<String>>();
  currentLevelPrefixMappings=Collections.EMPTY_LIST;
  attributes=new AttributesImpl();
}
Program: 65916
Project: 65916
Buggy source:
public void testNamespaceResolver(){
  assertNotNull("String_Node_Str",xmlContext);
  XMLDescriptor xdesc=xmlContext.getDescriptor(new QName("String_Node_Str","String_Node_Str"));
  assertNotNull("String_Node_Str",xdesc);
  String prefix=xdesc.getNamespaceResolver().resolveNamespaceURI("String_Node_Str");
  String prefix2=xdesc.getNamespaceResolver().resolveNamespaceURI("String_Node_Str");
  assertEquals("String_Node_Str",prefix);
  assertEquals("String_Node_Str",prefix2);
}

Fixed version (ground truth):
public void testNamespaceResolver(){
  assertNotNull("String_Node_Str",xmlContext);
  XMLDescriptor xdesc=xmlContext.getDescriptor(new QName("String_Node_Str","String_Node_Str"));
  assertNotNull("String_Node_Str",xdesc);
  String uriA="String_Node_Str";
  String uriB="String_Node_Str";
  String prefixA="String_Node_Str";
  String prefixNewA="String_Node_Str";
  String prefixB="String_Node_Str";
  assertEquals(uriA,xdesc.getNamespaceResolver().resolveNamespacePrefix(prefixA));
  assertEquals(uriA,xdesc.getNamespaceResolver().resolveNamespacePrefix(prefixNewA));
  assertEquals(uriB,xdesc.getNamespaceResolver().resolveNamespacePrefix(prefixB));
}
Program: 65918
Project: 65918
Buggy source:
/** 
 * PUBLIC: Cause: An exception occurred while attampting to get a new instance of  the adapter class.
 */
public static JAXBException adapterClassCouldNotBeInstantiated(String adapterClassName,Exception ex){
  Object[] args={adapterClassName};
  JAXBException validationException=new JAXBException(ExceptionMessageGenerator.buildMessage(JAXBException.class,ADAPTER_CLASS_COULD_NOT_BE_INSTANTIATED,args),ex);
  validationException.setErrorCode(ADAPTER_CLASS_COULD_NOT_BE_INSTANTIATED);
  return validationException;
}

Fixed version (ground truth):
/** 
 * PUBLIC: Cause: An exception occurred while attempting to get a new instance of  the adapter class.
 */
public static JAXBException adapterClassCouldNotBeInstantiated(String adapterClassName,Exception ex){
  Object[] args={adapterClassName};
  JAXBException validationException=new JAXBException(ExceptionMessageGenerator.buildMessage(JAXBException.class,ADAPTER_CLASS_COULD_NOT_BE_INSTANTIATED,args),ex);
  validationException.setErrorCode(ADAPTER_CLASS_COULD_NOT_BE_INSTANTIATED);
  return validationException;
}
Program: 65919
Project: 65919
Buggy source:
/** 
 * PUBLIC: Cause: An exception occurred while attampting to get the declared methods from  the adapter class.
 */
public static JAXBException adapterClassMethodsCouldNotBeAccessed(String adapterClassName,Exception ex){
  Object[] args={adapterClassName};
  JAXBException validationException=new JAXBException(ExceptionMessageGenerator.buildMessage(JAXBException.class,ADAPTER_CLASS_METHOD_EXCEPTION,args),ex);
  validationException.setErrorCode(ADAPTER_CLASS_METHOD_EXCEPTION);
  return validationException;
}

Fixed version (ground truth):
/** 
 * PUBLIC: Cause: An exception occurred while attempting to get the declared methods from  the adapter class.
 */
public static JAXBException adapterClassMethodsCouldNotBeAccessed(String adapterClassName,Exception ex){
  Object[] args={adapterClassName};
  JAXBException validationException=new JAXBException(ExceptionMessageGenerator.buildMessage(JAXBException.class,ADAPTER_CLASS_METHOD_EXCEPTION,args),ex);
  validationException.setErrorCode(ADAPTER_CLASS_METHOD_EXCEPTION);
  return validationException;
}
Program: 65921
Project: 65921
Buggy source:
/** 
 * INTERNAL:
 */
public void openStartElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  super.openStartElement(xPathFragment,namespaceResolver);
  currentLevelPrefixMappings=Collections.EMPTY_LIST;
  prefixMappingsDeque.push(currentLevelPrefixMappings);
  if (isStartElementOpen) {
    openAndCloseStartElement();
  }
  this.isStartElementOpen=true;
  this.xPathFragment=xPathFragment;
  this.attributes.clear();
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void openStartElement(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  super.openStartElement(xPathFragment,namespaceResolver);
  currentLevelPrefixMappings=null;
  prefixMappings.add(currentLevelPrefixMappings);
  if (isStartElementOpen) {
    openAndCloseStartElement();
  }
  this.isStartElementOpen=true;
  this.xPathFragment=xPathFragment;
  this.attributes.clear();
}
Program: 65922
Project: 65922
Buggy source:
/** 
 * INTERNAL:
 */
public void startPrefixMapping(String prefix,String namespaceURI){
  try {
    contentHandler.startPrefixMapping(prefix,namespaceURI);
    if (Collections.EMPTY_LIST == currentLevelPrefixMappings) {
      currentLevelPrefixMappings=new ArrayList<String>();
    }
    currentLevelPrefixMappings.add(prefix);
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void startPrefixMapping(String prefix,String namespaceURI){
  try {
    contentHandler.startPrefixMapping(prefix,namespaceURI);
    if (null == currentLevelPrefixMappings) {
      currentLevelPrefixMappings=new ArrayList<String>();
    }
    currentLevelPrefixMappings.add(prefix);
  }
 catch (  SAXException e) {
    throw XMLMarshalException.marshalException(e);
  }
}