nus-yam/ex-repair huggingface dataset:
Program: 68316
Project: 68316
Buggy source:
public void setUp(){
  super.setUp();
  SDOType changeSummaryType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.CHANGESUMMARY);
  DataObject rootPropertyTypeDO=defineType("String_Node_Str","String_Node_Str");
  SDOType rootPropertyType=(SDOType)typeHelper.define(rootPropertyTypeDO);
  DataObject rootTypeDO=defineType(URINAME,TYPENAME);
  DataObject changeSumPropertyDO=addProperty(rootTypeDO,"String_Node_Str",changeSummaryType);
  changeSumPropertyDO.set("String_Node_Str",true);
  DataObject rootPropertyDO=addProperty(rootTypeDO,"String_Node_Str",rootPropertyType);
  rootPropertyDO.set("String_Node_Str",true);
  DataObject rootProperty1DO=addProperty(rootTypeDO,"String_Node_Str",SDOConstants.SDO_STRING);
  rootType=(SDOType)typeHelper.define(rootTypeDO);
  rootProperty=(SDOProperty)rootType.getDeclaredPropertiesMap().get("String_Node_Str");
  rootProperty1=(SDOProperty)rootType.getDeclaredPropertiesMap().get("String_Node_Str");
  DataObject contained_typeDO=defineType("String_Node_Str","String_Node_Str");
  DataObject containedPropertyDO=addProperty(contained_typeDO,"String_Node_Str",SDOConstants.SDO_STRING);
  contained_type=(SDOType)typeHelper.define(contained_typeDO);
  containedDataObject=(SDODataObject)dataFactory.create(contained_type);
  root=(SDODataObject)dataFactory.create(rootType);
  root.set(rootProperty,containedDataObject);
  changeSummary=(SDOChangeSummary)root.getChangeSummary();
}

Fixed version (ground truth):
public void setUp(){
  super.setUp();
  SDOType changeSummaryType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.CHANGESUMMARY);
  DataObject rootPropertyTypeDO=defineType("String_Node_Str","String_Node_Str");
  SDOType rootPropertyType=(SDOType)typeHelper.define(rootPropertyTypeDO);
  DataObject rootTypeDO=defineType(URINAME,TYPENAME);
  DataObject changeSumPropertyDO=addProperty(rootTypeDO,"String_Node_Str",changeSummaryType);
  changeSumPropertyDO.set("String_Node_Str",true);
  DataObject rootPropertyDO=addProperty(rootTypeDO,"String_Node_Str",rootPropertyType);
  rootPropertyDO.set("String_Node_Str",true);
  DataObject rootProperty1DO=addProperty(rootTypeDO,"String_Node_Str",SDOConstants.SDO_STRING);
  rootType=(SDOType)typeHelper.define(rootTypeDO);
  rootProperty=(SDOProperty)rootType.getDeclaredPropertiesMap().get("String_Node_Str");
  rootProperty1=(SDOProperty)rootType.getDeclaredPropertiesMap().get("String_Node_Str");
  rootProperty1.setNullable(true);
  DataObject contained_typeDO=defineType("String_Node_Str","String_Node_Str");
  DataObject containedPropertyDO=addProperty(contained_typeDO,"String_Node_Str",SDOConstants.SDO_STRING);
  contained_type=(SDOType)typeHelper.define(contained_typeDO);
  containedDataObject=(SDODataObject)dataFactory.create(contained_type);
  root=(SDODataObject)dataFactory.create(rootType);
  root.set(rootProperty,containedDataObject);
  changeSummary=(SDOChangeSummary)root.getChangeSummary();
}
Program: 68317
Project: 68317
Buggy source:
public void testUnsetSimpleIDSetToNullOnRoot(){
  rootObject.set("String_Node_Str",null);
  cs.beginLogging();
  rootObject.unset("String_Node_Str");
  assertModified(rootObject,cs);
  assertEquals(1,cs.getChangedDataObjects().size());
  List oldValues=cs.getOldValues(rootObject);
  assertEquals(1,oldValues.size());
  ChangeSummary.Setting theSetting=(ChangeSummary.Setting)oldValues.get(0);
  assertEquals("String_Node_Str",theSetting.getProperty().getName());
  assertEquals(true,theSetting.isSet());
  assertEquals(null,theSetting.getValue());
}

