nus-yam/ex-repair huggingface dataset:
Program: 68067
Project: 68067
Buggy source:
public void registerTypes(){
  SDOType bytesType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.BYTES);
  SDOType propertyType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.PROPERTY);
  SDOType stringType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.STRING);
  SDOType typeType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.TYPE);
  DataObject customerType=dataFactory.create(typeType);
  customerType.set("String_Node_Str",getControlRootURI());
  customerType.set("String_Node_Str","String_Node_Str");
  addProperty(customerType,"String_Node_Str",stringType,true,false,true);
  addProperty(customerType,"String_Node_Str",stringType,true,false,true);
  DataObject photoProp=addProperty(customerType,"String_Node_Str",bytesType,true,true,true);
  photoProp.set(SDOConstants.MIME_TYPE_PROPERTY,"String_Node_Str");
  Type customerSDOType=typeHelper.define(customerType);
  DataObject propDO=dataFactory.create(propertyType);
  propDO.set("String_Node_Str",getControlRootName());
  propDO.set("String_Node_Str",customerSDOType);
  typeHelper.defineOpenContentProperty(getControlRootURI(),propDO);
}

Fixed version (ground truth):
public void registerTypes(){
  SDOType bytesType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.BYTES);
  SDOType propertyType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.PROPERTY);
  SDOType stringType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.STRING);
  SDOType typeType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.TYPE);
  DataObject customerType=dataFactory.create(typeType);
  customerType.set("String_Node_Str",getControlRootURI());
  customerType.set("String_Node_Str","String_Node_Str");
  addProperty(customerType,"String_Node_Str",stringType,false,false,true);
  addProperty(customerType,"String_Node_Str",stringType,false,false,true);
  DataObject photoProp=addProperty(customerType,"String_Node_Str",bytesType,false,true,true);
  photoProp.set(SDOConstants.MIME_TYPE_PROPERTY,"String_Node_Str");
  Type customerSDOType=typeHelper.define(customerType);
  DataObject propDO=dataFactory.create(propertyType);
  propDO.set("String_Node_Str",getControlRootName());
  propDO.set("String_Node_Str",customerSDOType);
  typeHelper.defineOpenContentProperty(getControlRootURI(),propDO);
}
Program: 68068
Project: 68068
Buggy source:
public void registerTypes(){
  SDOType bytesType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.BYTES);
  SDOType propertyType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.PROPERTY);
  SDOType stringType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.STRING);
  SDOType typeType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.TYPE);
  DataObject customerType=dataFactory.create(typeType);
  customerType.set("String_Node_Str",getControlRootURI());
  customerType.set("String_Node_Str","String_Node_Str");
  addProperty(customerType,"String_Node_Str",stringType,true,false,true);
  addProperty(customerType,"String_Node_Str",stringType,true,false,true);
  DataObject photoProp=addProperty(customerType,"String_Node_Str",bytesType,true,false,true);
  photoProp.set(SDOConstants.MIME_TYPE_PROPERTY,"String_Node_Str");
  Type customerSDOType=typeHelper.define(customerType);
  DataObject propDO=dataFactory.create(propertyType);
  propDO.set("String_Node_Str",getControlRootName());
  propDO.set("String_Node_Str",customerSDOType);
  typeHelper.defineOpenContentProperty(getControlRootURI(),propDO);
}

Fixed version (ground truth):
public void registerTypes(){
  SDOType bytesType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.BYTES);
  SDOType propertyType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.PROPERTY);
  SDOType stringType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.STRING);
  SDOType typeType=(SDOType)typeHelper.getType(SDOConstants.SDO_URL,SDOConstants.TYPE);
  DataObject customerType=dataFactory.create(typeType);
  customerType.set("String_Node_Str",getControlRootURI());
  customerType.set("String_Node_Str","String_Node_Str");
  addProperty(customerType,"String_Node_Str",stringType,false,false,true);
  addProperty(customerType,"String_Node_Str",stringType,false,false,true);
  DataObject photoProp=addProperty(customerType,"String_Node_Str",bytesType,false,false,true);
  photoProp.set(SDOConstants.MIME_TYPE_PROPERTY,"String_Node_Str");
  Type customerSDOType=typeHelper.define(customerType);
  DataObject propDO=dataFactory.create(propertyType);
  propDO.set("String_Node_Str",getControlRootName());
  propDO.set("String_Node_Str",customerSDOType);
  typeHelper.defineOpenContentProperty(getControlRootURI(),propDO);
}
Program: 68070
Project: 68070
Buggy source:
/** 
 * INTERNAL: Ensure that each Setting in the settings list is also present in the valuesToSettings map 
 */
