nus-yam/ex-repair huggingface dataset:
Program: 66997
Project: 66997
Buggy source:
public void testFindWithProperties(){
  if (!isJPA10()) {
    Employee employee=new Employee();
    employee.setFirstName("String_Node_Str");
    HashMap queryhints=new HashMap();
    EntityManager em=createEntityManager();
    try {
      beginTransaction(em);
      em.persist(employee);
      commitTransaction(em);
      beginTransaction(em);
      int empId=employee.getId();
      Employee e1=em.find(Employee.class,empId);
      e1.setFirstName("String_Node_Str");
      queryhints.put(QueryHints.REFRESH,"String_Node_Str");
      Employee e2=em.find(Employee.class,empId,queryhints);
      assertFalse(e2.getFirstName().equals("String_Node_Str"));
      commitTransaction(em);
    }
 catch (    IllegalArgumentException iae) {
      return;
    }
catch (    Exception e) {
      fail("String_Node_Str" + e.getClass());
    }
 finally {
      closeEntityManager(em);
    }
  }
}

Fixed version (ground truth):
public void testFindWithProperties(){
  if (!isJPA10()) {
    Employee employee=new Employee();
    employee.setFirstName("String_Node_Str");
    HashMap<String,Object> queryhints=new HashMap<String,Object>();
    EntityManager em=createEntityManager();
    try {
      beginTransaction(em);
      em.persist(employee);
      commitTransaction(em);
      beginTransaction(em);
      int empId=employee.getId();
      Employee e1=em.find(Employee.class,empId);
      e1.setFirstName("String_Node_Str");
      queryhints.put(QueryHints.REFRESH,"String_Node_Str");
      Employee e2=em.find(Employee.class,empId,queryhints);
      assertFalse(e2.getFirstName().equals("String_Node_Str"));
      commitTransaction(em);
    }
 catch (    IllegalArgumentException iae) {
      return;
    }
catch (    Exception e) {
      fail("String_Node_Str" + e.getClass());
    }
 finally {
      closeEntityManager(em);
    }
  }
}
Program: 67000
Project: 67000
Buggy source:
/** 
 * INTERNAL: Copy statements counts into UOW properties.
 */
