nus-yam/ex-repair huggingface dataset:
Program: 82265
Project: 82265
Buggy source:
/** 
 * This method treats arrays in a special way.
 */
private static Class<?> computeHasCustomFieldSerializer(Class<?> instanceType){
  assert(instanceType != null);
  String qualifiedTypeName=instanceType.getName();
  ClassLoader classLoader=SerializabilityUtil.class.getClassLoader();
  String simpleSerializerName=qualifiedTypeName + "String_Node_Str";
  Class<?> customSerializer=getCustomFieldSerializer(classLoader,simpleSerializerName);
  if (customSerializer != null) {
    return customSerializer;
  }
  Class<?> customSerializerClass=getCustomFieldSerializer(classLoader,JRE_SERIALIZER_PACKAGE + "String_Node_Str" + simpleSerializerName);
  if (customSerializerClass != null) {
    return customSerializerClass;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * This method treats arrays in a special way.
 */
private static Class<?> computeHasCustomFieldSerializer(Class<?> instanceType){
  assert(instanceType != null);
  String qualifiedTypeName=instanceType.getName();
  ClassLoader classLoader=GWT.isClient() ? SerializabilityUtil.class.getClassLoader() : Thread.currentThread().getContextClassLoader();
  String simpleSerializerName=qualifiedTypeName + "String_Node_Str";
  Class<?> customSerializer=getCustomFieldSerializer(classLoader,simpleSerializerName);
  if (customSerializer != null) {
    return customSerializer;
  }
  Class<?> customSerializerClass=getCustomFieldSerializer(classLoader,JRE_SERIALIZER_PACKAGE + "String_Node_Str" + simpleSerializerName);
  if (customSerializerClass != null) {
    return customSerializerClass;
  }
  return null;
}
Program: 82267
Project: 82267
Buggy source:
public final void execute(){
  if (canceled) {
    return;
  }
  scheduled=false;
  doBeforeLayout();
  layout.layout(duration,new Layout.AnimationCallback(){
    public void onAnimationComplete(){
      if (callback != null) {
        callback.onAnimationComplete();
      }
    }
    public void onLayout(    Layer layer,    double progress){
      Widget child=(Widget)layer.getUserObject();
      if (child instanceof RequiresResize) {
        ((RequiresResize)child).onResize();
      }
      if (callback != null) {
        callback.onLayout(layer,progress);
      }
    }
  }
);
}

Fixed version (ground truth):
public final void execute(){
  scheduled=false;
  if (canceled) {
    return;
  }
  doBeforeLayout();
  layout.layout(duration,new Layout.AnimationCallback(){
    public void onAnimationComplete(){
      if (callback != null) {
        callback.onAnimationComplete();
      }
    }
    public void onLayout(    Layer layer,    double progress){
      Widget child=(Widget)layer.getUserObject();
      if (child instanceof RequiresResize) {
        ((RequiresResize)child).onResize();
      }
      if (callback != null) {
        callback.onLayout(layer,progress);
      }
    }
  }
);
}
Program: 82269
Project: 82269
Buggy source:
private void doLayout(){
  int left=0, top=0, right=0, bottom=0;
  for (  Widget child : getChildren()) {
    LayoutData data=(LayoutData)child.getLayoutData();
    Layer layer=data.layer;
switch (data.direction) {
case NORTH:
      layer.setLeftRight(left,unit,right,unit);
    layer.setTopHeight(top,unit,data.size,unit);
  top+=data.size;
break;
case SOUTH:
layer.setLeftRight(left,unit,right,unit);
layer.setBottomHeight(bottom,unit,data.size,unit);
bottom+=data.size;
break;
case WEST:
layer.setTopBottom(top,unit,bottom,unit);
layer.setLeftWidth(left,unit,data.size,unit);
left+=data.size;
break;
case EAST:
layer.setTopBottom(top,unit,bottom,unit);
layer.setRightWidth(right,unit,data.size,unit);
right+=data.size;
break;
case CENTER:
layer.setLeftRight(left,unit,right,unit);
layer.setTopBottom(top,unit,bottom,unit);
break;
}
}
}

Fixed version (ground truth):
private void doLayout(){
  double left=0, top=0, right=0, bottom=0;
  for (  Widget child : getChildren()) {
    LayoutData data=(LayoutData)child.getLayoutData();
    Layer layer=data.layer;
switch (data.direction) {
case NORTH:
      layer.setLeftRight(left,unit,right,unit);
    layer.setTopHeight(top,unit,data.size,unit);
  top+=data.size;
break;
case SOUTH:
layer.setLeftRight(left,unit,right,unit);
layer.setBottomHeight(bottom,unit,data.size,unit);
bottom+=data.size;
break;
case WEST:
layer.setTopBottom(top,unit,bottom,unit);
layer.setLeftWidth(left,unit,data.size,unit);
left+=data.size;
break;
case EAST:
layer.setTopBottom(top,unit,bottom,unit);
layer.setRightWidth(right,unit,data.size,unit);
right+=data.size;
break;
case CENTER:
layer.setLeftRight(left,unit,right,unit);
layer.setTopBottom(top,unit,bottom,unit);
break;
}
}
}
Program: 82270
Project: 82270
Buggy source:
public void testParse(){
  assertTrue(0 == Double.parseDouble("String_Node_Str"));
  assertTrue(-1.5 == Double.parseDouble("String_Node_Str"));
  assertTrue(3.0 == Double.parseDouble("String_Node_Str"));
  assertTrue(0.5 == Double.parseDouble("String_Node_Str"));
  assertTrue(2.98e8 == Double.parseDouble("String_Node_Str"));
  assertTrue(-2.98e-8 == Double.parseDouble("String_Node_Str"));
  assertTrue(+2.98E+8 == Double.parseDouble("String_Node_Str"));
  assertTrue("String_Node_Str",Double.MIN_VALUE == Double.parseDouble(String.valueOf(Double.MIN_VALUE)));
  assertTrue("String_Node_Str",Double.MAX_VALUE == Double.parseDouble(String.valueOf(Double.MAX_VALUE)));
}

Fixed version (ground truth):
public void testParse(){
  assertTrue(0 == Double.parseDouble("String_Node_Str"));
  assertTrue(-1.5 == Double.parseDouble("String_Node_Str"));
  assertTrue(3.0 == Double.parseDouble("String_Node_Str"));
  assertTrue(0.5 == Double.parseDouble("String_Node_Str"));
  assertTrue(2.98e8 == Double.parseDouble("String_Node_Str"));
  assertTrue(-2.98e-8 == Double.parseDouble("String_Node_Str"));
  assertTrue(+2.98E+8 == Double.parseDouble("String_Node_Str"));
  assertTrue("String_Node_Str",Double.MIN_VALUE == Double.parseDouble(String.valueOf(Double.MIN_VALUE)));
  assertTrue("String_Node_Str",Double.MAX_VALUE == Double.parseDouble(String.valueOf(Double.MAX_VALUE)));
  assertTrue(2.56789e1 == Double.parseDouble("String_Node_Str"));
  assertTrue(2.56789e1 == Double.parseDouble("String_Node_Str"));
  assertTrue(2.56789e1 == Double.parseDouble("String_Node_Str"));
  assertTrue(2.56789e1 == Double.parseDouble("String_Node_Str"));
  assertTrue(2.56789e1 == Double.parseDouble("String_Node_Str"));
  assertTrue(2.56789e1 == Double.parseDouble("String_Node_Str"));
  assertTrue(2.56789e1 == Double.parseDouble("String_Node_Str"));
  assertTrue(2.56789e1 == Double.parseDouble("String_Node_Str"));
  assertTrue(-2.56789e1 == Double.parseDouble("String_Node_Str"));
  assertTrue(-2.56789e1 == Double.parseDouble("String_Node_Str"));
  assertTrue(-2.56789e1 == Double.parseDouble("String_Node_Str"));
  assertTrue(-2.56789e1 == Double.parseDouble("String_Node_Str"));
}
Program: 82271
Project: 82271
Buggy source:
public void testBadStrings(){
  try {
    new Integer("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
  try {
    Integer.decode("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
  try {
    Integer.parseInt("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
  try {
    Integer.parseInt(String.valueOf(Long.MAX_VALUE));
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
  try {
    Integer.parseInt(String.valueOf(Long.MIN_VALUE));
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
  try {
    Integer.parseInt(String.valueOf((long)Integer.MAX_VALUE + 1));
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
  try {
    Integer.parseInt(String.valueOf((long)Integer.MIN_VALUE - 1));
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
}

Fixed version (ground truth):
public void testBadStrings(){
  try {
    new Integer("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
  try {
    Integer.decode("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
  try {
    Integer.parseInt("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
  try {
    Integer.parseInt(String.valueOf(Long.MAX_VALUE));
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
  try {
    Integer.parseInt(String.valueOf(Long.MIN_VALUE));
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
  try {
    Integer.parseInt(String.valueOf((long)Integer.MAX_VALUE + 1));
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
  try {
    Integer.parseInt(String.valueOf((long)Integer.MIN_VALUE - 1));
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
  try {
    Integer.parseInt("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
  try {
    Integer.parseInt("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
  try {
    Integer.parseInt("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  NumberFormatException e) {
  }
}
Program: 82272
Project: 82272
Buggy source:
/** 
 * Constructor.
 * @param enableSourceInfoDescendants Controls whether or not SourceInfo nodescreated via the JProgram will record descendant information. Enabling this feature will collect extra data during the compilation cycle, but at a cost of memory and object allocations.
 */
public JProgram(CorrelationFactory correlator){
  super(correlator.makeSourceInfo(SourceOrigin.create(0,JProgram.class.getName())));
  this.correlator=correlator;
  intrinsic=createSourceInfo(0,getClass().getName());
  stringPoolSourceInfo=createLiteralSourceInfo("String_Node_Str",Literal.STRING);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param correlator Controls whether or not SourceInfo nodes created via theJProgram will record descendant information. Enabling this feature will collect extra data during the compilation cycle, but at a cost of memory and object allocations.
 */
public JProgram(CorrelationFactory correlator){
  super(correlator.makeSourceInfo(SourceOrigin.create(0,JProgram.class.getName())));
  this.correlator=correlator;
  intrinsic=createSourceInfo(0,getClass().getName());
  stringPoolSourceInfo=createLiteralSourceInfo("String_Node_Str",Literal.STRING);
}
Program: 82273
Project: 82273
Buggy source:
public JInterfaceType createInterface(SourceInfo info,char[][] name){
  String sname=dotify(name);
  JInterfaceType x=new JInterfaceType(info,sname);
  allTypes.add(x);
  putIntoTypeMap(sname,x);
  if (INDEX_TYPES_SET.contains(sname)) {
    indexedTypes.put(x.getShortName(),x);
  }
  return x;
}

Fixed version (ground truth):
public JInterfaceType createInterface(SourceInfo info,char[][] name){
  String sname=dotify(name);
  JInterfaceType x=new JInterfaceType(info,sname);
  allTypes.add(x);
  putIntoTypeMap(sname,x);
  if (INDEX_TYPES_SET.contains(sname)) {
    indexedTypes.put(x.getShortName(),x);
    if (sname.equals("String_Node_Str")) {
      typeJavaLangCloneable=x;
    }
 else     if (sname.equals("String_Node_Str")) {
      typeJavaIoSerializable=x;
    }
  }
  return x;
}
Program: 82277
Project: 82277
Buggy source:
public void testGeneralizeTypes(){
  assertSame(classA,generalizeTypes(classA,classA));
  assertSame(classB,generalizeTypes(classB,classBnn));
  assertSame(classB,generalizeTypes(classBnn,classB));
  assertSame(classBaseNn,generalizeTypes(classBnn,classBaseNn));
  assertSame(classB,generalizeTypes(classB,typeNull));
  assertSame(classB,generalizeTypes(typeNull,classB));
  assertSame(intfIBase,generalizeTypes(intfI,intfIBase));
  assertSame(intfIBase,generalizeTypes(intfIBase,intfI));
  assertSame(classObject,generalizeTypes(intfJ,intfI));
  assertSame(classObject,generalizeTypes(arrayOfB,arrayOfInt));
  assertSame(classObject,generalizeTypes(arrayOfC,arrayOfArrayOfB));
  assertSame(arrayOfObject,generalizeTypes(arrayOfC,arrayOfB));
  assertSame(arrayOfObject,generalizeTypes(arrayOfObject,arrayOfArrayOfInt));
  assertSame(intfI,generalizeTypes(classB,intfI));
  assertSame(classObject,generalizeTypes(classB,intfJ));
  assertSame(classObject,generalizeTypes(intfI,arrayOfInt));
  for (  JReferenceType type1 : severalTypes()) {
    for (    JReferenceType type2 : severalTypes()) {
      JReferenceType generalized=generalizeTypes(type1,type2);
      assertTrue(typeOracle.canTriviallyCast(type1,generalized));
      assertTrue(typeOracle.canTriviallyCast(type2,generalized));
    }
  }
}

Fixed version (ground truth):
public void testGeneralizeTypes(){
  assertSame(classA,generalizeTypes(classA,classA));
  assertSame(classB,generalizeTypes(classB,classBnn));
  assertSame(classB,generalizeTypes(classBnn,classB));
  assertSame(classBaseNn,generalizeTypes(classBnn,classBaseNn));
  assertSame(classB,generalizeTypes(classB,typeNull));
  assertSame(classB,generalizeTypes(typeNull,classB));
  assertSame(intfIBase,generalizeTypes(intfI,intfIBase));
  assertSame(intfIBase,generalizeTypes(intfIBase,intfI));
  assertSame(classObject,generalizeTypes(intfJ,intfI));
  assertSame(classObject,generalizeTypes(arrayOfB,arrayOfInt));
  assertSame(classObject,generalizeTypes(arrayOfC,arrayOfArrayOfB));
  assertSame(arrayOfObject,generalizeTypes(arrayOfC,arrayOfB));
  assertSame(arrayOfObject,generalizeTypes(arrayOfObject,arrayOfArrayOfInt));
  assertSame(intfI,generalizeTypes(classB,intfI));
  assertSame(classObject,generalizeTypes(classB,intfJ));
  assertSame(classObject,generalizeTypes(intfI,arrayOfInt));
  assertSame(intfSerializable,generalizeTypes(intfSerializable,arrayOfA));
  assertSame(intfCloneable,generalizeTypes(intfCloneable,arrayOfA));
  for (  JReferenceType type1 : severalTypes()) {
    for (    JReferenceType type2 : severalTypes()) {
      JReferenceType generalized=generalizeTypes(type1,type2);
      assertTrue(typeOracle.canTriviallyCast(type1,generalized));
      assertTrue(typeOracle.canTriviallyCast(type2,generalized));
    }
  }
}
Program: 82278
Project: 82278
Buggy source:
public void testCanTheoreticallyCast(){
  assertFalse(typeOracle.canTheoreticallyCast(classBnn,typeNull));
  assertTrue(typeOracle.canTheoreticallyCast(classBSub,classB));
  assertTrue(typeOracle.canTheoreticallyCast(classB,classBSub));
  assertTrue(typeOracle.canTheoreticallyCast(classB,classBnn));
  assertTrue(typeOracle.canTheoreticallyCast(classBnn,classB));
  assertTrue(typeOracle.canTheoreticallyCast(classB,classB));
  assertTrue(typeOracle.canTheoreticallyCast(classObject,arrayOfB));
  assertFalse(typeOracle.canTheoreticallyCast(arrayOfA,arrayOfArrayOfB));
  assertTrue(typeOracle.canTheoreticallyCast(arrayOfObject,arrayOfArrayOfB));
  assertTrue(typeOracle.canTheoreticallyCast(arrayOfB,arrayOfBSub));
  assertTrue(typeOracle.canTheoreticallyCast(classBase,intfI));
  assertFalse(typeOracle.canTheoreticallyCast(classA,intfJ));
  assertTrue(typeOracle.canTheoreticallyCast(intfIBase,intfI));
  assertTrue(typeOracle.canTheoreticallyCast(intfIBase,classBase));
  assertFalse(typeOracle.canTheoreticallyCast(intfJ,classA));
}

Fixed version (ground truth):
public void testCanTheoreticallyCast(){
  assertFalse(typeOracle.canTheoreticallyCast(classBnn,typeNull));
  assertTrue(typeOracle.canTheoreticallyCast(classBSub,classB));
  assertTrue(typeOracle.canTheoreticallyCast(classB,classBSub));
  assertTrue(typeOracle.canTheoreticallyCast(classB,classBnn));
  assertTrue(typeOracle.canTheoreticallyCast(classBnn,classB));
  assertTrue(typeOracle.canTheoreticallyCast(classB,classB));
  assertTrue(typeOracle.canTheoreticallyCast(classObject,arrayOfB));
  assertFalse(typeOracle.canTheoreticallyCast(arrayOfA,arrayOfArrayOfB));
  assertTrue(typeOracle.canTheoreticallyCast(arrayOfObject,arrayOfArrayOfB));
  assertTrue(typeOracle.canTheoreticallyCast(arrayOfB,arrayOfBSub));
  assertTrue(typeOracle.canTheoreticallyCast(classBase,intfI));
  assertFalse(typeOracle.canTheoreticallyCast(classA,intfJ));
  assertTrue(typeOracle.canTheoreticallyCast(intfIBase,intfI));
  assertTrue(typeOracle.canTheoreticallyCast(intfIBase,classBase));
  assertFalse(typeOracle.canTheoreticallyCast(intfJ,classA));
  assertTrue(typeOracle.canTheoreticallyCast(arrayOfA,intfSerializable));
  assertTrue(typeOracle.canTheoreticallyCast(intfSerializable,arrayOfA));
  assertTrue(typeOracle.canTheoreticallyCast(arrayOfA,intfCloneable));
  assertTrue(typeOracle.canTheoreticallyCast(intfCloneable,arrayOfA));
}
Program: 82279
Project: 82279
Buggy source:
public void testStrongerType(){
  assertSame(classA,program.strongerType(classA,classA));
  assertSame(classBnn,program.strongerType(classB,classBnn));
  assertSame(classB,program.strongerType(classB,classBase));
  assertSame(classB,program.strongerType(classBase,classB));
  assertSame(intfI,program.strongerType(intfI,intfJ));
}

Fixed version (ground truth):
public void testStrongerType(){
  assertSame(classA,program.strongerType(classA,classA));
  assertSame(classBnn,program.strongerType(classB,classBnn));
  assertSame(classB,program.strongerType(classB,classBase));
  assertSame(classB,program.strongerType(classBase,classB));
  assertSame(intfI,program.strongerType(intfI,intfJ));
  assertSame(arrayOfA,program.strongerType(intfSerializable,arrayOfA));
  assertSame(arrayOfA,program.strongerType(intfCloneable,arrayOfA));
}
Program: 82280
Project: 82280
Buggy source:
public String getModuleName(){
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getModuleName(){
  return "String_Node_Str";
}
Program: 82281
Project: 82281
Buggy source:
public static Timestamp valueOf(String s){
  String[] components=s.split("String_Node_Str");
  if (components.length != 2) {
    throw new IllegalArgumentException("String_Node_Str" + s);
  }
  String[] timeComponents=components[1].split("String_Node_Str");
  boolean hasNanos=true;
  int nanos=0;
  if (timeComponents.length == 1) {
    hasNanos=false;
  }
 else   if (timeComponents.length != 2) {
    throw new IllegalArgumentException("String_Node_Str" + s);
  }
  Date d=Date.valueOf(components[0]);
  Time t=Time.valueOf(timeComponents[0]);
  if (hasNanos) {
    String nanosString=timeComponents[1];
    int len=nanosString.length();
    assert(len > 0);
    if (len > 9) {
      throw new IllegalArgumentException("String_Node_Str" + s);
    }
    if (len < 9) {
      nanosString+="String_Node_Str".substring(len - 1);
    }
    try {
      nanos=Integer.valueOf(nanosString);
    }
 catch (    NumberFormatException e) {
      throw new IllegalArgumentException("String_Node_Str" + s);
    }
  }
  return new Timestamp(d.getYear(),d.getMonth(),d.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),nanos);
}

Fixed version (ground truth):
public static Timestamp valueOf(String s){
}
Program: 82282
Project: 82282
Buggy source:
public static Timestamp valueOf(String s){
  String[] components=s.split("String_Node_Str");
  if (components.length != 2) {
    throw new IllegalArgumentException("String_Node_Str" + s);
  }
  String[] timeComponents=components[1].split("String_Node_Str");
  if (timeComponents.length != 2) {
    throw new IllegalArgumentException("String_Node_Str" + s);
  }
 else   if (timeComponents[1].length() != 9) {
    throw new IllegalArgumentException("String_Node_Str" + s);
  }
  Date d=Date.valueOf(components[0]);
  Time t=Time.valueOf(timeComponents[0]);
  int nanos;
  try {
    nanos=Integer.valueOf(timeComponents[1]);
  }
 catch (  NumberFormatException e) {
    throw new IllegalArgumentException("String_Node_Str" + s);
  }
  return new Timestamp(d.getYear(),d.getMonth(),d.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),nanos);
}

Fixed version (ground truth):
public static Timestamp valueOf(String s){
  String[] components=s.split("String_Node_Str");
  if (components.length != 2) {
    throw new IllegalArgumentException("String_Node_Str" + s);
  }
  String[] timeComponents=components[1].split("String_Node_Str");
  boolean hasNanos=true;
  int nanos=0;
  if (timeComponents.length == 1) {
    hasNanos=false;
  }
 else   if (timeComponents.length != 2) {
    throw new IllegalArgumentException("String_Node_Str" + s);
  }
  Date d=Date.valueOf(components[0]);
  Time t=Time.valueOf(timeComponents[0]);
  if (hasNanos) {
    String nanosString=timeComponents[1];
    int len=nanosString.length();
    assert(len > 0);
    if (len > 9) {
      throw new IllegalArgumentException("String_Node_Str" + s);
    }
    if (len < 9) {
      nanosString+="String_Node_Str".substring(len - 1);
    }
    try {
      nanos=Integer.valueOf(nanosString);
    }
 catch (    NumberFormatException e) {
      throw new IllegalArgumentException("String_Node_Str" + s);
    }
  }
  return new Timestamp(d.getYear(),d.getMonth(),d.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),nanos);
}
Program: 82283
Project: 82283
Buggy source:
public void testValueOf(){
  try {
    Timestamp.valueOf("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  try {
    Timestamp.valueOf("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  Timestamp expected=new Timestamp(2000 - 1900,1 - 1,1,12,34,56,123456789);
  Timestamp actual=Timestamp.valueOf("String_Node_Str");
  assertEquals(expected,actual);
}

Fixed version (ground truth):
public void testValueOf(){
  try {
    Timestamp.valueOf("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  try {
    Timestamp.valueOf("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException e) {
  }
  Timestamp expected=new Timestamp(2000 - 1900,1 - 1,1,12,34,56,123456789);
  Timestamp actual=Timestamp.valueOf("String_Node_Str");
  assertEquals(expected,actual);
  expected=new Timestamp(2000 - 1900,1 - 1,1,12,34,56,0);
  actual=Timestamp.valueOf("String_Node_Str");
  assertEquals(expected,actual);
  expected=new Timestamp(2000 - 1900,1 - 1,1,12,34,56,100000000);
  actual=Timestamp.valueOf("String_Node_Str");
  assertEquals(expected,actual);
  expected=new Timestamp(2000 - 1900,1 - 1,1,12,34,56,120000000);
  actual=Timestamp.valueOf("String_Node_Str");
  assertEquals(expected,actual);
  expected=new Timestamp(2000 - 1900,1 - 1,1,12,34,56,123000000);
  actual=Timestamp.valueOf("String_Node_Str");
  assertEquals(expected,actual);
  expected=new Timestamp(2000 - 1900,1 - 1,1,12,34,56,123400000);
  actual=Timestamp.valueOf("String_Node_Str");
  assertEquals(expected,actual);
  expected=new Timestamp(2000 - 1900,1 - 1,1,12,34,56,123450000);
  actual=Timestamp.valueOf("String_Node_Str");
  assertEquals(expected,actual);
  expected=new Timestamp(2000 - 1900,1 - 1,1,12,34,56,123456000);
  actual=Timestamp.valueOf("String_Node_Str");
  assertEquals(expected,actual);
  expected=new Timestamp(2000 - 1900,1 - 1,1,12,34,56,123456700);
  actual=Timestamp.valueOf("String_Node_Str");
  assertEquals(expected,actual);
  expected=new Timestamp(2000 - 1900,1 - 1,1,12,34,56,123456780);
  actual=Timestamp.valueOf("String_Node_Str");
}
Program: 82285
Project: 82285
Buggy source:
public GeneratedCompilationUnit(GeneratedUnit generatedUnit,List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,CategorizedProblem[] problems){
  super(compiledClasses,dependencies,jsniMethods,problems);
  this.generatedUnit=generatedUnit;
}

Fixed version (ground truth):
public GeneratedCompilationUnit(GeneratedUnit generatedUnit,List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,MethodArgNamesLookup methodArgs,CategorizedProblem[] problems){
  super(compiledClasses,dependencies,jsniMethods,methodArgs,problems);
  this.generatedUnit=generatedUnit;
}
Program: 82286
Project: 82286
Buggy source:
@Override public boolean isSuperSource(){
  return false;
}

Fixed version (ground truth):
@Deprecated @Override public boolean isSuperSource(){
  return false;
}
Program: 82287
Project: 82287
Buggy source:
public CompilationUnit build(List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,CategorizedProblem[] problems){
  source=null;
  return makeUnit(compiledClasses,dependencies,jsniMethods,problems);
}

Fixed version (ground truth):
public CompilationUnit build(List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,MethodArgNamesLookup methodArgs,CategorizedProblem[] problems){
  source=null;
  return makeUnit(compiledClasses,dependencies,jsniMethods,methodArgs,problems);
}
Program: 82288
Project: 82288
Buggy source:
protected abstract CompilationUnit makeUnit(List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,CategorizedProblem[] errors);

Fixed version (ground truth):
protected abstract CompilationUnit makeUnit(List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,MethodArgNamesLookup methodArgs,CategorizedProblem[] errors);
Program: 82289
Project: 82289
Buggy source:
public CompilationUnitImpl(List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,CategorizedProblem[] problems){
  this.exposedCompiledClasses=Lists.normalizeUnmodifiable(compiledClasses);
  this.dependencies=dependencies;
  this.jsniMethods=Lists.create(jsniMethods.toArray(new JsniMethod[jsniMethods.size()]));
  this.problems=problems;
  for (  CompiledClass cc : compiledClasses) {
    cc.initUnit(this);
  }
}

Fixed version (ground truth):
public CompilationUnitImpl(List<CompiledClass> compiledClasses,Set<ContentId> dependencies,Collection<? extends JsniMethod> jsniMethods,MethodArgNamesLookup methodArgs,CategorizedProblem[] problems){
  this.exposedCompiledClasses=Lists.normalizeUnmodifiable(compiledClasses);
  this.dependencies=dependencies;
  this.jsniMethods=Lists.create(jsniMethods.toArray(new JsniMethod[jsniMethods.size()]));
  this.methodArgs=methodArgs;
  this.problems=problems;
  for (  CompiledClass cc : compiledClasses) {
    cc.initUnit(this);
  }
}
Program: 82290
Project: 82290
Buggy source:
Set<ContentId> getDependencies(){
  return dependencies;
}

Fixed version (ground truth):
@Override Set<ContentId> getDependencies(){
  return dependencies;
}
Program: 82291
Project: 82291
Buggy source:
public List<JsniMethod> getJsniMethods(){
  return jsniMethods;
}

Fixed version (ground truth):
@Override public List<JsniMethod> getJsniMethods(){
  return jsniMethods;
}
Program: 82292
Project: 82292
Buggy source:
/** 
 * Returns all contained classes.
 */
Collection<CompiledClass> getCompiledClasses(){
  return exposedCompiledClasses;
}

Fixed version (ground truth):
/** 
 * Returns all contained classes.
 */
@Override Collection<CompiledClass> getCompiledClasses(){
  return exposedCompiledClasses;
}
Program: 82293
Project: 82293
Buggy source:
CategorizedProblem[] getProblems(){
  return problems;
}

Fixed version (ground truth):
@Override CategorizedProblem[] getProblems(){
  return problems;
}
Program: 82294
Project: 82294
Buggy source:
public boolean isCompiled(){
  return false;
}

Fixed version (ground truth):
@Override public boolean isCompiled(){
  return false;
}
Program: 82295
Project: 82295
Buggy source:
public long getLastModified(){
  return unit.getLastModified();
}

Fixed version (ground truth):
@Override public long getLastModified(){
  return unit.getLastModified();
}
Program: 82296
Project: 82296
Buggy source:
public boolean isSuperSource(){
  return unit.isSuperSource();
}

Fixed version (ground truth):
@Override @Deprecated public boolean isSuperSource(){
  return unit.isSuperSource();
}
Program: 82297
Project: 82297
Buggy source:
public List<JsniMethod> getJsniMethods(){
  return unit.getJsniMethods();
}

Fixed version (ground truth):
@Override public List<JsniMethod> getJsniMethods(){
  return unit.getJsniMethods();
}
Program: 82298
Project: 82298
Buggy source:
public boolean isGenerated(){
  return unit.isGenerated();
}

Fixed version (ground truth):
@Override @Deprecated public boolean isGenerated(){
  return unit.isGenerated();
}
Program: 82299
Project: 82299
Buggy source:
public boolean isError(){
  return true;
}

Fixed version (ground truth):
@Override public boolean isError(){
  return true;
}
Program: 82300
Project: 82300
Buggy source:
public String getDisplayLocation(){
  return unit.getDisplayLocation();
}

Fixed version (ground truth):
@Override public String getDisplayLocation(){
  return unit.getDisplayLocation();
}
Program: 82301
Project: 82301
Buggy source:
public String getSource(){
  return unit.getSource();
}

Fixed version (ground truth):
@Override @Deprecated public String getSource(){
  return unit.getSource();
}
Program: 82302
Project: 82302
Buggy source:
public String getTypeName(){
  return unit.getTypeName();
}

Fixed version (ground truth):
@Override public String getTypeName(){
  return unit.getTypeName();
}
Program: 82303
Project: 82303
Buggy source:
public boolean isCompiled(){
  return false;
}

Fixed version (ground truth):
@Override public boolean isCompiled(){
  return false;
}
Program: 82304
Project: 82304
Buggy source:
public long getLastModified(){
  return unit.getLastModified();
}

Fixed version (ground truth):
@Override public long getLastModified(){
  return unit.getLastModified();
}
Program: 82305
Project: 82305
Buggy source:
public boolean isSuperSource(){
  return unit.isSuperSource();
}

Fixed version (ground truth):
@Override @Deprecated public boolean isSuperSource(){
  return unit.isSuperSource();
}
Program: 82306
Project: 82306
Buggy source:
public List<JsniMethod> getJsniMethods(){
  return unit.getJsniMethods();
}

Fixed version (ground truth):
@Override public List<JsniMethod> getJsniMethods(){
  return unit.getJsniMethods();
}
Program: 82307
Project: 82307
Buggy source:
public boolean isGenerated(){
  return unit.isGenerated();
}

Fixed version (ground truth):
@Override @Deprecated public boolean isGenerated(){
  return unit.isGenerated();
}
Program: 82308
Project: 82308
Buggy source:
public boolean isError(){
  return false;
}

Fixed version (ground truth):
@Override public boolean isError(){
  return false;
}
Program: 82309
Project: 82309
Buggy source:
public String getDisplayLocation(){
  return unit.getDisplayLocation();
}

Fixed version (ground truth):
@Override public String getDisplayLocation(){
  return unit.getDisplayLocation();
}
Program: 82310
Project: 82310
Buggy source:
public String getSource(){
  return unit.getSource();
}

Fixed version (ground truth):
@Override @Deprecated public String getSource(){
  return unit.getSource();
}
Program: 82311
Project: 82311
Buggy source:
public String getTypeName(){
  return unit.getTypeName();
}

Fixed version (ground truth):
@Override public String getTypeName(){
  return unit.getTypeName();
}
Program: 82313
Project: 82313
Buggy source:
private static String escapeXml(String unescaped){
  String escaped=unescaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  escaped=escaped.replaceAll("String_Node_Str","String_Node_Str");
  return escaped;
}

Fixed version (ground truth):
private static String escapeXml(String unescaped){
  return SizeMapRecorder.escapeXml(unescaped);
}
Program: 82314
Project: 82314
Buggy source:
/** 
 * Checks whether the given method qualifies as a setter. This looks at the method qualifiers, name and return type, but not at the parameter types.
 * @param method the method to look at
 * @return whether it's a setter
 */
private boolean isSetterMethod(JMethod method){
  return method.isPublic() && !method.isStatic() && method.getName().startsWith("String_Node_Str")&& method.getReturnType() == JPrimitiveType.VOID;
}

Fixed version (ground truth):
/** 
 * Checks whether the given method qualifies as a setter. This looks at the method qualifiers, name and return type, but not at the parameter types.
 * @param method the method to look at
 * @return whether it's a setter
 */
private boolean isSetterMethod(JMethod method){
  return method.isPublic() && !method.isStatic() && method.getName().startsWith("String_Node_Str")&& method.getName().length() > 3 && method.getReturnType() == JPrimitiveType.VOID;
}
Program: 82315
Project: 82315
Buggy source:
/** 
 * Formats Year field according to pattern specified. Javascript Date object seems incapable handling 1BC and year before. It can show you year 0 which does not exists. following we just keep consistent with javascript's toString method. But keep in mind those things should be unsupported.
 * @param buf where formatted string will be appended to
 * @param count number of time pattern char repeats; this controls how a fieldshould be formatted
 * @param date hold the date object to be formatted
 */
private void formatYear(StringBuffer buf,int count,Date date){
  int value=date.getYear() + JS_START_YEAR;
  if (value < 0) {
    value=-value;
  }
  if (count == 2) {
    zeroPaddingNumber(buf,value % 100,2);
  }
 else {
    buf.append(Integer.toString(value));
  }
}

Fixed version (ground truth):
/** 
 * Formats Year field according to pattern specified. Javascript Date object seems incapable handling 1BC and year before. It can show you year 0 which does not exists. following we just keep consistent with javascript's toString method. But keep in mind those things should be unsupported.
 * @param buf where formatted string will be appended to
 * @param count number of time pattern char repeats; this controls how a fieldshould be formatted
 * @param date hold the date object to be formatted
 */
private void formatYear(StringBuffer buf,int count,Date date){
  int value=date.getYear() + JS_START_YEAR;
  if (value < 0) {
    value=-value;
  }
  if (count == 2) {
    zeroPaddingNumber(buf,value % 100,2);
  }
 else {
    buf.append(value);
  }
}
Program: 82316
Project: 82316
Buggy source:
/** 
 * Formats Fractional seconds field according to pattern specified.
 * @param buf where formatted string will be appended to
 * @param count number of time pattern char repeats; this controls how a fieldshould be formatted
 * @param date hold the date object to be formatted
 */
private void formatFractionalSeconds(StringBuffer buf,int count,Date date){
  long time=date.getTime();
  int value;
  if (time < 0) {
    value=1000 - (int)(-time % 1000);
  }
 else {
    value=(int)(time % 1000);
  }
  if (count == 1) {
    value=(value + 50) / 100;
    buf.append(Integer.toString(value));
  }
 else   if (count == 2) {
    value=(value + 5) / 10;
    zeroPaddingNumber(buf,value,2);
  }
 else {
    zeroPaddingNumber(buf,value,3);
    if (count > 3) {
      zeroPaddingNumber(buf,0,count - 3);
    }
  }
}

Fixed version (ground truth):
/** 
 * Formats Fractional seconds field according to pattern specified.
 * @param buf where formatted string will be appended to
 * @param count number of time pattern char repeats; this controls how a fieldshould be formatted
 * @param date hold the date object to be formatted
 */
private void formatFractionalSeconds(StringBuffer buf,int count,Date date){
  long time=date.getTime();
  int value;
  if (time < 0) {
    value=1000 - (int)(-time % 1000);
  }
 else {
    value=(int)(time % 1000);
  }
  if (count == 1) {
    value=Math.min((value + 50) / 100,9);
    buf.append((char)('0' + value));
  }
 else   if (count == 2) {
    value=Math.min((value + 5) / 10,99);
    zeroPaddingNumber(buf,value,2);
  }
 else {
    zeroPaddingNumber(buf,value,3);
    if (count > 3) {
      zeroPaddingNumber(buf,0,count - 3);
    }
  }
}
Program: 82317
Project: 82317
Buggy source:
/** 
 * Formats a number with the specified minimum number of digits, using zero to fill the gap.
 * @param buf where zero padded string will be written to
 * @param value the number value being formatted
 * @param minWidth minimum width of the formatted string; zero will be paddedto reach this width
 */
private void zeroPaddingNumber(StringBuffer buf,int value,int minWidth){
  int b=NUMBER_BASE;
  for (int i=0; i < minWidth - 1; i++) {
    if (value < b) {
      buf.append('0');
    }
    b*=NUMBER_BASE;
  }
  buf.append(Integer.toString(value));
}

Fixed version (ground truth):
/** 
 * Formats a number with the specified minimum number of digits, using zero to fill the gap.
 * @param buf where zero padded string will be written to
 * @param value the number value being formatted
 * @param minWidth minimum width of the formatted string; zero will be paddedto reach this width
 */
private void zeroPaddingNumber(StringBuffer buf,int value,int minWidth){
  int b=NUMBER_BASE;
  for (int i=0; i < minWidth - 1; i++) {
    if (value < b) {
      buf.append('0');
    }
    b*=NUMBER_BASE;
  }
  buf.append(value);
}
Program: 82318
Project: 82318
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public <T>T[] toArray(T[] a){
  Object[] result=super.toArray(a);
  for (int i=0, c=result.length; i < c; ++i) {
    result[i]=new UnmodifiableEntry<K,V>((Map.Entry<K,V>)result[i]);
  }
  return (T[])result;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public <T>T[] toArray(T[] a){
  Object[] result=super.toArray(a);
  wrap(result,coll.size());
  return (T[])result;
}
Program: 82319
Project: 82319
Buggy source:
public int compare(Object o1,Object o2){
  String s1=(String)o1;
  String s2=(String)o2;
  return s2.compareTo(s1);
}

Fixed version (ground truth):
public int compare(String s1,String s2){
  return s2.compareTo(s1);
}
Program: 82320
Project: 82320
Buggy source:
public void testSort(){
  List a=createSortedList();
  Collections.reverse(a);
  Collections.sort(a);
  assertEquals(createSortedList(),a);
}

Fixed version (ground truth):
public void testSort(){
  List<String> a=createSortedList();
  Collections.reverse(a);
  Collections.sort(a);
  assertEquals(createSortedList(),a);
}
Program: 82321
Project: 82321
Buggy source:
public static List createSortedList(){
  ArrayList l=new ArrayList();
  l.add("String_Node_Str");
  l.add("String_Node_Str");
  l.add("String_Node_Str");
  return l;
}

Fixed version (ground truth):
public static List<String> createSortedList(){
  ArrayList<String> l=new ArrayList<String>();
  l.add("String_Node_Str");
  l.add("String_Node_Str");
  l.add("String_Node_Str");
  return l;
}
Program: 82322
Project: 82322
Buggy source:
/** 
 * Test Collections.binarySearch(List, Object, Comparator). Verify the following cases: empty List odd numbers of elements even numbers of elements not found value larger than all elements not found value smaller than all elements null Comparator uses natural ordering
 */
public void testBinarySearchObjectComparator(){
  Comparator inverseSort=new Comparator(){
    public int compare(    Object o1,    Object o2){
      return ((Comparable)o2).compareTo(o1);
    }
  }
;
  List a1=new ArrayList();
  int ret=Collections.binarySearch(a1,"String_Node_Str",inverseSort);
  assertEquals(-1,ret);
  List a2=new ArrayList(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a2,"String_Node_Str",inverseSort);
  assertEquals(-3,ret);
  ret=Collections.binarySearch(a2,"String_Node_Str",inverseSort);
  assertEquals(2,ret);
  List a3=new ArrayList(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(-5,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(-1,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(0,ret);
  List a4=new ArrayList(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a4,"String_Node_Str",null);
  assertEquals(3,ret);
}

Fixed version (ground truth):
/** 
 * Test Collections.binarySearch(List, Object, Comparator). Verify the following cases: empty List odd numbers of elements even numbers of elements not found value larger than all elements not found value smaller than all elements null Comparator uses natural ordering
 */
public void testBinarySearchObjectComparator(){
  Comparator<String> inverseSort=new Comparator<String>(){
    public int compare(    String o1,    String o2){
      return o2.compareTo(o1);
    }
  }
;
  List<String> a1=new ArrayList<String>();
  int ret=Collections.binarySearch(a1,"String_Node_Str",inverseSort);
  assertEquals(-1,ret);
  List<String> a2=new ArrayList<String>(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a2,"String_Node_Str",inverseSort);
  assertEquals(-3,ret);
  ret=Collections.binarySearch(a2,"String_Node_Str",inverseSort);
  assertEquals(2,ret);
  List<String> a3=new ArrayList<String>(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(-5,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(-1,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str",inverseSort);
  assertEquals(0,ret);
  List<String> a4=new ArrayList<String>(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a4,"String_Node_Str",null);
  assertEquals(3,ret);
}
Program: 82323
Project: 82323
Buggy source:
public void testReverse(){
  List a=createSortedList();
  Collections.reverse(a);
  Object[] x={"String_Node_Str","String_Node_Str","String_Node_Str"};
  assertEquals(x,a);
  List b=createRandomList();
  Collections.reverse(b);
  Collections.reverse(b);
  assertEquals(b,createRandomList());
}

Fixed version (ground truth):
public void testReverse(){
  List<String> a=createSortedList();
  Collections.reverse(a);
  Object[] x={"String_Node_Str","String_Node_Str","String_Node_Str"};
  assertEquals(x,a);
  List<Integer> b=createRandomList();
  Collections.reverse(b);
  Collections.reverse(b);
  assertEquals(b,createRandomList());
}
Program: 82324
Project: 82324
Buggy source:
public void testSortWithComparator(){
  Comparator x=new Comparator(){
    public int compare(    Object o1,    Object o2){
      String s1=(String)o1;
      String s2=(String)o2;
      return s2.compareTo(s1);
    }
  }
;
  List a=createSortedList();
  Collections.sort(a,x);
  Object[] expected={"String_Node_Str","String_Node_Str","String_Node_Str"};
  assertEquals(expected,a);
}

Fixed version (ground truth):
public void testSortWithComparator(){
  Comparator<String> x=new Comparator<String>(){
    public int compare(    String s1,    String s2){
      return s2.compareTo(s1);
    }
  }
;
  List<String> a=createSortedList();
  Collections.sort(a,x);
  Object[] expected={"String_Node_Str","String_Node_Str","String_Node_Str"};
  assertEquals(expected,a);
}
Program: 82325
Project: 82325
Buggy source:
public void testFill(){
  List a=createSortedList();
  Collections.fill(a,null);
  assertEquals(new Object[a.size()],a);
  List b=createRandomList();
  Collections.fill(b,null);
  assertEquals(new Object[b.size()],b);
}

Fixed version (ground truth):
public void testFill(){
  List<String> a=createSortedList();
  Collections.fill(a,null);
  assertEquals(new Object[a.size()],a);
  List<Integer> b=createRandomList();
  Collections.fill(b,null);
  assertEquals(new Object[b.size()],b);
}
Program: 82326
Project: 82326
Buggy source:
/** 
 * Test Collections.binarySearch(List, Object). Verify the following cases: empty List odd numbers of elements even numbers of elements not found value larger than all elements not found value smaller than all elements
 */
public void testBinarySearchObject(){
  List a1=new ArrayList();
  int ret=Collections.binarySearch(a1,"String_Node_Str");
  assertEquals(-1,ret);
  List a2=new ArrayList(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a2,"String_Node_Str");
  assertEquals(-2,ret);
  ret=Collections.binarySearch(a2,"String_Node_Str");
  assertEquals(2,ret);
  List a3=new ArrayList(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a3,"String_Node_Str");
  assertEquals(-5,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str");
  assertEquals(-1,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str");
  assertEquals(0,ret);
}

Fixed version (ground truth):
/** 
 * Test Collections.binarySearch(List, Object). Verify the following cases: empty List odd numbers of elements even numbers of elements not found value larger than all elements not found value smaller than all elements
 */
public void testBinarySearchObject(){
  List<String> a1=new ArrayList<String>();
  int ret=Collections.binarySearch(a1,"String_Node_Str");
  assertEquals(-1,ret);
  List<String> a2=new ArrayList<String>(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a2,"String_Node_Str");
  assertEquals(-2,ret);
  ret=Collections.binarySearch(a2,"String_Node_Str");
  assertEquals(2,ret);
  List<String> a3=new ArrayList<String>(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  ret=Collections.binarySearch(a3,"String_Node_Str");
  assertEquals(-5,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str");
  assertEquals(-1,ret);
  ret=Collections.binarySearch(a3,"String_Node_Str");
  assertEquals(0,ret);
}
Program: 82327
Project: 82327
Buggy source:
public static List createRandomList(){
  ArrayList l=new ArrayList();
  l.add(new Integer(5));
  l.add(new Integer(2));
  l.add(new Integer(3));
  l.add(new Integer(1));
  l.add(new Integer(4));
  return l;
}

Fixed version (ground truth):
public static List<Integer> createRandomList(){
  ArrayList<Integer> l=new ArrayList<Integer>();
  l.add(new Integer(5));
  l.add(new Integer(2));
  l.add(new Integer(3));
  l.add(new Integer(1));
  l.add(new Integer(4));
  return l;
}
Program: 82328
Project: 82328
Buggy source:
public static void retainValidUnits(Collection<CompilationUnit> units,Set<ContentId> knownValidRefs){
  Set<CompilationUnit> currentlyValidUnits=new HashSet<CompilationUnit>();
  Set<ContentId> currentlyValidRefs=new HashSet<ContentId>(knownValidRefs);
  for (  CompilationUnit unit : units) {
    if (unit.isCompiled()) {
      currentlyValidUnits.add(unit);
      currentlyValidRefs.add(unit.getContentId());
    }
  }
  boolean changed;
  do {
    changed=false;
    iterating:     for (Iterator<CompilationUnit> it=currentlyValidUnits.iterator(); it.hasNext(); ) {
      CompilationUnit unitToCheck=it.next();
      for (      ContentId ref : unitToCheck.getDependencies()) {
        if (!currentlyValidRefs.contains(ref)) {
          it.remove();
          currentlyValidRefs.remove(unitToCheck.getDisplayLocation());
          changed=true;
          continue iterating;
        }
      }
    }
  }
 while (changed);
  units.retainAll(currentlyValidUnits);
}

Fixed version (ground truth):
public static void retainValidUnits(Collection<CompilationUnit> units,Set<ContentId> knownValidRefs){
  Set<CompilationUnit> currentlyValidUnits=new HashSet<CompilationUnit>();
  Set<ContentId> currentlyValidRefs=new HashSet<ContentId>(knownValidRefs);
  for (  CompilationUnit unit : units) {
    if (unit.isCompiled()) {
      currentlyValidUnits.add(unit);
      currentlyValidRefs.add(unit.getContentId());
    }
  }
  boolean changed;
  do {
    changed=false;
    iterating:     for (Iterator<CompilationUnit> it=currentlyValidUnits.iterator(); it.hasNext(); ) {
      CompilationUnit unitToCheck=it.next();
      for (      ContentId ref : unitToCheck.getDependencies()) {
        if (!currentlyValidRefs.contains(ref)) {
          it.remove();
          currentlyValidRefs.remove(unitToCheck.getContentId());
          changed=true;
          continue iterating;
        }
      }
    }
  }
 while (changed);
  units.retainAll(currentlyValidUnits);
}