nus-yam/ex-repair huggingface dataset:
Program: 54284
Project: 54284
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: 54285
Project: 54285
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: 54287
Project: 54287
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: 54288
Project: 54288
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: 54292
Project: 54292
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: 54293
Project: 54293
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: 54294
Project: 54294
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: 54295
Project: 54295
Buggy source:
public String getModuleName(){
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getModuleName(){
  return "String_Node_Str";
}
Program: 54296
Project: 54296
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: 54297
Project: 54297
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: 54298
Project: 54298
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: 54299
Project: 54299
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: 54300
Project: 54300
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: 54301
Project: 54301
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);
}
Program: 54302
Project: 54302
Buggy source:
/** 
 * Returns a pretty printed list of clients that have not retrieved the current test. Used for error reporting.
 * @param testInfo the {@link TestInfo} we are waiting for
 * @return a string containing the list of clients that have not retrieved thecurrent test.
 */
String getUnretrievedClients(TestInfo testInfo){
synchronized (clientStatusesLock) {
    Map<ClientStatus,JUnitResult> results=testResults.get(testInfo);
    StringBuilder buf=new StringBuilder();
    int lineCount=0;
    for (    ClientStatus clientStatus : clientStatuses.values()) {
      if (lineCount > 0) {
        buf.append('\n');
      }
      if (results == null || !results.containsKey(clientStatus)) {
        buf.append("String_Node_Str");
      }
 else {
        buf.append("String_Node_Str");
      }
      buf.append(clientStatus.clientDesc);
      ++lineCount;
    }
    int difference=numClients - getNumClientsRetrievedTest(testInfo);
    if (difference > 0) {
      if (lineCount > 0) {
        buf.append('\n');
      }
      buf.append("String_Node_Str" + difference + "String_Node_Str");
    }
    return buf.toString();
  }
}

Fixed version (ground truth):
/** 
 * Returns a pretty printed list of clients that have not retrieved the current test. Used for error reporting.
 * @param testInfo the {@link TestInfo} we are waiting for
 * @return a string containing the list of clients that have not retrieved thecurrent test.
 */
String getUnretrievedClients(TestInfo testInfo){
synchronized (clientStatusesLock) {
    Map<ClientStatus,JUnitResult> results=testResults.get(testInfo);
    StringBuilder buf=new StringBuilder();
    int lineCount=0;
    for (    ClientStatus clientStatus : clientStatuses.values()) {
      if (lineCount > 0) {
        buf.append('\n');
      }
      if (results == null || !results.containsKey(clientStatus)) {
        buf.append("String_Node_Str");
      }
 else {
        buf.append("String_Node_Str");
      }
      buf.append(clientStatus.getDesc());
      ++lineCount;
    }
    int difference=numClients - getNumClientsRetrievedTest(testInfo);
    if (difference > 0) {
      if (lineCount > 0) {
        buf.append('\n');
      }
      buf.append("String_Node_Str" + difference + "String_Node_Str");
    }
    return buf.toString();
  }
}
Program: 54303
Project: 54303
Buggy source:
public void reportFatalLaunch(String clientId,String clientDesc,String userAgent,JUnitResult result){
  ClientStatus clientStatus=ensureClientStatus(clientId,clientDesc);
  Map<TestInfo,JUnitResult> results=new HashMap<TestInfo,JUnitResult>();
  for (  TestInfo testInfo : testBlocks.get(clientStatus.blockIndex)) {
    results.put(testInfo,result);
  }
  reportResults(clientId,clientDesc,userAgent,results);
}

Fixed version (ground truth):
/** 
 * Reports a failure from a client that cannot startup.
 * @param clientInfo information about the client
 * @param result the failure result
 */
public void reportFatalLaunch(ClientInfoExt clientInfo,JUnitResult result){
  ClientStatus clientStatus=ensureClientStatus(clientInfo);
  Map<TestInfo,JUnitResult> results=new HashMap<TestInfo,JUnitResult>();
  for (  TestInfo testInfo : testBlocks.get(clientStatus.blockIndex)) {
    results.put(testInfo,result);
  }
  reportResults(clientInfo,results);
}
Program: 54304
Project: 54304
Buggy source:
/** 
 * Returns any new clients that have contacted the server since the last call. The same client will never be returned from this method twice.
 */
