nus-yam/ex-repair huggingface dataset:
Program: 68152
Project: 68152
Buggy source:
public void testSetPropertyOnNullNestedDataObject(){
  boolean expectedEx=false;
  boolean unexpectedEx=false;
  try {
    SDODataFactory factory=new SDODataFactory(getHelperContext());
    SDODataObject po=(SDODataObject)factory.create("String_Node_Str","String_Node_Str");
    SDODataObject items=(SDODataObject)po.createDataObject("String_Node_Str");
    items.createDataObject("String_Node_Str");
    po.set("String_Node_Str","String_Node_Str");
  }
 catch (  SDOException sdoex) {
    if (sdoex.getMessage().lastIndexOf("String_Node_Str") != -1) {
      expectedEx=true;
    }
  }
catch (  Exception x) {
    unexpectedEx=true;
  }
  assertTrue("String_Node_Str",expectedEx);
  assertFalse("String_Node_Str",unexpectedEx);
}

Fixed version (ground truth):
public void testSetPropertyOnNullNestedDataObject(){
  boolean expectedEx=false;
  boolean unexpectedEx=false;
  try {
    SDODataFactory factory=(SDODataFactory)getHelperContext().getDataFactory();
    SDODataObject po=(SDODataObject)factory.create("String_Node_Str","String_Node_Str");
    SDODataObject items=(SDODataObject)po.createDataObject("String_Node_Str");
    items.createDataObject("String_Node_Str");
    po.set("String_Node_Str","String_Node_Str");
  }
 catch (  SDOException sdoex) {
    if (sdoex.getMessage().lastIndexOf("String_Node_Str") != -1) {
      expectedEx=true;
    }
  }
catch (  Exception x) {
    unexpectedEx=true;
  }
  assertTrue("String_Node_Str",expectedEx);
  assertFalse("String_Node_Str",unexpectedEx);
}
Program: 68153
Project: 68153
Buggy source:
public void testSetPropertyOnNullListWrapper(){
  boolean expectedEx=false;
  boolean unexpectedEx=false;
  try {
    SDODataFactory factory=new SDODataFactory(getHelperContext());
    SDODataObject po=(SDODataObject)factory.create("String_Node_Str","String_Node_Str");
    po.createDataObject("String_Node_Str");
    po.set("String_Node_Str","String_Node_Str");
  }
 catch (  SDOException sdoe) {
    expectedEx=true;
  }
catch (  Exception x) {
    unexpectedEx=true;
  }
  assertTrue("String_Node_Str",expectedEx);
  assertFalse("String_Node_Str",unexpectedEx);
}