private void copyStatementsCountIntoProperties(){
  if (getAccessor() != null && getAccessor() instanceof DatasourceAccessor) {
    getProperties().put(DatasourceAccessor.READ_STATEMENTS_COUNT_PROPERTY,new Integer(((DatasourceAccessor)getAccessor()).getReadStatementsCount()));
    getProperties().put(DatasourceAccessor.WRITE_STATEMENTS_COUNT_PROPERTY,new Integer(((DatasourceAccessor)getAccessor()).getWriteStatementsCount()));
    getProperties().put(DatasourceAccessor.STOREDPROCEDURE_STATEMENTS_COUNT_PROPERTY,new Integer(((DatasourceAccessor)getAccessor()).getStoredProcedureStatementsCount()));
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Copy statements counts into UOW properties.
 */
private void copyStatementsCountIntoProperties(){
  try {
    Accessor accessor=getAccessor();
  }
 catch (  DatabaseException exception) {
  }
  if (accessor != null && accessor instanceof DatasourceAccessor) {
    getProperties().put(DatasourceAccessor.READ_STATEMENTS_COUNT_PROPERTY,new Integer(((DatasourceAccessor)accessor).getReadStatementsCount()));
    getProperties().put(DatasourceAccessor.WRITE_STATEMENTS_COUNT_PROPERTY,new Integer(((DatasourceAccessor)accessor).getWriteStatementsCount()));
    getProperties().put(DatasourceAccessor.STOREDPROCEDURE_STATEMENTS_COUNT_PROPERTY,new Integer(((DatasourceAccessor)accessor).getStoredProcedureStatementsCount()));
  }
}
Program: 67002
Project: 67002
Buggy source:
public String resolveNamespacePrefix(String s){
  String resolved=super.resolveNamespacePrefix(s);
  if (resolved == null) {
    return "String_Node_Str";
  }
  return resolved;
}

Fixed version (ground truth):
public String resolveNamespacePrefix(String s){
  String resolved=super.resolveNamespacePrefix(s);
  if (resolved == null) {
    return XMLConstants.EMPTY_STRING;
  }
  return resolved;
}
Program: 67003
Project: 67003
Buggy source:
public URL getEntryAsURL(String entryPath) throws IOException {
  URL subEntry=new URL(url,entryPath);
  try {
    InputStream is=subEntry.openStream();
    is.close();
  }
 catch (  IOException ioe) {
    return null;
  }
  return subEntry;
}

Fixed version (ground truth):
public URL getEntryAsURL(String entryPath) throws IOException {
  URL subEntry=new URL(url,entryPath);
  try {
    InputStream is=subEntry.openStream();
    if (is == null) {
      return null;
    }
    is.close();
  }
 catch (  IOException ioe) {
    return null;
  }
  return subEntry;
}
Program: 67004
Project: 67004
Buggy source:
@Override public void addPrimaryKeyFieldName(String fieldName){
  addPrimaryKeyField(new XMLField(fieldName));
}

Fixed version (ground truth):
@Override public void addPrimaryKeyFieldName(String fieldName){
  super.addPrimaryKeyField(new XMLField(fieldName));
}
Program: 67005
Project: 67005
Buggy source:
public void init() throws Exception {
  setControlDocument(XML_RESOURCE);
  Type[] types=new Type[2];
  types[0]=getTypeToUnmarshalTo();
  Type mapType2=new ParameterizedType(){
    Type[] typeArgs={Calendar.class,Float.class};
    public Type[] getActualTypeArguments(){
      return typeArgs;
    }
    public Type getOwnerType(){
      return null;
    }
    public Type getRawType(){
      return Map.class;
    }
  }
;
  types[1]=mapType2;
  setTypes(types);
}

Fixed version (ground truth):
public void init() throws Exception {
  setControlDocument(XML_RESOURCE);
  types=new Type[2];
  types[0]=getTypeToUnmarshalTo();
  Type mapType2=new ParameterizedType(){
    Type[] typeArgs={Calendar.class,Float.class};
    public Type[] getActualTypeArguments(){
      return typeArgs;
    }
    public Type getOwnerType(){
      return null;
    }
    public Type getRawType(){
      return Map.class;
    }
  }
;
  types[1]=mapType2;
  setTypes(types);
}
Program: 67007
Project: 67007
Buggy source:
private Node selectSingleAttribute(Node contextNode,XPathFragment xPathFragment,XMLNamespaceResolver xmlNamespaceResolver){
  if (xPathFragment.hasNamespace()) {
    Element contextElement=(Element)contextNode;
    String attributeNamespaceURI=xmlNamespaceResolver.resolveNamespacePrefix(xPathFragment.getPrefix());
    return contextElement.getAttributeNodeNS(attributeNamespaceURI,xPathFragment.getLocalName());
  }
 else {
    Element contextElement=(Element)contextNode;
    return contextElement.getAttributeNode(xPathFragment.getShortName());
  }
}

Fixed version (ground truth):
private Node selectSingleAttribute(Node contextNode,XPathFragment xPathFragment,XMLNamespaceResolver xmlNamespaceResolver){
  if (xPathFragment.hasNamespace()) {
    String attributeNamespaceURI=xmlNamespaceResolver.resolveNamespacePrefix(xPathFragment.getPrefix());
    return contextNode.getAttributes().getNamedItemNS(attributeNamespaceURI,xPathFragment.getLocalName());
  }
 else {
    return contextNode.getAttributes().getNamedItem(xPathFragment.getShortName());
  }
}
Program: 67008
Project: 67008
Buggy source:
private void setPKField(XMLDescriptor desc,TypeInfo info){
  if (info.isIDSet()) {
    String pkFieldName;
    String uri=info.getIDProperty().getSchemaName().getNamespaceURI();
    String local=info.getIDProperty().getSchemaName().getLocalPart();
    String resolvedUri=desc.getNamespaceResolver().resolveNamespaceURI(uri);
    if (resolvedUri == null) {
      resolvedUri="String_Node_Str";
    }
 else {
      resolvedUri+="String_Node_Str";
    }
    if (helper.isAnnotationPresent(info.getIDProperty().getElement(),XmlAttribute.class)) {
      pkFieldName=ATT + resolvedUri + local;
    }
 else {
      pkFieldName=resolvedUri + local + TXT;
    }
    desc.addPrimaryKeyFieldName(pkFieldName);
  }
}

Fixed version (ground truth):
private void setPKField(XMLDescriptor desc,TypeInfo info){
  if (info.isIDSet()) {
    String pkFieldName;
    String uri=info.getIDProperty().getSchemaName().getNamespaceURI();
    String local=info.getIDProperty().getSchemaName().getLocalPart();
    String prefix=null;
    if (uri != null && uri.length() != 0) {
      prefix=desc.getNamespaceResolver().resolveNamespaceURI(uri);
      if (prefix == null) {
        prefix=getPrefixForNamespace(uri,desc.getNamespaceResolver(),null,true);
      }
    }
    if (prefix == null) {
      prefix="String_Node_Str";
    }
 else {
      prefix+="String_Node_Str";
    }
    if (helper.isAnnotationPresent(info.getIDProperty().getElement(),XmlAttribute.class)) {
      pkFieldName=ATT + prefix + local;
    }
 else {
      pkFieldName=prefix + local + TXT;
    }
    desc.addPrimaryKeyFieldName(pkFieldName);
  }
}
Program: 67009
Project: 67009
Buggy source:
/** 
 * INTERNAL: The mapping is initialized with the given session. This mapping is fully initialized after this.
 */
public void initialize(AbstractSession session) throws DescriptorException {
  super.initialize(session);
  ContainerPolicy cp=getContainerPolicy();
  if (cp != null) {
    if (cp.getContainerClass() == null) {
      Class cls=session.getDatasourcePlatform().getConversionManager().convertClassNameToClass(cp.getContainerClassName());
      cp.setContainerClass(cls);
    }
  }
  XMLDescriptor descriptor=(XMLDescriptor)this.getDescriptor();
  XMLDescriptor targetDescriptor=(XMLDescriptor)getReferenceDescriptor();
  for (int index=0; index < sourceToTargetKeys.size(); index++) {
    XMLField sourceField=(XMLField)sourceToTargetKeys.get(index);
    sourceField=(XMLField)descriptor.buildField(sourceField);
    sourceToTargetKeys.set(index,sourceField);
    XMLField targetField=(XMLField)sourceToTargetKeyFieldAssociations.get(sourceField);
    targetField=(XMLField)targetDescriptor.buildField(targetField);
    sourceToTargetKeyFieldAssociations.put(sourceField,targetField);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: The mapping is initialized with the given session. This mapping is fully initialized after this.
 */
public void initialize(AbstractSession session) throws DescriptorException {
  super.initialize(session);
  ContainerPolicy cp=getContainerPolicy();
  if (cp != null) {
    if (cp.getContainerClass() == null) {
      Class cls=session.getDatasourcePlatform().getConversionManager().convertClassNameToClass(cp.getContainerClassName());
      cp.setContainerClass(cls);
    }
  }
  XMLDescriptor descriptor=(XMLDescriptor)this.getDescriptor();
  XMLDescriptor targetDescriptor=(XMLDescriptor)getReferenceDescriptor();
  for (int index=0; index < sourceToTargetKeys.size(); index++) {
    XMLField sourceField=(XMLField)sourceToTargetKeys.get(index);
    XMLField targetField=(XMLField)sourceToTargetKeyFieldAssociations.remove(sourceField);
    sourceField=(XMLField)descriptor.buildField(sourceField);
    sourceToTargetKeys.set(index,sourceField);
    targetField=(XMLField)targetDescriptor.buildField(targetField);
    sourceToTargetKeyFieldAssociations.put(sourceField,targetField);
  }
}
Program: 67013
Project: 67013
Buggy source:
/** 
 * PUBLIC: Specify the primary key field. This should be called for each field that make up the primary key. For EIS XML Descriptors use the addPrimaryKeyField(DatabaseField) API and supply an org.eclipse.persistence.oxm.XMLField parameter instead of using this method
 */
public void addPrimaryKeyFieldName(String fieldName){
  super.addPrimaryKeyFieldName(fieldName);
}

Fixed version (ground truth):
/** 
 * PUBLIC: Specify the primary key field. This should be called for each field that make up the primary key. For EIS XML Descriptors use the addPrimaryKeyField(DatabaseField) API and supply an org.eclipse.persistence.oxm.XMLField parameter instead of using this method
 */
public void addPrimaryKeyFieldName(String fieldName){
  if (getDataFormat() == EISDescriptor.XML) {
    addPrimaryKeyField(new XMLField(fieldName));
  }
 else {
    super.addPrimaryKeyFieldName(fieldName);
  }
}
Program: 67014
Project: 67014
Buggy source:
/** 
 * INTERNAL: If the field is an XMLField then set the namespace resolver from the descriptor. This allows the resolver to only be set in the descriptor.
 */
public DatabaseField buildField(DatabaseField field){
  if (field instanceof XMLField) {
    ((XMLField)field).setNamespaceResolver(getNamespaceResolver());
  }
  return super.buildField(field);
}

Fixed version (ground truth):
/** 
 * INTERNAL: If the field is an XMLField then set the namespace resolver from the descriptor. This allows the resolver to only be set in the descriptor.
 */
public DatabaseField buildField(DatabaseField field){
  if (getDataFormat().equals(XML)) {
    if (!(field instanceof XMLField)) {
      field=new XMLField(field.getName());
    }
    ((XMLField)field).setNamespaceResolver(getNamespaceResolver());
    ((XMLField)field).initialize();
  }
  return super.buildField(field);
}
Program: 67015
Project: 67015
Buggy source:
public boolean marshalAttributes(MarshalRecord marshalRecord,Object object,AbstractSession session){
  boolean hasValue=false;
  XPathNode attributeNode;
  NamespaceResolver namespaceResolver;
  if (rootXPathNode.getAttributeChildren() != null) {
    int size=rootXPathNode.getAttributeChildren().size();
    for (int x=0; x < size; x++) {
      attributeNode=(XPathNode)rootXPathNode.getAttributeChildren().get(x);
      namespaceResolver=((XMLDescriptor)this.getDescriptor()).getNamespaceResolver();
      hasValue=attributeNode.marshal(marshalRecord,object,session,namespaceResolver,ObjectMarshalContext.getInstance()) || hasValue;
    }
  }
  if (rootXPathNode.getAnyAttributeNode() != null) {
    namespaceResolver=((XMLDescriptor)this.getDescriptor()).getNamespaceResolver();
    hasValue=rootXPathNode.getAnyAttributeNode().marshal(marshalRecord,object,session,namespaceResolver,ObjectMarshalContext.getInstance()) || hasValue;
  }
  if (rootXPathNode.getSelfChildren() != null) {
    XPathNode childNode;
    for (int x=0; x < rootXPathNode.getSelfChildren().size(); x++) {
      childNode=(XPathNode)rootXPathNode.getSelfChildren().get(x);
      namespaceResolver=((XMLDescriptor)this.getDescriptor()).getNamespaceResolver();
      childNode.marshalSelfAttributes(marshalRecord,object,session,namespaceResolver,marshalRecord.getMarshaller());
    }
  }
  return hasValue;
}

Fixed version (ground truth):
public boolean marshalAttributes(MarshalRecord marshalRecord,Object object,AbstractSession session){
  boolean hasValue=false;
  NamespaceResolver namespaceResolver=((XMLDescriptor)this.getDescriptor()).getNamespaceResolver();
  List attributeChildren=rootXPathNode.getAttributeChildren();
  if (null != attributeChildren) {
    for (int x=0, attributeChildrenSize=attributeChildren.size(); x < attributeChildrenSize; x++) {
      XPathNode attributeNode=(XPathNode)rootXPathNode.getAttributeChildren().get(x);
      hasValue=attributeNode.marshal(marshalRecord,object,session,namespaceResolver,ObjectMarshalContext.getInstance()) || hasValue;
    }
  }
  if (rootXPathNode.getAnyAttributeNode() != null) {
    hasValue=rootXPathNode.getAnyAttributeNode().marshal(marshalRecord,object,session,namespaceResolver,ObjectMarshalContext.getInstance()) || hasValue;
  }
  List selfChildren=rootXPathNode.getSelfChildren();
  if (null != selfChildren) {
    for (int x=0, selfChildrenSize=selfChildren.size(); x < selfChildrenSize; x++) {
      XPathNode childNode=(XPathNode)selfChildren.get(x);
      childNode.marshalSelfAttributes(marshalRecord,object,session,namespaceResolver,marshalRecord.getMarshaller());
    }
  }
  return hasValue;
}
Program: 67016
Project: 67016
Buggy source:
public AbstractRecord buildRow(AbstractRecord record,Object object,org.eclipse.persistence.internal.sessions.AbstractSession session,XMLMarshaller marshaller){
  if (null == getRootXPathNode().getNonAttributeChildren()) {
    return record;
  }
  XMLDescriptor xmlDescriptor=(XMLDescriptor)this.getDescriptor();
  XPathNode xPathNode;
  NamespaceResolver namespaceResolver=xmlDescriptor.getNamespaceResolver();
  MarshalContext marshalContext=null;
  if (xmlDescriptor.isSequencedObject()) {
    SequencedObject sequencedObject=(SequencedObject)object;
    marshalContext=new SequencedMarshalContext(sequencedObject.getSettings());
  }
 else {
    marshalContext=ObjectMarshalContext.getInstance();
  }
  int size=marshalContext.getNonAttributeChildrenSize(getRootXPathNode());
  for (int x=0; x < size; x++) {
    xPathNode=(XPathNode)marshalContext.getNonAttributeChild(x,getRootXPathNode());
    xPathNode.marshal((MarshalRecord)record,object,session,namespaceResolver,marshaller,marshalContext.getMarshalContext(x));
  }
  return record;
}

Fixed version (ground truth):
public AbstractRecord buildRow(AbstractRecord record,Object object,org.eclipse.persistence.internal.sessions.AbstractSession session,XMLMarshaller marshaller){
  if (null == getRootXPathNode().getNonAttributeChildren()) {
    return record;
  }
  XMLDescriptor xmlDescriptor=(XMLDescriptor)this.getDescriptor();
  NamespaceResolver namespaceResolver=xmlDescriptor.getNamespaceResolver();
  MarshalContext marshalContext=null;
  if (xmlDescriptor.isSequencedObject()) {
    SequencedObject sequencedObject=(SequencedObject)object;
    marshalContext=new SequencedMarshalContext(sequencedObject.getSettings());
  }
 else {
    marshalContext=ObjectMarshalContext.getInstance();
  }
  int size=marshalContext.getNonAttributeChildrenSize(getRootXPathNode());
  for (int x=0; x < size; x++) {
    XPathNode xPathNode=(XPathNode)marshalContext.getNonAttributeChild(x,getRootXPathNode());
    xPathNode.marshal((MarshalRecord)record,object,session,namespaceResolver,marshaller,marshalContext.getMarshalContext(x));
  }
  return record;
}
Program: 67018
Project: 67018
Buggy source:
public int hashCode(){
  int hash=217;
  if (localName != null) {
    hash+=localName.hashCode();
  }
  if (namespaceURI != null) {
    hash+=namespaceURI.hashCode();
  }
  return hash;
}

Fixed version (ground truth):
public int hashCode(){
  if (null == localName) {
    return 1;
  }
 else {
    return localName.hashCode();
  }
}
Program: 67019
Project: 67019
Buggy source:
public boolean equals(Object object){
  try {
    if (this == object) {
      return true;
    }
    XPathFragment xPathFragment=(XPathFragment)object;
    return ((nameIsText && xPathFragment.nameIsText()) || (localName == xPathFragment.getLocalName()) || ((localName != null) && localName.equals(xPathFragment.getLocalName()))) && ((namespaceURI == xPathFragment.getNamespaceURI()) || ((namespaceURI != null) && namespaceURI.equals(xPathFragment.getNamespaceURI()))) && (this.indexValue == xPathFragment.getIndexValue())&& (nameIsText == xPathFragment.nameIsText());
  }
 catch (  ClassCastException e) {
    return false;
  }
}

Fixed version (ground truth):
public boolean equals(Object object){
  try {
    if (null == object) {
      return false;
    }
 else     if (this == object) {
      return true;
    }
    XPathFragment xPathFragment=(XPathFragment)object;
    return ((nameIsText && xPathFragment.nameIsText()) || (localName == xPathFragment.getLocalName()) || ((localName != null) && localName.equals(xPathFragment.getLocalName()))) && ((namespaceURI == xPathFragment.getNamespaceURI()) || ((namespaceURI != null) && namespaceURI.equals(xPathFragment.getNamespaceURI()))) && (this.indexValue == xPathFragment.getIndexValue())&& (nameIsText == xPathFragment.nameIsText());
  }
 catch (  ClassCastException e) {
    return false;
  }
}
Program: 67021
Project: 67021
Buggy source:
public Object getNonAttributeChild(int index,XPathNode xPathNode){
  Setting setting=settings.get(index);
  if (null == setting.getName()) {
    return xPathNode.getNonAttributeChildrenMap().get(null);
  }
 else {
    if (setting.getName().equals(XMLConstants.TEXT)) {
      return xPathNode.getTextNode();
    }
 else {
      indexFragment.setLocalName(null);
      indexFragment.setXPath(setting.getName());
      indexFragment.setNamespaceURI(setting.getNamespaceURI());
      return xPathNode.getNonAttributeChildrenMap().get(indexFragment);
    }
  }
}

Fixed version (ground truth):
public Object getNonAttributeChild(int index,XPathNode xPathNode){
  Setting setting=settings.get(index);
  if (null == setting.getName()) {
    return xPathNode.getAnyNode();
  }
 else {
    if (setting.getName().equals(XMLConstants.TEXT)) {
      return xPathNode.getTextNode();
    }
 else {
      indexFragment.setLocalName(null);
      indexFragment.setXPath(setting.getName());
      indexFragment.setNamespaceURI(setting.getNamespaceURI());
      return xPathNode.getNonAttributeChildrenMap().get(indexFragment);
    }
  }
}
Program: 67022
Project: 67022
Buggy source:
/** 
 * Returns the namespace URI associated with a specified namespace prefix
 * @param prefix The prefix to lookup a namespace URI for
 * @return The namespace URI associated with the specified prefix
 */
public String resolveNamespacePrefix(String prefix){
  if (null == prefix) {
    return defaultNamespaceURI;
  }
  String uri=prefixesToNamespaces.get(prefix);
  if (null != uri) {
    return uri;
  }
 else   if (XMLConstants.XML_NAMESPACE_PREFIX.equals(prefix)) {
    return XMLConstants.XML_NAMESPACE_URL;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the namespace URI associated with a specified namespace prefix
 * @param prefix The prefix to lookup a namespace URI for
 * @return The namespace URI associated with the specified prefix
 */
public String resolveNamespacePrefix(String prefix){
  if (null == prefix) {
    return defaultNamespaceURI;
  }
  String uri=prefixesToNamespaces.get(prefix);
  if (null != uri) {
    return uri;
  }
 else   if (XMLConstants.XML_NAMESPACE_PREFIX.equals(prefix)) {
    return XMLConstants.XML_NAMESPACE_URL;
  }
 else   if (XMLConstants.XMLNS.equals(prefix)) {
    return XMLConstants.XMLNS_URL;
  }
  return null;
}
Program: 67025
Project: 67025
Buggy source:
public void testSchemaContextAsQName(){
  try {
    JAXBContext ctx=(JAXBContext)JAXBContextFactory.createContext(new Class[]{Root.class},new HashMap());
    assertTrue("String_Node_Str",ctx != null);
    XMLContext xCtx=ctx.getXMLContext();
    assertTrue("String_Node_Str",xCtx != null);
    XMLDescriptor xDesc=xCtx.getDescriptor(qName);
    assertTrue("String_Node_Str" + NAMESPACE_URI + "String_Node_Str"+ LOCAL_PART+ "String_Node_Str",xDesc != null);
    XMLSchemaReference sRef=xDesc.getSchemaReference();
    assertTrue("String_Node_Str" + NAMESPACE_URI + "String_Node_Str"+ LOCAL_PART+ "String_Node_Str"+ sRef.getSchemaContextAsQName()+ "String_Node_Str",sRef.getSchemaContextAsQName().equals(qName));
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void testSchemaContextAsQName() throws Exception {
  JAXBContext ctx=(JAXBContext)JAXBContextFactory.createContext(new Class[]{Root.class},new HashMap());
  assertTrue("String_Node_Str",ctx != null);
  XMLContext xCtx=ctx.getXMLContext();
  assertTrue("String_Node_Str",xCtx != null);
  XPathFragment typeFragment=new XPathFragment();
  typeFragment.setLocalName(qName.getLocalPart());
  typeFragment.setNamespaceURI(qName.getNamespaceURI());
  XMLDescriptor xDesc=xCtx.getDescriptorByGlobalType(typeFragment);
  assertTrue("String_Node_Str" + NAMESPACE_URI + "String_Node_Str"+ LOCAL_PART+ "String_Node_Str",xDesc != null);
  XMLSchemaReference sRef=xDesc.getSchemaReference();
  assertTrue("String_Node_Str" + NAMESPACE_URI + "String_Node_Str"+ LOCAL_PART+ "String_Node_Str"+ sRef.getSchemaContextAsQName()+ "String_Node_Str",sRef.getSchemaContextAsQName().equals(qName));
}
Program: 67026
Project: 67026
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(SchemaGenEmployeeTestCases.class);
  suite.addTestSuite(SchemaGenXMLTypeTestCases.class);
  suite.addTestSuite(SchemaGenXMLRootElementTestCases.class);
  suite.addTestSuite(DeploymentXMLSchemaGenTestCases.class);
  suite.addTestSuite(SchemaGenXmlElementWrapperTestCases.class);
  suite.addTestSuite(SchemaGenXmlElementRefByteArrayTestCases.class);
  suite.addTestSuite(SchemaGenXmlElementRefTestCases.class);
  suite.addTestSuite(SchemaGenXmlListTestCases.class);
  suite.addTestSuite(SchemaGenXmlIDTestCases.class);
  suite.addTestSuite(SchemaGenXmlIDREFTestCases.class);
  suite.addTestSuite(ClassArraySchemaGenTestCases.class);
  suite.addTestSuite(TypeArraySchemaGenTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(SchemaGenEmployeeTestCases.class);
  suite.addTestSuite(SchemaGenXMLTypeTestCases.class);
  suite.addTestSuite(SchemaGenXMLRootElementTestCases.class);
  suite.addTestSuite(DeploymentXMLSchemaGenTestCases.class);
  suite.addTestSuite(SchemaGenXmlElementWrapperTestCases.class);
  suite.addTestSuite(SchemaGenXmlElementRefByteArrayTestCases.class);
  suite.addTestSuite(SchemaGenXmlElementRefTestCases.class);
  suite.addTestSuite(SchemaGenXmlListTestCases.class);
  suite.addTestSuite(SchemaGenXmlIDTestCases.class);
  suite.addTestSuite(SchemaGenXmlIDREFTestCases.class);
  suite.addTestSuite(ClassArraySchemaGenTestCases.class);
  suite.addTestSuite(TypeArraySchemaGenTestCases.class);
  suite.addTestSuite(SchemaGenScopeTestCases.class);
  return suite;
}
Program: 67028
Project: 67028
Buggy source:
private Map createProperties(){
  Map newProps=new HashMap(3);
  newProps.put(PersistenceUnitProperties.ORACLE_PROXY_TYPE,OracleConnection.PROXYTYPE_USER_NAME);
  newProps.put(OracleConnection.PROXY_USER_NAME,"String_Node_Str");
  newProps.put(PersistenceUnitProperties.EXCLUSIVE_CONNECTION_MODE,ExclusiveConnectionMode.Always);
  return newProps;
}

Fixed version (ground truth):
private Map createProperties(){
  Map newProps=new HashMap(3);
  newProps.put(PersistenceUnitProperties.ORACLE_PROXY_TYPE,OracleConnection.PROXYTYPE_USER_NAME);
  newProps.put(OracleConnection.PROXY_USER_NAME,System.getProperty("String_Node_Str"));
  newProps.put(PersistenceUnitProperties.EXCLUSIVE_CONNECTION_MODE,ExclusiveConnectionMode.Always);
  return newProps;
}
Program: 67029
Project: 67029
Buggy source:
public TIMESTAMPTZWrapper(TIMESTAMPTZ timestampTZ,Connection connection,boolean isTimestampInGmt){
  try {
    ts=timestampTZ.timestampValue(connection);
    tz=TIMESTAMPHelper.extractTimeZone(timestampTZ.toBytes());
    this.isTimestampInGmt=isTimestampInGmt;
  }
 catch (  SQLException exception) {
    throw DatabaseException.sqlException(exception);
  }
}

Fixed version (ground truth):
public TIMESTAMPTZWrapper(Timestamp ts,TimeZone tz,boolean isTimestampInGmt){
  this.ts=ts;
  this.tz=tz;
  this.isTimestampInGmt=isTimestampInGmt;
}
Program: 67030
Project: 67030
Buggy source:
/** 
 * INTERNAL: Get a timestamp value from a result set. Overrides the default behavior to specifically return a timestamp.  Added to overcome an issue with the oracle 9.0.1.4 JDBC driver.
 */
public Object getObjectFromResultSet(ResultSet resultSet,int columnNumber,int type,AbstractSession session) throws java.sql.SQLException {
  if ((type == Types.TIMESTAMP) || (type == Types.DATE)) {
    return resultSet.getTimestamp(columnNumber);
  }
 else   if (type == oracle.jdbc.OracleTypes.TIMESTAMPTZ) {
    TIMESTAMPTZ tsTZ=(TIMESTAMPTZ)resultSet.getObject(columnNumber);
    if ((tsTZ != null) && (tsTZ.getLength() != 0)) {
      Connection connection=getConnection(session,resultSet.getStatement().getConnection());
      return new TIMESTAMPTZWrapper(tsTZ,connection,isTimestampInGmt(connection));
    }
    return null;
  }
 else   if (type == oracle.jdbc.OracleTypes.TIMESTAMPLTZ) {
    TIMESTAMPLTZ tsLTZ=(TIMESTAMPLTZ)resultSet.getObject(columnNumber);
    if ((tsLTZ != null) && (tsLTZ.getLength() != 0)) {
      Timestamp ts=TIMESTAMPLTZ.toTimestamp(getConnection(session,resultSet.getStatement().getConnection()),tsLTZ.toBytes());
      return new TIMESTAMPLTZWrapper(ts,((OracleConnection)getConnection(session,resultSet.getStatement().getConnection())).getSessionTimeZone());
    }
    return null;
  }
 else   if (type == OracleTypes.OPAQUE) {
    try {
      Object result=resultSet.getObject(columnNumber);
      if (!(result instanceof OPAQUE)) {
        return result;
      }
      return getXMLTypeFactory().getString((OPAQUE)result);
    }
 catch (    SQLException ex) {
      throw DatabaseException.sqlException(ex,null,session,false);
    }
  }
 else {
    return super.getObjectFromResultSet(resultSet,columnNumber,type,session);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Get a timestamp value from a result set. Overrides the default behavior to specifically return a timestamp.  Added to overcome an issue with the oracle 9.0.1.4 JDBC driver.
 */
public Object getObjectFromResultSet(ResultSet resultSet,int columnNumber,int type,AbstractSession session) throws java.sql.SQLException {
  if ((type == Types.TIMESTAMP) || (type == Types.DATE)) {
    return resultSet.getTimestamp(columnNumber);
  }
 else   if (type == oracle.jdbc.OracleTypes.TIMESTAMPTZ) {
    return getTIMESTAMPTZFromResultSet(resultSet,columnNumber,type,session);
  }
 else   if (type == oracle.jdbc.OracleTypes.TIMESTAMPLTZ) {
    return getTIMESTAMPLTZFromResultSet(resultSet,columnNumber,type,session);
  }
 else   if (type == OracleTypes.OPAQUE) {
    try {
      Object result=resultSet.getObject(columnNumber);
      if (!(result instanceof OPAQUE)) {
        return result;
      }
      return getXMLTypeFactory().getString((OPAQUE)result);
    }
 catch (    SQLException ex) {
      throw DatabaseException.sqlException(ex,null,session,false);
    }
  }
 else {
    return super.getObjectFromResultSet(resultSet,columnNumber,type,session);
  }
}
Program: 67031
Project: 67031
Buggy source:
public void setXPath(String xpathString){
  xpath=xpathString;
  if (xpathString.length() == 0) {
    return;
  }
  if ((xpath.indexOf('[') != -1) && (xpath.indexOf(']') == -1)) {
    setShouldExecuteSelectNodes(true);
    return;
  }
  if (xpath.indexOf("String_Node_Str") != -1) {
    setShouldExecuteSelectNodes(true);
    return;
  }
  shortName=xpathString;
  if (xpathString.charAt(0) == '@') {
    hasAttribute=true;
    shortName=xpathString.substring(1);
    indexValue=hasIndex(xpathString);
    setupNamespaceInformation(shortName);
    return;
  }
  if (xpathString.charAt(0) == '/') {
    setShouldExecuteSelectNodes(true);
    shortName=xpathString;
    indexValue=hasIndex(xpathString);
    setupNamespaceInformation(shortName);
    return;
  }
  if (xpathString.equals(XMLConstants.TEXT)) {
    nameIsText=true;
    shortName=xpathString;
    return;
  }
 else {
    nameIsText=false;
  }
  if (xpathString.equals(SELF_XPATH)) {
    isSelfFragment=true;
    shortName=xpathString;
    return;
  }
  indexValue=hasIndex(xpathString);
  setupNamespaceInformation(shortName);
}

Fixed version (ground truth):
public void setXPath(String xpathString){
  xpath=xpathString;
  shortName=xpathString;
  if (xpathString.length() > 0) {
    if ((xpath.indexOf('[') != -1) && (xpath.indexOf(']') == -1)) {
      setShouldExecuteSelectNodes(true);
      return;
    }
    if (xpath.indexOf("String_Node_Str") != -1) {
      setShouldExecuteSelectNodes(true);
      return;
    }
    if (xpathString.charAt(0) == '@') {
      hasAttribute=true;
      shortName=xpathString.substring(1);
      indexValue=hasIndex(xpathString);
      setupNamespaceInformation(shortName);
      return;
    }
    if (xpathString.charAt(0) == '/') {
      setShouldExecuteSelectNodes(true);
      shortName=xpathString;
      indexValue=hasIndex(xpathString);
      setupNamespaceInformation(shortName);
      return;
    }
  }
  if (xpathString.equals(XMLConstants.TEXT)) {
    nameIsText=true;
    shortName=xpathString;
    return;
  }
 else {
    nameIsText=false;
  }
  if (xpathString.equals(SELF_XPATH)) {
    isSelfFragment=true;
    shortName=xpathString;
    return;
  }
  indexValue=hasIndex(xpathString);
  setupNamespaceInformation(shortName);
}
Program: 67033
Project: 67033
Buggy source:
public Object getObject(){
  return this.object;
}

Fixed version (ground truth):
public Object getObject(){
  if (object == null) {
    if (this.descriptor != null) {
      object=this.descriptor.wrapObjectInXMLRoot(this.rootRecord,this.unmarshaller.isResultAlwaysXMLRoot());
    }
 else     if (documentBuilder != null) {
      Node node=(Node)documentBuilder.getDocument().getDocumentElement();
      XMLRoot root=new XMLRoot();
      root.setLocalName(node.getLocalName());
      root.setNamespaceURI(node.getNamespaceURI());
      root.setObject(node);
      object=root;
    }
 else {
      if (rootRecord != null) {
        object=this.rootRecord.getCurrentObject();
      }
    }
  }
  return this.object;
}
Program: 67035
Project: 67035
Buggy source:
private void parse(XMLStreamReader xmlStreamReader) throws SAXException {
  try {
    parseEvent(xmlStreamReader);
    while (depth > 0 && xmlStreamReader.hasNext()) {
      xmlStreamReader.next();
      parseEvent(xmlStreamReader);
    }
  }
 catch (  XMLStreamException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private void parse(XMLStreamReader xmlStreamReader) throws SAXException {
  try {
    getContentHandler().startDocument();
    parseEvent(xmlStreamReader);
    while (depth > 0 && xmlStreamReader.hasNext()) {
      xmlStreamReader.next();
      parseEvent(xmlStreamReader);
    }
    getContentHandler().endDocument();
  }
 catch (  XMLStreamException e) {
    throw new RuntimeException(e);
  }
}
Program: 67037
Project: 67037
Buggy source:
public void testConverterClassNotFound() throws Exception {
  try {
    XMLContext xmlContext=new XMLContext(new JAXBEnumTypeConverterProject());
  }
 catch (  IntegrityException integrityException) {
    Exception internalException=(Exception)((IntegrityException)integrityException).getIntegrityChecker().getCaughtExceptions().get(0);
    if (internalException instanceof ValidationException) {
      Throwable nestedException=((ValidationException)internalException).getInternalException();
      if (nestedException instanceof ClassNotFoundException) {
        return;
      }
    }
  }
  fail("String_Node_Str");
}

Fixed version (ground truth):
public void testConverterClassNotFound() throws Exception {
  try {
    Project proj=new JAXBEnumTypeConverterProject();
    proj.convertClassNamesToClasses(this.getClass().getClassLoader());
    XMLContext xmlContext=new XMLContext(proj);
  }
 catch (  ValidationException validationException) {
    Throwable nestedException=validationException.getInternalException();
    if (nestedException instanceof ClassNotFoundException) {
      return;
    }
  }
  fail("String_Node_Str");
}
Program: 67038
Project: 67038
Buggy source:
/** 
 * INTERNAL:
 */
public void initialize(DatabaseMapping mapping,Session session){
  convertClassNamesToClasses();
  Iterator<Enum> i=EnumSet.allOf(m_enumClass).iterator();
  while (i.hasNext()) {
    Enum theEnum=i.next();
    if (this.getAttributeToFieldValues().get(theEnum) == null) {
      Object existingVal=this.getAttributeToFieldValues().get(theEnum.name());
      if (existingVal != null) {
        this.getAttributeToFieldValues().remove(theEnum.name());
        addConversionValue(existingVal,theEnum);
      }
 else {
        if (m_usesOrdinalValues) {
          addConversionValue(theEnum.ordinal(),theEnum);
        }
 else {
          addConversionValue(theEnum.name(),theEnum);
        }
      }
    }
  }
  super.initialize(mapping,session);
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void initialize(DatabaseMapping mapping,Session session){
  Iterator<Enum> i=EnumSet.allOf(m_enumClass).iterator();
  while (i.hasNext()) {
    Enum theEnum=i.next();
    if (this.getAttributeToFieldValues().get(theEnum) == null) {
      Object existingVal=this.getAttributeToFieldValues().get(theEnum.name());
      if (existingVal != null) {
        this.getAttributeToFieldValues().remove(theEnum.name());
        addConversionValue(existingVal,theEnum);
      }
 else {
        if (m_usesOrdinalValues) {
          addConversionValue(theEnum.ordinal(),theEnum);
        }
 else {
          addConversionValue(theEnum.name(),theEnum);
        }
      }
    }
  }
  super.initialize(mapping,session);
}
Program: 67039
Project: 67039
Buggy source:
/** 
 * INTERNAL: Convert all the class-name-based settings in this converter to actual  class-based settings. This method is used when converting a project  that has been built with class names to a project with classes.
 * @param classLoader 
 */
public void convertClassNamesToClasses(){
  try {
    if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
      try {
        m_enumClass=(Class)AccessController.doPrivileged(new PrivilegedClassForName(m_enumClassName));
      }
 catch (      PrivilegedActionException exception) {
        throw ValidationException.classNotFoundWhileConvertingClassNames(m_enumClassName,exception.getException());
      }
    }
 else {
      m_enumClass=org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(m_enumClassName);
    }
  }
 catch (  ClassNotFoundException exception) {
    throw ValidationException.classNotFoundWhileConvertingClassNames(m_enumClassName,exception);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Convert all the class-name-based settings in this converter to actual  class-based settings. This method is used when converting a project  that has been built with class names to a project with classes.
 * @param classLoader 
 */
public void convertClassNamesToClasses(ClassLoader classLoader){
  try {
    if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
      try {
        m_enumClass=(Class)AccessController.doPrivileged(new PrivilegedClassForName(m_enumClassName,true,classLoader));
      }
 catch (      PrivilegedActionException exception) {
        throw ValidationException.classNotFoundWhileConvertingClassNames(m_enumClassName,exception.getException());
      }
    }
 else {
      m_enumClass=org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(m_enumClassName,true,classLoader);
    }
  }
 catch (  ClassNotFoundException exception) {
    throw ValidationException.classNotFoundWhileConvertingClassNames(m_enumClassName,exception);
  }
}
Program: 67040
Project: 67040
Buggy source:
protected void setup(){
  dbAccessor=new DatabaseAccessor();
  expectedException=org.eclipse.persistence.exceptions.DatabaseException.databaseAccessorConnectionIsNull(dbAccessor);
}

Fixed version (ground truth):
protected void setup(){
  dbAccessor=new DatabaseAccessor();
  expectedException=org.eclipse.persistence.exceptions.DatabaseException.databaseAccessorConnectionIsNull(dbAccessor,null);
}
Program: 67041
Project: 67041
Buggy source:
public void addTests(){
  addTest(new NotConnectedDeleteObjectTest());
  addTest(new NotConnectedReadObjectTest());
  addTest(new NotConnectedUpdateObjectQueryTest());
  addTest(new NotConnectedWriteObjectTest());
  addTest(new ConnectionIsNullAccessorTest());
}

Fixed version (ground truth):
public void addTests(){
  addTest(new NotConnectedDeleteObjectTest());
  addTest(new NotConnectedReadObjectTest());
  addTest(new NotConnectedUpdateObjectQueryTest());
  addTest(new NotConnectedWriteObjectTest());
  addTest(new ConnectionIsNullAccessorTest());
  addTest(new ConnectionIsNullReleasedSessionTest());
}
Program: 67042
Project: 67042
Buggy source:
public static DatabaseException databaseAccessorConnectionIsNull(DatabaseAccessor databaseAccessor){
  Object[] args={};
  DatabaseException databaseException=new DatabaseException(ExceptionMessageGenerator.buildMessage(DatabaseException.class,DATABASE_ACCESSOR_CONNECTION_IS_NULL,args));
  databaseException.setErrorCode(DATABASE_ACCESSOR_CONNECTION_IS_NULL);
  databaseException.setAccessor(databaseAccessor);
  return databaseException;
}

Fixed version (ground truth):
public static DatabaseException databaseAccessorConnectionIsNull(DatabaseAccessor databaseAccessor,AbstractSession session){
  Object[] args={};
  DatabaseException databaseException=new DatabaseException(ExceptionMessageGenerator.buildMessage(DatabaseException.class,DATABASE_ACCESSOR_CONNECTION_IS_NULL,args));
  databaseException.setErrorCode(DATABASE_ACCESSOR_CONNECTION_IS_NULL);
  databaseException.setAccessor(databaseAccessor);
  databaseException.setSession(session);
  return databaseException;
}
Program: 67044
Project: 67044
Buggy source:
/** 
 * INTERNAL: Return the read or write connection depending on the transaction state.
 */
public Accessor getAccessor(){
  if (isInTransaction()) {
    return getWriteConnection();
  }
  return super.getAccessor();
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the read or write connection depending on the transaction state.  Will throw a DatabaseException if the Accessor cannot be returned.
 */
public Accessor getAccessor(){
  Accessor accessor=null;
  if (isInTransaction()) {
    accessor=getWriteConnection();
  }
 else {
    accessor=super.getAccessor();
  }
  if (accessor == null) {
    throw DatabaseException.databaseAccessorConnectionIsNull(null,this);
  }
  return accessor;
}
Program: 67045
Project: 67045
Buggy source:
/** 
 * INTERNAL: Set if the client session is actvie (has not been released).
 */
protected void setIsActive(boolean isActive){
  this.isActive=isActive;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Set if the client session is active (has not been released).
 */
protected void setIsActive(boolean isActive){
  this.isActive=isActive;
}
Program: 67046
Project: 67046
Buggy source:
/** 
 * Entries in a zip file are directory entries using slashes to separate  them. Build a class name using '.' instead of slash and removing the  '.class' extension.
 */
public static String buildClassNameFromEntryString(String classEntryString){
  String classNameForLoader=classEntryString;
  if (classEntryString.endsWith("String_Node_Str")) {
    classNameForLoader=classNameForLoader.substring(0,classNameForLoader.length() - 6);
    ;
    classNameForLoader=classNameForLoader.replace("String_Node_Str","String_Node_Str");
  }
  return classNameForLoader;
}

Fixed version (ground truth):
/** 
 * Entries in a zip file are directory entries using slashes to separate  them. Build a class name using '.' instead of slash and removing the  '.class' extension.
 */
public static String buildClassNameFromEntryString(String classEntryString){
  String classNameForLoader=classEntryString;
  if (classEntryString.endsWith("String_Node_Str")) {
    classNameForLoader=classNameForLoader.substring(0,classNameForLoader.length() - 6);
    classNameForLoader=classNameForLoader.replace("String_Node_Str","String_Node_Str");
  }
  return classNameForLoader;
}
Program: 67047
Project: 67047
Buggy source:
/** 
 * Determine the URL path to the persistence unit 
 * @param pxmlURL - Encoded URL containing the pu
 * @return
 * @throws IOException
 */
public static URL computePURootURL(URL pxmlURL) throws IOException {
  String protocol=pxmlURL.getProtocol();
  if ("String_Node_Str".equals(protocol)) {
    return new URL(pxmlURL,"String_Node_Str");
  }
 else   if ("String_Node_Str".equals(protocol)) {
    JarURLConnection conn=JarURLConnection.class.cast(pxmlURL.openConnection());
    assert(conn.getJarEntry().getName().equals("String_Node_Str"));
    return conn.getJarFileURL();
  }
 else {
    return new URL(pxmlURL,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Determine the URL path to the persistence unit 
 * @param pxmlURL - Encoded URL containing the pu
 * @return
 * @throws IOException
 */
public static URL computePURootURL(URL pxmlURL) throws IOException, URISyntaxException {
  URL result;
  String protocol=pxmlURL.getProtocol();
  if ("String_Node_Str".equals(protocol)) {
    result=new URL(pxmlURL,"String_Node_Str");
  }
 else   if ("String_Node_Str".equals(protocol)) {
    JarURLConnection conn=JarURLConnection.class.cast(pxmlURL.openConnection());
    assert(conn.getJarEntry().getName().equals("String_Node_Str"));
    result=conn.getJarFileURL();
  }
 else {
    result=new URL(pxmlURL,"String_Node_Str");
  }
  result=fixUNC(result);
  return result;
}
Program: 67049
Project: 67049
Buggy source:
/** 
 * Return if the JDBC type is a large character type such as clob.
 */
private boolean isClob(int type){
  return (type == Types.CLOB) || (type == Types.LONGVARCHAR);
}

Fixed version (ground truth):
/** 
 * Return if the JDBC type is a large character type such as clob.
 */
private boolean isClob(int type){
  return (type == Types.CLOB) || (type == Types.LONGVARCHAR) || (type == DatabasePlatform.Types_NCLOB);
}
Program: 67050
Project: 67050
Buggy source:
protected void setup(){
  if (!getSession().getPlatform().isOracle()) {
    throw new TestWarningException("String_Node_Str");
  }
  try {
    getOracle9Platform();
  }
 catch (  ClassCastException ex) {
    DatabasePlatform platform=getSession().getPlatform();
    try {
      getSession().getLogin().usePlatform(new org.eclipse.persistence.platform.database.oracle.Oracle9Platform());
      getDatabaseSession().logout();
      getDatabaseSession().login();
      platformOriginal=platform;
      getOracle9Platform();
    }
 catch (    Exception ex2) {
      throw new TestWarningException("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
protected void setup(){
  if (!getSession().getPlatform().isOracle()) {
    throw new TestWarningException("String_Node_Str");
  }
  try {
    getOracle9Platform();
  }
 catch (  ClassCastException ex) {
    DatabasePlatform platform=getSession().getPlatform();
    try {
      getSession().getLogin().usePlatform(new org.eclipse.persistence.platform.database.oracle.Oracle9Platform());
      getDatabaseSession().logout();
      getDatabaseSession().login();
      platformOriginal=platform;
      getOracle9Platform();
    }
 catch (    Exception ex2) {
      throw new TestWarningException("String_Node_Str");
    }
  }
  DatabasePlatform platform=getSession().getPlatform();
  if (!platform.shouldBindAllParameters()) {
    usesStringBindingOriginal=platform.usesStringBinding();
    platform.setUsesStringBinding(true);
  }
}
Program: 67051
Project: 67051
Buggy source:
public void reset(){
  if (object != null) {
    UnitOfWork uow=getSession().acquireUnitOfWork();
    uow.deleteObject(object);
    uow.commit();
    object=null;
  }
  controlObject=null;
  if (platformOriginal != null) {
    getSession().getLogin().usePlatform(platformOriginal);
    getDatabaseSession().logout();
    getDatabaseSession().login();
    platformOriginal=null;
  }
}

Fixed version (ground truth):
public void reset(){
  if (object != null) {
    UnitOfWork uow=getSession().acquireUnitOfWork();
    uow.deleteObject(object);
    uow.commit();
    object=null;
  }
  controlObject=null;
  DatabasePlatform platform=getSession().getPlatform();
  if (!platform.shouldBindAllParameters()) {
    platform.setUsesStringBinding(usesStringBindingOriginal);
  }
  if (platformOriginal != null) {
    getSession().getLogin().usePlatform(platformOriginal);
    getDatabaseSession().logout();
    getDatabaseSession().login();
    platformOriginal=null;
  }
}
Program: 67052
Project: 67052
Buggy source:
/** 
 * INTERNAL: Creates a new Document and returns the root element of that document
 */
public Node createNewDocument(String defaultRootElementName,String namespaceURI){
  XMLPlatform xmlPlatform=XMLPlatformFactory.getInstance().getXMLPlatform();
  Document document=xmlPlatform.createDocument();
  if (defaultRootElementName != null) {
    Node rootNode=document.createElementNS(namespaceURI,defaultRootElementName);
    document.appendChild(rootNode);
    return document.getDocumentElement();
  }
 else {
    DocumentFragment fragment=document.createDocumentFragment();
    return fragment;
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Creates a new Document and returns the root element of that document
 */
public Node createNewDocument(String defaultRootElementName,String namespaceURI){
  XMLPlatform xmlPlatform=XMLPlatformFactory.getInstance().getXMLPlatform();
  Document document=xmlPlatform.createDocument();
  if (defaultRootElementName == null || defaultRootElementName.length() == 0) {
    DocumentFragment fragment=document.createDocumentFragment();
    return fragment;
  }
 else {
    Node rootNode=document.createElementNS(namespaceURI,defaultRootElementName);
    document.appendChild(rootNode);
    return document.getDocumentElement();
  }
}
Program: 67054
Project: 67054
Buggy source:
private void addDescriptors(){
  addDescriptor(getNillableTestObjectDescriptor());
  addDescriptor(getNillableTestSubObjectDescriptor());
}

Fixed version (ground truth):
private void addDescriptors(){
  addDescriptor(getRequiredTestObjectDescriptor());
  addDescriptor(getRequiredTestSubObjectDescriptor());
}