String[] getNewClients(){
synchronized (clientStatusesLock) {
    List<String> results=new ArrayList<String>();
    for (    ClientStatus clientStatus : clientStatuses.values()) {
      if (clientStatus.isNew) {
        results.add(clientStatus.clientDesc);
        clientStatus.isNew=false;
      }
    }
    clientStatusesLock.notifyAll();
    return results.toArray(new String[results.size()]);
  }
}

Fixed version (ground truth):
/** 
 * Returns any new clients that have contacted the server since the last call. The same client will never be returned from this method twice.
 */
String[] getNewClients(){
synchronized (clientStatusesLock) {
    List<String> results=new ArrayList<String>();
    for (    ClientStatus clientStatus : clientStatuses.values()) {
      if (clientStatus.isNew) {
        results.add(clientStatus.getDesc());
        clientStatus.isNew=false;
      }
    }
    clientStatusesLock.notifyAll();
    return results.toArray(new String[results.size()]);
  }
}
Program: 54305
Project: 54305
Buggy source:
public ClientStatus(String clientId,String clientDesc){
  this.clientId=clientId;
  this.clientDesc=clientDesc;
}

Fixed version (ground truth):
public ClientStatus(ClientInfoExt clientInfo){
  this.clientInfo=clientInfo;
}
Program: 54306
Project: 54306
Buggy source:
/** 
 * Ensure that a   {@link ClientStatus} for the clientId exists.
 * @param clientId the id of the client
 * @return the {@link ClientStatus} for the client
 */
private ClientStatus ensureClientStatus(String clientId,String clientDesc){
  ClientStatus clientStatus=clientStatuses.get(clientId);
  if (clientStatus == null) {
    clientStatus=new ClientStatus(clientId,clientDesc);
    clientStatuses.put(clientId,clientStatus);
  }
 else {
    clientStatus.clientDesc=clientDesc;
  }
  return clientStatus;
}

Fixed version (ground truth):
/** 
 * Ensure that a   {@link ClientStatus} for the clientId exists.
 * @param clientId the id of the client
 * @return the {@link ClientStatus} for the client
 */
private ClientStatus ensureClientStatus(ClientInfoExt clientInfo){
  int id=clientInfo.getSessionId();
  ClientStatus clientStatus=clientStatuses.get(id);
  if (clientStatus == null) {
    clientStatus=new ClientStatus(clientInfo);
    clientStatuses.put(id,clientStatus);
  }
 else {
    clientStatus.updateClientInfo(clientInfo);
  }
  return clientStatus;
}
Program: 54307
Project: 54307
Buggy source:
/** 
 * Called by the servlet to report the results of the last test to run.
 * @param clientId the ID of the client
 * @param userAgent the user agent property of the client
 * @param results the result of running the test block
 */
public void reportResults(String clientId,String clientDesc,String userAgent,Map<TestInfo,JUnitResult> results){
synchronized (clientStatusesLock) {
    if (results == null) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    userAgents.add(userAgent);
    ClientStatus clientStatus=ensureClientStatus(clientId,clientDesc);
    for (    Map.Entry<TestInfo,JUnitResult> entry : results.entrySet()) {
      TestInfo testInfo=entry.getKey();
      ensureResults(testInfo).put(clientStatus,entry.getValue());
    }
    clientStatusesLock.notifyAll();
  }
}

Fixed version (ground truth):
/** 
 * Called by the servlet to report the results of the last test to run.
 * @param clientInfo information about the client
 * @param results the result of running the test block
 */
public void reportResults(ClientInfoExt clientInfo,Map<TestInfo,JUnitResult> results){
synchronized (clientStatusesLock) {
    if (results == null) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    userAgents.add(clientInfo.getUserAgent());
    ClientStatus clientStatus=ensureClientStatus(clientInfo);
    for (    Map.Entry<TestInfo,JUnitResult> entry : results.entrySet()) {
      TestInfo testInfo=entry.getKey();
      ensureResults(testInfo).put(clientStatus,entry.getValue());
    }
    clientStatusesLock.notifyAll();
  }
}
Program: 54308
Project: 54308
Buggy source:
/** 
 * Returns a human-formatted message identifying what clients have connected but have not yet reported results for this test. It is used in a timeout condition, to identify what we're still waiting on.
 * @param testInfo the {@link TestInfo} that the clients are working on
 * @return human readable message
 */