Fixed version (ground truth):
public void testSetPropertyOnNullListWrapper(){
  boolean expectedEx=false;
  boolean unexpectedEx=false;
  try {
    SDODataFactory factory=(SDODataFactory)getHelperContext().getDataFactory();
    SDODataObject po=(SDODataObject)factory.create("String_Node_Str","String_Node_Str");
    po.createDataObject("String_Node_Str");
    po.set("String_Node_Str","String_Node_Str");
  }
 catch (  SDOException sdoe) {
    expectedEx=true;
  }
catch (  Exception x) {
    unexpectedEx=true;
  }
  assertTrue("String_Node_Str",expectedEx);
  assertFalse("String_Node_Str",unexpectedEx);
}
Program: 68154
Project: 68154
Buggy source:
public void setHelperContext(HelperContext helperContext){
  aHelperContext=helperContext;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Set the helperContext that this instance is associated with.
 * @param helperContext
 */
public void setHelperContext(HelperContext helperContext);
Program: 68155
Project: 68155
Buggy source:
public HelperContext getHelperContext(){
  if (null == aHelperContext) {
    aHelperContext=HelperProvider.getDefaultContext();
  }
  return aHelperContext;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the helperContext that this instance is associated with.
 * @return
 */
public HelperContext getHelperContext();
Program: 68156
Project: 68156
Buggy source:
public SDOHelperContext(ClassLoader aClassLoader){
  super();
  copyHelper=new SDOCopyHelper(this);
  dataFactory=new SDODataFactory(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):
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: 68157
Project: 68157
Buggy source:
/** 
 * INTERNAL:
 */
private SDOTypeHelperDelegate getSDOTypeHelperDelegate(){
  Object key=getDelegateMapKey();
  SDOTypeHelperDelegate sdoTypeHelperDelegate=(SDOTypeHelperDelegate)sdoTypeHelperDelegates.get(key);
  if (null == sdoTypeHelperDelegate) {
    sdoTypeHelperDelegate=new SDOTypeHelperDelegate(getHelperContext());
    sdoTypeHelperDelegates.put(key,sdoTypeHelperDelegate);
    AbstractSessionLog.getLog().log(AbstractSessionLog.FINEST,"String_Node_Str",new Object[]{getClass().getName(),sdoTypeHelperDelegate,key},false);
  }
  return sdoTypeHelperDelegate;
}

Fixed version (ground truth):
private SDOTypeHelperDelegate getSDOTypeHelperDelegate(){
  HelperContext hCtx=SDOHelperContext.getHelperContext(getDelegateMapKey());
  return (SDOTypeHelperDelegate)hCtx.getTypeHelper();
}
Program: 68158
Project: 68158
Buggy source:
public SDOTypeHelperDelegator(HelperContext aContext){
  super();
  aHelperContext=aContext;
  sdoTypeHelperDelegates=new WeakHashMap();
}

Fixed version (ground truth):
public SDOTypeHelperDelegator(HelperContext aContext){
  aHelperContext=aContext;
}
Program: 68159
Project: 68159
Buggy source:
/** 
 * INTERNAL:
 */
private SDOXMLHelperDelegate getSDOXMLHelperDelegate(){
  Object key=getDelegateMapKey();
  SDOXMLHelperDelegate sdoXMLHelperDelegate=(SDOXMLHelperDelegate)sdoXMLHelperDelegates.get(key);
  if (null == sdoXMLHelperDelegate) {
    sdoXMLHelperDelegate=new SDOXMLHelperDelegate(getHelperContext());
    sdoXMLHelperDelegates.put(key,sdoXMLHelperDelegate);
    AbstractSessionLog.getLog().log(AbstractSessionLog.FINEST,"String_Node_Str",new Object[]{getClass().getName(),sdoXMLHelperDelegate,key},false);
  }
  return sdoXMLHelperDelegate;
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
private SDOXMLHelperDelegate getSDOXMLHelperDelegate(){
  HelperContext hCtx=SDOHelperContext.getHelperContext(getDelegateMapKey());
  return (SDOXMLHelperDelegate)hCtx.getXMLHelper();
}
Program: 68160
Project: 68160
Buggy source:
public SDOXMLHelperDelegator(HelperContext aContext){
  super();
  aHelperContext=aContext;
  sdoXMLHelperDelegates=new WeakHashMap();
}

Fixed version (ground truth):
public SDOXMLHelperDelegator(HelperContext aContext){
  super();
  aHelperContext=aContext;
}
Program: 68161
Project: 68161
Buggy source:
private void buildCalendar(){
  CONTROL_ID.set(Calendar.YEAR,2000);
  CONTROL_ID.set(Calendar.MONTH,Calendar.JANUARY);
  CONTROL_ID.set(Calendar.DAY_OF_MONTH,2);
  CONTROL_ID.set(Calendar.HOUR,9);
  CONTROL_ID.set(Calendar.HOUR_OF_DAY,9);
  CONTROL_ID.set(Calendar.AM_PM,Calendar.AM);
  CONTROL_ID.set(Calendar.MINUTE,30);
  CONTROL_ID.set(Calendar.SECOND,45);
  CONTROL_ID.set(Calendar.MILLISECOND,0);
}

Fixed version (ground truth):
private void buildCalendar(){
  CONTROL_ID.clear();
  CONTROL_ID.set(Calendar.YEAR,2000);
  CONTROL_ID.set(Calendar.MONTH,Calendar.JANUARY);
  CONTROL_ID.set(Calendar.DAY_OF_MONTH,2);
  CONTROL_ID.set(Calendar.HOUR,9);
  CONTROL_ID.set(Calendar.HOUR_OF_DAY,9);
  CONTROL_ID.set(Calendar.AM_PM,Calendar.AM);
  CONTROL_ID.set(Calendar.MINUTE,30);
  CONTROL_ID.set(Calendar.SECOND,45);
  CONTROL_ID.set(Calendar.MILLISECOND,0);
}
Program: 68163
Project: 68163
Buggy source:
public void testCalendarToString_gMonth(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.G_MONTH_QNAME);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_gMonth(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.G_MONTH_QNAME);
  this.assertEquals(control,test);
}
Program: 68164
Project: 68164
Buggy source:
public void testCalendarToString_gMonthDay(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.G_MONTH_DAY_QNAME);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_gMonthDay(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.G_MONTH_DAY_QNAME);
  this.assertEquals(control,test);
}
Program: 68165
Project: 68165
Buggy source:
public void testCalendarToString_time_1ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_1MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.TIME_QNAME);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_time_1ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_1MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.TIME_QNAME);
  this.assertEquals(control,test);
}
Program: 68166
Project: 68166
Buggy source:
public void testCalendarToString_gYear(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.G_YEAR_QNAME);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_gYear(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.G_YEAR_QNAME);
  this.assertEquals(control,test);
}
Program: 68167
Project: 68167
Buggy source:
public void testCalendarToString_time_0ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.TIME_QNAME);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_time_0ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.TIME_QNAME);
  this.assertEquals(control,test);
}
Program: 68168
Project: 68168
Buggy source:
public void testCalendarToString_dateTime_0ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.DATE_TIME_QNAME);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_dateTime_0ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.DATE_TIME_QNAME);
  this.assertEquals(control,test);
}
Program: 68169
Project: 68169
Buggy source:
public void testCalendarToString_dateTime_10ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_10MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.DATE_TIME_QNAME);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_dateTime_10ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_10MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.DATE_TIME_QNAME);
  this.assertEquals(control,test);
}
Program: 68170
Project: 68170
Buggy source:
public void testCalendarToString_gYearMonth(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.G_YEAR_MONTH_QNAME);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_gYearMonth(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.G_YEAR_MONTH_QNAME);
  this.assertEquals(control,test);
}
Program: 68171
Project: 68171
Buggy source:
public void testCalendarToString_gDay(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.G_DAY_QNAME);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_gDay(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.G_DAY_QNAME);
  this.assertEquals(control,test);
}
Program: 68172
Project: 68172
Buggy source:
public void testCalendarToString_time_100ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_100MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.TIME_QNAME);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_time_100ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_100MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.TIME_QNAME);
  this.assertEquals(control,test);
}
Program: 68173
Project: 68173
Buggy source:
public void testCalendarToString_time_10ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_10MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.TIME_QNAME);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_time_10ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_10MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.TIME_QNAME);
  this.assertEquals(control,test);
}
Program: 68174
Project: 68174
Buggy source:
public void testCalendarToString_dateTime_1ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_1MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.DATE_TIME_QNAME);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_dateTime_1ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_1MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.DATE_TIME_QNAME);
  this.assertEquals(control,test);
}
Program: 68175
Project: 68175
Buggy source:
public void testCalendarToString_dateTime_100ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_100MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.DATE_TIME_QNAME);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_dateTime_100ms(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_100MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.DATE_TIME_QNAME);
  this.assertEquals(control,test);
}
Program: 68176
Project: 68176
Buggy source:
public void testCalendarToString_date(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.DATE_QNAME);
  this.assertEquals(control,test);
}