Fixed version (ground truth):
public void testUnsetSimpleIDSetToNullOnRoot(){
  SDOProperty idProperty=(SDOProperty)((SDOType)rootObject.getType()).getDeclaredPropertiesMap().get("String_Node_Str");
  idProperty.setNullable(true);
  rootObject.set("String_Node_Str",null);
  cs.beginLogging();
  rootObject.unset("String_Node_Str");
  assertModified(rootObject,cs);
  assertEquals(1,cs.getChangedDataObjects().size());
  List oldValues=cs.getOldValues(rootObject);
  assertEquals(1,oldValues.size());
  ChangeSummary.Setting theSetting=(ChangeSummary.Setting)oldValues.get(0);
  assertEquals("String_Node_Str",theSetting.getProperty().getName());
  assertEquals(true,theSetting.isSet());
  assertEquals(null,theSetting.getValue());
}
Program: 68318
Project: 68318
Buggy source:
public void testUnsetSimpleIDSetToNullOnRoot(){
  rootObject.set("String_Node_Str",null);
  cs.beginLogging();
  rootObject.unset("String_Node_Str");
  assertModified(rootObject,cs);
  assertEquals(1,cs.getChangedDataObjects().size());
  List oldValues=cs.getOldValues(rootObject);
  assertEquals(1,oldValues.size());
  ChangeSummary.Setting theSetting=(ChangeSummary.Setting)oldValues.get(0);
  assertEquals("String_Node_Str",theSetting.getProperty().getName());
  assertEquals(true,theSetting.isSet());
  assertEquals(null,theSetting.getValue());
}

Fixed version (ground truth):
public void testUnsetSimpleIDSetToNullOnRoot(){
  SDOProperty idProperty=(SDOProperty)((SDOType)rootObject.getType()).getDeclaredPropertiesMap().get("String_Node_Str");
  idProperty.setNullable(true);
  rootObject.set("String_Node_Str",null);
  cs.beginLogging();
  rootObject.unset("String_Node_Str");
  assertModified(rootObject,cs);
  assertEquals(1,cs.getChangedDataObjects().size());
  List oldValues=cs.getOldValues(rootObject);
  assertEquals(1,oldValues.size());
  ChangeSummary.Setting theSetting=(ChangeSummary.Setting)oldValues.get(0);
  assertEquals("String_Node_Str",theSetting.getProperty().getName());
  assertEquals(true,theSetting.isSet());
  assertEquals(null,theSetting.getValue());
}
Program: 68320
Project: 68320
Buggy source:
/** 
 * INTERNAL: Sets the value of the given property of the object to the new value. <p> The use of a false updateSequence flag is internally implemented during an SDOSequence.add() call. Refactor: we need to abstract this function using a type of Command pattern to handle the sequence context.
 * @param property
 * @param value
 * @param updateSequence
 * @throws UnsupportedOperationException
 * @throws IllegalArgumentException
 */