String getWorkingClients(TestInfo testInfo){
synchronized (clientStatusesLock) {
    int itemCount=0;
    StringBuilder buf=new StringBuilder();
    Map<ClientStatus,JUnitResult> results=testResults.get(testInfo);
    if (results != null) {
      for (      Map.Entry<ClientStatus,JUnitResult> entry : results.entrySet()) {
        if (entry.getValue() == null) {
          buf.append(entry.getKey().clientDesc);
          buf.append("String_Node_Str");
          itemCount++;
        }
      }
    }
    int difference=numClients - itemCount;
    if (difference > 0) {
      if (itemCount > 0) {
        buf.append('\n');
      }
      buf.append(difference + "String_Node_Str");
    }
    return buf.toString();
  }
}

Fixed version (ground truth):
/** 
 * Returns a human-formatted message identifying what clients have connected but have not yet reported results for this test. It is used in a timeout condition, to identify what we're still waiting on.
 * @param testInfo the {@link TestInfo} that the clients are working on
 * @return human readable message
 */
String getWorkingClients(TestInfo testInfo){
synchronized (clientStatusesLock) {
    int itemCount=0;
    StringBuilder buf=new StringBuilder();
    Map<ClientStatus,JUnitResult> results=testResults.get(testInfo);
    if (results != null) {
      for (      Map.Entry<ClientStatus,JUnitResult> entry : results.entrySet()) {
        if (entry.getValue() == null) {
          buf.append(entry.getKey().getDesc());
          buf.append("String_Node_Str");
          itemCount++;
        }
      }
    }
    int difference=numClients - itemCount;
    if (difference > 0) {
      if (itemCount > 0) {
        buf.append('\n');
      }
      buf.append(difference + "String_Node_Str");
    }
    return buf.toString();
  }
}
Program: 54310
Project: 54310
Buggy source:
/** 
 * Reports results for the last method run and gets the name of next method to run.
 * @param results the results of executing the test
 * @param blockIndex the index of the test block to retrieve
 * @param userAgent the user agent property of this client
 * @return the next test block
 * @throws TimeoutException if the wait for the next method times out.
 */
TestBlock reportResultsAndGetTestBlock(HashMap<TestInfo,JUnitResult> results,int blockIndex,String userAgent) throws TimeoutException ;

Fixed version (ground truth):
/** 
 * Reports results for the last method run and gets the name of next method to run.
 * @param results the results of executing the test
 * @param blockIndex the index of the test block to retrieve
 * @param clientInfo the info for this client
 * @return the next test block
 * @throws TimeoutException if the wait for the next method times out.
 */
TestBlock reportResultsAndGetTestBlock(HashMap<TestInfo,JUnitResult> results,int blockIndex,ClientInfo clientInfo) throws TimeoutException ;
Program: 54311
Project: 54311
Buggy source:
/** 
 * Gets a specific block of tests to run.
 * @param blockIndex the index of the test block to retrieve
 * @param userAgent the user agent property of this client
 * @return the test block
 * @throws TimeoutException if the wait for the next method times out.
 */
TestBlock getTestBlock(int blockIndex,String userAgent) throws TimeoutException ;

Fixed version (ground truth):
/** 
 * Gets a specific block of tests to run.
 * @param blockIndex the index of the test block to retrieve
 * @param clientInfo the info for this client
 * @return the initial response
 * @throws TimeoutException if the wait for the next method times out.
 */