Fixed version (ground truth):
public void testCalendarToString_date(){
  Calendar calendar=Calendar.getInstance();
  calendar.clear();
  calendar.setTimeInMillis(CONTROL_DATE_TIME_0MS);
  calendar.clear(Calendar.ZONE_OFFSET);
  String control="String_Node_Str";
  String test=(String)xcm.convertObject(calendar,String.class,XMLConstants.DATE_QNAME);
  this.assertEquals(control,test);
}
Program: 68177
Project: 68177
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 getTypeForSimpleJavaType(interfaceClass);
}

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;
  }
  type=getTypeForSimpleJavaType(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;
}
Program: 68178
Project: 68178
Buggy source:
public void addTests(){
  addTest(new AggregatePrimaryKeyTest());
  addTest(new AggregatePrimaryKeyOrderByTest());
  addTest(new NestedAggregateTest());
}

Fixed version (ground truth):
public void addTests(){
  addTest(new AggregatePrimaryKeyOrderByTest());
  addTest(new NestedAggregateTest());
}
Program: 68179
Project: 68179
Buggy source:
protected void checkIndirection(List newProblems){
  if (this.usesValueHolderIndirection()) {
    if (!getProject().usesWeaving() && !this.getInstanceVariable().isValueHolder()) {
      newProblems.add(this.buildProblem(ProblemConstants.MAPPING_VALUE_HOLDER_INDIRECTION_WITHOUT_VALUE_HOLDER_ATTRIBUTE));
    }
  }
 else {
    if (this.getInstanceVariable().isValueHolder()) {
      newProblems.add(this.buildProblem(ProblemConstants.MAPPING_VALUE_HOLDER_ATTRIBUTE_WITHOUT_VALUE_HOLDER_INDIRECTION));
    }
  }
}

Fixed version (ground truth):
protected void checkIndirection(List newProblems){
  if (this.usesValueHolderIndirection()) {
    if (this.getInstanceVariable().isTLValueHolder()) {
      newProblems.add(this.buildProblem(ProblemConstants.MAPPING_VALUE_HOLDER_INDIRECTION_WITH_TL_VALUE_HOLDER_ATTRIBUTE));
    }
 else     if (!getProject().usesWeaving() && !this.getInstanceVariable().isValueHolder()) {
      newProblems.add(this.buildProblem(ProblemConstants.MAPPING_VALUE_HOLDER_INDIRECTION_WITHOUT_VALUE_HOLDER_ATTRIBUTE));
    }
  }
 else {
    if (this.getInstanceVariable().isValueHolder()) {
      newProblems.add(this.buildProblem(ProblemConstants.MAPPING_VALUE_HOLDER_ATTRIBUTE_WITHOUT_VALUE_HOLDER_INDIRECTION));
    }
  }
}
Program: 68180
Project: 68180
Buggy source:
private void removeAllAdditionalProjects(){
  this.removeItemsFromCollection(CollectionTools.collection(additionalProjects()),additionalProjects,ADDITIONAL_PROJECTS_COLLECTION);
}

Fixed version (ground truth):
private void removeAllAdditionalProjects(){
  this.removeItemsFromCollection(CollectionTools.collection(additionalProjects()),additionalProjects,ADDITIONAL_PROJECTS_COLLECTION);
  this.getAdditionalProjectsConfigs().clear();
}
Program: 68181
Project: 68181
Buggy source:
private void addExpressionMathTest(){
  ExpressionBuilder builder=new ExpressionBuilder();
  Expression expression=builder.get("String_Node_Str").greaterThanEqual(1000);
  expression=expression.and((ExpressionMath.add(builder.get("String_Node_Str"),new Integer(3000))).lessThan(90000));
  expression=expression.and((ExpressionMath.subtract(builder.get("String_Node_Str"),new Integer(1000))).greaterThan(1000));
  expression=expression.and((ExpressionMath.multiply(builder.get("String_Node_Str"),new Integer(3))).greaterThan(50000));
  expression=expression.and((ExpressionMath.divide(builder.get("String_Node_Str"),new Integer(3))).lessThan(100000));
  expression=expression.and((ExpressionMath.abs(builder.get("String_Node_Str"))).lessThan(100000));
  expression=expression.and((ExpressionMath.cos(builder.get("String_Node_Str")).lessThanEqual(1)));
  expression=expression.and((ExpressionMath.sin(builder.get("String_Node_Str")).lessThanEqual(1)));
  expression=expression.and((ExpressionMath.tan(builder.get("String_Node_Str")).lessThanEqual(1)));
  expression=expression.and((ExpressionMath.log(builder.get("String_Node_Str"))).greaterThan(0));
  ReadAllExpressionTest test=new ReadAllExpressionTest(Employee.class,6);
  test.setExpression(expression);
  test.setName("String_Node_Str");
  test.setDescription("String_Node_Str");
  test.addUnsupportedPlatform(TimesTenPlatform.class);
  addTest(test);
}