public void set(SDOProperty property,Object value,boolean updateSequence) throws UnsupportedOperationException, IllegalArgumentException {
  if (null == property) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (property.isReadOnly()) {
    throw new UnsupportedOperationException("String_Node_Str" + property.getName() + "String_Node_Str"+ getType().getName());
  }
  setInternal(property,value,updateSequence);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Sets the value of the given property of the object to the new value. <p> The use of a false updateSequence flag is internally implemented during an SDOSequence.add() call. Refactor: we need to abstract this function using a type of Command pattern to handle the sequence context.
 * @param property
 * @param value
 * @param updateSequence
 * @throws UnsupportedOperationException
 * @throws IllegalArgumentException
 */
public void set(SDOProperty property,Object value,boolean updateSequence) throws UnsupportedOperationException, IllegalArgumentException {
  if (null == property) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (property.isReadOnly()) {
    throw new UnsupportedOperationException("String_Node_Str" + property.getName() + "String_Node_Str"+ getType().getName());
  }
  if (value == null && !property.isNullable()) {
    unset(property,false,updateSequence);
  }
 else {
    setInternal(property,value,updateSequence);
  }
}
Program: 68323
Project: 68323
Buggy source:
protected static void buildFormatters(XMLConversionManager xmlConversionManager){
  xmlConversionManager.dateFormatter=new DateFormatThreadLocal(XSD_DATE_FORMAT_STR,null);
  xmlConversionManager.timeFormatter=new DateFormatThreadLocal(XSD_TIME_FORMAT_STR,xmlConversionManager);
  xmlConversionManager.dateTimeFormatter=new DateFormatThreadLocal(XSD_DATE_TIME_FORMAT_STR,xmlConversionManager);
  xmlConversionManager.gDayFormatter=new DateFormatThreadLocal(XSD_GDAY_FORMAT_STR,null);
  xmlConversionManager.gMonthFormatter=new DateFormatThreadLocal(XSD_GMONTH_FORMAT_STR,null);
  xmlConversionManager.gMonthDayFormatter=new DateFormatThreadLocal(XSD_GMONTH_DAY_FORMAT_STR,null);
  xmlConversionManager.gYearFormatter=new DateFormatThreadLocal(XSD_GYEAR_FORMAT_STR,null);
  xmlConversionManager.gYearMonthFormatter=new DateFormatThreadLocal(XSD_GYEAR_MONTH_FORMAT_STR,null);
}

Fixed version (ground truth):
protected static void buildFormatters(XMLConversionManager xmlConversionManager){
  xmlConversionManager.dateFormatter=new DateFormatThreadLocal(XSD_DATE_FORMAT_STR,xmlConversionManager);
  xmlConversionManager.timeFormatter=new DateFormatThreadLocal(XSD_TIME_FORMAT_STR,xmlConversionManager);
  xmlConversionManager.dateTimeFormatter=new DateFormatThreadLocal(XSD_DATE_TIME_FORMAT_STR,xmlConversionManager);
  xmlConversionManager.gDayFormatter=new DateFormatThreadLocal(XSD_GDAY_FORMAT_STR,xmlConversionManager);
  xmlConversionManager.gMonthFormatter=new DateFormatThreadLocal(XSD_GMONTH_FORMAT_STR,xmlConversionManager);
  xmlConversionManager.gMonthDayFormatter=new DateFormatThreadLocal(XSD_GMONTH_DAY_FORMAT_STR,xmlConversionManager);
  xmlConversionManager.gYearFormatter=new DateFormatThreadLocal(XSD_GYEAR_FORMAT_STR,xmlConversionManager);
  xmlConversionManager.gYearMonthFormatter=new DateFormatThreadLocal(XSD_GYEAR_MONTH_FORMAT_STR,xmlConversionManager);
}
Program: 68324
Project: 68324
Buggy source:
public void testConverFromString_Calendar(){
  String b="String_Node_Str";
  Calendar controlCalendar=Calendar.getInstance();
  controlCalendar.clear();
  controlCalendar.set(Calendar.YEAR,2000);
  controlCalendar.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  this.assertEquals(controlCalendar,(Calendar)dataHelper.convertFromStringValue(b,Calendar.class,null));
}

Fixed version (ground truth):
public void testConverFromString_Calendar(){
  String b="String_Node_Str";
  Calendar controlCalendar=Calendar.getInstance();
  controlCalendar.clear();
  controlCalendar.set(Calendar.YEAR,2000);
  controlCalendar.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  Calendar aCalendar=(Calendar)dataHelper.convertFromStringValue(b,Calendar.class,null);
  assertTrue("String_Node_Str" + controlCalendar.get(Calendar.YEAR) + "String_Node_Str"+ aCalendar.get(Calendar.YEAR),controlCalendar.get(Calendar.YEAR) == aCalendar.get(Calendar.YEAR));
  assertTrue("String_Node_Str" + controlCalendar.getTimeZone() + "String_Node_Str"+ aCalendar.getTimeZone(),controlCalendar.getTimeZone().equals(aCalendar.getTimeZone()));
  assertTrue("String_Node_Str" + controlCalendar.toString() + "String_Node_Str"+ aCalendar.toString(),controlCalendar.toString().equals(aCalendar.toString()));
}
Program: 68325
Project: 68325
Buggy source:
public void testConverFromString_Calendar_NoQname(){
  String b="String_Node_Str";
  Calendar controlCalendar=Calendar.getInstance();
  controlCalendar.clear();
  controlCalendar.set(Calendar.YEAR,2000);
  controlCalendar.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  this.assertEquals(controlCalendar,(Calendar)dataHelper.convertFromStringValue(b,Calendar.class));
}

Fixed version (ground truth):
public void testConverFromString_Calendar_NoQname(){
  String b="String_Node_Str";
  Calendar controlCalendar=Calendar.getInstance();
  controlCalendar.clear();
  controlCalendar.set(Calendar.YEAR,2000);
  controlCalendar.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  Calendar aCalendar=(Calendar)dataHelper.convertFromStringValue(b,Calendar.class,null);
  assertTrue("String_Node_Str" + controlCalendar.get(Calendar.YEAR) + "String_Node_Str"+ aCalendar.get(Calendar.YEAR),controlCalendar.get(Calendar.YEAR) == aCalendar.get(Calendar.YEAR));
  assertTrue("String_Node_Str" + controlCalendar.getTimeZone() + "String_Node_Str"+ aCalendar.getTimeZone(),controlCalendar.getTimeZone().equals(aCalendar.getTimeZone()));
  assertTrue("String_Node_Str" + controlCalendar.toString() + "String_Node_Str"+ aCalendar.toString(),controlCalendar.toString().equals(aCalendar.toString()));
}
Program: 68326
Project: 68326
Buggy source:
@Test public void noargsTest(){
  Invocation invocation=new Invocation("String_Node_Str");
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(xrService.getORSession().getProject().getDatasourceLogin().getPlatform() instanceof OraclePlatform ? VALUE_1_XML : VALUE_0_XML));
  assertTrue("String_Node_Str",comparer.isNodeEqual(controlDoc,doc));
}