InitialResponse getTestBlock(int blockIndex,ClientInfo clientInfo) throws TimeoutException ;
Program: 54312
Project: 54312
Buggy source:
public static String toSourceName(String dottedName){
  return dottedName.replaceAll("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public static String toSourceName(String dottedName){
  return NON_TRAILING_DOLLAR.matcher(dottedName).replaceAll("String_Node_Str");
}
Program: 54313
Project: 54313
Buggy source:
/** 
 * React to messages from the other side, where a return value is expected.
 * @param handler
 * @throws RemoteDeathError
 */
public ReturnMessage reactToMessagesWhileWaitingForReturn(SessionHandler handler){
  do {
    try {
      getStreamToOtherSide().flush();
      MessageType messageType=Message.readMessageType(getStreamFromOtherSide());
switch (messageType) {
case FREE_VALUE:
        final FreeMessage freeMsg=FreeMessage.receive(this);
      handler.freeValue(this,freeMsg.getIds());
    break;
case RETURN:
  return ReturnMessage.receive(this);
case INVOKE:
InvokeOnServerMessage imsg=InvokeOnServerMessage.receive(this);
ExceptionOrReturnValue result=handler.invoke(this,imsg.getThis(),imsg.getMethodDispatchId(),imsg.getArgs());
sendFreedValues();
ReturnMessage.send(this,result);
break;
case INVOKE_SPECIAL:
handleInvokeSpecial(handler);
break;
case QUIT:
throw new RemoteDeathError(null);
default :
throw new BrowserChannelException("String_Node_Str" + messageType + "String_Node_Str");
}
}
 catch (IOException e) {
throw new RemoteDeathError(e);
}
catch (BrowserChannelException e) {
throw new RemoteDeathError(e);
}
}
 while (true);
}

Fixed version (ground truth):
/** 
 * React to messages from the other side, where a return value is expected.
 * @param handler
 * @throws BrowserChannelException 
 * @throws RemoteDeathError
 */
public ReturnMessage reactToMessagesWhileWaitingForReturn(SessionHandler handler) throws BrowserChannelException, RemoteDeathError {
  do {
    try {
      getStreamToOtherSide().flush();
      MessageType messageType=Message.readMessageType(getStreamFromOtherSide());
switch (messageType) {
case FREE_VALUE:
        final FreeMessage freeMsg=FreeMessage.receive(this);
      handler.freeValue(this,freeMsg.getIds());
    break;
case RETURN:
  return ReturnMessage.receive(this);
case INVOKE:
InvokeOnServerMessage imsg=InvokeOnServerMessage.receive(this);
ExceptionOrReturnValue result=handler.invoke(this,imsg.getThis(),imsg.getMethodDispatchId(),imsg.getArgs());
sendFreedValues();
ReturnMessage.send(this,result);
break;
case INVOKE_SPECIAL:
handleInvokeSpecial(handler);
break;
case QUIT:
throw new RemoteDeathError(null);
default :
throw new BrowserChannelException("String_Node_Str" + messageType + "String_Node_Str");
}
}
 catch (IOException e) {
throw new RemoteDeathError(e);
}
catch (BrowserChannelException e) {
throw new RemoteDeathError(e);
}
}
 while (true);
}
Program: 54314
Project: 54314
Buggy source:
/** 
 * Load a new instance of a module.
 * @param channel
 * @param moduleName
 * @param userAgent
 * @param url top-level URL of the main page, null if using an old plugin
 * @param tabKey opaque key of the tab, may be empty if the plugin can'tdistinguish tabs or null if using an old plugin
 * @param sessionKey opaque key for this session, null if using an old plugin
 * @param userAgentIcon byte array containing an icon (which fits within24x24) representing the user agent or null if unavailable
 * @return a TreeLogger to use for the module's logs
 */
public abstract TreeLogger loadModule(BrowserChannel channel,String moduleName,String userAgent,String url,String tabKey,String sessionKey,byte[] userAgentIcon);

Fixed version (ground truth):
/** 
 * Load a new instance of a module.
 * @param channel
 * @param moduleName
 * @param userAgent
 * @param url top-level URL of the main page, null if using an old plugin
 * @param tabKey opaque key of the tab, may be empty if the plugin can'tdistinguish tabs or null if using an old plugin
 * @param sessionKey opaque key for this session, null if using an old plugin
 * @param userAgentIcon byte array containing an icon (which fits within24x24) representing the user agent or null if unavailable
 * @return a TreeLogger to use for the module's logs, or null if the moduleload failed
 */
public abstract TreeLogger loadModule(BrowserChannel channel,String moduleName,String userAgent,String url,String tabKey,String sessionKey,byte[] userAgentIcon);
Program: 54315
Project: 54315
Buggy source:
protected void BrowserChannel(InputStream inputStream,OutputStream outputStream,ObjectRefFactory objectRefFactory) throws IOException {
  streamFromOtherSide=new DataInputStream(inputStream);
  streamToOtherSide=new DataOutputStream(outputStream);
  socket=null;
  this.objectRefFactory=objectRefFactory;
}

Fixed version (ground truth):
protected void BrowserChannel(InputStream inputStream,OutputStream outputStream,ObjectRefFactory objectRefFactory){
  streamFromOtherSide=new DataInputStream(inputStream);
  streamToOtherSide=new DataOutputStream(outputStream);
  socket=null;
  this.objectRefFactory=objectRefFactory;
}
Program: 54316
Project: 54316
Buggy source:
BrowserChannelServer(TreeLogger initialLogger,InputStream inputStream,OutputStream outputStream,SessionHandler handler,boolean ignoreRemoteDeath) throws IOException {
  super(inputStream,outputStream,new ServerObjectRefFactory());
  this.handler=handler;
  this.ignoreRemoteDeath=ignoreRemoteDeath;
  init(initialLogger);
}

Fixed version (ground truth):
BrowserChannelServer(TreeLogger initialLogger,InputStream inputStream,OutputStream outputStream,SessionHandler handler,boolean ignoreRemoteDeath){
  super(inputStream,outputStream,new ServerObjectRefFactory());
  this.handler=handler;
  this.ignoreRemoteDeath=ignoreRemoteDeath;
  init(initialLogger);
}
Program: 54319
Project: 54319
Buggy source:
protected ModuleSpace(TreeLogger logger,ModuleSpaceHost host,String moduleName,Object key){
  this.host=host;
  this.moduleName=moduleName;
  this.key=key;
  this.logger=logger;
  threadLocalLogger.set(host.getLogger());
}

Fixed version (ground truth):
protected ModuleSpace(TreeLogger logger,ModuleSpaceHost host,String moduleName){
  this.host=host;
  this.moduleName=moduleName;
  this.logger=logger;
  threadLocalLogger.set(host.getLogger());
}
Program: 54320
Project: 54320
Buggy source:
public ModuleSpaceOOPHM(ModuleSpaceHost msh,String moduleName,BrowserChannelServer channel){
  super(msh.getLogger(),msh,moduleName,moduleName);
  this.channel=channel;
  msh.getLogger().log(TreeLogger.DEBUG,"String_Node_Str" + moduleName,null);
}

Fixed version (ground truth):
public ModuleSpaceOOPHM(ModuleSpaceHost msh,String moduleName,BrowserChannelServer channel){
  super(msh.getLogger(),msh,moduleName);
  this.channel=channel;
  msh.getLogger().log(TreeLogger.DEBUG,"String_Node_Str" + moduleName,null);
}
Program: 54321
Project: 54321
Buggy source:
@Override public synchronized TreeLogger loadModule(BrowserChannel channel,String moduleName,String userAgent,String url,String tabKey,String sessionKey,byte[] userAgentIcon){
  PerfLogger.start("String_Node_Str" + moduleName);
  BrowserChannelServer serverChannel=(BrowserChannelServer)channel;
  ModuleHandle moduleHandle=host.createModuleLogger(moduleName,userAgent,url,tabKey,sessionKey,serverChannel,userAgentIcon);
  TreeLogger logger=moduleHandle.getLogger();
  moduleHandleMap.put(serverChannel,moduleHandle);
  ModuleSpace moduleSpace=null;
  try {
    ModuleSpaceHost msh=host.createModuleSpaceHost(moduleHandle,moduleName);
    moduleSpace=new ModuleSpaceOOPHM(msh,moduleName,serverChannel);
    moduleMap.put(serverChannel,moduleSpace);
    PerfLogger.start("String_Node_Str");
    moduleSpace.onLoad(logger);
  }
 catch (  Throwable e) {
    moduleHandle.getLogger().log(TreeLogger.ERROR,"String_Node_Str" + moduleName + "String_Node_Str"+ userAgent+ "String_Node_Str"+ channel.getRemoteEndpoint(),e);
    if (moduleSpace != null) {
      moduleSpace.dispose();
    }
    moduleHandle.unload();
    moduleMap.remove(serverChannel);
    moduleHandleMap.remove(serverChannel);
  }
 finally {
    PerfLogger.end();
    PerfLogger.end();
  }
  return moduleHandle.getLogger();
}

Fixed version (ground truth):
@Override public synchronized TreeLogger loadModule(BrowserChannel channel,String moduleName,String userAgent,String url,String tabKey,String sessionKey,byte[] userAgentIcon){
  PerfLogger.start("String_Node_Str" + moduleName);
  BrowserChannelServer serverChannel=(BrowserChannelServer)channel;
  ModuleHandle moduleHandle=host.createModuleLogger(moduleName,userAgent,url,tabKey,sessionKey,serverChannel,userAgentIcon);
  TreeLogger logger=moduleHandle.getLogger();
  moduleHandleMap.put(serverChannel,moduleHandle);
  ModuleSpace moduleSpace=null;
  try {
    ModuleSpaceHost msh=host.createModuleSpaceHost(moduleHandle,moduleName);
    moduleSpace=new ModuleSpaceOOPHM(msh,moduleName,serverChannel);
    moduleMap.put(serverChannel,moduleSpace);
    PerfLogger.start("String_Node_Str");
    moduleSpace.onLoad(logger);
  }
 catch (  Throwable e) {
    moduleHandle.getLogger().log(TreeLogger.ERROR,"String_Node_Str" + moduleName + "String_Node_Str"+ userAgent+ "String_Node_Str"+ channel.getRemoteEndpoint(),e);
    if (moduleSpace != null) {
      moduleSpace.dispose();
    }
    moduleHandle.unload();
    moduleMap.remove(serverChannel);
    moduleHandleMap.remove(serverChannel);
    return null;
  }
 finally {
    PerfLogger.end();
    PerfLogger.end();
  }
  return moduleHandle.getLogger();
}
Program: 54322
Project: 54322
Buggy source:
/** 
 * @return full text of log event.
 */
public String getFullText(){
  StringBuffer sb=new StringBuffer();
  formatTimestamp(timestamp.getTime() - firstLog.getTime(),sb);
  sb.append("String_Node_Str");
  if (type != null) {
    sb.append("String_Node_Str");
    sb.append(type.getLabel());
    sb.append("String_Node_Str");
  }
  sb.append(htmlEscape(message));
  sb.append("String_Node_Str");
  if (exceptionDetail != null) {
    sb.append("String_Node_Str" + htmlEscape(exceptionDetail) + "String_Node_Str");
  }
  if (helpInfo != null) {
    URL url=helpInfo.getURL();
    String anchorText=helpInfo.getAnchorText();
    if (anchorText == null) {
      anchorText=url.toExternalForm();
    }
    String prefix=helpInfo.getPrefix();
    if (url != null) {
      sb.append("String_Node_Str" + prefix + "String_Node_Str");
      sb.append(url.toString());
      sb.append("String_Node_Str");
      sb.append(anchorText);
      sb.append("String_Node_Str");
      sb.append("String_Node_Str");
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * @return full text of log event.
 */
public String getFullText(){
  StringBuffer sb=new StringBuffer();
  formatTimestamp(timestamp.getTime() - firstLog.getTime(),sb);
  sb.append("String_Node_Str");
  if (type != null) {
    sb.append("String_Node_Str");
    sb.append(type.getLabel());
    sb.append("String_Node_Str");
  }
  sb.append(htmlEscape(message));
  sb.append("String_Node_Str");
  if (exceptionDetail != null) {
    sb.append("String_Node_Str" + htmlEscape(exceptionDetail) + "String_Node_Str");
  }
  if (helpInfo != null) {
    URL url=helpInfo.getURL();
    String anchorText=helpInfo.getAnchorText();
    if (anchorText == null && url != null) {
      anchorText=url.toExternalForm();
    }
    String prefix=helpInfo.getPrefix();
    if (url != null) {
      sb.append("String_Node_Str" + prefix + "String_Node_Str");
      sb.append(url.toString());
      sb.append("String_Node_Str");
      sb.append(anchorText);
      sb.append("String_Node_Str");
      sb.append("String_Node_Str");
    }
  }
  return sb.toString();
}
Program: 54323
Project: 54323
Buggy source:
/** 
 * The height of the scroll view of an element.
 */
public final native int getScrollWidth();

Fixed version (ground truth):
/** 
 * The width of the scroll view of an element.
 */
public final native int getScrollWidth();
Program: 54324
Project: 54324
Buggy source:
protected static DivElement createRuler(Unit widthUnit,Unit heightUnit){
  DivElement ruler=Document.get().createDivElement();
  ruler.setInnerHTML("String_Node_Str");
  Style style=ruler.getStyle();
  style.setPosition(Position.ABSOLUTE);
  style.setZIndex(-32767);
  style.setLeft(-10000,PX);
  style.setWidth(10,widthUnit);
  style.setHeight(10,heightUnit);
  return ruler;
}

Fixed version (ground truth):
protected static DivElement createRuler(Unit widthUnit,Unit heightUnit){
  DivElement ruler=Document.get().createDivElement();
  ruler.setInnerHTML("String_Node_Str");
  Style style=ruler.getStyle();
  style.setPosition(Position.ABSOLUTE);
  style.setZIndex(-32767);
  style.setLeft(-20,widthUnit);
  style.setTop(-20,heightUnit);
  style.setWidth(10,widthUnit);
  style.setHeight(10,heightUnit);
  return ruler;
}