Fixed version (ground truth):
private void addExpressionMathTest(){
  ExpressionBuilder builder=new ExpressionBuilder();
  Expression expression=builder.get("String_Node_Str").greaterThanEqual(1000);
  expression=expression.and((ExpressionMath.add(builder.get("String_Node_Str"),new Integer(3000))).lessThan(90000));
  expression=expression.and((ExpressionMath.subtract(builder.get("String_Node_Str"),new Integer(1000))).greaterThan(1000));
  expression=expression.and((ExpressionMath.multiply(builder.get("String_Node_Str"),new Integer(3))).greaterThan(50000));
  expression=expression.and((ExpressionMath.divide(builder.get("String_Node_Str"),new Integer(3))).lessThan(100000));
  expression=expression.and((ExpressionMath.abs(builder.get("String_Node_Str"))).lessThan(100000));
  expression=expression.and((ExpressionMath.cos(builder.get("String_Node_Str")).lessThanEqual(1)));
  expression=expression.and((ExpressionMath.sin(builder.get("String_Node_Str")).lessThanEqual(1)));
  expression=expression.and((ExpressionMath.tan(builder.get("String_Node_Str")).lessThanEqual(1)));
  expression=expression.and((ExpressionMath.log(builder.get("String_Node_Str"))).greaterThan(4));
  ReadAllExpressionTest test=new ReadAllExpressionTest(Employee.class,6);
  test.setExpression(expression);
  test.setName("String_Node_Str");
  test.setDescription("String_Node_Str");
  test.addUnsupportedPlatform(TimesTenPlatform.class);
  addTest(test);
}
Program: 68182
Project: 68182
Buggy source:
/** 
 * INTERNAL:
 */
public static XMLEntityMappings read(URL url,ClassLoader classLoader) throws IOException {
  InputStreamReader reader1=null;
  InputStreamReader reader2=null;
  InputStreamReader reader3=null;
  try {
    try {
      reader1=new InputStreamReader(url.openStream(),"String_Node_Str");
      reader2=new InputStreamReader(url.openStream(),"String_Node_Str");
      reader3=new InputStreamReader(url.openStream(),"String_Node_Str");
    }
 catch (    UnsupportedEncodingException exception) {
      throw ValidationException.fatalErrorOccurred(exception);
    }
    XMLEntityMappings entityMappings=read(url,reader1,reader2,reader3,classLoader);
    entityMappings.setMappingFile(url);
    return entityMappings;
  }
  finally {
    try {
      if (reader1 != null) {
        reader1.close();
      }
      if (reader2 != null) {
        reader2.close();
      }
    }
 catch (    IOException exception) {
      throw ValidationException.fileError(exception);
    }
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public static XMLEntityMappings read(URL url,ClassLoader classLoader) throws IOException {
  InputStreamReader reader1=null;
  InputStreamReader reader2=null;
  InputStreamReader reader3=null;
  try {
    try {
      reader1=getInputStreamReader(url);
      reader2=getInputStreamReader(url);
      reader3=getInputStreamReader(url);
    }
 catch (    UnsupportedEncodingException exception) {
      throw ValidationException.fatalErrorOccurred(exception);
    }
    XMLEntityMappings entityMappings=read(url,reader1,reader2,reader3,classLoader);
    entityMappings.setMappingFile(url);
    return entityMappings;
  }
  finally {
    try {
      if (reader1 != null) {
        reader1.close();
      }
      if (reader2 != null) {
        reader2.close();
      }
      if (reader3 != null) {
        reader3.close();
      }
    }
 catch (    IOException exception) {
      throw ValidationException.fileError(exception);
    }
  }
}
Program: 68183
Project: 68183
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  return new TestSetup(suite){
    protected void setUp(){
      DatabaseSession session=JUnitTestCase.getServerSession();
      new InheritedTableManager().replaceTables(session);
    }
    protected void tearDown(){
      clearCache();
    }
  }
;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  return suite;
}
Program: 68184
Project: 68184
Buggy source:
protected void setUp(){
  DatabaseSession session=JUnitTestCase.getServerSession();
  new InheritedTableManager().replaceTables(session);
}

Fixed version (ground truth):
public void setUp(){
  super.setUp();
  clearCache();
}
Program: 68185
Project: 68185
Buggy source:
private JComboBox buildQueryTypeComboBox(ObjectListSelectionModel querySelectionModel){
  JComboBox comboBox=new JComboBox(new ComboBoxModelAdapter(buildQueryTypeValueModel(),buildQueryTypePropertyAdapter(querySelectionModel)));
  comboBox.setEnabled(false);
  comboBox.setEditable(false);
  this.queryHolder.addPropertyChangeListener(ValueModel.VALUE,buildQueryTypeChooserListener(comboBox));
  return comboBox;
}

Fixed version (ground truth):
private JComboBox buildQueryTypeComboBox(ObjectListSelectionModel querySelectionModel){
  JComboBox comboBox=new JComboBox(new ComboBoxModelAdapter(buildQueryTypeValueModel(),buildQueryTypePropertyAdapter(querySelectionModel)));
  comboBox.setEnabled(false);
  comboBox.setEditable(false);
  this.queryHolder.addPropertyChangeListener(buildQueryTypeChooserListener(comboBox));
  return comboBox;
}
Program: 68186
Project: 68186
Buggy source:
private PropertyChangeListener buildQueryTypeChooserListener(final JComboBox comboBox){
  return new PropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent evt){
      if (getQuery() == null) {
        comboBox.setEnabled(false);
      }
    }
  }