Fixed version (ground truth):
@Test public void noargsTest(){
  Invocation invocation=new Invocation("String_Node_Str");
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(xrService.getORSession().getProject().getDatasourceLogin().getPlatform() instanceof MySQLPlatform ? VALUE_0_XML : VALUE_1_XML));
  assertTrue("String_Node_Str",comparer.isNodeEqual(controlDoc,doc));
}
Program: 68327
Project: 68327
Buggy source:
@Test public void varcharTest(){
  Invocation invocation=new Invocation("String_Node_Str");
  invocation.setParameter("String_Node_Str","String_Node_Str");
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(xrService.getORSession().getProject().getDatasourceLogin().getPlatform() instanceof OraclePlatform ? VALUE_1_XML : VALUE_0_XML));
  assertTrue("String_Node_Str",comparer.isNodeEqual(controlDoc,doc));
}

Fixed version (ground truth):
@Test public void varcharTest(){
  Invocation invocation=new Invocation("String_Node_Str");
  invocation.setParameter("String_Node_Str","String_Node_Str");
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(xrService.getORSession().getProject().getDatasourceLogin().getPlatform() instanceof MySQLPlatform ? VALUE_0_XML : VALUE_1_XML));
  assertTrue("String_Node_Str",comparer.isNodeEqual(controlDoc,doc));
}
Program: 68331
Project: 68331
Buggy source:
@Override public void buildSessions(){
  XMLContext context=new XMLContext(new EclipseLinkObjectPersistenceRuntimeXMLProject());
  XMLUnmarshaller unmarshaller=context.createUnmarshaller();
  Project orProject=(Project)unmarshaller.unmarshal(new StringReader(RELATIONSHIPS_OR_PROJECT));
  DatasourceLogin login=new DatabaseLogin();
  login.setUserName(username);
  login.setPassword(password);
  ((DatabaseLogin)login).setConnectionString(url);
  ((DatabaseLogin)login).setDriverClassName(driver);
  Platform platform=new OraclePlatform();
  login.setDatasourcePlatform(platform);
  ((DatabaseLogin)login).bindAllParameters();
  orProject.setDatasourceLogin(login);
  Project oxProject=(Project)unmarshaller.unmarshal(new StringReader(RELATIONSHIPS_OX_PROJECT));
  xrService.setORSession(orProject.createDatabaseSession());
  xrService.getORSession().dontLogMessages();
  xrService.setXMLContext(new XMLContext(oxProject));
  xrService.setOXSession(xrService.getXMLContext().getSession(0));
}

Fixed version (ground truth):
@Override public void buildSessions(){
  XMLContext context=new XMLContext(new EclipseLinkObjectPersistenceRuntimeXMLProject());
  XMLUnmarshaller unmarshaller=context.createUnmarshaller();
  Project orProject=(Project)unmarshaller.unmarshal(new StringReader(RELATIONSHIPS_OR_PROJECT));
  DatasourceLogin login=new DatabaseLogin();
  login.setUserName(username);
  login.setPassword(password);
  ((DatabaseLogin)login).setConnectionString(url);
  ((DatabaseLogin)login).setDriverClassName(driver);
  Platform platform=new MySQLPlatform();
  login.setDatasourcePlatform(platform);
  ((DatabaseLogin)login).bindAllParameters();
  orProject.setDatasourceLogin(login);
  Project oxProject=(Project)unmarshaller.unmarshal(new StringReader(RELATIONSHIPS_OX_PROJECT));
  xrService.setORSession(orProject.createDatabaseSession());
  xrService.getORSession().dontLogMessages();
  xrService.setXMLContext(new XMLContext(oxProject));
  xrService.setOXSession(xrService.getXMLContext().getSession(0));
}
Program: 68333
Project: 68333
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new AdvancedQueryTestSuite("String_Node_Str"));
  suite.addTest(new AdvancedQueryTestSuite("String_Node_Str"));
  suite.addTest(new AdvancedQueryTestSuite("String_Node_Str"));
  suite.addTest(new AdvancedQueryTestSuite("String_Node_Str"));
  suite.addTest(new AdvancedQueryTestSuite("String_Node_Str"));
  return new TestSetup(suite){
    protected void tearDown(){
      clearCache();
    }
    protected void setUp(){
      DatabaseSession session=JUnitTestCase.getServerSession();
      EmployeePopulator employeePopulator=new EmployeePopulator();
      new AdvancedTableCreator().replaceTables(session);
      comparer=new JUnitDomainObjectComparer();
      comparer.setSession((AbstractSession)session.getActiveSession());
      employeePopulator.buildExamples();
      employeePopulator.persistExample(session);
    }
  }