public void afterUnmarshal(){
  for (Iterator<Setting> setIt=getSettings().iterator(); setIt.hasNext(); ) {
    addValueToSettings(setIt.next());
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Ensure that each Setting in the settings list is also present in the valuesToSettings map
 */
public void afterUnmarshal(){
  for (Iterator<Setting> setIt=getSettings().iterator(); setIt.hasNext(); ) {
    addValueToSettings(setIt.next());
  }
}
Program: 68071
Project: 68071
Buggy source:
/** 
 * INTERNAL: Convenience method that returns the index of the Setting associated  with a given property in the Settings list
 * @param property
 * @return index of the Setting associated with a given property in the Settings list or -1 if not found
 */
public int getIndexForProperty(Property property){
  List<Key> keys=new ArrayList<Key>(valuesToSettings.keySet());
  for (int i=0; i < keys.size(); i++) {
    Key nextKey=keys.get(i);
    if (nextKey.getProperty() == property) {
      return settings.indexOf(valuesToSettings.get(nextKey));
    }
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Convenience method that returns the index of the Setting associated with a given property in the Settings list
 * @param property
 * @return index of the Setting associated with a given property in theSettings list or -1 if not found
 */
public int getIndexForProperty(Property property){
  List<Key> keys=new ArrayList<Key>(valuesToSettings.keySet());
  for (int i=0; i < keys.size(); i++) {
    Key nextKey=keys.get(i);
    if (nextKey.getProperty() == property) {
      return settings.indexOf(valuesToSettings.get(nextKey));
    }
  }
  return -1;
}
Program: 68072
Project: 68072
Buggy source:
/** 
 * INTERNAL: Convenience method that, given a many property and a value, returns the associated Setting's index in the Settings list.  For example, if a  sequence contains many properties "letters" and "numbers", such as  [A, 1, C, 2, B, D], and we are looking for the letter B, this method will return 2.  Although B is at index 4 of the Settings list, it is at index 2 of the list of "letters" - [A, C, B, D].    
 * @param property
 * @return index of the value's Setting in the list relative to a given property or -1 if not found.
 */
private int getIndexInList(Property manyProp,Object value){
  int returnIndex=-1;
  for (int i=0; i < settings.size(); i++) {
    Setting nextSetting=settings.get(i);
    Property prop=getProperty(nextSetting);
    if (prop.equals(manyProp)) {
      returnIndex++;
      if (value.equals(getValue(nextSetting))) {
        return returnIndex;
      }
    }
  }
  return returnIndex;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Convenience method that, given a many property and a value, returns the associated Setting's index in the Settings list. For example, if a sequence contains many properties "letters" and "numbers", such as [A, 1, C, 2, B, D], and we are looking for the letter B, this method will return 2. Although B is at index 4 of the Settings list, it is at index 2 of the list of "letters" - [A, C, B, D].
 * @param property
 * @return index of the value's Setting in the list relative to a givenproperty or -1 if not found.
 */
private int getIndexInList(Property manyProp,Object value){
  int returnIndex=-1;
  for (int i=0; i < settings.size(); i++) {
    Setting nextSetting=settings.get(i);
    Property prop=getProperty(nextSetting);
    if (prop.equals(manyProp)) {
      returnIndex++;
      if (value.equals(getValue(nextSetting))) {
        return returnIndex;
      }
    }
  }
  return returnIndex;
}
Program: 68073
Project: 68073
Buggy source:
/** 
 * INTERNAL: Prepare the receiver for execution in a session.
 */
public void prepareForExecution() throws QueryException {
  super.prepareForExecution();
  DatabaseCall databaseCall=this.getCall();
  if (databaseCall != null) {
    AbstractRecord parameters=this.getTranslationRow();
    if (parameters.isEmpty()) {
      parameters=new DatabaseRecord();
    }
    parameters.add(DatabaseCall.FIRSTRESULT_FIELD,this.getFirstResult());
    parameters.add(DatabaseCall.MAXROW_FIELD,session.getPlatform().computeMaxRowsForSQL(this.getFirstResult(),this.getMaxRows()));
    this.setTranslationRow(parameters);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Prepare the receiver for execution in a session.
 */
public void prepareForExecution() throws QueryException {
  super.prepareForExecution();
  DatabaseCall databaseCall=this.getCall();
  if (databaseCall != null && databaseCall.shouldIgnoreFirstRowMaxResultsSettings()) {
    AbstractRecord parameters=this.getTranslationRow();
    if (parameters.isEmpty()) {
      parameters=new DatabaseRecord();
    }
    parameters.add(DatabaseCall.FIRSTRESULT_FIELD,this.getFirstResult());
    parameters.add(DatabaseCall.MAXROW_FIELD,session.getPlatform().computeMaxRowsForSQL(this.getFirstResult(),this.getMaxRows()));
    this.setTranslationRow(parameters);
  }
}
Program: 68077
Project: 68077
Buggy source:
protected void testDefine(Source xsdSource,DefaultSchemaResolver schemaResolver){
  schemaResolver.setBaseSchemaLocation(getSchemaLocation());
  List types=((SDOXSDHelper)xsdHelper).define(xsdSource,schemaResolver);
  log("String_Node_Str");
  List<SDOType> controlTypes=getControlTypes();
  log(controlTypes);
  log("String_Node_Str");
  log(types);
  compare(getControlTypes(),types);
  try {
    FileInputStream inStream=new FileInputStream("String_Node_Str");
    XMLDocument theDoc=xmlHelper.load(inStream);
    assertNotNull(theDoc);
    assertNotNull(theDoc.getRootObject());
    DataObject shipToDO=theDoc.getRootObject().getDataObject("String_Node_Str");
    DataObject billToDo=theDoc.getRootObject().getDataObject("String_Node_Str");
    assertNotNull(shipToDO);
    assertNotNull(billToDo);
    DataObject shipToPhoneData=shipToDO.getDataObject("String_Node_Str");
    assertNotNull(shipToPhoneData);
    assertEquals("String_Node_Str",shipToPhoneData.getString("String_Node_Str"));
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
protected void testDefine(Source xsdSource,DefaultSchemaResolver schemaResolver){
  schemaResolver.setBaseSchemaLocation(getSchemaLocation());
  List types=((SDOXSDHelper)xsdHelper).define(xsdSource,schemaResolver);
  log("String_Node_Str");
  List<Type> controlTypes=getControlTypes();
  log(controlTypes);
  log("String_Node_Str");
  log(types);
  compare(getControlTypes(),types);
  try {
    FileInputStream inStream=new FileInputStream("String_Node_Str");
    XMLDocument theDoc=xmlHelper.load(inStream);
    assertNotNull(theDoc);
    assertNotNull(theDoc.getRootObject());
    DataObject shipToDO=theDoc.getRootObject().getDataObject("String_Node_Str");
    DataObject billToDo=theDoc.getRootObject().getDataObject("String_Node_Str");
    assertNotNull(shipToDO);
    assertNotNull(billToDo);
    DataObject shipToPhoneData=shipToDO.getDataObject("String_Node_Str");
    assertNotNull(shipToPhoneData);
    assertEquals("String_Node_Str",shipToPhoneData.getString("String_Node_Str"));
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail("String_Node_Str");
  }
}
Program: 68079
Project: 68079
Buggy source:
@Override public void endElement(String namespaceURI,String localName,String qName) throws SAXException {
  if (XMLConstants.XOP_URL.equals(namespaceURI) && (INCLUDE_ELEMENT_NAME.equals(localName) || INCLUDE_ELEMENT_NAME.equals(qName))) {
    XMLAttachmentUnmarshaller attachmentUnmarshaller=record.getUnmarshaller().getAttachmentUnmarshaller();
    Object data=attachmentUnmarshaller.getAttachmentAsByteArray(this.c_id);
    if (this.converter != null) {
      Converter converter=this.converter;
      if (converter instanceof XMLConverter) {
        data=((XMLConverter)converter).convertDataValueToObjectValue(data,record.getSession(),record.getUnmarshaller());
      }
 else {
        data=converter.convertDataValueToObjectValue(data,record.getSession());
      }
    }
    data=XMLBinaryDataHelper.getXMLBinaryDataHelper().convertObject(data,mapping.getAttributeClassification(),record.getSession());
    if (isCollection) {
      if (data != null) {
        record.addAttributeValue((ContainerValue)nodeValue,data);
      }
    }
 else {
      record.setAttributeValue(data,mapping);
    }
    record.getXMLReader().setContentHandler(record);
  }
 else {
    record.getXMLReader().setContentHandler(record);
    record.endElement(namespaceURI,localName,qName);
  }
}

Fixed version (ground truth):
@Override public void endElement(String namespaceURI,String localName,String qName) throws SAXException {
  if (XMLConstants.XOP_URL.equals(namespaceURI) && (INCLUDE_ELEMENT_NAME.equals(localName) || INCLUDE_ELEMENT_NAME.equals(qName))) {
    XMLAttachmentUnmarshaller attachmentUnmarshaller=record.getUnmarshaller().getAttachmentUnmarshaller();
    Object data=null;
    Class attributeClassification=null;
    if (isCollection) {
      attributeClassification=((XMLBinaryDataCollectionMapping)mapping).getCollectionContentType();
    }
 else {
      attributeClassification=mapping.getAttributeClassification();
    }
    if (attributeClassification.equals(XMLBinaryDataHelper.getXMLBinaryDataHelper().DATA_HANDLER)) {
      data=attachmentUnmarshaller.getAttachmentAsDataHandler(this.c_id);
    }
 else {
      data=attachmentUnmarshaller.getAttachmentAsByteArray(this.c_id);
    }
    if (this.converter != null) {
      Converter converter=this.converter;
      if (converter instanceof XMLConverter) {
        data=((XMLConverter)converter).convertDataValueToObjectValue(data,record.getSession(),record.getUnmarshaller());
      }
 else {
        data=converter.convertDataValueToObjectValue(data,record.getSession());
      }
    }
    data=XMLBinaryDataHelper.getXMLBinaryDataHelper().convertObject(data,mapping.getAttributeClassification(),record.getSession());
    if (isCollection) {
      if (data != null) {
        record.addAttributeValue((ContainerValue)nodeValue,data);
      }
    }
 else {
      record.setAttributeValue(data,mapping);
    }
    record.getXMLReader().setContentHandler(record);
  }
 else {
    record.getXMLReader().setContentHandler(record);
    record.endElement(namespaceURI,localName,qName);
  }
}
Program: 68080
Project: 68080
Buggy source:
/** 
 * INTERNAL: Prepare the receiver for execution in a session.
 */
public void prepareForExecution() throws QueryException {
  super.prepareForExecution();
  DatabaseCall databaseCall=this.getCall();
  if (databaseCall != null && databaseCall.shouldIgnoreFirstRowMaxResultsSettings()) {
    AbstractRecord parameters=this.getTranslationRow();
    if (parameters.isEmpty()) {
      parameters=new DatabaseRecord();
    }
    parameters.add(DatabaseCall.FIRSTRESULT_FIELD,this.getFirstResult());
    parameters.add(DatabaseCall.MAXROW_FIELD,session.getPlatform().computeMaxRowsForSQL(this.getFirstResult(),this.getMaxRows()));
    this.setTranslationRow(parameters);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Prepare the receiver for execution in a session.
 */
public void prepareForExecution() throws QueryException {
  super.prepareForExecution();
  DatabaseCall databaseCall=this.getCall();
  if (databaseCall != null) {
    AbstractRecord parameters=this.getTranslationRow();
    if (parameters.isEmpty()) {
      parameters=new DatabaseRecord();
    }
    parameters.add(DatabaseCall.FIRSTRESULT_FIELD,this.getFirstResult());
    parameters.add(DatabaseCall.MAXROW_FIELD,session.getPlatform().computeMaxRowsForSQL(this.getFirstResult(),this.getMaxRows()));
    this.setTranslationRow(parameters);
  }
}
Program: 68081
Project: 68081
Buggy source:
/** 
 * Prior to the fix for GF 2333, the query in this test would generate an invalid query key exception
 */
public void testInvertedSelectionCriteriaInvalidQueryKey(){
  Exception exception=null;
  try {
    String jpqlString="String_Node_Str";
    List resultList=createEntityManager().createQuery(jpqlString).getResultList();
  }
 catch (  Exception e) {
    e.printStackTrace();
    exception=e;
  }
  Assert.assertNull("String_Node_Str",exception);
}

Fixed version (ground truth):
/** 
 * Prior to the fix for GF 2333, the query in this test would generate an invalid query key exception
 */
public void testInvertedSelectionCriteriaInvalidQueryKey(){
  Exception exception=null;
  try {
    String jpqlString="String_Node_Str";
    List resultList=createEntityManager().createQuery(jpqlString).getResultList();
  }
 catch (  Exception e) {
    logThrowable(e);
    exception=e;
  }
  Assert.assertNull("String_Node_Str",exception);
}
Program: 68082
Project: 68082
Buggy source:
/** 
 * Tests fix for bug6070214 that using Oracle Rownum pagination with non-unique columns throws an SQl exception.
 */
public void testMaxAndFirstResultsOnDataQuery(){
  EntityManager em=createEntityManager();
  Exception exception=null;
  List resultList=null;
  clearCache();
  Query query=em.createQuery("String_Node_Str");
  try {
    query.setFirstResult(1);
    query.setMaxResults(1);
    resultList=query.getResultList();
  }
 catch (  Exception e) {
    e.printStackTrace();
    exception=e;
  }
  Assert.assertNull("String_Node_Str",exception);
  Assert.assertTrue("String_Node_Str" + resultList.size(),resultList.size() == 1);
}

Fixed version (ground truth):
/** 
 * Tests fix for bug6070214 that using Oracle Rownum pagination with non-unique columns throws an SQl exception.
 */
public void testMaxAndFirstResultsOnDataQuery(){
  EntityManager em=createEntityManager();
  Exception exception=null;
  List resultList=null;
  clearCache();
  Query query=em.createQuery("String_Node_Str");
  try {
    query.setFirstResult(1);
    query.setMaxResults(1);
    resultList=query.getResultList();
  }
 catch (  Exception e) {
    logThrowable(exception);
    exception=e;
  }
  Assert.assertNull("String_Node_Str",exception);
  Assert.assertTrue("String_Node_Str" + resultList.size(),resultList.size() == 1);
}
Program: 68083
Project: 68083
Buggy source:
/** 
 * Tests fix for bug6070214 that using Oracle Rownum pagination with group by throws an SQl exception.
 */
public void testMaxAndFirstResultsOnDataQueryWithGroupBy(){
  EntityManager em=createEntityManager();
  Exception exception=null;
  List resultList=null;
  clearCache();
  Query query=em.createQuery("String_Node_Str");
  try {
    query.setFirstResult(1);
    query.setMaxResults(1);
    resultList=query.getResultList();
  }
 catch (  Exception e) {
    e.printStackTrace();
    exception=e;
  }
  Assert.assertNull("String_Node_Str",exception);
  Assert.assertTrue("String_Node_Str" + resultList.size(),resultList.size() == 1);
}

Fixed version (ground truth):
/** 
 * Tests fix for bug6070214 that using Oracle Rownum pagination with group by throws an SQl exception.
 */
public void testMaxAndFirstResultsOnDataQueryWithGroupBy(){
  EntityManager em=createEntityManager();
  Exception exception=null;
  List resultList=null;
  clearCache();
  Query query=em.createQuery("String_Node_Str");
  try {
    query.setFirstResult(1);
    query.setMaxResults(1);
    resultList=query.getResultList();
  }
 catch (  Exception e) {
    logThrowable(exception);
    exception=e;
  }
  Assert.assertNull("String_Node_Str",exception);
  Assert.assertTrue("String_Node_Str" + resultList.size(),resultList.size() == 1);
}
Program: 68084
Project: 68084
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLUnitTestSuite("String_Node_Str"));
  return suite;
}
Program: 68085
Project: 68085
Buggy source:
/** 
 * Prior to the fix for GF 2333, the query in this test would a Null PK exception
 */
public void testInvertedSelectionCriteriaNullPK(){
  Exception exception=null;
  try {
    String jpqlString="String_Node_Str";
    List resultList=createEntityManager().createQuery(jpqlString).getResultList();
  }
 catch (  Exception e) {
    e.printStackTrace();
    exception=e;
  }
  Assert.assertNull("String_Node_Str",exception);
}

Fixed version (ground truth):
/** 
 * Prior to the fix for GF 2333, the query in this test would a Null PK exception
 */
public void testInvertedSelectionCriteriaNullPK(){
  Exception exception=null;
  try {
    String jpqlString="String_Node_Str";
    List resultList=createEntityManager().createQuery(jpqlString).getResultList();
  }
 catch (  Exception e) {
    logThrowable(exception);
    exception=e;
  }
  Assert.assertNull("String_Node_Str",exception);
}
Program: 68086
Project: 68086
Buggy source:
/** 
 * Configure the firstResult, maxRows and lock mode in the EclipseLink ReadQuery.
 */
protected void propagateResultProperties(){
  DatabaseQuery databaseQuery=getDatabaseQuery();
  if (databaseQuery.isReadQuery()) {
    ReadQuery readQuery=(ReadQuery)databaseQuery;
    if (maxResults >= 0) {
      cloneSharedQuery();
      readQuery=(ReadQuery)getDatabaseQuery();
      maxRows=maxResults + ((firstResultIndex >= 0) ? firstResultIndex : 0);
      readQuery.setMaxRows(maxRows);
      maxResults=-1;
    }
    if (firstResultIndex > -1) {
      cloneSharedQuery();
      readQuery=(ReadQuery)getDatabaseQuery();
      readQuery.setFirstResult(firstResultIndex);
      firstResultIndex=-1;
    }
  }
}

Fixed version (ground truth):
/** 
 * Configure the firstResult, maxRows and lock mode in the EclipseLink ReadQuery.
 */
protected void propagateResultProperties(){
  DatabaseQuery databaseQuery=getDatabaseQuery();
  if (databaseQuery.isReadQuery()) {
    ReadQuery readQuery=(ReadQuery)databaseQuery;
    if (maxResults >= 0) {
      cloneSharedQuery();
      readQuery=(ReadQuery)getDatabaseQuery();
      int maxRows=maxResults + ((firstResultIndex >= 0) ? firstResultIndex : 0);
      readQuery.setMaxRows(maxRows);
      maxResults=-1;
      if (readQuery.isObjectLevelReadQuery()) {
        ((org.eclipse.persistence.queries.ObjectLevelReadQuery)readQuery).setShouldOuterJoinSubclasses(true);
      }
    }
    if (firstResultIndex > -1) {
      cloneSharedQuery();
      readQuery=(ReadQuery)getDatabaseQuery();
      readQuery.setFirstResult(firstResultIndex);
      firstResultIndex=-1;
      if (readQuery.isObjectLevelReadQuery()) {
        ((org.eclipse.persistence.queries.ObjectLevelReadQuery)readQuery).setShouldOuterJoinSubclasses(true);
      }
    }
  }
}
Program: 68087
Project: 68087
Buggy source:
public SDOHelperContext(ClassLoader aClassLoader){
  super();
  copyHelper=new SDOCopyHelper(this);
  dataFactory=new SDODataFactoryDelegate(this);
  dataHelper=new SDODataHelper(this);
  equalityHelper=new SDOEqualityHelper(this);
  xmlHelper=new SDOXMLHelperDelegate(this,aClassLoader);
  typeHelper=new SDOTypeHelperDelegate(this);
  xsdHelper=new SDOXSDHelperDelegate(this);
}

Fixed version (ground truth):
/** 
 * This constructor creates the helper instances.
 * @param aClassLoader
 */
public SDOHelperContext(ClassLoader aClassLoader){
  super();
  copyHelper=new SDOCopyHelper(this);
  dataFactory=new SDODataFactoryDelegate(this);
  dataHelper=new SDODataHelper(this);
  equalityHelper=new SDOEqualityHelper(this);
  xmlHelper=new SDOXMLHelperDelegate(this,aClassLoader);
  typeHelper=new SDOTypeHelperDelegate(this);
  xsdHelper=new SDOXSDHelperDelegate(this);
}
Program: 68088
Project: 68088
Buggy source:
/** 
 * INTERNAL:  Return the helper context for a given key.  The key will either be a ClassLoader or a String (representing an application name). A new context will be created and put in the map if none exists  for the given key.
 */
public static HelperContext getHelperContext(){
  Object key=getDelegateMapKey();
  HelperContext hCtx=helperContexts.get(key);
  if (hCtx == null) {
    hCtx=new SDOHelperContext();
    helperContexts.put(key,hCtx);
  }
  return hCtx;
}

Fixed version (ground truth):
/** 
 * INTERNAL:  Return the helper context for a given key.  The key will either be a ClassLoader or a String (representing an application name). A new context will be created and put in the map if none exists  for the given key. The key is assumed to be non-null -  getDelegateKey should always return either a string representing the application name (for WLS) or a class loader.  This is relevant since 'putIfAbsent' will  throw a null pointer exception if the key is null.   
 */
public static HelperContext getHelperContext(){
  Object key=getDelegateMapKey();
  HelperContext hCtx=helperContexts.get(key);
  if (hCtx == null) {
    hCtx=new SDOHelperContext();
    HelperContext existingCtx=helperContexts.putIfAbsent(key,hCtx);
    if (existingCtx != null) {
      hCtx=existingCtx;
    }
  }
  return hCtx;
}
Program: 68089
Project: 68089
Buggy source:
/** 
 * INTERNAL: This convenience method will look up a WebLogic execute thread from the runtime  MBean tree.  The execute thread contains application information.  This code  will use the name of the current thread to lookup the corresponding ExecuteThread. The ExecuteThread will allow us to obtain the application name (and version, etc). Note that the MBeanServer and ThreadPoolRuntime instances will be cached for  performance.
 * @return application name or null if the name cannot be obtained
 */
private static Object getExecuteThread(){
  if (wlsMBeanServer == null) {
    Context weblogicContext=null;
    try {
      weblogicContext=new InitialContext();
      try {
        wlsMBeanServer=(MBeanServer)weblogicContext.lookup(WLS_ENV_CONTEXT_LOOKUP);
      }
 catch (      NamingException e) {
        try {
          wlsMBeanServer=(MBeanServer)weblogicContext.lookup(WLS_CONTEXT_LOOKUP);
        }
 catch (        NamingException ne) {
        }
      }
    }
 catch (    NamingException nex) {
    }
  }
  if (wlsMBeanServer != null) {
    if (wlsThreadPoolRuntime == null) {
      try {
        ObjectName service=new ObjectName(WLS_SERVICE_KEY);
        ObjectName serverRuntime=(ObjectName)wlsMBeanServer.getAttribute(service,WLS_SERVER_RUNTIME);
        wlsThreadPoolRuntime=(ObjectName)wlsMBeanServer.getAttribute(serverRuntime,WLS_THREADPOOL_RUNTIME);
      }
 catch (      Exception x) {
      }
    }
    if (wlsThreadPoolRuntime != null) {
      try {
        return wlsMBeanServer.invoke(wlsThreadPoolRuntime,WLS_EXECUTE_THREAD_GET_METHOD_NAME,new Object[]{Thread.currentThread().getName()},new String[]{String.class.getName()});
      }
 catch (      Exception e) {
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * INTERNAL: This convenience method will look up a WebLogic execute thread from the runtime  MBean tree.  The execute thread contains application information.  This code  will use the name of the current thread to lookup the corresponding ExecuteThread. The ExecuteThread will allow us to obtain the application name (and version, etc).
 * @return application name or null if the name cannot be obtained
 */
private static Object getExecuteThread(){
  if (getWLSMBeanServer() != null) {
    if (wlsThreadPoolRuntime == null) {
      try {
        ObjectName service=new ObjectName(WLS_SERVICE_KEY);
        ObjectName serverRuntime=(ObjectName)wlsMBeanServer.getAttribute(service,WLS_SERVER_RUNTIME);
        wlsThreadPoolRuntime=(ObjectName)wlsMBeanServer.getAttribute(serverRuntime,WLS_THREADPOOL_RUNTIME);
      }
 catch (      Exception x) {
        return null;
      }
    }
    try {
      return wlsMBeanServer.invoke(wlsThreadPoolRuntime,WLS_EXECUTE_THREAD_GET_METHOD_NAME,new Object[]{Thread.currentThread().getName()},new String[]{String.class.getName()});
    }
 catch (    Exception e) {
    }
  }
  return null;
}
Program: 68090
Project: 68090
Buggy source:
public void reset(){
  ((SDOTypeHelper)getTypeHelper()).reset();
  ((SDOXMLHelper)getXMLHelper()).reset();
  ((SDOXSDHelper)getXSDHelper()).reset();
}

Fixed version (ground truth):
/** 
 * Reset the Type,XML and XSD helper instances.
 */
public void reset(){
  ((SDOTypeHelper)getTypeHelper()).reset();
  ((SDOXMLHelper)getXMLHelper()).reset();
  ((SDOXSDHelper)getXSDHelper()).reset();
}
Program: 68093
Project: 68093
Buggy source:
public void setDefaultValue(String defaultValue){
  this.defaultValue=defaultValue;
}

Fixed version (ground truth):
public void setDefaultValue(String defaultValue){
  this.defaultValue=defaultValue;
  isSetDefaultValue=true;
}
Program: 68095
Project: 68095
Buggy source:
private void setDefaultValue(SDOProperty p,SimpleComponent sc){
  if (sc.getFixed() != null) {
    Object convertedValue=convertDefaultValue(p.getType(),sc.getFixed());
    p.setDefault(convertedValue);
  }
 else   if (sc.getDefaultValue() != null) {
    Object convertedValue=convertDefaultValue(p.getType(),sc.getDefaultValue());
    p.setDefault(convertedValue);
  }
}

Fixed version (ground truth):
private void setDefaultValue(SDOProperty p,SimpleComponent sc){
  if (sc.getFixed() != null) {
    Object convertedValue=convertDefaultValue(p.getType(),sc.getFixed());
    p.setDefault(convertedValue);
  }
 else   if (sc.getDefaultValue() != null) {
    Object convertedValue=convertDefaultValue(p.getType(),sc.getDefaultValue());
    p.setDefault(convertedValue);
  }
 else {
    if (p.getType().getQName().equals(SDOConstants.SDO_STRING.getQName()) && sc.isSetDefaultValue()) {
      p.setDefault("String_Node_Str");
    }
  }
}
Program: 68096
Project: 68096
Buggy source:
/** 
 * Creates an XMLDocument with the specified XML rootElement for the DataObject.
 * @param dataObject specifies DataObject to be saved
 * @param rootElementURI the Target Namespace URI of the root XML element
 * @param rootElementName the Name of the root XML element
 * @return XMLDocument a new XMLDocument set with the specified parameters.
 */
public XMLDocument createDocument(DataObject dataObject,String rootElementURI,String rootElementName){
  SDOXMLDocument document=new SDOXMLDocument();
  document.setRootObject(dataObject);
  document.setRootElementURI(rootElementURI);
  if (rootElementName != null) {
    document.setRootElementName(rootElementName);
  }
  document.setEncoding(SDOXMLDocument.DEFAULT_XML_ENCODING);
  document.setXMLVersion(SDOXMLDocument.DEFAULT_XML_VERSION);
  return document;
}

Fixed version (ground truth):
/** 
 * Creates an XMLDocument with the specified XML rootElement for the DataObject.
 * @param dataObject specifies DataObject to be saved
 * @param rootElementURI the Target Namespace URI of the root XML element
 * @param rootElementName the Name of the root XML element
 * @return XMLDocument a new XMLDocument set with the specified parameters.
 */
public XMLDocument createDocument(DataObject dataObject,String rootElementURI,String rootElementName){
  SDOXMLDocument document=new SDOXMLDocument();
  document.setRootObject(dataObject);
  document.setRootElementURI(rootElementURI);
  if (rootElementName != null) {
    document.setRootElementName(rootElementName);
  }
  Property globalProp=getHelperContext().getXSDHelper().getGlobalProperty(rootElementURI,rootElementName,true);
  if (null != globalProp) {
    document.setSchemaType(((SDOType)globalProp.getType()).getXsdType());
  }
  document.setEncoding(SDOXMLDocument.DEFAULT_XML_ENCODING);
  document.setXMLVersion(SDOXMLDocument.DEFAULT_XML_VERSION);
  return document;
}
Program: 68097
Project: 68097
Buggy source:
/** 
 * Return the method for the WebSphere JDBC connection wrapper vendorConnection.
 */
protected Method getVendorConnectionMethod(){
  if ((this.vendorConnectionMethod == null) && (!getWebsphereUtilClass().equals(void.class))) {
    try {
      Class args[]=new Class[1];
      args[0]=getWebsphereConnectionClass();
      this.vendorConnectionMethod=PrivilegedAccessHelper.getDeclaredMethod(getWebsphereUtilClass(),"String_Node_Str",new Class[0]);
    }
 catch (    NoSuchMethodException exception) {
      getDatabaseSession().getSessionLog().logThrowable(SessionLog.WARNING,exception);
    }
  }
  return this.vendorConnectionMethod;
}

Fixed version (ground truth):
/** 
 * Return the method for the WebSphere JDBC connection wrapper vendorConnection.
 */
protected Method getVendorConnectionMethod(){
  if ((this.vendorConnectionMethod == null) && (!getWebsphereUtilClass().equals(void.class))) {
    try {
      Class args[]=new Class[1];
      args[0]=getWebsphereConnectionClass();
      this.vendorConnectionMethod=PrivilegedAccessHelper.getDeclaredMethod(getWebsphereUtilClass(),"String_Node_Str",args);
    }
 catch (    NoSuchMethodException exception) {
      getDatabaseSession().getSessionLog().logThrowable(SessionLog.WARNING,exception);
    }
  }
  return this.vendorConnectionMethod;
}
Program: 68098
Project: 68098
Buggy source:
/** 
 * Unwraps the WebSphere JDBC connection wrapping using the WebLogic API reflectively.
 */
@Override public Connection unwrapConnection(Connection connection){
  if (getWebsphereConnectionClass().isInstance(connection) && getVendorConnectionMethod() != null) {
    try {
      return (Connection)PrivilegedAccessHelper.invokeMethod(getVendorConnectionMethod(),connection);
    }
 catch (    IllegalAccessException exception) {
      getDatabaseSession().getSessionLog().logThrowable(SessionLog.WARNING,exception);
    }
catch (    InvocationTargetException exception) {
      getDatabaseSession().getSessionLog().logThrowable(SessionLog.WARNING,exception);
    }
  }
  return super.unwrapConnection(connection);
}

Fixed version (ground truth):
/** 
 * Unwraps the WebSphere JDBC connection wrapping using the WebLogic API reflectively.
 */
@Override public Connection unwrapConnection(Connection connection){
  if (getWebsphereConnectionClass().isInstance(connection) && getVendorConnectionMethod() != null) {
    try {
      return (Connection)PrivilegedAccessHelper.invokeMethod(getVendorConnectionMethod(),null,new Object[]{connection});
    }
 catch (    IllegalAccessException exception) {
      getDatabaseSession().getSessionLog().logThrowable(SessionLog.WARNING,exception);
    }
catch (    InvocationTargetException exception) {
      getDatabaseSession().getSessionLog().logThrowable(SessionLog.WARNING,exception);
    }
  }
  return super.unwrapConnection(connection);
}
Program: 68099
Project: 68099
Buggy source:
public void addTests(){
  addTest(getReadObjectTestSuite());
  addTest(getReadAllTestSuite());
  addTest(getSessionBrokerClientQueryTestSuite());
  addTest(new SessionBrokerPlatformTest());
  addTest(new ReadOnlyClassesInSessionBrokerTest());
}

Fixed version (ground truth):
public void addTests(){
  addTest(getReadObjectTestSuite());
  addTest(getReadAllTestSuite());
  addTest(getSessionBrokerClientQueryTestSuite());
  addTest(new SessionBrokerPlatformTest());
  addTest(new ReadOnlyClassesInSessionBrokerTest());
  addTest(new VerifyClientBrokerCreationTest());
}
Program: 68101
Project: 68101
Buggy source:
/** 
 * INTERNAL: Return a copy (not using clone) of a session broker.
 */
protected SessionBroker copySessionBroker(){
  SessionBroker broker=new SessionBroker(this.getSessionNamesByClass());
  broker.accessor=getAccessor();
  broker.name=getName();
  broker.sessionLog=getSessionLog();
  broker.project=project;
  broker.eventManager=getEventManager().clone(broker);
  return broker;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return a copy (not using clone) of a session broker.
 */
protected SessionBroker copySessionBroker(){
  SessionBroker broker=new SessionBroker(this.getSessionNamesByClass());
  broker.accessor=getAccessor();
  broker.name=getName();
  broker.sessionLog=getSessionLog();
  broker.project=project;
  broker.eventManager=getEventManager().clone(broker);
  broker.shouldPropagateChanges=shouldPropagateChanges;
  return broker;
}
Program: 68102
Project: 68102
Buggy source:
public void setNamespaceURI(String namespaceURI){
  if ("String_Node_Str".equals(namespaceURI)) {
    this.namespaceURI=null;
  }
 else {
    this.namespaceURI=namespaceURI;
  }
}

Fixed version (ground truth):
public void setNamespaceURI(String namespaceURI){
  if (isSelfFragment || "String_Node_Str".equals(namespaceURI)) {
    this.namespaceURI=null;
  }
 else {
    this.namespaceURI=namespaceURI;
  }
}
Program: 68103
Project: 68103
Buggy source:
/** 
 * INTERNAL:  Return the helper context for a given key.  The key will either be a ClassLoader or a String (representing an application name). A new context will be created and put in the map if none exists  for the given key. The key is assumed to be non-null -  getDelegateKey should always return either a string representing the application name (for WLS) or a class loader.  This is relevant since 'putIfAbsent' will  throw a null pointer exception if the key is null.   
 */
public static HelperContext getHelperContext(){
  Object key=getDelegateMapKey();
  HelperContext hCtx=helperContexts.get(key);
  if (hCtx == null) {
    hCtx=new SDOHelperContext();
    HelperContext existingCtx=helperContexts.putIfAbsent(key,hCtx);
    if (existingCtx != null) {
      hCtx=existingCtx;
    }
  }
  return hCtx;
}

Fixed version (ground truth):
/** 
 * INTERNAL:  Return the helper context for a given key.  The key will either be a ClassLoader or a String (representing an application name). A new context will be created and put in the map if none exists  for the given key. The key is assumed to be non-null -  getDelegateKey should always return either a string representing the application name (for WLS) or a class loader.  This is relevant since 'putIfAbsent' will  throw a null pointer exception if the key is null.   
 */
public static HelperContext getHelperContext(){
  Object key=getDelegateMapKey();
  HelperContext hCtx=helperContexts.get(key);
  if (hCtx == null) {
    hCtx=new SDOHelperContext();
    HelperContext existingCtx=helperContexts.putIfAbsent(key,hCtx);
    if (existingCtx != null) {
      hCtx=existingCtx;
    }
    addNotificationListener(key);
  }
  return hCtx;
}
Program: 68104
Project: 68104
Buggy source:
private void processList(String targetNamespace,String defaultNamespace,String sdoTypeName,List list){
  if (list != null) {
    SDOType type=getSDOTypeForName(targetNamespace,defaultNamespace,sdoTypeName);
    type.setXsdList(true);
  }
}

Fixed version (ground truth):
private void processList(String targetNamespace,String defaultNamespace,String sdoTypeName,List list){
  if (list != null) {
    SDOType type=getSDOTypeForName(targetNamespace,defaultNamespace,sdoTypeName);
    type.setXsdList(true);
    type.setInstanceClass(ClassConstants.List_Class);
  }
}
Program: 68105
Project: 68105
Buggy source:
/** 
 * INTERNAL: Update the ValueStore with the new property value and update any sequence if it exists.
 * @param property
 * @param value
 * @param updateSequence (truncate call back from sequence when this function was called from sequence)
 */
public void setPropertyInternal(SDOProperty property,Object value,boolean updateSequence){
  if (type.isSequenced() && updateSequence && !property.getType().isChangeSummaryType()&& !aHelperContext.getXSDHelper().isAttribute(property)) {
    if (property.isMany()) {
      ((SDOSequence)sequence).addSettingWithoutModifyingDataObject(property,value);
    }
 else {
      if (isSet(property)) {
        ((SDOSequence)sequence).updateSettingWithoutModifyingDataObject(property,get(property),value);
      }
 else {
        ((SDOSequence)sequence).addSettingWithoutModifyingDataObject(property,value);
      }
    }
  }
  int index=((SDOProperty)property).getIndexInType();
  if (index == -1) {
    _getCurrentValueStore().setOpenContentProperty(property,value);
  }
 else {
    _getCurrentValueStore().setDeclaredProperty(index,value);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Update the ValueStore with the new property value and update any sequence if it exists.
 * @param property
 * @param value
 * @param updateSequence (truncate call back from sequence when this function was called from sequence)
 */
public void setPropertyInternal(SDOProperty property,Object value,boolean updateSequence){
  Object origValue=getPropertyInternal(property);
  if (type.isSequenced() && updateSequence && !property.getType().isChangeSummaryType()&& !aHelperContext.getXSDHelper().isAttribute(property)) {
    if (property.isMany()) {
      ((SDOSequence)sequence).addSettingWithoutModifyingDataObject(property,value);
    }
 else {
      if (isSet(property)) {
        ((SDOSequence)sequence).updateSettingWithoutModifyingDataObject(property,get(property),value);
      }
 else {
        ((SDOSequence)sequence).addSettingWithoutModifyingDataObject(property,value);
      }
    }
  }
  int index=((SDOProperty)property).getIndexInType();
  if (index == -1) {
    _getCurrentValueStore().setOpenContentProperty(property,value);
  }
 else {
    _getCurrentValueStore().setDeclaredProperty(index,value);
  }
  if (origValue != null && property.getOpposite() != null && property.getType() != null && !property.getType().isDataType()) {
    Property oppositeProp=property.getOpposite();
    DataObject valueDO=(DataObject)value;
    valueDO.set(oppositeProp,this);
    DataObject origValueDO=(DataObject)origValue;
    origValueDO.set(oppositeProp,null);
  }
}
Program: 68106
Project: 68106
Buggy source:
public void setUp(){
  xmlComparer=new SDOXMLComparer();
  if (customContext) {
    aHelperContext=new SDOHelperContext();
  }
 else {
    aHelperContext=HelperProvider.getDefaultContext();
  }
  typeHelper=aHelperContext.getTypeHelper();
  xmlHelper=aHelperContext.getXMLHelper();
  xsdHelper=aHelperContext.getXSDHelper();
  equalityHelper=aHelperContext.getEqualityHelper();
  copyHelper=aHelperContext.getCopyHelper();
  dataFactory=aHelperContext.getDataFactory();
  dataHelper=(SDODataHelper)aHelperContext.getDataHelper();
  DocumentBuilderFactory builderFactory=DocumentBuilderFactory.newInstance();
  builderFactory.setNamespaceAware(true);
  builderFactory.setIgnoringElementContentWhitespace(true);
  try {
    parser=builderFactory.newDocumentBuilder();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
    e.printStackTrace();
  }
  if (customContext) {
    ((SDOHelperContext)aHelperContext).reset();
  }
 else {
    SDOHelperContext.resetHelperContext();
  }
}

Fixed version (ground truth):
public void setUp(){
  xmlComparer=new SDOXMLComparer();
  if (customContext) {
    aHelperContext=new SDOHelperContext();
  }
 else {
    aHelperContext=HelperProvider.getDefaultContext();
  }
  typeHelper=aHelperContext.getTypeHelper();
  xmlHelper=aHelperContext.getXMLHelper();
  xsdHelper=aHelperContext.getXSDHelper();
  equalityHelper=aHelperContext.getEqualityHelper();
  copyHelper=aHelperContext.getCopyHelper();
  dataFactory=aHelperContext.getDataFactory();
  dataHelper=(SDODataHelper)aHelperContext.getDataHelper();
  DocumentBuilderFactory builderFactory=DocumentBuilderFactory.newInstance();
  builderFactory.setNamespaceAware(true);
  builderFactory.setIgnoringElementContentWhitespace(true);
  try {
    parser=builderFactory.newDocumentBuilder();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
    e.printStackTrace();
  }
  ((SDOTypeHelper)typeHelper).reset();
  ((SDOXMLHelper)xmlHelper).reset();
  ((SDOXSDHelper)xsdHelper).reset();
}
Program: 68107
Project: 68107
Buggy source:
public void tearDown() throws Exception {
  if (customContext) {
    ((SDOHelperContext)aHelperContext).reset();
  }
 else {
    SDOHelperContext.resetHelperContext();
  }
  typeHelper=null;
  xmlHelper=null;
  xsdHelper=null;
  equalityHelper=null;
  copyHelper=null;
  dataFactory=null;
  parser=null;
  aHelperContext=null;
}

Fixed version (ground truth):
public void tearDown() throws Exception {
  ((SDOTypeHelper)typeHelper).reset();
  ((SDOXMLHelper)xmlHelper).reset();
  ((SDOXSDHelper)xsdHelper).reset();
  typeHelper=null;
  xmlHelper=null;
  xsdHelper=null;
  equalityHelper=null;
  copyHelper=null;
  dataFactory=null;
  parser=null;
  aHelperContext=null;
}
Program: 68109
Project: 68109
Buggy source:
@Override public DateFormat get(){
  if (timeZoneHolder != null) {
    TimeZone tz=timeZoneHolder.getTimeZone();
    if (tz != null && !simpleDateFormat.getTimeZone().equals(tz)) {
      simpleDateFormat.setTimeZone(tz);
    }
  }
  return super.get();
}

Fixed version (ground truth):
@Override public DateFormat get(){
  DateFormat simpleDateFormat=super.get();
  if (timeZoneHolder != null) {
    TimeZone tz=timeZoneHolder.getTimeZone();
    if (tz != null && !simpleDateFormat.getTimeZone().equals(tz)) {
      simpleDateFormat.setTimeZone(tz);
    }
  }
  return simpleDateFormat;
}
Program: 68110
Project: 68110
Buggy source:
public DateFormatThreadLocal(String formatStr,TimeZoneHolder timeZoneHolder){
  super();
  simpleDateFormat=new SimpleDateFormat(formatStr);
  this.timeZoneHolder=timeZoneHolder;
}

Fixed version (ground truth):
public DateFormatThreadLocal(String formatStr,TimeZoneHolder timeZoneHolder){
  super();
  this.formatStr=formatStr;
  this.timeZoneHolder=timeZoneHolder;
}
Program: 68111
Project: 68111
Buggy source:
@Override protected DateFormat initialValue(){
  return simpleDateFormat;
}

Fixed version (ground truth):
@Override protected DateFormat initialValue(){
  SimpleDateFormat format=new SimpleDateFormat(formatStr);
  return format;
}