nus-yam/ex-repair huggingface dataset:
Program: 67832
Project: 67832
Buggy source:
/** 
 * Load the default login from the test.properties file. This file must be on the classpath, or system property set.
 */
public void loadLoginFromProperties(){
  Map properties=JUnitTestCaseHelper.getDatabaseProperties();
  login=new DatabaseLogin();
  login.setDriverClassName((String)properties.get("String_Node_Str"));
  login.setConnectionString((String)properties.get("String_Node_Str"));
  login.setUserName((String)properties.get("String_Node_Str"));
  login.setEncryptedPassword((String)properties.get("String_Node_Str"));
  login.setPlatformClassName((String)properties.get("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Load the default login from the test.properties file. This file must be on the classpath, or system property set.
 */
public void loadLoginFromProperties(){
  Map properties=JUnitTestCaseHelper.getDatabaseProperties();
  login=new DatabaseLogin();
  login.setDriverClassName((String)properties.get(PersistenceUnitProperties.JDBC_DRIVER));
  login.setConnectionString((String)properties.get(PersistenceUnitProperties.JDBC_URL));
  login.setUserName((String)properties.get(PersistenceUnitProperties.JDBC_USER));
  login.setEncryptedPassword((String)properties.get(PersistenceUnitProperties.JDBC_PASSWORD));
  login.setPlatformClassName((String)properties.get("String_Node_Str"));
}
Program: 67835
Project: 67835
Buggy source:
public void testClassGenerationLoadAndSave() throws Exception {
  String tmpDirName=tempFileDir + "String_Node_Str";
  File f=new File(tmpDirName);
  f.mkdir();
  f.deleteOnExit();
  generateClasses(tmpDirName);
  setUp();
  compileFiles(tmpDirName,getPackages());
  URL[] urls=new URL[1];
  urls[0]=f.toURL();
  URLClassLoader myURLLoader=new URLClassLoader(urls);
  String package1=(String)getPackages().get(0);
  String className=package1 + "String_Node_Str" + getRootInterfaceName();
  className=className.replaceAll("String_Node_Str","String_Node_Str");
  Class urlLoadedClass=myURLLoader.loadClass(className);
  ((SDOXMLHelper)xmlHelper).getLoader().setDelegateLoader(myURLLoader);
  Class loadedClass2=((SDOXMLHelper)xmlHelper).getLoader().loadClass(className);
  defineTypes();
  assertEquals(urlLoadedClass,loadedClass2);
  FileInputStream inputStream=new FileInputStream(getControlFileName());
  XMLDocument document=xmlHelper.load(inputStream);
  Class loadedClass=document.getRootObject().getType().getInstanceClass();
  assertEquals(urlLoadedClass,loadedClass);
  verifyAfterLoad(document);
  StringWriter writer=new StringWriter();
  xmlHelper.save(document,writer,null);
  compareXML(getControlWriteFileName(),writer.toString());
}

Fixed version (ground truth):
public void testClassGenerationLoadAndSave() throws Exception {
  String tmpDirName=tempFileDir + "String_Node_Str";
  File f=new File(tmpDirName);
  f.mkdir();
  f.deleteOnExit();
  generateClasses(tmpDirName);
  setUp();
  compileFiles(tmpDirName,getPackages());
  URL[] urls=new URL[1];
  urls[0]=f.toURL();
  URLClassLoader myURLLoader=new URLClassLoader(urls);
  String package1=(String)getPackages().get(0);
  String className=package1 + "String_Node_Str" + getRootInterfaceName();
  className=className.replaceAll("String_Node_Str","String_Node_Str");
  Class urlLoadedClass=myURLLoader.loadClass(className);
  ((SDOXMLHelper)xmlHelper).setLoader(new SDOClassLoader(myURLLoader,aHelperContext));
  Class loadedClass2=((SDOXMLHelper)xmlHelper).getLoader().loadClass(className);
  defineTypes();
  assertEquals(urlLoadedClass,loadedClass2);
  FileInputStream inputStream=new FileInputStream(getControlFileName());
  XMLDocument document=xmlHelper.load(inputStream);
  Class loadedClass=document.getRootObject().getType().getInstanceClass();
  assertEquals(urlLoadedClass,loadedClass);
  verifyAfterLoad(document);
  StringWriter writer=new StringWriter();
  xmlHelper.save(document,writer,null);
  compareXML(getControlWriteFileName(),writer.toString());
}
Program: 67836
Project: 67836
Buggy source:
public SDOClassLoader(ClassLoader delegateLoader,HelperContext aContext){
  aHelperContext=aContext;
  this.delegateLoader=delegateLoader;
  generatedClasses=new HashMap();
}

Fixed version (ground truth):
public SDOClassLoader(ClassLoader delegateLoader,HelperContext aContext){
  super(delegateLoader);
  aHelperContext=aContext;
  generatedClasses=new HashMap();
}
Program: 67837
Project: 67837
Buggy source:
public Class loadClass(String className,SDOType type) throws ClassNotFoundException {
  Class javaClass=null;
  javaClass=(Class)generatedClasses.get(className);
  if (javaClass != null) {
    return javaClass;
  }
  try {
    javaClass=delegateLoader.loadClass(className);
  }
 catch (  ClassNotFoundException e) {
    javaClass=createGeneric(className,type);
    if (javaClass == null) {
      throw e;
    }
  }
catch (  NoClassDefFoundError error) {
    javaClass=createGeneric(className,type);
    if (javaClass == null) {
      throw error;
    }
  }
  return javaClass;
}

Fixed version (ground truth):
public Class loadClass(String className,SDOType type) throws ClassNotFoundException {
  Class javaClass=null;
  javaClass=(Class)generatedClasses.get(className);
  if (javaClass != null) {
    return javaClass;
  }
  try {
    javaClass=getParent().loadClass(className);
  }
 catch (  ClassNotFoundException e) {
    javaClass=createGeneric(className,type);
    if (javaClass == null) {
      throw e;
    }
  }
catch (  NoClassDefFoundError error) {
    javaClass=createGeneric(className,type);
    if (javaClass == null) {
      throw error;
    }
  }
  return javaClass;
}
Program: 67838
Project: 67838
Buggy source:
public ArrayList getPublicMemberPropertiesForClass(JavaClass cls,TypeInfo info){
  ArrayList<Property> publicFieldProperties=getFieldPropertiesForClass(cls,info,true);
  ArrayList<Property> publicMethodProperties=getPropertyPropertiesForClass(cls,info,true);
  if (publicFieldProperties.size() >= 0 && publicMethodProperties.size() == 0) {
    return publicFieldProperties;
  }
 else   if (publicMethodProperties.size() > 0 && publicFieldProperties.size() == 0) {
    return publicMethodProperties;
  }
 else {
    HashMap fieldPropertyMap=getPropertyMapFromArrayList(publicFieldProperties);
    for (int i=0; i < publicMethodProperties.size(); i++) {
      Property next=(Property)publicMethodProperties.get(i);
      if (fieldPropertyMap.get(next.getPropertyName()) == null) {
        publicFieldProperties.add(next);
      }
    }
    return publicFieldProperties;
  }
}

Fixed version (ground truth):
public ArrayList getPublicMemberPropertiesForClass(JavaClass cls,TypeInfo info){
  ArrayList<Property> fieldProperties=getFieldPropertiesForClass(cls,info,false);
  ArrayList<Property> methodProperties=getPropertyPropertiesForClass(cls,info,false);
  ArrayList<Property> publicFieldProperties=new ArrayList<Property>();
  ArrayList<Property> publicMethodProperties=new ArrayList<Property>();
  for (  Property next : fieldProperties) {
    if (Modifier.isPublic(((JavaField)next.getElement()).getModifiers())) {
      publicFieldProperties.add(next);
    }
 else {
      if (hasJAXBAnnotations(next.getElement())) {
        publicFieldProperties.add(next);
      }
    }
  }
  for (  Property next : methodProperties) {
    if (next.getElement() != null) {
      if (Modifier.isPublic(((JavaMethod)next.getElement()).getModifiers())) {
        publicMethodProperties.add(next);
      }
 else {
        if (hasJAXBAnnotations(next.getElement())) {
          publicMethodProperties.add(next);
        }
      }
    }
  }
  if (publicFieldProperties.size() >= 0 && publicMethodProperties.size() == 0) {
    return publicFieldProperties;
  }
 else   if (publicMethodProperties.size() > 0 && publicFieldProperties.size() == 0) {
    return publicMethodProperties;
  }
 else {
    HashMap fieldPropertyMap=getPropertyMapFromArrayList(publicFieldProperties);
    for (int i=0; i < publicMethodProperties.size(); i++) {
      Property next=(Property)publicMethodProperties.get(i);
      if (fieldPropertyMap.get(next.getPropertyName()) == null) {
        publicFieldProperties.add(next);
      }
    }
    return publicFieldProperties;
  }
}
Program: 67840
Project: 67840
Buggy source:
public ArrayList getNoAccessTypePropertiesForClass(JavaClass cls,TypeInfo info){
  ArrayList list=new ArrayList();
  if (cls == null) {
    return list;
  }
  ArrayList fieldProperties=getFieldPropertiesForClass(cls,info,false);
  ArrayList methodProperties=getPropertyPropertiesForClass(cls,info,false);
  for (int i=0; i < fieldProperties.size(); i++) {
    Property next=(Property)fieldProperties.get(i);
    JavaHasAnnotations elem=next.getElement();
    if (helper.isAnnotationPresent(elem,XmlElement.class) || helper.isAnnotationPresent(elem,XmlAttribute.class) || helper.isAnnotationPresent(elem,XmlAnyElement.class)|| helper.isAnnotationPresent(elem,XmlAnyAttribute.class)|| helper.isAnnotationPresent(elem,XmlValue.class)|| helper.isAnnotationPresent(elem,XmlElements.class)) {
      list.add(next);
    }
  }
  for (int i=0; i < methodProperties.size(); i++) {
    Property next=(Property)methodProperties.get(i);
    JavaHasAnnotations elem=next.getElement();
    if (helper.isAnnotationPresent(elem,XmlElement.class) || helper.isAnnotationPresent(elem,XmlAttribute.class) || helper.isAnnotationPresent(elem,XmlAnyElement.class)|| helper.isAnnotationPresent(elem,XmlAnyAttribute.class)|| helper.isAnnotationPresent(elem,XmlValue.class)|| helper.isAnnotationPresent(elem,XmlElements.class)) {
      list.add(next);
    }
  }
  return list;
}

Fixed version (ground truth):
public ArrayList getNoAccessTypePropertiesForClass(JavaClass cls,TypeInfo info){
  ArrayList list=new ArrayList();
  if (cls == null) {
    return list;
  }
  ArrayList fieldProperties=getFieldPropertiesForClass(cls,info,false);
  ArrayList methodProperties=getPropertyPropertiesForClass(cls,info,false);
  for (int i=0; i < fieldProperties.size(); i++) {
    Property next=(Property)fieldProperties.get(i);
    JavaHasAnnotations elem=next.getElement();
    if (hasJAXBAnnotations(elem)) {
      list.add(next);
    }
  }
  for (int i=0; i < methodProperties.size(); i++) {
    Property next=(Property)methodProperties.get(i);
    JavaHasAnnotations elem=next.getElement();
    if (hasJAXBAnnotations(elem)) {
      list.add(next);
    }
  }
  return list;
}
Program: 67841
Project: 67841
Buggy source:
private boolean isSimpleXMLRoot(XMLRoot xmlRoot){
  Class xmlRootObjectClass=xmlRoot.getObject().getClass();
  if (XMLConversionManager.getDefaultJavaTypes().get(xmlRootObjectClass) != null) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean isSimpleXMLRoot(XMLRoot xmlRoot){
  Class xmlRootObjectClass=xmlRoot.getObject().getClass();
  if (XMLConversionManager.getDefaultJavaTypes().get(xmlRootObjectClass) != null || ClassConstants.List_Class.isAssignableFrom(xmlRootObjectClass)) {
    return true;
  }
  return false;
}
Program: 67842
Project: 67842
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(MarshalToNodeTestCases.class);
  suite.addTestSuite(XMLRootComplexTestCases.class);
  suite.addTestSuite(XMLRootComplexDifferentPrefixWithDRTestCases.class);
  suite.addTestSuite(XMLRootComplexNoPrefixTestCases.class);
  suite.addTestSuite(XMLRootComplexNoNamespaceResolverTestCases.class);
  suite.addTestSuite(XMLRootComplexNullUriTestCases.class);
  suite.addTestSuite(XMLRootComplexNoNRWithPrefixTestCases.class);
  suite.addTestSuite(XMLRootComplexDifferentPrefixTestCases.class);
  suite.addTestSuite(XMLRootSimpleTestCases.class);
  suite.addTestSuite(XMLRootNoPrefixTestCases.class);
  suite.addTestSuite(XMLRootNullUriTestCases.class);
  suite.addTestSuite(XMLRootNullSchemaReferenceTestCases.class);
  suite.addTestSuite(XMLRootMultipleMarshalTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(MarshalToNodeTestCases.class);
  suite.addTestSuite(XMLRootComplexTestCases.class);
  suite.addTestSuite(XMLRootComplexDifferentPrefixWithDRTestCases.class);
  suite.addTestSuite(XMLRootComplexNoPrefixTestCases.class);
  suite.addTestSuite(XMLRootComplexNoNamespaceResolverTestCases.class);
  suite.addTestSuite(XMLRootComplexNullUriTestCases.class);
  suite.addTestSuite(XMLRootComplexNoNRWithPrefixTestCases.class);
  suite.addTestSuite(XMLRootComplexDifferentPrefixTestCases.class);
  suite.addTestSuite(XMLRootSimpleTestCases.class);
  suite.addTestSuite(XMLRootNoPrefixTestCases.class);
  suite.addTestSuite(XMLRootNullUriTestCases.class);
  suite.addTestSuite(XMLRootNullSchemaReferenceTestCases.class);
  suite.addTestSuite(XMLRootMultipleMarshalTestCases.class);
  suite.addTestSuite(XMLRootSimpleCollectionTestCases.class);
  return suite;
}
Program: 67846
Project: 67846
Buggy source:
public ElementDeclaration(QName name,JavaClass javaType,String javaTypeName){
  this.elementName=name;
  this.javaTypeName=javaTypeName;
  this.javaType=javaType;
  this.substitutableElements=new ArrayList<ElementDeclaration>();
}

Fixed version (ground truth):
public ElementDeclaration(QName name,JavaClass javaType,String javaTypeName,boolean isList){
  this.elementName=name;
  this.javaTypeName=javaTypeName;
  this.javaType=javaType;
  this.substitutableElements=new ArrayList<ElementDeclaration>();
  this.isList=isList;
}
Program: 67849
Project: 67849
Buggy source:
public Object unmarshal(String systemId,Class clazz){
  boolean isPrimitiveWrapper=XMLConversionManager.getDefaultJavaTypes().get(clazz) != null;
  UnmarshalRecord unmarshalRecord;
  XMLDescriptor xmlDescriptor=null;
  AbstractSession session=null;
  if (isPrimitiveWrapper) {
    unmarshalRecord=new XMLRootRecord(clazz);
  }
 else {
    session=xmlUnmarshaller.getXMLContext().getReadSession(clazz);
    xmlDescriptor=(XMLDescriptor)session.getDescriptor(clazz);
    unmarshalRecord=(UnmarshalRecord)xmlDescriptor.getObjectBuilder().createRecord(session);
  }
  try {
    unmarshalRecord.setXMLReader(xmlReader);
    unmarshalRecord.setUnmarshaller(xmlUnmarshaller);
    xmlReader.setContentHandler(unmarshalRecord);
    try {
      unmarshalRecord.getXMLReader().setProperty("String_Node_Str",unmarshalRecord);
    }
 catch (    SAXNotRecognizedException ex) {
    }
catch (    SAXNotSupportedException ex) {
    }
    xmlReader.parse(systemId);
  }
 catch (  IOException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
catch (  SAXException e) {
    throw convertSAXException(e);
  }
  xmlUnmarshaller.resolveReferences(session);
  if (isPrimitiveWrapper) {
    return unmarshalRecord.getCurrentObject();
  }
  return xmlDescriptor.wrapObjectInXMLRoot(unmarshalRecord,this.isResultAlwaysXMLRoot);
}

Fixed version (ground truth):
public Object unmarshal(String systemId,Class clazz){
  boolean isPrimitiveWrapper=isPrimitiveWrapper(clazz);
  UnmarshalRecord unmarshalRecord;
  XMLDescriptor xmlDescriptor=null;
  AbstractSession session=null;
  if (isPrimitiveWrapper) {
    unmarshalRecord=new XMLRootRecord(clazz);
  }
 else {
    session=xmlUnmarshaller.getXMLContext().getReadSession(clazz);
    xmlDescriptor=(XMLDescriptor)session.getDescriptor(clazz);
    unmarshalRecord=(UnmarshalRecord)xmlDescriptor.getObjectBuilder().createRecord(session);
  }
  try {
    unmarshalRecord.setXMLReader(xmlReader);
    unmarshalRecord.setUnmarshaller(xmlUnmarshaller);
    xmlReader.setContentHandler(unmarshalRecord);
    try {
      unmarshalRecord.getXMLReader().setProperty("String_Node_Str",unmarshalRecord);
    }
 catch (    SAXNotRecognizedException ex) {
    }
catch (    SAXNotSupportedException ex) {
    }
    xmlReader.parse(systemId);
  }
 catch (  IOException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
catch (  SAXException e) {
    throw convertSAXException(e);
  }
  xmlUnmarshaller.resolveReferences(session);
  if (isPrimitiveWrapper) {
    return unmarshalRecord.getCurrentObject();
  }
  return xmlDescriptor.wrapObjectInXMLRoot(unmarshalRecord,this.isResultAlwaysXMLRoot);
}
Program: 67850
Project: 67850
Buggy source:
private boolean isSimpleXMLRoot(XMLRoot xmlRoot){
  Class xmlRootObjectClass=xmlRoot.getObject().getClass();
  if (XMLConversionManager.getDefaultJavaTypes().get(xmlRootObjectClass) != null || ClassConstants.List_Class.isAssignableFrom(xmlRootObjectClass)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean isSimpleXMLRoot(XMLRoot xmlRoot){
  Class xmlRootObjectClass=xmlRoot.getObject().getClass();
  if (XMLConversionManager.getDefaultJavaTypes().get(xmlRootObjectClass) != null || ClassConstants.List_Class.isAssignableFrom(xmlRootObjectClass) || ClassConstants.XML_GREGORIAN_CALENDAR.isAssignableFrom(xmlRootObjectClass) || ClassConstants.DURATION.isAssignableFrom(xmlRootObjectClass)) {
    return true;
  }
  return false;
}
Program: 67851
Project: 67851
Buggy source:
public void testRootObjectInstanceClassForUserDefinedType() throws Exception {
  xsdHelper.define(getSchema(getSchemaNameForUserDefinedType()));
  FileInputStream inputStream=new FileInputStream(getControlFileName());
  XMLDocument document=xmlHelper.load(inputStream,null,null);
  Class instanceClassFromDocument=document.getRootObject().get("String_Node_Str").getClass();
  assertEquals(getDatatypeJavaClass(),instanceClassFromDocument);
}

Fixed version (ground truth):
public void testRootObjectInstanceClassForUserDefinedType() throws Exception {
  xsdHelper.define(getSchema(getSchemaNameForUserDefinedType()));
  FileInputStream inputStream=new FileInputStream(getControlFileName());
  XMLDocument document=xmlHelper.load(inputStream,null,null);
  assertNull(document.getRootObject().getType().getInstanceClass());
  Class instanceClassFromDocument=document.getRootObject().get("String_Node_Str").getClass();
  assertEquals(getDatatypeJavaClass(),instanceClassFromDocument);
}
Program: 67852
Project: 67852
Buggy source:
public void testRootObjectInstanceClassForBuiltinType() throws Exception {
  xsdHelper.define(getSchema(getSchemaNameForBuiltinType()));
  FileInputStream inputStream=new FileInputStream(getControlFileName());
  XMLDocument document=xmlHelper.load(inputStream,null,null);
  Class instanceClassFromDocument=document.getRootObject().get("String_Node_Str").getClass();
  assertEquals(getDatatypeJavaClass(),instanceClassFromDocument);
}

Fixed version (ground truth):
public void testRootObjectInstanceClassForBuiltinType() throws Exception {
  xsdHelper.define(getSchema(getSchemaNameForBuiltinType()));
  FileInputStream inputStream=new FileInputStream(getControlFileName());
  XMLDocument document=xmlHelper.load(inputStream,null,null);
  assertNull(document.getRootObject().getType().getInstanceClass());
  Class instanceClassFromDocument=document.getRootObject().get("String_Node_Str").getClass();
  assertEquals(getDatatypeJavaClass(),instanceClassFromDocument);
}
Program: 67853
Project: 67853
Buggy source:
/** 
 * INTERNAL:
 */
public Class getImplClass(){
  if ((javaImplClass == null) && (getImplClassName() != null)) {
    try {
      SDOClassLoader loader=((SDOXMLHelper)aHelperContext.getXMLHelper()).getLoader();
      javaImplClass=loader.loadClass(getImplClassName(),this);
    }
 catch (    ClassNotFoundException e) {
      throw SDOException.classNotFound(e,getURI(),getName());
    }
catch (    SecurityException e) {
      throw SDOException.classNotFound(e,getURI(),getName());
    }
  }
  return javaImplClass;
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public Class getImplClass(){
  if ((javaImplClass == null) && (getImplClassName() != null)) {
    try {
      SDOClassLoader loader=((SDOXMLHelper)aHelperContext.getXMLHelper()).getLoader();
      javaImplClass=loader.loadClass(getImplClassName(),this);
      xmlDescriptor.setJavaClass(javaImplClass);
    }
 catch (    ClassNotFoundException e) {
      throw SDOException.classNotFound(e,getURI(),getName());
    }
catch (    SecurityException e) {
      throw SDOException.classNotFound(e,getURI(),getName());
    }
  }
  return javaImplClass;
}
Program: 67855
Project: 67855
Buggy source:
public DataObject create(Type type){
  if (type == null) {
    throw new IllegalArgumentException(SDOException.cannotPerformOperationWithNullInputParameter("String_Node_Str","String_Node_Str"));
  }
  if (type.isAbstract()) {
    throw new IllegalArgumentException(SDOException.errorCreatingDataObjectForType(type.getURI(),type.getName()));
  }
  if (type.isDataType()) {
    SDOTypeHelper sth=(SDOTypeHelper)getHelperContext().getTypeHelper();
    type=(SDOType)sth.getWrappersHashMap().get(((SDOType)type).getQName());
  }
  Class typedDataObjectClass=((SDOType)type).getInstanceClass();
  if (typedDataObjectClass != null) {
    try {
      Class implClass=((SDOType)type).getImplClass();
      if (implClass != null) {
        SDODataObject theDataObject=(SDODataObject)implClass.newInstance();
        theDataObject._setType(type);
        theDataObject._setHelperContext(getHelperContext());
        return theDataObject;
      }
    }
 catch (    InstantiationException e) {
      throw new IllegalArgumentException(SDOException.errorCreatingDataObjectForClass(e,typedDataObjectClass.getName(),type.getURI(),type.getName()));
    }
catch (    IllegalAccessException e) {
      throw new IllegalArgumentException(SDOException.errorCreatingDataObjectForClass(e,typedDataObjectClass.getName(),type.getURI(),type.getName()));
    }
  }
  SDODataObject dataObject=new SDODataObject();
  dataObject._setType(type);
  dataObject._setHelperContext(getHelperContext());
  return dataObject;
}

Fixed version (ground truth):
public DataObject create(Type type){
  if (type == null) {
    throw new IllegalArgumentException(SDOException.cannotPerformOperationWithNullInputParameter("String_Node_Str","String_Node_Str"));
  }
  if (type.isAbstract()) {
    throw new IllegalArgumentException(SDOException.errorCreatingDataObjectForType(type.getURI(),type.getName()));
  }
  if (type.isDataType()) {
    SDOTypeHelper sth=(SDOTypeHelper)getHelperContext().getTypeHelper();
    type=(SDOType)sth.getWrappersHashMap().get(((SDOType)type).getQName());
  }
  Class implClass;
  try {
    implClass=((SDOType)type).getImplClass();
    if (implClass != null) {
      SDODataObject theDataObject=(SDODataObject)implClass.newInstance();
      theDataObject._setType(type);
      theDataObject._setHelperContext(getHelperContext());
      return theDataObject;
    }
  }
 catch (  InstantiationException e) {
    throw new IllegalArgumentException(SDOException.errorCreatingDataObjectForClass(e,((SDOType)type).getInstanceClassName(),type.getURI(),type.getName()));
  }
catch (  IllegalAccessException e) {
    throw new IllegalArgumentException(SDOException.errorCreatingDataObjectForClass(e,((SDOType)type).getInstanceClassName(),type.getURI(),type.getName()));
  }
  SDODataObject dataObject=new SDODataObject();
  dataObject._setType(type);
  dataObject._setHelperContext(getHelperContext());
  return dataObject;
}
Program: 67858
Project: 67858
Buggy source:
public static TestSuite getSRGDescriptorPropertiesTestSuite(){
  PopulationManager manager=PopulationManager.getDefaultManager();
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.setDescription("String_Node_Str");
  suite.addTest(new DescriptorRefreshCacheTest(manager.getObject(Employee.class,"String_Node_Str")));
  return suite;
}

Fixed version (ground truth):
public static TestSuite getSRGDescriptorPropertiesTestSuite(){
  PopulationManager manager=PopulationManager.getDefaultManager();
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.setDescription("String_Node_Str");
  suite.addTest(new DescriptorRefreshCacheTest(manager.getObject(Employee.class,"String_Node_Str")));
  suite.addTest(new AgentBuilderTablesTest());
  return suite;
}
Program: 67859
Project: 67859
Buggy source:
/** 
 * INTERNAL: The mapping clones itself to create deep copy.
 */
public Object clone(){
  AggregateCollectionMapping mappingObject=(AggregateCollectionMapping)super.clone();
  mappingObject.setTargetForeignKeyToSourceKeys(new HashMap(getTargetForeignKeyToSourceKeys()));
  mappingObject.setSourceKeyFields(org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(getSourceKeyFields()));
  mappingObject.setTargetForeignKeyFields(org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(getTargetForeignKeyFields()));
  return mappingObject;
}

Fixed version (ground truth):
/** 
 * INTERNAL: The mapping clones itself to create deep copy.
 */
public Object clone(){
  AggregateCollectionMapping mappingObject=(AggregateCollectionMapping)super.clone();
  mappingObject.setTargetForeignKeyToSourceKeys(new HashMap(getTargetForeignKeyToSourceKeys()));
  mappingObject.setSourceKeyFields(org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(getSourceKeyFields()));
  mappingObject.setTargetForeignKeyFields(org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(getTargetForeignKeyFields()));
  mappingObject.aggregateToSourceFieldNames=new HashMap(this.aggregateToSourceFieldNames);
  mappingObject.nestedAggregateToSourceFieldNames=new HashMap(this.nestedAggregateToSourceFieldNames);
  return mappingObject;
}
Program: 67861
Project: 67861
Buggy source:
/** 
 * PUBLIC: Provide order support for queryKeyName in ascending order. Called from the EJBAnnotationsProcessor when an @OrderBy on an aggregate is found.
 */
public void addAggregateOrderBy(String aggregateName,String queryKeyName,boolean isDescending){
  this.hasOrderBy=true;
  ReadAllQuery readAllQuery=(ReadAllQuery)getSelectionQuery();
  ExpressionBuilder builder=readAllQuery.getExpressionBuilder();
  Expression expression=builder.get(aggregateName).get(queryKeyName);
  if (isDescending) {
    readAllQuery.addOrdering(expression.descending());
  }
 else {
    readAllQuery.addOrdering(expression.ascending());
  }
}

Fixed version (ground truth):
/** 
 * PUBLIC: Provide order support for queryKeyName in ascending or descending order. Called from the jpa metadata processing of an order by value. The  aggregate name may be chained through the dot notation.
 */
public void addAggregateOrderBy(String aggregateName,String queryKeyName,boolean isDescending){
  this.hasOrderBy=true;
  ReadAllQuery readAllQuery=(ReadAllQuery)getSelectionQuery();
  ExpressionBuilder builder=readAllQuery.getExpressionBuilder();
  Expression expression=null;
  if (aggregateName.contains("String_Node_Str")) {
    StringTokenizer st=new StringTokenizer(aggregateName,"String_Node_Str");
    while (st.hasMoreTokens()) {
      if (expression == null) {
        expression=builder.get(st.nextToken());
      }
 else {
        expression=expression.get(st.nextToken());
      }
    }
    expression=expression.get(queryKeyName);
  }
 else {
    expression=builder.get(aggregateName).get(queryKeyName);
  }
  if (isDescending) {
    readAllQuery.addOrdering(expression.descending());
  }
 else {
    readAllQuery.addOrdering(expression.ascending());
  }
}
Program: 67862
Project: 67862
Buggy source:
/** 
 * PUBLIC: Provide order support for queryKeyName in descending or ascending order. Called from the EJBAnnotationsProcessor when an @OrderBy is found.
 */
public void addOrderBy(String queryKeyName,boolean isDescending){
  if (isDescending) {
    addDescendingOrdering(queryKeyName);
  }
 else {
    addAscendingOrdering(queryKeyName);
  }
}

Fixed version (ground truth):
/** 
 * PUBLIC: Provide order support for queryKeyName in descending or ascending order. Called from the jpa metadata processing of an order by value.
 */
public void addOrderBy(String queryKeyName,boolean isDescending){
  if (isDescending) {
    addDescendingOrdering(queryKeyName);
  }
 else {
    addAscendingOrdering(queryKeyName);
  }
}
Program: 67864
Project: 67864
Buggy source:
private void checkTeam(int id){
  HockeyTeam team=getEntityManager().find(HockeyTeam.class,id);
  if (team == null) {
    throw new TestErrorException("String_Node_Str" + id + "String_Node_Str");
  }
  if (team.getPlayers().size() != 2) {
    throw new TestErrorException("String_Node_Str" + id + "String_Node_Str"+ team.getPlayers().size());
  }
  if (team.getCoaches().size() != 1) {
    throw new TestErrorException("String_Node_Str" + id + "String_Node_Str"+ team.getCoaches().size());
  }
}

Fixed version (ground truth):
private void checkTeam(int id){
  HockeyTeam team=getEntityManager().find(HockeyTeam.class,id);
  if (team == null) {
    throw new TestErrorException("String_Node_Str" + id + "String_Node_Str");
  }
  if (team.getPlayers().size() != 2) {
    throw new TestErrorException("String_Node_Str" + id + "String_Node_Str"+ team.getPlayers().size());
  }
  if (team.getCoaches().size() != 2) {
    throw new TestErrorException("String_Node_Str" + id + "String_Node_Str"+ team.getCoaches().size());
  }
}
Program: 67865
Project: 67865
Buggy source:
public void verify(){
  checkTeam(teamIDs[0]);
  checkTeam(teamIDs[1]);
  checkTeam(teamIDs[2]);
  m_session.getIdentityMapAccessor().initializeAllIdentityMaps();
  checkTeam(teamIDs[0]);
  checkTeam(teamIDs[1]);
  checkTeam(teamIDs[2]);
}

Fixed version (ground truth):
public void verify(){
  checkTeam(teamIDs[0]);
  checkTeam(teamIDs[1]);
  checkTeam(teamIDs[2]);
  m_session.getIdentityMapAccessor().initializeAllIdentityMaps();
  checkTeam(teamIDs[0]);
  checkTeam(teamIDs[1]);
  checkTeam(teamIDs[2]);
  HockeyTeam team=getEntityManager().find(HockeyTeam.class,teamIDs[0]);
  if (((HockeyCoach)team.getCoaches().get(0)).getVitals().getPersonalVitals().getAge() != 67) {
    throw new TestErrorException("String_Node_Str");
  }
}
Program: 67867
Project: 67867
Buggy source:
/** 
 * INTERNAL: Return if this descriptor is involved in inheritance, (is child or parent).
 */
public boolean hasInheritance(){
  return (inheritancePolicy != null);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return if this descriptor is involved in inheritance, (is child or parent). Note: If this class is part of table per class inheritance strategy this method will return false. 
 * @see hasTablePerClassPolicy()
 */
public boolean hasInheritance(){
  return (inheritancePolicy != null);
}
Program: 67868
Project: 67868
Buggy source:
/** 
 * INTERNAL: Validate that the descriptor was defined correctly. This allows for checks to be done that require the descriptor initialization to be completed.
 */
protected void selfValidationAfterInitialization(AbstractSession session) throws DescriptorException {
  if (!(hasInheritance() && (getInheritancePolicy().shouldReadSubclasses() || java.lang.reflect.Modifier.isAbstract(getJavaClass().getModifiers())))) {
    if (session.getIntegrityChecker().shouldCheckInstantiationPolicy()) {
      getInstantiationPolicy().buildNewInstance();
    }
  }
  if (hasReturningPolicy()) {
    getReturningPolicy().validationAfterDescriptorInitialization(session);
  }
  getObjectBuilder().validate(session);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Validate that the descriptor was defined correctly. This allows for checks to be done that require the descriptor initialization to be completed.
 */
protected void selfValidationAfterInitialization(AbstractSession session) throws DescriptorException {
  if ((hasInheritance() && (getInheritancePolicy().shouldReadSubclasses() || isAbstract())) || hasTablePerClassPolicy() && isAbstract()) {
  }
 else   if (session.getIntegrityChecker().shouldCheckInstantiationPolicy()) {
    getInstantiationPolicy().buildNewInstance();
  }
  if (hasReturningPolicy()) {
    getReturningPolicy().validationAfterDescriptorInitialization(session);
  }
  getObjectBuilder().validate(session);
}
Program: 67872
Project: 67872
Buggy source:
public void processSchemaType(XmlSchemaType type){
  String schemaTypeName=type.name();
  Class javaType=type.type();
  if (javaType == null) {
    return;
  }
  JavaClass jClass=helper.getJavaClass(javaType);
  if (jClass == null) {
    return;
  }
  QName typeQName=new QName(XMLConstants.SCHEMA_INSTANCE_URL,schemaTypeName);
  this.userDefinedSchemaTypes.put(jClass.getQualifiedName(),typeQName);
}

Fixed version (ground truth):
public void processSchemaType(XmlSchemaType type){
  String schemaTypeName=type.name();
  Class javaType=type.type();
  if (javaType == null) {
    return;
  }
  JavaClass jClass=helper.getJavaClass(javaType);
  if (jClass == null) {
    return;
  }
  QName typeQName=new QName(type.namespace(),schemaTypeName);
  this.userDefinedSchemaTypes.put(jClass.getQualifiedName(),typeQName);
}
Program: 67873
Project: 67873
Buggy source:
public void processSchemaType(XmlSchemaType type){
  String schemaTypeName=type.name();
  Class javaType=type.type();
  if (javaType == null) {
    return;
  }
  QName typeQName=new QName(XMLConstants.SCHEMA_INSTANCE_URL,schemaTypeName);
  this.userDefinedSchemaTypes.put(javaType,typeQName);
}

Fixed version (ground truth):
public void processSchemaType(XmlSchemaType type){
  String schemaTypeName=type.name();
  Class javaType=type.type();
  if (javaType == null) {
    return;
  }
  QName typeQName=new QName(type.namespace(),schemaTypeName);
  this.userDefinedSchemaTypes.put(javaType,typeQName);
}
Program: 67875
Project: 67875
Buggy source:
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  if (!xmlField.getLastXPathFragment().nameIsText()) {
    return;
  }
  Object value=unmarshalRecord.getStringBuffer().toString();
  boolean isCDATA=unmarshalRecord.isBufferCDATA();
  unmarshalRecord.resetStringBuffer();
  XMLField toWrite=xmlField;
  if (xmlField.isCDATA() != isCDATA) {
    toWrite=new XMLField(xmlField.getName());
    toWrite.setNamespaceResolver(xmlField.getNamespaceResolver());
    toWrite.setIsCDATA(isCDATA);
  }
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=xmlField.convertValueBasedOnSchemaType(value,xmlConversionManager);
  }
  if (null == unmarshalRecord.getTransformationRecord()) {
    unmarshalRecord.setTransformationRecord(new XMLTransformationRecord("String_Node_Str",unmarshalRecord));
  }
  unmarshalRecord.getTransformationRecord().put(toWrite,value);
}

Fixed version (ground truth):
public void endElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord){
  Object value=unmarshalRecord.getStringBuffer().toString();
  boolean isCDATA=unmarshalRecord.isBufferCDATA();
  unmarshalRecord.resetStringBuffer();
  XMLField toWrite=xmlField;
  if (xmlField.isCDATA() != isCDATA) {
    toWrite=new XMLField(xmlField.getName());
    toWrite.setNamespaceResolver(xmlField.getNamespaceResolver());
    toWrite.setIsCDATA(isCDATA);
  }
  XMLConversionManager xmlConversionManager=(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
  if (unmarshalRecord.getTypeQName() != null) {
    Class typeClass=xmlField.getJavaClass(unmarshalRecord.getTypeQName());
    value=xmlConversionManager.convertObject(value,typeClass,unmarshalRecord.getTypeQName());
  }
 else {
    value=xmlField.convertValueBasedOnSchemaType(value,xmlConversionManager);
  }
  if (null == unmarshalRecord.getTransformationRecord()) {
    unmarshalRecord.setTransformationRecord(new XMLTransformationRecord("String_Node_Str",unmarshalRecord));
  }
  unmarshalRecord.getTransformationRecord().put(toWrite,value);
}
Program: 67876
Project: 67876
Buggy source:
/** 
 * INTERNAL: Add the field-value pair to the document.
 */
public void add(DatabaseField key,Object value){
  if (null == value) {
    return;
  }
  XMLField xmlField=convertToXMLField(key);
  XPathFragment lastFragment=xmlField.getLastXPathFragment();
  XMLConversionManager xcm=(XMLConversionManager)session.getDatasourcePlatform().getConversionManager();
  if (lastFragment.nameIsText()) {
    String stringValue=(String)xcm.convertObject(value,String.class);
    characters(stringValue);
  }
 else   if (lastFragment.isAttribute()) {
    String stringValue=(String)xcm.convertObject(value,String.class);
    attribute(lastFragment,xmlField.getNamespaceResolver(),stringValue);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Add the field-value pair to the document.
 */
public void add(DatabaseField key,Object value){
  if (null == value) {
    return;
  }
  XMLField xmlField=convertToXMLField(key);
  XPathFragment lastFragment=xmlField.getLastXPathFragment();
  XMLConversionManager xcm=(XMLConversionManager)session.getDatasourcePlatform().getConversionManager();
  if (lastFragment.nameIsText()) {
    String stringValue=(String)xcm.convertObject(value,String.class);
    characters(stringValue);
  }
 else   if (lastFragment.isAttribute()) {
    String stringValue=(String)xcm.convertObject(value,String.class);
    attribute(lastFragment,xmlField.getNamespaceResolver(),stringValue);
  }
 else {
    element(lastFragment.getNamespaceURI(),lastFragment.getXPath(),lastFragment.getShortName());
  }
}
Program: 67877
Project: 67877
Buggy source:
/** 
 * INTERNAL: Return the namespace URI associated with the prefix held onto by the XPathFragment.
 * @param xPathFragment The XPathFragment contains the name and prefixinformation about the XML element being ended.
 * @param namespaceResolver The NamespaceResolver can be used to resolve thenamespace URI for the namespace prefix held by the XPathFragment (if required).
 * @return A namespace URI.
 */
protected String resolveNamespacePrefix(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  String uri=xPathFragment.getNamespaceURI();
  if ((uri == null) && (xPathFragment.getPrefix() != null)) {
    if (null == namespaceResolver) {
      throw XMLMarshalException.namespaceResolverNotSpecified(xPathFragment.getShortName());
    }
    uri=namespaceResolver.resolveNamespacePrefix(xPathFragment.getPrefix());
    if (null == uri) {
      throw XMLMarshalException.namespaceNotFound(xPathFragment.getShortName());
    }
    xPathFragment.setNamespaceURI(uri);
  }
  return uri;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the namespace URI associated with the prefix held onto by the XPathFragment.
 * @param xPathFragment The XPathFragment contains the name and prefixinformation about the XML element being ended.
 * @param namespaceResolver The NamespaceResolver can be used to resolve thenamespace URI for the namespace prefix held by the XPathFragment (if required).
 * @return A namespace URI.
 */
protected String resolveNamespacePrefix(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  String uri=xPathFragment.getNamespaceURI();
  if (uri == null) {
    if (null == namespaceResolver) {
      if (null != xPathFragment.getPrefix()) {
        throw XMLMarshalException.namespaceResolverNotSpecified(xPathFragment.getShortName());
      }
    }
 else {
      if (!xPathFragment.isAttribute() || xPathFragment.isAttribute() && xPathFragment.getPrefix() != null) {
        uri=namespaceResolver.resolveNamespacePrefix(xPathFragment.getPrefix());
      }
    }
    if (null == uri && null != xPathFragment.getPrefix()) {
      throw XMLMarshalException.namespaceNotFound(xPathFragment.getShortName());
    }
    xPathFragment.setNamespaceURI(uri);
  }
  return uri;
}
Program: 67879
Project: 67879
Buggy source:
public void transform(Document sourceDocument,Node resultParentNode,URL stylesheet) throws XMLPlatformException {
  try {
    TransformerFactory transformerFactory=TransformerFactory.newInstance();
    StreamSource stylesheetSource=new StreamSource(stylesheet.openStream());
    Transformer transformer=transformerFactory.newTransformer(stylesheetSource);
    DOMSource source=new DOMSource(sourceDocument);
    DOMResult result=new DOMResult(resultParentNode);
    transformer.transform(source,result);
  }
 catch (  Exception e) {
    throw XMLPlatformException.xmlPlatformTransformException(e);
  }
}

Fixed version (ground truth):
public void transform(Document sourceDocument,Node resultParentNode,URL stylesheet) throws XMLPlatformException {
  try {
    TransformerFactory transformerFactory=TransformerFactory.newInstance();
    transformerFactory.setErrorListener(new TransformErrorListener());
    StreamSource stylesheetSource=new StreamSource(stylesheet.openStream());
    Transformer transformer=transformerFactory.newTransformer(stylesheetSource);
    DOMSource source=new DOMSource(sourceDocument);
    DOMResult result=new DOMResult(resultParentNode);
    transformer.transform(source,result);
  }
 catch (  Exception e) {
    throw XMLPlatformException.xmlPlatformTransformException(e);
  }
}
Program: 67881
Project: 67881
Buggy source:
public Calendar convertStringToCalendar(String sourceString,QName schemaTypeQName){
  java.util.Date date=convertStringToDate(sourceString,schemaTypeQName);
  applyTimeZone(date,sourceString);
  return Helper.calendarFromUtilDate(date);
}

Fixed version (ground truth):
public Calendar convertStringToCalendar(String sourceString,QName schemaTypeQName){
  java.util.Date date=convertStringToDate(sourceString,schemaTypeQName);
  Calendar cal=Helper.calendarFromUtilDate(date);
  cal.setTimeZone(getTimeZone());
  return cal;
}
Program: 67882
Project: 67882
Buggy source:
protected String convertObjectToString(Object sourceObject,QName schemaTypeQName) throws ConversionException {
  if (sourceObject instanceof Calendar) {
    return stringFromCalendar((Calendar)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof QName) {
    return stringFromQName((QName)sourceObject);
  }
  if (sourceObject instanceof java.sql.Date) {
    return stringFromSQLDate((java.sql.Date)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof java.sql.Time) {
    return stringFromSQLTime((java.sql.Time)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof java.sql.Timestamp) {
    return stringFromTimestamp((Timestamp)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof java.util.Date) {
    return stringFromDate((java.util.Date)sourceObject,schemaTypeQName);
  }
  return super.convertObjectToString(sourceObject);
}

Fixed version (ground truth):
protected String convertObjectToString(Object sourceObject,QName schemaTypeQName) throws ConversionException {
  if (sourceObject instanceof Calendar) {
    return stringFromCalendar((Calendar)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof QName) {
    return stringFromQName((QName)sourceObject);
  }
  if (sourceObject instanceof java.sql.Date) {
    return stringFromSQLDate((java.sql.Date)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof java.sql.Time) {
    return stringFromSQLTime((java.sql.Time)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof java.sql.Timestamp) {
    return stringFromTimestamp((Timestamp)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof java.util.Date) {
    return stringFromDate((java.util.Date)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof XMLGregorianCalendar) {
    return stringFromXMLGregorianCalendar((XMLGregorianCalendar)sourceObject);
  }
  if (sourceObject instanceof Duration) {
    return stringFromDuration((Duration)sourceObject);
  }
  return super.convertObjectToString(sourceObject);
}
Program: 67885
Project: 67885
Buggy source:
protected String convertObjectToString(Object sourceObject,QName schemaTypeQName) throws ConversionException {
  if (sourceObject instanceof Calendar) {
    return stringFromCalendar((Calendar)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof QName) {
    return stringFromQName((QName)sourceObject);
  }
  if (sourceObject instanceof java.sql.Date) {
    return stringFromSQLDate((java.sql.Date)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof java.sql.Time) {
    return stringFromSQLTime((java.sql.Time)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof java.sql.Timestamp) {
    return stringFromTimestamp((Timestamp)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof java.util.Date) {
    return stringFromDate((java.util.Date)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof XMLGregorianCalendar) {
    return stringFromXMLGregorianCalendar((XMLGregorianCalendar)sourceObject);
  }
  if (sourceObject instanceof Duration) {
    return stringFromDuration((Duration)sourceObject);
  }
  return super.convertObjectToString(sourceObject);
}

Fixed version (ground truth):
protected String convertObjectToString(Object sourceObject,QName schemaTypeQName) throws ConversionException {
  if (sourceObject instanceof Calendar) {
    return stringFromCalendar((Calendar)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof QName) {
    return stringFromQName((QName)sourceObject);
  }
  if (sourceObject instanceof java.sql.Date) {
    return stringFromSQLDate((java.sql.Date)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof java.sql.Time) {
    return stringFromSQLTime((java.sql.Time)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof java.sql.Timestamp) {
    return stringFromTimestamp((Timestamp)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof java.util.Date) {
    return stringFromDate((java.util.Date)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof XMLGregorianCalendar) {
    return stringFromXMLGregorianCalendar((XMLGregorianCalendar)sourceObject,schemaTypeQName);
  }
  if (sourceObject instanceof Duration) {
    return stringFromDuration((Duration)sourceObject);
  }
  return super.convertObjectToString(sourceObject);
}
Program: 67886
Project: 67886
Buggy source:
/** 
 * Return an XMLGregorianCalander created with a given date string
 * @param dateString
 * @return
 */
public XMLGregorianCalendar convertStringToXMLGregorianCalendar(String dateString){
  XMLGregorianCalendar calToReturn=null;
  try {
    calToReturn=getDatatypeFactory().newXMLGregorianCalendar(dateString);
  }
 catch (  IllegalArgumentException e1) {
    try {
      calToReturn=getDatatypeFactory().newXMLGregorianCalendar(dateString + "String_Node_Str");
    }
 catch (    IllegalArgumentException e2) {
      throw e1;
    }
  }
  return calToReturn;
}

Fixed version (ground truth):
/** 
 * Return an XMLGregorianCalander created with a given date string
 * @param dateString
 * @return
 */
public XMLGregorianCalendar convertStringToXMLGregorianCalendar(String sourceString){
  XMLGregorianCalendar calToReturn=null;
  try {
    calToReturn=getDatatypeFactory().newXMLGregorianCalendar(sourceString);
  }
 catch (  IllegalArgumentException e1) {
    try {
      calToReturn=getDatatypeFactory().newXMLGregorianCalendar(sourceString + "String_Node_Str");
    }
 catch (    IllegalArgumentException e2) {
      throw e1;
    }
  }
  return calToReturn;
}
Program: 67887
Project: 67887
Buggy source:
/** 
 * Return a Duration created with a given date string.
 * @param dateString
 * @return
 */
public Duration convertStringToDuration(String dateString){
  return getDatatypeFactory().newDuration(dateString);
}

Fixed version (ground truth):
/** 
 * Return a Duration created with a given date string.
 * @param dateString
 * @return
 */
public Duration convertStringToDuration(String sourceString){
  return getDatatypeFactory().newDuration(sourceString);
}
Program: 67889
Project: 67889
Buggy source:
/** 
 * Inherited suite method for generating all test cases.
 * @return
 */
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new XSDHelperDefineTestSuite().suite());
  suite.addTest(new XSDHelperGenerateTestSuite().suite());
  suite.addTest(new SDOTypeHelperTestSuite().suite());
  suite.addTest(new SDODataFactoryTestSuite().suite());
  suite.addTest(new SDOXMLHelperTestSuite().suite());
  return suite;
}

Fixed version (ground truth):
/** 
 * Inherited suite method for generating all test cases.
 * @return
 */
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new SDOXSDHelperTestSuite().suite());
  suite.addTest(new SDOTypeHelperTestSuite().suite());
  suite.addTest(new SDODataFactoryTestSuite().suite());
  suite.addTest(new SDOXMLHelperTestSuite().suite());
  return suite;
}