;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new AdvancedQueryTestSuite("String_Node_Str"));
  suite.addTest(new AdvancedQueryTestSuite("String_Node_Str"));
  suite.addTest(new AdvancedQueryTestSuite("String_Node_Str"));
  suite.addTest(new AdvancedQueryTestSuite("String_Node_Str"));
  suite.addTest(new AdvancedQueryTestSuite("String_Node_Str"));
  suite.addTest(new AdvancedQueryTestSuite("String_Node_Str"));
  return new TestSetup(suite){
    protected void tearDown(){
      clearCache();
    }
    protected void setUp(){
      DatabaseSession session=JUnitTestCase.getServerSession();
      EmployeePopulator employeePopulator=new EmployeePopulator();
      new AdvancedTableCreator().replaceTables(session);
      comparer=new JUnitDomainObjectComparer();
      comparer.setSession((AbstractSession)session.getActiveSession());
      employeePopulator.buildExamples();
      employeePopulator.persistExample(session);
    }
  }
;
}
Program: 68334
Project: 68334
Buggy source:
public boolean equals(java.lang.Object arg0){
  if (!(arg0 instanceof Child)) {
    return false;
  }
  return id == ((Child)arg0).id;
}

Fixed version (ground truth):
public boolean equals(java.lang.Object arg0){
  if (!(arg0 instanceof Child)) {
    return false;
  }
  Child c2=(Child)arg0;
  if ((id == c2.id) || ((id != null) && (c2.id != null) && id.equals(c2.id))) {
    return true;
  }
  return false;
}
Program: 68335
Project: 68335
Buggy source:
protected void setup() throws Exception {
  originalSession=getExecutor().getSession();
  createObject();
  try {
    LocateRegistry.createRegistry(41099);
  }
 catch (  Exception e) {
  }
  cluster1Session=buildSession("String_Node_Str");
  cluster1Session.login();
  cluster2Session=buildSession("String_Node_Str");
  cluster2Session.login();
  Thread.sleep(5000);
  policy1=disableOptimisticLocking(cluster1Session);
  policy2=disableOptimisticLocking(cluster2Session);
}

Fixed version (ground truth):
protected void setup() throws Exception {
  originalSession=getExecutor().getSession();
  originalSession.getIdentityMapAccessor().initializeAllIdentityMaps();
  createObject();
  try {
    LocateRegistry.createRegistry(41099);
  }
 catch (  Exception e) {
  }
  cluster1Session=buildSession("String_Node_Str");
  cluster1Session.login();
  cluster2Session=buildSession("String_Node_Str");
  cluster2Session.login();
  Thread.sleep(5000);
  policy1=disableOptimisticLocking(cluster1Session);
  policy2=disableOptimisticLocking(cluster2Session);
}
Program: 68336
Project: 68336
Buggy source:
/** 
 * INTERNAL: This method returns the application ClassLoader. The parent application ClassLoader is returned when running in a J2EE client  either in a web or ejb container to match a weak reference to a particular  HelperContext.
 */