;
}

Fixed version (ground truth):
private PropertyChangeListener buildQueryTypeChooserListener(final JComboBox comboBox){
  return new PropertyChangeListener(){
    public void propertyChange(    PropertyChangeEvent evt){
      if (getQuery() == null) {
        comboBox.setEnabled(false);
      }
 else {
        comboBox.setEnabled(true);
      }
    }
  }
;
}
Program: 68187
Project: 68187
Buggy source:
public void propertyChange(PropertyChangeEvent evt){
  if (getQuery() == null) {
    comboBox.setEnabled(false);
  }
}

Fixed version (ground truth):
public void propertyChange(PropertyChangeEvent evt){
  if (getQuery() == null) {
    comboBox.setEnabled(false);
  }
 else {
    comboBox.setEnabled(true);
  }
}
Program: 68188
Project: 68188
Buggy source:
/** 
 * INTERNAL:
 * @return
 */
private SDOTypeHelperDelegate getSDOTypeHelperDelegate(){
  ClassLoader contextClassLoader=getContextClassLoader();
  SDOTypeHelperDelegate sdoTypeHelperDelegate=(SDOTypeHelperDelegate)sdoTypeHelperDelegates.get(contextClassLoader);
  if (null == sdoTypeHelperDelegate) {
    sdoTypeHelperDelegate=new SDOTypeHelperDelegate(getHelperContext());
    sdoTypeHelperDelegates.put(contextClassLoader,sdoTypeHelperDelegate);
    AbstractSessionLog.getLog().log(AbstractSessionLog.FINEST,"String_Node_Str",new Object[]{getClass().getName(),sdoTypeHelperDelegate,contextClassLoader.toString()},false);
  }
  return sdoTypeHelperDelegate;
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
private SDOTypeHelperDelegate getSDOTypeHelperDelegate(){
  Object key=getDelegateMapKey();
  SDOTypeHelperDelegate sdoTypeHelperDelegate=(SDOTypeHelperDelegate)sdoTypeHelperDelegates.get(key);
  if (null == sdoTypeHelperDelegate) {
    sdoTypeHelperDelegate=new SDOTypeHelperDelegate(getHelperContext());
    sdoTypeHelperDelegates.put(key,sdoTypeHelperDelegate);
    AbstractSessionLog.getLog().log(AbstractSessionLog.FINEST,"String_Node_Str",new Object[]{getClass().getName(),sdoTypeHelperDelegate,key},false);
  }
  return sdoTypeHelperDelegate;
}
Program: 68189
Project: 68189
Buggy source:
/** 
 * INTERNAL:
 * @return
 */
private SDOXMLHelperDelegate getSDOXMLHelperDelegate(){
  ClassLoader contextClassLoader=getContextClassLoader();
  SDOXMLHelperDelegate sdoXMLHelperDelegate=(SDOXMLHelperDelegate)sdoXMLHelperDelegates.get(contextClassLoader);
  if (null == sdoXMLHelperDelegate) {
    sdoXMLHelperDelegate=new SDOXMLHelperDelegate(getHelperContext());
    sdoXMLHelperDelegates.put(contextClassLoader,sdoXMLHelperDelegate);
    AbstractSessionLog.getLog().log(AbstractSessionLog.FINEST,"String_Node_Str",new Object[]{getClass().getName(),sdoXMLHelperDelegate,contextClassLoader.toString()},false);
  }
  return sdoXMLHelperDelegate;
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
private SDOXMLHelperDelegate getSDOXMLHelperDelegate(){
  Object key=getDelegateMapKey();
  SDOXMLHelperDelegate sdoXMLHelperDelegate=(SDOXMLHelperDelegate)sdoXMLHelperDelegates.get(key);
  if (null == sdoXMLHelperDelegate) {
    sdoXMLHelperDelegate=new SDOXMLHelperDelegate(getHelperContext());
    sdoXMLHelperDelegates.put(key,sdoXMLHelperDelegate);
    AbstractSessionLog.getLog().log(AbstractSessionLog.FINEST,"String_Node_Str",new Object[]{getClass().getName(),sdoXMLHelperDelegate,key},false);
  }
  return sdoXMLHelperDelegate;
}
Program: 68190
Project: 68190
Buggy source:
/** 
 * INTERNAL:
 * @return
 */
private SDOXSDHelperDelegate getSDOXSDHelperDelegate(){
  ClassLoader contextClassLoader=getContextClassLoader();
  SDOXSDHelperDelegate sdoXSDHelperDelegate=(SDOXSDHelperDelegate)sdoXSDHelperDelegates.get(contextClassLoader);
  if (null == sdoXSDHelperDelegate) {
    sdoXSDHelperDelegate=new SDOXSDHelperDelegate(getHelperContext());
    sdoXSDHelperDelegates.put(contextClassLoader,sdoXSDHelperDelegate);
    AbstractSessionLog.getLog().log(AbstractSessionLog.FINEST,"String_Node_Str",new Object[]{getClass().getName(),sdoXSDHelperDelegate,contextClassLoader.toString()},false);
  }
  return sdoXSDHelperDelegate;
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
private SDOXSDHelperDelegate getSDOXSDHelperDelegate(){
  Object key=getDelegateMapKey();
  SDOXSDHelperDelegate sdoXSDHelperDelegate=(SDOXSDHelperDelegate)sdoXSDHelperDelegates.get(key);
  if (null == sdoXSDHelperDelegate) {
    sdoXSDHelperDelegate=new SDOXSDHelperDelegate(getHelperContext());
    sdoXSDHelperDelegates.put(key,sdoXSDHelperDelegate);
    AbstractSessionLog.getLog().log(AbstractSessionLog.FINEST,"String_Node_Str",new Object[]{getClass().getName(),sdoXSDHelperDelegate,key},false);
  }
  return sdoXSDHelperDelegate;
}
Program: 68192
Project: 68192
Buggy source:
/** 
 * Delegate to the node's editor.
 * @see javax.swing.CellEditor#isCellEditable(java.util.EventObject)
 */
public boolean isCellEditable(EventObject e){
  try {
    MouseEvent mouseEvent=(MouseEvent)e;
    JTree tree=(JTree)mouseEvent.getSource();
    TreePath path=tree.getPathForLocation(mouseEvent.getX(),mouseEvent.getY());
    EditingNode node=(EditingNode)path.getLastPathComponent();
    return node.getEditor().isCellEditable(e);
  }
 catch (  NullPointerException exception) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Delegate to the node's editor.
 * @see javax.swing.CellEditor#isCellEditable(java.util.EventObject)
 */
public boolean isCellEditable(EventObject e){
  JTree tree=(JTree)e.getSource();
  TreePath path=null;
  if (e instanceof MouseEvent) {
    MouseEvent mouseEvent=(MouseEvent)e;
    path=tree.getPathForLocation(mouseEvent.getX(),mouseEvent.getY());
  }
 else {
    path=tree.getSelectionPath();
  }
  if (path == null) {
    return false;
  }
  EditingNode node=(EditingNode)path.getLastPathComponent();
  return node.getEditor().isCellEditable(e);
}
Program: 68193
Project: 68193
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("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 OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  suite.addTest(new OrderedListJunitTest("String_Node_Str"));
  return new TestSetup(suite){
    protected void setUp(){
      DatabaseSession session=JUnitTestCase.getServerSession();
      new InheritedTableManager().replaceTables(session);
    }
    protected void tearDown(){
      clearCache();
    }
  }
;
}
Program: 68194
Project: 68194
Buggy source:
public void setUp(){
  super.setUp();
  clearCache();
}

Fixed version (ground truth):
protected void setUp(){
  DatabaseSession session=JUnitTestCase.getServerSession();
  new InheritedTableManager().replaceTables(session);
}
Program: 68195
Project: 68195
Buggy source:
/** 
 * Delegate to the node's editor.
 * @see javax.swing.CellEditor#isCellEditable(java.util.EventObject)
 */
public boolean isCellEditable(EventObject e){
  MouseEvent mouseEvent=(MouseEvent)e;
  JTree tree=(JTree)mouseEvent.getSource();
  TreePath path=tree.getPathForLocation(mouseEvent.getX(),mouseEvent.getY());
  EditingNode node=(EditingNode)path.getLastPathComponent();
  return node.getEditor().isCellEditable(e);
}

Fixed version (ground truth):
/** 
 * Delegate to the node's editor.
 * @see javax.swing.CellEditor#isCellEditable(java.util.EventObject)
 */
public boolean isCellEditable(EventObject e){
  try {
    MouseEvent mouseEvent=(MouseEvent)e;
    JTree tree=(JTree)mouseEvent.getSource();
    TreePath path=tree.getPathForLocation(mouseEvent.getX(),mouseEvent.getY());
    EditingNode node=(EditingNode)path.getLastPathComponent();
    return node.getEditor().isCellEditable(e);
  }
 catch (  NullPointerException exception) {
    return false;
  }
}
Program: 68196
Project: 68196
Buggy source:
protected LoginAdapter buildLogin(){
  if (this.platformIsEis()) {
    return new EISLoginAdapter(this);
  }
  return new DatabaseLoginAdapter(this);
}

Fixed version (ground truth):
protected LoginAdapter buildLogin(){
  if (this.platformIsEis()) {
    return new EISLoginAdapter(this);
  }
 else   if (this.platformIsXml()) {
    return new XMLLoginAdapter(this);
  }
  return new DatabaseLoginAdapter(this);
}
Program: 68197
Project: 68197
Buggy source:
private void initializeXmlDs(){
  this.platformId=XML_PLATFORM_ID;
  this.platformName="String_Node_Str";
}

Fixed version (ground truth):
private void initializeXmlDs(){
  this.platformId=XML_PLATFORM_ID;
  this.platformName="String_Node_Str";
  this.platformClassName=XMLLoginAdapter.DEFAULT_PLATFORM_CLASS_NAME;
}
Program: 68198
Project: 68198
Buggy source:
/** 
 * Returns the datasource platform class from user's preference.
 */
protected String getDefaultPlatformClassName(){
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the datasource platform class from user's preference.
 */
protected String getDefaultPlatformClassName(){
  return DEFAULT_PLATFORM_CLASS_NAME;
}
Program: 68199
Project: 68199
Buggy source:
protected void initializeTabs(){
  addTab(buildGeneralPropertiesPage(),0,buildGeneralPropertiesPageTitle());
  addTab(buildMultipleProjectsHolder(),1,buildMultipleProjectsPageBuilder(),buildMultipleProjectsPropertiesPageTitle());
  addTab(buildServerPlatformPropertiesPage(),2,buildServerPlatformPropertiesPageTitle());
}

Fixed version (ground truth):
protected void initializeTabs(){
  addTab(buildGeneralPropertiesPage(),0,buildGeneralPropertiesPageTitle());
  addTab(buildLoginPropertiesPage(),1,buildLoginPropertiesPageTitle());
  addTab(buildMultipleProjectsHolder(),2,buildMultipleProjectsPageBuilder(),buildMultipleProjectsPropertiesPageTitle());
  addTab(buildServerPlatformPropertiesPage(),3,buildServerPlatformPropertiesPageTitle());
}
Program: 68201
Project: 68201
Buggy source:
private Node selectSingleText(Node contextNode){
  NodeList childrenNodes=contextNode.getChildNodes();
  if (childrenNodes.getLength() == 0) {
    return null;
  }
  if (childrenNodes.getLength() == 1) {
    Node child=childrenNodes.item(0);
    if (child.getNodeType() == Node.TEXT_NODE || child.getNodeType() == Node.CDATA_SECTION_NODE) {
      return child;
    }
    return null;
  }
  String returnVal=null;
  for (int i=0; i < childrenNodes.getLength(); i++) {
    Node next=childrenNodes.item(i);
    if (next.getNodeType() == Node.TEXT_NODE || next.getNodeType() == Node.CDATA_SECTION_NODE) {
      String val=next.getNodeValue();
      if (val != null) {
        if (returnVal == null) {
          returnVal=new String();
        }
        if (next.getNodeType() == Node.CDATA_SECTION_NODE) {
          val=val.trim();
        }
        returnVal+=val;
      }
    }
  }
  if (returnVal != null) {
    return contextNode.getOwnerDocument().createTextNode(returnVal);
  }
  return null;
}

Fixed version (ground truth):
private Node selectSingleText(Node contextNode){
  NodeList childrenNodes=contextNode.getChildNodes();
  int numberOfNodes=childrenNodes.getLength();
  if (numberOfNodes == 0) {
    return null;
  }
  if (numberOfNodes == 1) {
    Node child=childrenNodes.item(0);
    if (child.getNodeType() == Node.TEXT_NODE || child.getNodeType() == Node.CDATA_SECTION_NODE) {
      return child;
    }
    return null;
  }
  String returnVal=null;
  for (int i=0; i < numberOfNodes; i++) {
    Node next=childrenNodes.item(i);
    if (next.getNodeType() == Node.TEXT_NODE || next.getNodeType() == Node.CDATA_SECTION_NODE) {
      String val=next.getNodeValue();
      if (val != null) {
        if (returnVal == null) {
          returnVal=new String();
        }
        if (next.getNodeType() == Node.CDATA_SECTION_NODE) {
          val=val.trim();
        }
        returnVal+=val;
      }
    }
  }
  if (returnVal != null) {
    return contextNode.getOwnerDocument().createTextNode(returnVal);
  }
  return null;
}
Program: 68202
Project: 68202
Buggy source:
public int getIndex(String uri,String localName){
  Attr item;
  for (int i=0; i < attrs.size(); i++) {
    item=attrs.get(i);
    try {
      if (item.getNamespaceURI().equals(uri) && item.getLocalName().equals(localName)) {
        return i;
      }
    }
 catch (    Exception x) {
    }
  }
  return -1;
}

Fixed version (ground truth):
public int getIndex(String uri,String localName){
  Attr item;
  int size=attrs.size();
  for (int i=0; i < size; i++) {
    item=attrs.get(i);
    try {
      if (item.getNamespaceURI().equals(uri) && item.getLocalName().equals(localName)) {
        return i;
      }
    }
 catch (    Exception x) {
    }
  }
  return -1;
}
Program: 68203
Project: 68203
Buggy source:
protected void handleChildNodes(NodeList children) throws SAXException {
  for (int i=0; i < children.getLength(); i++) {
    Node next=children.item(i);
    if (next.getNodeType() == Node.TEXT_NODE) {
      char[] value=((Text)next).getNodeValue().toCharArray();
      getContentHandler().characters(value,0,value.length);
    }
 else     if (next.getNodeType() == Node.COMMENT_NODE) {
      char[] value=((Comment)next).getNodeValue().toCharArray();
      if (lexicalHandler != null) {
        lexicalHandler.comment(value,0,value.length);
      }
    }
 else     if (next.getNodeType() == Node.ELEMENT_NODE) {
      Element childElement=(Element)next;
      reportElementEvents(childElement);
    }
 else     if (next.getNodeType() == Node.CDATA_SECTION_NODE) {
      if (lexicalHandler != null) {
        lexicalHandler.startCDATA();
      }
      char[] value=((CDATASection)next).getData().toCharArray();
      getContentHandler().characters(value,0,value.length);
      if (lexicalHandler != null) {
        lexicalHandler.endCDATA();
      }
    }
  }
}

Fixed version (ground truth):
protected void handleChildNodes(NodeList children) throws SAXException {
  Node nextChild=null;
  if (children.getLength() > 0) {
    nextChild=children.item(0);
  }
  while (nextChild != null) {
    if (nextChild.getNodeType() == Node.TEXT_NODE) {
      char[] value=((Text)nextChild).getNodeValue().toCharArray();
      getContentHandler().characters(value,0,value.length);
    }
 else     if (nextChild.getNodeType() == Node.COMMENT_NODE) {
      char[] value=((Comment)nextChild).getNodeValue().toCharArray();
      if (lexicalHandler != null) {
        lexicalHandler.comment(value,0,value.length);
      }
    }
 else     if (nextChild.getNodeType() == Node.ELEMENT_NODE) {
      Element childElement=(Element)nextChild;
      reportElementEvents(childElement);
    }
 else     if (nextChild.getNodeType() == Node.CDATA_SECTION_NODE) {
      if (lexicalHandler != null) {
        lexicalHandler.startCDATA();
      }
      char[] value=((CDATASection)nextChild).getData().toCharArray();
      getContentHandler().characters(value,0,value.length);
      if (lexicalHandler != null) {
        lexicalHandler.endCDATA();
      }
    }
    nextChild=nextChild.getNextSibling();
  }
}
Program: 68204
Project: 68204
Buggy source:
/** 
 * Process namespace declarations on parent elements if not the root. For each parent node from current to root push each onto a stack,  then pop each off, calling startPrefixMapping for each XMLNS  attribute.  Using a stack ensures that the parent nodes are  processed top down.
 * @param element
 */
protected void processParentNamespaces(Element element) throws SAXException {
  Node parent=element.getParentNode();
  if (parent != null && parent.getNodeType() == Node.DOCUMENT_NODE) {
    return;
  }
  Stack<Node> parentElements=new Stack();
  while (parent != null && parent.getNodeType() != Node.DOCUMENT_NODE) {
    parentElements.push(parent);
    parent=parent.getParentNode();
  }
  for (Iterator stackIt=parentElements.iterator(); stackIt.hasNext(); ) {
    NamedNodeMap attrs=parentElements.pop().getAttributes();
    if (attrs != null) {
      for (int i=0; i < attrs.getLength(); i++) {
        Attr next=(Attr)attrs.item(i);
        String attrPrefix=next.getPrefix();
        if (attrPrefix != null && attrPrefix.equals(XMLConstants.XMLNS)) {
          getContentHandler().startPrefixMapping(next.getLocalName(),next.getValue());
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Process namespace declarations on parent elements if not the root. For each parent node from current to root push each onto a stack,  then pop each off, calling startPrefixMapping for each XMLNS  attribute.  Using a stack ensures that the parent nodes are  processed top down.
 * @param element
 */
protected void processParentNamespaces(Element element) throws SAXException {
  Node parent=element.getParentNode();
  if (parent != null && parent.getNodeType() == Node.DOCUMENT_NODE) {
    return;
  }
  Stack<Node> parentElements=new Stack();
  while (parent != null && parent.getNodeType() != Node.DOCUMENT_NODE) {
    parentElements.push(parent);
    parent=parent.getParentNode();
  }
  for (Iterator stackIt=parentElements.iterator(); stackIt.hasNext(); ) {
    NamedNodeMap attrs=parentElements.pop().getAttributes();
    if (attrs != null) {
      int length=attrs.getLength();
      for (int i=0; i < length; i++) {
        Attr next=(Attr)attrs.item(i);
        String attrPrefix=next.getPrefix();
        if (attrPrefix != null && attrPrefix.equals(XMLConstants.XMLNS)) {
          getContentHandler().startPrefixMapping(next.getLocalName(),next.getValue());
        }
      }
    }
  }
}
Program: 68205
Project: 68205
Buggy source:
public String getValue(String uri,String localName){
  Attr item;
  for (int i=0; i < attrs.size(); i++) {
    item=attrs.get(i);
    if (item != null) {
      String itemNS=item.getNamespaceURI();
      if (item.getNamespaceURI() == null) {
        itemNS="String_Node_Str";
      }
      if ((itemNS.equals(uri)) && (item.getLocalName() != null && item.getLocalName().equals(localName))) {
        return item.getValue();
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public String getValue(String uri,String localName){
  Attr item;
  int size=attrs.size();
  for (int i=0; i < size; i++) {
    item=attrs.get(i);
    if (item != null) {
      String itemNS=item.getNamespaceURI();
      if (item.getNamespaceURI() == null) {
        itemNS="String_Node_Str";
      }
      if ((itemNS.equals(uri)) && (item.getLocalName() != null && item.getLocalName().equals(localName))) {
        return item.getValue();
      }
    }
  }
  return null;
}