protected ClassLoader getContextClassLoader(){
  ClassLoader classLoader=Thread.currentThread().getContextClassLoader();
  String classLoaderName=classLoader.getClass().getName();
  if (classLoaderName.startsWith("String_Node_Str")) {
    if ((classLoader.getParent() != null) && ((classLoader.toString().indexOf(SDOConstants.CLASSLOADER_WEB_FRAGMENT) != -1) || (classLoader.toString().indexOf(SDOConstants.CLASSLOADER_EJB_FRAGMENT) != -1))) {
      classLoader=classLoader.getParent();
    }
  }
 else   if (classLoaderName.startsWith("String_Node_Str")) {
    final int systemLoaderOffest=4;
    ClassLoader systemLoader=ClassLoader.getSystemClassLoader();
    ClassLoader currentLoader=classLoader;
    ArrayList<ClassLoader> loaders=new ArrayList<ClassLoader>();
    loaders.add(currentLoader);
    while (currentLoader.getParent() != null) {
      currentLoader=currentLoader.getParent();
      loaders.add(currentLoader);
      if (currentLoader.getParent() == systemLoader) {
        if (loaders.size() >= 4) {
          classLoader=loaders.get(loaders.size() - systemLoaderOffest);
          break;
        }
      }
    }
  }
  return classLoader;
}

Fixed version (ground truth):
/** 
 * INTERNAL: This method returns the application ClassLoader. The parent application ClassLoader is returned when running in a J2EE client  either in a web or ejb container to match a weak reference to a particular  HelperContext.
 */
protected ClassLoader getContextClassLoader(){
  ClassLoader classLoader=Thread.currentThread().getContextClassLoader();
  String classLoaderName=classLoader.getClass().getName();
  if (classLoaderName.startsWith("String_Node_Str")) {
    if ((classLoader.getParent() != null) && ((classLoader.toString().indexOf(SDOConstants.CLASSLOADER_WEB_FRAGMENT) != -1) || (classLoader.toString().indexOf(SDOConstants.CLASSLOADER_EJB_FRAGMENT) != -1))) {
      classLoader=classLoader.getParent();
    }
  }
 else   if (classLoaderName.startsWith("String_Node_Str")) {
    final int systemLoaderOffest=3;
    ClassLoader systemLoader=ClassLoader.getSystemClassLoader();
    ClassLoader currentLoader=classLoader;
    ArrayList<ClassLoader> loaders=new ArrayList<ClassLoader>();
    loaders.add(currentLoader);
    while (currentLoader.getParent() != null) {
      currentLoader=currentLoader.getParent();
      loaders.add(currentLoader);
      if (currentLoader.getParent() == systemLoader) {
        if (loaders.size() >= 4) {
          classLoader=loaders.get(loaders.size() - systemLoaderOffest);
          break;
        }
      }
    }
  }
  return classLoader;
}
Program: 68337
Project: 68337
Buggy source:
/** 
 * Create a DataObject of the Type specified.
 * @param type The Type.
 * @return the created DataObject.
 * @throws IllegalArgumentException if the Typecannot be instantiated by this factory.
 */
public DataObject create(Type type){
  if (type.isAbstract() || type.isDataType()) {
    throw new IllegalArgumentException(SDOException.errorCreatingDataObjectForType(type.getURI(),type.getName()));
  }
  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):
/** 
 * Create a DataObject of the Type specified.
 * @param type The Type.
 * @return the created DataObject.
 * @throws IllegalArgumentException if the Typecannot be instantiated by this factory.
 */
public DataObject create(Type type){
  if (type.isAbstract()) {
    throw new IllegalArgumentException(SDOException.errorCreatingDataObjectForType(type.getURI(),type.getName()));
  }
  if (type.isDataType()) {
    SDOTypeHelper sth=(SDOTypeHelper)aHelperContext.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;
}
Program: 68342
Project: 68342
Buggy source:
/** 
 * Return the Type for this interfaceClass or null if not found.
 * @param interfaceClass is the interface for the DataObject's Type -type.getInstanceClass();
 * @return the Type for this interfaceClass or null if not found.
 */
public SDOType getType(Class interfaceClass){
  SDOType type=(SDOType)getInterfacesToSDOTypeHashMap().get(interfaceClass);
  if (type != null) {
    return type;
  }
  Iterator iter=getTypesHashMap().keySet().iterator();
  while (iter.hasNext()) {
    QName key=(QName)iter.next();
    SDOType value=(SDOType)getTypesHashMap().get(key);
    if (value.getInstanceClass() == interfaceClass) {
      return value;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return the Type for this interfaceClass or null if not found.
 * @param interfaceClass is the interface for the DataObject's Type -type.getInstanceClass();
 * @return the Type for this interfaceClass or null if not found.
 */
public SDOType getType(Class interfaceClass){
  SDOType type=(SDOType)getInterfacesToSDOTypeHashMap().get(interfaceClass);
  if (type != null) {
    return type;
  }
  Iterator iter=getTypesHashMap().keySet().iterator();
  while (iter.hasNext()) {
    QName key=(QName)iter.next();
    SDOType value=(SDOType)getTypesHashMap().get(key);
    if (value.getInstanceClass() == interfaceClass) {
      return value;
    }
  }
  return getTypeForSimpleJavaType(interfaceClass);
}
Program: 68345
Project: 68345
Buggy source:
public SchemaFactory getSchemaFactory(){
  if (null == schemaFactory) {
    schemaFactory=SchemaFactory.newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI);
  }
  return schemaFactory;
}

Fixed version (ground truth):
public SchemaFactory getSchemaFactory(){
  if (null == schemaFactory) {
    schemaFactory=SchemaFactory.newInstance(XMLConstants.SCHEMA_URL);
  }
  return schemaFactory;
}
Program: 68346
Project: 68346
Buggy source:
public void testName002Positive() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{Name002.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
  }
  assertTrue("String_Node_Str" + msg,exception == false);
}

Fixed version (ground truth):
public void testName002Positive() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{Name002.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(XMLConstants.SCHEMA_URL);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
  }
  assertTrue("String_Node_Str" + msg,exception == false);
}
Program: 68347
Project: 68347
Buggy source:
public void testNamespace001Positive() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{NameSpace001.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.getMessage();
  }
  assertTrue("String_Node_Str" + msg,exception == false);
}

Fixed version (ground truth):
public void testNamespace001Positive() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{NameSpace001.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(XMLConstants.SCHEMA_URL);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.getMessage();
  }
  assertTrue("String_Node_Str" + msg,exception == false);
}
Program: 68348
Project: 68348
Buggy source:
public void testName001Positive() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{Name001.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.toString();
  }
  assertTrue("String_Node_Str" + msg,exception == false);
}

Fixed version (ground truth):
public void testName001Positive() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{Name001.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(XMLConstants.SCHEMA_URL);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.toString();
  }
  assertTrue("String_Node_Str" + msg,exception == false);
}
Program: 68349
Project: 68349
Buggy source:
public void testName001Negative() throws Exception {
  boolean exception=false;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{Name001.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
  }
  assertFalse("String_Node_Str",exception == false);
}

Fixed version (ground truth):
public void testName001Negative() throws Exception {
  boolean exception=false;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{Name001.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(XMLConstants.SCHEMA_URL);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
  }
  assertFalse("String_Node_Str",exception == false);
}
Program: 68350
Project: 68350
Buggy source:
public void testNamespace001Negative() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{NameSpace001.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.getMessage();
  }
  assertFalse("String_Node_Str" + msg,exception == false);
}

Fixed version (ground truth):
public void testNamespace001Negative() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{NameSpace001.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(XMLConstants.SCHEMA_URL);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.getMessage();
  }
  assertFalse("String_Node_Str" + msg,exception == false);
}
Program: 68351
Project: 68351
Buggy source:
public void testName002Negative() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{Name002.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.getMessage();
  }
  assertFalse("String_Node_Str" + msg,exception == false);
}

Fixed version (ground truth):
public void testName002Negative() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{Name002.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(XMLConstants.SCHEMA_URL);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.getMessage();
  }
  assertFalse("String_Node_Str" + msg,exception == false);
}
Program: 68352
Project: 68352
Buggy source:
public void testBaseType001cPositive() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{BaseType001c.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.toString();
  }
  assertTrue("String_Node_Str" + msg,exception == false);
}

Fixed version (ground truth):
public void testBaseType001cPositive() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{BaseType001c.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(XMLConstants.SCHEMA_URL);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.toString();
  }
  assertTrue("String_Node_Str" + msg,exception == false);
}
Program: 68353
Project: 68353
Buggy source:
public void testBaseType001cNegative() throws Exception {
  boolean exception=false;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{BaseType001c.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
  }
  assertFalse("String_Node_Str",exception == false);
}

Fixed version (ground truth):
public void testBaseType001cNegative() throws Exception {
  boolean exception=false;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{BaseType001c.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(XMLConstants.SCHEMA_URL);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
  }
  assertFalse("String_Node_Str",exception == false);
}
Program: 68354
Project: 68354
Buggy source:
/** 
 * The following test expects a schema validation exception to occur. This is due to the fact that the supplied instance document does not contain a 'firstName' element, which is required as the  corresponding field in the Employee class contains the following annotation:  @XmlElement(required = true)
 * @throws Exception
 */
public void testEmployeeSchemaGenMissingRequiredElement() throws Exception {
  boolean exception=false;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  String msg="String_Node_Str";
  try {
    Class[] jClasses=new Class[]{Address.class,Employee.class,PhoneNumber.class,Department.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.getLocalizedMessage();
  }
  assertTrue("String_Node_Str",exception);
  assertTrue("String_Node_Str" + msg,msg.contains("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * The following test expects a schema validation exception to occur. This is due to the fact that the supplied instance document does not contain a 'firstName' element, which is required as the  corresponding field in the Employee class contains the following annotation:  @XmlElement(required = true)
 * @throws Exception
 */
public void testEmployeeSchemaGenMissingRequiredElement() throws Exception {
  boolean exception=false;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  String msg="String_Node_Str";
  try {
    Class[] jClasses=new Class[]{Address.class,Employee.class,PhoneNumber.class,Department.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(XMLConstants.SCHEMA_URL);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.getLocalizedMessage();
  }
  assertTrue("String_Node_Str",exception);
  assertTrue("String_Node_Str" + msg,msg.contains("String_Node_Str"));
}
Program: 68355
Project: 68355
Buggy source:
public void testEmployeeSchemaGeneration() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{Address.class,Employee.class,PhoneNumber.class,Department.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.toString();
  }
  assertTrue("String_Node_Str" + msg,exception == false);
}

Fixed version (ground truth):
public void testEmployeeSchemaGeneration() throws Exception {
  boolean exception=false;
  String msg=null;
  String src="String_Node_Str";
  String tmpdir=System.getenv("String_Node_Str");
  try {
    Class[] jClasses=new Class[]{Address.class,Employee.class,PhoneNumber.class,Department.class};
    Generator gen=new Generator(new JavaModelInputImpl(jClasses,new JavaModelImpl(Thread.currentThread().getContextClassLoader())));
    gen.generateSchemaFiles(tmpdir,null);
    SchemaFactory sFact=SchemaFactory.newInstance(XMLConstants.SCHEMA_URL);
    Schema theSchema=sFact.newSchema(new File(tmpdir + "String_Node_Str"));
    Validator validator=theSchema.newValidator();
    StreamSource ss=new StreamSource(new File(src));
    validator.validate(ss);
  }
 catch (  Exception ex) {
    exception=true;
    msg=ex.toString();
  }
  assertTrue("String_Node_Str" + msg,exception == false);
}
Program: 68356
Project: 68356
Buggy source:
public Schema getSchema(){
  try {
    return SchemaFactory.newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema();
  }
 catch (  org.xml.sax.SAXException ex) {
  }
  return null;
}

Fixed version (ground truth):
public Schema getSchema(){
  try {
    return SchemaFactory.newInstance(XMLConstants.SCHEMA_URL).newSchema();
  }
 catch (  org.xml.sax.SAXException ex) {
  }
  return null;
}
Program: 68358
Project: 68358
Buggy source:
/** 
 * INTERNAL: Return a valid Java set method name for a given string
 * @param s
 * @return
 */
public static String setMethodName(String s){
  StringBuffer stringbuffer=new StringBuffer();
  stringbuffer.append("String_Node_Str").append(methodName(s));
  return stringbuffer.toString();
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return a valid Java set method name for a given string
 * @param s
 * @return
 */
public static String setMethodName(String s){
  StringBuffer stringbuffer=new StringBuffer();
  stringbuffer.append(SET).append(methodName(s));
  return stringbuffer.toString();
}
Program: 68359
Project: 68359
Buggy source:
/** 
 * INTERNAL: Return a valid Java get method name for a given string
 * @param s
 * @return
 */
public static String getMethodName(String s){
  StringBuffer stringbuffer=new StringBuffer();
  stringbuffer.append("String_Node_Str").append(className(s,true,false,false));
  return stringbuffer.toString();
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return a valid Java get method name for a given string. This method will check the returnType to see if it is a boolean/Boolean:  if so, 'is' will be used in the method name instead of 'get'.
 * @param s
 * @param returnType
 * @return
 */
public static String getMethodName(String s,String returnType){
  if (returnType.equals(ClassConstants.PBOOLEAN.getName()) || returnType.equals(ClassConstants.BOOLEAN.getName())) {
    StringBuffer stringbuffer=new StringBuffer();
    stringbuffer.append(IS).append(SDOUtil.className(s,true,false,false));
    return stringbuffer.toString();
  }
  return getMethodName(s);
}