nus-yam/ex-repair huggingface dataset:
Program: 82487
Project: 82487
Buggy source:
/** 
 * Start downloading the next fragment in the initial sequence, if there are any left.
 */
private void startLoadingNextInitial(){
  if (remainingInitialFragments == null) {
    remainingInitialFragments=new BoundedIntQueue(initialLoadSequence.length + 1);
    for (    int sp : initialLoadSequence) {
      remainingInitialFragments.add(sp);
    }
    remainingInitialFragments.add(leftoversFragment());
  }
  if (initialFragmentErrorHandlers.isEmpty() && waitingForInitialFragmentsErrorHandlers.isEmpty() && remainingInitialFragments.size() > 1) {
    initialFragmentsLoading=false;
    return;
  }
  if (remainingInitialFragments.size() > 0) {
    initialFragmentsLoading=true;
    int nextSplitPoint=remainingInitialFragments.peek();
    logEventProgress(LwmLabels.downloadGroup(nextSplitPoint),LwmLabels.BEGIN,nextSplitPoint,null);
    startLoadingFragment(nextSplitPoint,new InitialFragmentDownloadFailed());
    return;
  }
  initialFragmentsLoading=false;
  assert(haveInitialFragmentsLoaded());
  assert(waitingForInitialFragments.size() == waitingForInitialFragmentsErrorHandlers.size());
  while (waitingForInitialFragments.size() > 0) {
    startLoadingFragment(waitingForInitialFragments.remove(),waitingForInitialFragmentsErrorHandlers.remove());
  }
}

Fixed version (ground truth):
/** 
 * Start downloading the next fragment in the initial sequence, if there are any left.
 */
private void startLoadingNextInitial(){
  if (remainingInitialFragments == null) {
    remainingInitialFragments=new BoundedIntQueue(initialLoadSequence.length + 1);
    for (    int sp : initialLoadSequence) {
      remainingInitialFragments.add(sp);
    }
    remainingInitialFragments.add(leftoversFragment());
  }
  if (initialFragmentErrorHandlers.isEmpty() && waitingForInitialFragmentsErrorHandlers.isEmpty() && remainingInitialFragments.size() > 1) {
    initialFragmentsLoading=false;
    return;
  }
  if (remainingInitialFragments.size() > 0) {
    initialFragmentsLoading=true;
    int nextSplitPoint=remainingInitialFragments.peek();
    logDownloadStart(nextSplitPoint);
    startLoadingFragment(nextSplitPoint,new InitialFragmentDownloadFailed());
    return;
  }
  initialFragmentsLoading=false;
  assert(haveInitialFragmentsLoaded());
  assert(waitingForInitialFragments.size() == waitingForInitialFragmentsErrorHandlers.size());
  while (waitingForInitialFragments.size() > 0) {
    int nextSplitPoint=waitingForInitialFragments.remove();
    LoadErrorHandler handler=waitingForInitialFragmentsErrorHandlers.remove();
    logDownloadStart(nextSplitPoint);
    startLoadingFragment(nextSplitPoint,handler);
  }
}
Program: 82488
Project: 82488
Buggy source:
/** 
 * Loads the specified split point.
 * @param splitPoint the split point whose code needs to be loaded
 */
public void inject(int splitPoint,LoadErrorHandler loadErrorHandler){
  if (haveInitialFragmentsLoaded()) {
    logEventProgress(LwmLabels.downloadGroup(splitPoint),LwmLabels.BEGIN,splitPoint,null);
    startLoadingFragment(splitPoint,loadErrorHandler);
    return;
  }
  if (isInitial(splitPoint)) {
    initialFragmentErrorHandlers.put(splitPoint,loadErrorHandler);
  }
 else {
    assert(waitingForInitialFragments.size() == waitingForInitialFragmentsErrorHandlers.size());
    waitingForInitialFragments.add(splitPoint);
    waitingForInitialFragmentsErrorHandlers.add(loadErrorHandler);
  }
  if (!initialFragmentsLoading) {
    startLoadingNextInitial();
  }
}

Fixed version (ground truth):
/** 
 * Loads the specified split point.
 * @param splitPoint the split point whose code needs to be loaded
 */
public void inject(int splitPoint,LoadErrorHandler loadErrorHandler){
  if (haveInitialFragmentsLoaded()) {
    logDownloadStart(splitPoint);
    startLoadingFragment(splitPoint,loadErrorHandler);
    return;
  }
  if (isInitial(splitPoint)) {
    initialFragmentErrorHandlers.put(splitPoint,loadErrorHandler);
  }
 else {
    assert(waitingForInitialFragments.size() == waitingForInitialFragmentsErrorHandlers.size());
    waitingForInitialFragments.add(splitPoint);
    waitingForInitialFragmentsErrorHandlers.add(loadErrorHandler);
  }
  if (!initialFragmentsLoading) {
    startLoadingNextInitial();
  }
}
Program: 82489
Project: 82489
Buggy source:
public void addBugs(){
  addIssue(new Issue1245());
  addIssue(new Issue1772());
  addIssue(new Issue1897());
  addIssue(new Issue1932());
  addIssue(new Issue2261());
  addIssue(new Issue2290());
  addIssue(new Issue2307());
  addIssue(new Issue2318());
  addIssue(new Issue2321());
  addIssue(new Issue2331());
  addIssue(new Issue2338());
  addIssue(new Issue2339());
  addIssue(new Issue2390());
  addIssue(new Issue1169());
  addIssue(new Issue2392());
  addIssue(new Issue2443());
  addIssue(new Issue2553());
  addIssue(new Issue2855());
  addIssue(new Issue3172());
  addIssue(new Issue3973());
}

Fixed version (ground truth):
public void addBugs(){
  addIssue(new Issue1245());
  addIssue(new Issue1772());
  addIssue(new Issue1897());
  addIssue(new Issue1932());
  addIssue(new Issue2261());
  addIssue(new Issue2290());
  addIssue(new Issue2307());
  addIssue(new Issue2318());
  addIssue(new Issue2321());
  addIssue(new Issue2331());
  addIssue(new Issue2338());
  addIssue(new Issue2339());
  addIssue(new Issue2390());
  addIssue(new Issue1169());
  addIssue(new Issue2392());
  addIssue(new Issue2443());
  addIssue(new Issue2553());
  addIssue(new Issue2855());
  addIssue(new Issue3172());
  addIssue(new Issue3962());
  addIssue(new Issue3973());
}
Program: 82490
Project: 82490
Buggy source:
/** 
 * IE returns a numeric type for some attributes that are really properties, such as offsetWidth.  We need to coerce these to strings to prevent a runtime JS exception.
 */
@Override public native String getAttribute(Element elem,String name);

Fixed version (ground truth):
/** 
 * IE returns a numeric type for some attributes that are really properties, such as offsetWidth. We need to coerce these to strings to prevent a runtime JS exception.
 */
@Override public native String getAttribute(Element elem,String name);
Program: 82491
Project: 82491
Buggy source:
public String getTagName(Element elem){
  String tagName=getTagNameInternal(elem);
  String scopeName=getScopeNameInternal(elem);
  if ("String_Node_Str".equalsIgnoreCase(scopeName) || "String_Node_Str".equalsIgnoreCase(scopeName)) {
    return tagName;
  }
  return scopeName + "String_Node_Str" + tagName;
}

Fixed version (ground truth):
@Override public String getTagName(Element elem){
  String tagName=getTagNameInternal(elem);
  String scopeName=getScopeNameInternal(elem);
  if ("String_Node_Str".equalsIgnoreCase(scopeName) || "String_Node_Str".equalsIgnoreCase(scopeName)) {
    return tagName;
  }
  return scopeName + "String_Node_Str" + tagName;
}
Program: 82492
Project: 82492
Buggy source:
private JsExpression mapUnaryVariant(Node unOp) throws JsParserException {
switch (unOp.getIntDatum()) {
case TokenStream.SUB:
    return mapPrefixOperation(JsUnaryOperator.NEG,unOp);
case TokenStream.NOT:
  return mapPrefixOperation(JsUnaryOperator.NOT,unOp);
case TokenStream.BITNOT:
return mapPrefixOperation(JsUnaryOperator.BIT_NOT,unOp);
case TokenStream.TYPEOF:
return mapPrefixOperation(JsUnaryOperator.TYPEOF,unOp);
case TokenStream.ADD:
return mapExpression(unOp.getFirstChild());
case TokenStream.VOID:
return mapPrefixOperation(JsUnaryOperator.VOID,unOp);
default :
throw new JsParserException("String_Node_Str" + unOp.getIntDatum());
}
}

Fixed version (ground truth):
private JsExpression mapUnaryVariant(Node unOp) throws JsParserException {
switch (unOp.getIntDatum()) {
case TokenStream.SUB:
    return mapPrefixOperation(JsUnaryOperator.NEG,unOp);
case TokenStream.NOT:
  return mapPrefixOperation(JsUnaryOperator.NOT,unOp);
case TokenStream.BITNOT:
return mapPrefixOperation(JsUnaryOperator.BIT_NOT,unOp);
case TokenStream.TYPEOF:
return mapPrefixOperation(JsUnaryOperator.TYPEOF,unOp);
case TokenStream.ADD:
if (unOp.getFirstChild().getType() != TokenStream.NUMBER) {
return mapPrefixOperation(JsUnaryOperator.POS,unOp);
}
 else {
return mapExpression(unOp.getFirstChild());
}
case TokenStream.VOID:
return mapPrefixOperation(JsUnaryOperator.VOID,unOp);
default :
throw new JsParserException("String_Node_Str" + unOp.getIntDatum());
}
}
Program: 82493
Project: 82493
Buggy source:
/** 
 * Decide whether, if <code>op</code> is printed followed by <code>arg</code>, there needs to be a space between the operator and expression.
 * @return <code>true</code> if a space needs to be printed
 */
private boolean _spaceCalc(JsOperator op,JsExpression arg){
  if (op.isKeyword()) {
    return true;
  }
  if (arg instanceof JsBinaryOperation) {
    JsBinaryOperation binary=(JsBinaryOperation)arg;
    if (binary.getOperator().getPrecedence() > op.getPrecedence()) {
      return _spaceCalc(op,binary.getArg1());
    }
    return false;
  }
  if (arg instanceof JsPrefixOperation) {
    JsOperator op2=((JsPrefixOperation)arg).getOperator();
    return (op == JsBinaryOperator.SUB || op == JsUnaryOperator.NEG) && (op2 == JsUnaryOperator.DEC || op2 == JsUnaryOperator.NEG) || (op == JsBinaryOperator.ADD && op2 == JsUnaryOperator.INC);
  }
  if (arg instanceof JsNumberLiteral) {
    JsNumberLiteral literal=(JsNumberLiteral)arg;
    return (op == JsBinaryOperator.SUB || op == JsUnaryOperator.NEG) && (literal.getValue() < 0);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Decide whether, if <code>op</code> is printed followed by <code>arg</code>, there needs to be a space between the operator and expression.
 * @return <code>true</code> if a space needs to be printed
 */
private boolean _spaceCalc(JsOperator op,JsExpression arg){
  if (op.isKeyword()) {
    return true;
  }
  if (arg instanceof JsBinaryOperation) {
    JsBinaryOperation binary=(JsBinaryOperation)arg;
    if (binary.getOperator().getPrecedence() > op.getPrecedence()) {
      return _spaceCalc(op,binary.getArg1());
    }
    return false;
  }
  if (arg instanceof JsPrefixOperation) {
    JsOperator op2=((JsPrefixOperation)arg).getOperator();
    return (op == JsBinaryOperator.SUB || op == JsUnaryOperator.NEG) && (op2 == JsUnaryOperator.DEC || op2 == JsUnaryOperator.NEG) || (op == JsBinaryOperator.ADD || op == JsUnaryOperator.POS) && (op2 == JsUnaryOperator.INC || op2 == JsUnaryOperator.POS);
  }
  if (arg instanceof JsNumberLiteral) {
    JsNumberLiteral literal=(JsNumberLiteral)arg;
    return (op == JsBinaryOperator.SUB || op == JsUnaryOperator.NEG) && (literal.getValue() < 0);
  }
  return false;
}
Program: 82494
Project: 82494
Buggy source:
public DependencyRecorder(OutputStream out) throws IOException {
  try {
    this.writer=new OutputStreamWriter(new GZIPOutputStream(out),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    throw new InternalCompilerException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public DependencyRecorder(OutputStream out){
  this.finalOutput=out;
}
Program: 82495
Project: 82495
Buggy source:
public void open(){
  printPre();
}

Fixed version (ground truth):
public void open(){
  try {
    this.writer=new OutputStreamWriter(new GZIPOutputStream(finalOutput),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    throw new InternalCompilerException("String_Node_Str",e);
  }
catch (  IOException e) {
    throw new NestedIOException(e);
  }
  printPre();
}
Program: 82497
Project: 82497
Buggy source:
public boolean hasInstantiableSubtypes(){
  return isInstantiable() || instantiableSubtypes;
}

Fixed version (ground truth):
public boolean hasInstantiableSubtypes(){
  return isInstantiable() || instantiableSubtypes || isPendingInstantiable();
}
Program: 82498
Project: 82498
Buggy source:
/** 
 * Remove serializable types that were visited due to speculative paths but are not really needed for serialization. NOTE: This is currently much more limited than it should be. For example, a path sensitive prune could remove instantiable types also.
 */
private void pruneUnreachableTypes(){
  Set<JType> supersOfInstantiableTypes=new LinkedHashSet<JType>();
  for (  TypeInfoComputed tic : typeToTypeInfoComputed.values()) {
    if (tic.isInstantiable()) {
      JClassType type=tic.getType().getErasedType();
      JClassType sup=type;
      while (sup != null) {
        supersOfInstantiableTypes.add(sup.getErasedType());
        sup=sup.getErasedType().getSuperclass();
      }
    }
  }
  Set<JType> toKill=new LinkedHashSet<JType>();
  for (  TypeInfoComputed tic : typeToTypeInfoComputed.values()) {
    if (tic.isFieldSerializable() && !supersOfInstantiableTypes.contains(tic.getType().getErasedType())) {
      toKill.add(tic.getType());
    }
  }
  for (  JType type : toKill) {
    typeToTypeInfoComputed.remove(type);
  }
}

Fixed version (ground truth):
/** 
 * Remove serializable types that were visited due to speculative paths but are not really needed for serialization. NOTE: This is currently much more limited than it should be. For example, a path sensitive prune could remove instantiable types also.
 */
private void pruneUnreachableTypes(){
  Set<JType> supersOfInstantiableTypes=new LinkedHashSet<JType>();
  for (  TypeInfoComputed tic : typeToTypeInfoComputed.values()) {
    if (tic.isInstantiable() && tic.getType() instanceof JClassType) {
      JClassType type=(JClassType)tic.getType().getErasedType();
      JClassType sup=type;
      while (sup != null) {
        supersOfInstantiableTypes.add(sup.getErasedType());
        sup=sup.getErasedType().getSuperclass();
      }
    }
  }
  Set<JType> toKill=new LinkedHashSet<JType>();
  for (  TypeInfoComputed tic : typeToTypeInfoComputed.values()) {
    if (tic.isFieldSerializable() && !supersOfInstantiableTypes.contains(tic.getType().getErasedType())) {
      toKill.add(tic.getType());
    }
  }
  for (  JType type : toKill) {
    typeToTypeInfoComputed.remove(type);
  }
}
Program: 82499
Project: 82499
Buggy source:
/** 
 * Consider any subtype of java.lang.Object which qualifies for serialization.
 * @param logger
 */
private void checkAllSubtypesOfObject(TreeLogger logger,TypePath parent,ProblemReport problems){
  if (alreadyCheckedObject) {
    return;
  }
  alreadyCheckedObject=true;
  TreeLogger localLogger=logger.branch(TreeLogger.WARN,"String_Node_Str",null);
  JClassType[] allTypes=typeOracle.getJavaLangObject().getSubtypes();
  for (  JClassType cls : allTypes) {
    if (isDeclaredSerializable(cls)) {
      checkTypeInstantiable(localLogger,cls,TypePaths.createSubtypePath(parent,cls,typeOracle.getJavaLangObject()),problems);
    }
  }
}

Fixed version (ground truth):
/** 
 * Consider any subtype of java.lang.Object which qualifies for serialization.
 * @param logger
 */
private void checkAllSubtypesOfObject(TreeLogger logger,TypePath parent,ProblemReport problems){
  if (alreadyCheckedObject) {
    return;
  }
  alreadyCheckedObject=true;
  TreeLogger localLogger=logger.branch(TreeLogger.WARN,"String_Node_Str",null);
  JClassType[] allTypes=typeOracle.getJavaLangObject().getSubtypes();
  for (  JClassType cls : allTypes) {
    if (isDeclaredSerializable(cls)) {
      computeTypeInstantiability(localLogger,cls,TypePaths.createSubtypePath(parent,cls,typeOracle.getJavaLangObject()),problems);
    }
  }
}
Program: 82501
Project: 82501
Buggy source:
public TypeInfoComputed(JClassType type,TypePath path){
  this.type=type;
  this.path=path;
  autoSerializable=SerializableTypeOracleBuilder.isAutoSerializable(type);
  manualSerializer=findCustomFieldSerializer(typeOracle,type);
  directlyImplementsMarker=directlyImplementsMarkerInterface(type);
  maybeEnhanced=hasJdoAnnotation(type) || hasJpaAnnotation(type);
}

Fixed version (ground truth):
public TypeInfoComputed(JType type,TypePath path){
  this.type=type;
  this.path=path;
  if (type instanceof JClassType) {
    JClassType typeClass=(JClassType)type;
    autoSerializable=SerializableTypeOracleBuilder.isAutoSerializable(typeClass);
    manualSerializer=findCustomFieldSerializer(typeOracle,typeClass);
    directlyImplementsMarker=directlyImplementsMarkerInterface(typeClass);
    maybeEnhanced=hasJdoAnnotation(typeClass) || hasJpaAnnotation(typeClass);
  }
 else {
    autoSerializable=false;
    manualSerializer=null;
    directlyImplementsMarker=false;
    maybeEnhanced=false;
  }
}
Program: 82503
Project: 82503
Buggy source:
public JClassType getType(){
  return type;
}

Fixed version (ground truth):
public JType getType(){
  return type;
}
Program: 82504
Project: 82504
Buggy source:
private boolean checkArrayInstantiable(TreeLogger logger,JArrayType array,TypePath path,ProblemReport problems){
}

Fixed version (ground truth):
private TypeInfoComputed checkArrayInstantiable(TreeLogger logger,JArrayType array,TypePath path,ProblemReport problems){
}
Program: 82505
Project: 82505
Buggy source:
private TypeInfoComputed getTypeInfoComputed(JClassType type,TypePath path,boolean createIfNeeded){
  TypeInfoComputed tic=typeToTypeInfoComputed.get(type);
  if (tic == null && createIfNeeded) {
    tic=new TypeInfoComputed(type,path);
    typeToTypeInfoComputed.put(type,tic);
  }
  return tic;
}

Fixed version (ground truth):
private TypeInfoComputed getTypeInfoComputed(JType type,TypePath path,boolean createIfNeeded){
  TypeInfoComputed tic=typeToTypeInfoComputed.get(type);
  if (tic == null && createIfNeeded) {
    tic=new TypeInfoComputed(type,path);
    typeToTypeInfoComputed.put(type,tic);
  }
  return tic;
}
Program: 82507
Project: 82507
Buggy source:
public WebModePayloadSink(ClientOracle clientOracle,OutputStream out){
  this.clientOracle=clientOracle;
  this.out=out;
  backRefIdent=clientOracle.createUnusedIdent("String_Node_Str");
}

Fixed version (ground truth):
public WebModePayloadSink(ClientOracle clientOracle,OutputStream out){
  this.clientOracle=clientOracle;
  this.out=out;
}
Program: 82508
Project: 82508
Buggy source:
byte[] makeBackRef(ValueCommand x){
  byte[] toReturn=valueBackRefs.get(x);
  if (toReturn == null) {
    if (freeBackRefs.isEmpty()) {
      int idx=valueBackRefs.size();
      toReturn=getBytes(backRefIdent + "String_Node_Str" + Integer.toString(idx,Character.MAX_RADIX));
    }
 else {
      toReturn=freeBackRefs.pop();
    }
    valueBackRefs.put(x,toReturn);
  }
  return toReturn;
}

Fixed version (ground truth):
byte[] makeBackRef(ValueCommand x){
  byte[] toReturn=valueBackRefs.get(x);
  if (toReturn == null) {
    if (freeBackRefs.isEmpty()) {
      int idx=valueBackRefs.size();
      toReturn=getBytes(BACKREF_IDENT + "String_Node_Str" + Integer.toString(idx,Character.MAX_RADIX));
    }
 else {
      toReturn=freeBackRefs.pop();
    }
    valueBackRefs.put(x,toReturn);
  }
  return toReturn;
}
Program: 82509
Project: 82509
Buggy source:
private JsExpression mapUnaryVariant(Node unOp) throws JsParserException {
switch (unOp.getIntDatum()) {
case TokenStream.SUB:
    return mapPrefixOperation(JsUnaryOperator.NEG,unOp);
case TokenStream.NOT:
  return mapPrefixOperation(JsUnaryOperator.NOT,unOp);
case TokenStream.BITNOT:
return mapPrefixOperation(JsUnaryOperator.BIT_NOT,unOp);
case TokenStream.TYPEOF:
return mapPrefixOperation(JsUnaryOperator.TYPEOF,unOp);
case TokenStream.ADD:
return mapExpression(unOp.getFirstChild());
case TokenStream.VOID:
return mapPrefixOperation(JsUnaryOperator.VOID,unOp);
default :
throw new JsParserException("String_Node_Str" + unOp.getIntDatum());
}
}

Fixed version (ground truth):
private JsExpression mapUnaryVariant(Node unOp) throws JsParserException {
switch (unOp.getIntDatum()) {
case TokenStream.SUB:
    return mapPrefixOperation(JsUnaryOperator.NEG,unOp);
case TokenStream.NOT:
  return mapPrefixOperation(JsUnaryOperator.NOT,unOp);
case TokenStream.BITNOT:
return mapPrefixOperation(JsUnaryOperator.BIT_NOT,unOp);
case TokenStream.TYPEOF:
return mapPrefixOperation(JsUnaryOperator.TYPEOF,unOp);
case TokenStream.ADD:
if (unOp.getFirstChild().getType() != TokenStream.NUMBER) {
return mapPrefixOperation(JsUnaryOperator.POS,unOp);
}
 else {
return mapExpression(unOp.getFirstChild());
}
case TokenStream.VOID:
return mapPrefixOperation(JsUnaryOperator.VOID,unOp);
default :
throw new JsParserException("String_Node_Str" + unOp.getIntDatum());
}
}
Program: 82510
Project: 82510
Buggy source:
private void doTest(String js) throws Exception {
  List<JsStatement> expected=JsParser.parse(SourceOrigin.UNKNOWN,new JsProgram().getScope(),new StringReader(js));
  List<JsStatement> actual=parse(expected,true);
  ComparingVisitor.exec(expected,actual);
  actual=parse(expected,false);
  ComparingVisitor.exec(expected,actual);
}

Fixed version (ground truth):
private void doTest(String js,String expectedJs) throws Exception {
  List<JsStatement> actual=JsParser.parse(SourceOrigin.UNKNOWN,new JsProgram().getScope(),new StringReader(js));
  List<JsStatement> expected=JsParser.parse(SourceOrigin.UNKNOWN,new JsProgram().getScope(),new StringReader(expectedJs));
  ComparingVisitor.exec(expected,actual);
}
Program: 82511
Project: 82511
Buggy source:
public void testUnaryOperations() throws Exception {
  doTest("String_Node_Str");
}

Fixed version (ground truth):
public void testUnaryOperations() throws Exception {
  doTest("String_Node_Str");
  doTest("String_Node_Str","String_Node_Str");
  doTest("String_Node_Str","String_Node_Str");
}
Program: 82512
Project: 82512
Buggy source:
private static String downloadGroup(int splitPoint){
  return "String_Node_Str" + splitPoint;
}

Fixed version (ground truth):
private String downloadGroup(int fragment){
  return (fragment == leftoversFragment()) ? LwmLabels.LEFTOVERS_DOWNLOAD : LwmLabels.downloadGroupForExclusive(fragment);
}
Program: 82513
Project: 82513
Buggy source:
private void logFragmentLoaded(int fragment){
  String logGroup=(fragment == leftoversFragment()) ? LwmLabels.LEFTOVERS_DOWNLOAD : LwmLabels.downloadGroup(fragment);
  logEventProgress(logGroup,LwmLabels.END,fragment,null);
}

Fixed version (ground truth):
private void logFragmentLoaded(int fragment){
  String logGroup=downloadGroup(fragment);
  logEventProgress(logGroup,LwmLabels.END,fragment,null);
}
Program: 82514
Project: 82514
Buggy source:
/** 
 * Start downloading the next fragment in the initial sequence, if there are any left.
 */
private void startLoadingNextInitial(){
  if (remainingInitialFragments == null) {
    remainingInitialFragments=new BoundedIntQueue(initialLoadSequence.length + 1);
    for (    int sp : initialLoadSequence) {
      remainingInitialFragments.add(sp);
    }
    remainingInitialFragments.add(leftoversFragment());
  }
  if (initialFragmentErrorHandlers.isEmpty() && waitingForInitialFragmentsErrorHandlers.isEmpty() && remainingInitialFragments.size() > 1) {
    initialFragmentsLoading=false;
    return;
  }
  if (remainingInitialFragments.size() > 0) {
    initialFragmentsLoading=true;
    int nextSplitPoint=remainingInitialFragments.peek();
    logEventProgress(LwmLabels.downloadGroup(nextSplitPoint),LwmLabels.BEGIN,nextSplitPoint,null);
    startLoadingFragment(nextSplitPoint,new InitialFragmentDownloadFailed());
    return;
  }
  initialFragmentsLoading=false;
  assert(haveInitialFragmentsLoaded());
  assert(waitingForInitialFragments.size() == waitingForInitialFragmentsErrorHandlers.size());
  while (waitingForInitialFragments.size() > 0) {
    startLoadingFragment(waitingForInitialFragments.remove(),waitingForInitialFragmentsErrorHandlers.remove());
  }
}

Fixed version (ground truth):
/** 
 * Start downloading the next fragment in the initial sequence, if there are any left.
 */
private void startLoadingNextInitial(){
  if (remainingInitialFragments == null) {
    remainingInitialFragments=new BoundedIntQueue(initialLoadSequence.length + 1);
    for (    int sp : initialLoadSequence) {
      remainingInitialFragments.add(sp);
    }
    remainingInitialFragments.add(leftoversFragment());
  }
  if (initialFragmentErrorHandlers.isEmpty() && waitingForInitialFragmentsErrorHandlers.isEmpty() && remainingInitialFragments.size() > 1) {
    initialFragmentsLoading=false;
    return;
  }
  if (remainingInitialFragments.size() > 0) {
    initialFragmentsLoading=true;
    int nextSplitPoint=remainingInitialFragments.peek();
    logDownloadStart(nextSplitPoint);
    startLoadingFragment(nextSplitPoint,new InitialFragmentDownloadFailed());
    return;
  }
  initialFragmentsLoading=false;
  assert(haveInitialFragmentsLoaded());
  assert(waitingForInitialFragments.size() == waitingForInitialFragmentsErrorHandlers.size());
  while (waitingForInitialFragments.size() > 0) {
    int nextSplitPoint=waitingForInitialFragments.remove();
    LoadErrorHandler handler=waitingForInitialFragmentsErrorHandlers.remove();
    logDownloadStart(nextSplitPoint);
    startLoadingFragment(nextSplitPoint,handler);
  }
}
Program: 82515
Project: 82515
Buggy source:
/** 
 * Loads the specified split point.
 * @param splitPoint the split point whose code needs to be loaded
 */
public void inject(int splitPoint,LoadErrorHandler loadErrorHandler){
  if (haveInitialFragmentsLoaded()) {
    logEventProgress(LwmLabels.downloadGroup(splitPoint),LwmLabels.BEGIN,splitPoint,null);
    startLoadingFragment(splitPoint,loadErrorHandler);
    return;
  }
  if (isInitial(splitPoint)) {
    initialFragmentErrorHandlers.put(splitPoint,loadErrorHandler);
  }
 else {
    assert(waitingForInitialFragments.size() == waitingForInitialFragmentsErrorHandlers.size());
    waitingForInitialFragments.add(splitPoint);
    waitingForInitialFragmentsErrorHandlers.add(loadErrorHandler);
  }
  if (!initialFragmentsLoading) {
    startLoadingNextInitial();
  }
}

Fixed version (ground truth):
/** 
 * Loads the specified split point.
 * @param splitPoint the split point whose code needs to be loaded
 */
public void inject(int splitPoint,LoadErrorHandler loadErrorHandler){
  if (haveInitialFragmentsLoaded()) {
    logDownloadStart(splitPoint);
    startLoadingFragment(splitPoint,loadErrorHandler);
    return;
  }
  if (isInitial(splitPoint)) {
    initialFragmentErrorHandlers.put(splitPoint,loadErrorHandler);
  }
 else {
    assert(waitingForInitialFragments.size() == waitingForInitialFragmentsErrorHandlers.size());
    waitingForInitialFragments.add(splitPoint);
    waitingForInitialFragmentsErrorHandlers.add(loadErrorHandler);
  }
  if (!initialFragmentsLoading) {
    startLoadingNextInitial();
  }
}
Program: 82516
Project: 82516
Buggy source:
/** 
 * This test catches a case in an earlier version of AsyncFragmentLoader where AsyncFragmentLoader.waitingForInitialFragments could exhaust its available space.
 */
public void testOverflowInWaitingForInitialFragments(){
  MockLoadStrategy reqs=new MockLoadStrategy();
  int numEntries=6;
  AsyncFragmentLoader loader=new AsyncFragmentLoader(numEntries,new int[]{1,2,3},reqs,NULL_LOGGER);
  for (int i=0; i < 10; i++) {
    MockErrorHandler error=new MockErrorHandler();
    loader.inject(4,error);
    reqs.assertFragmentsRequested(1);
    loadFailed(reqs,1);
    assertTrue(error.getWasCalled());
  }
}

Fixed version (ground truth):
/** 
 * This test catches a case in an earlier version of AsyncFragmentLoader where AsyncFragmentLoader.waitingForInitialFragments could exhaust its available space.
 */
public void testOverflowInWaitingForInitialFragments(){
  MockLoadStrategy reqs=new MockLoadStrategy();
  MockProgressLogger progress=new MockProgressLogger();
  int numEntries=6;
  AsyncFragmentLoader loader=new AsyncFragmentLoader(numEntries,new int[]{1,2,3},reqs,progress);
  for (int i=0; i < 10; i++) {
    MockErrorHandler error=new MockErrorHandler();
    loader.inject(4,error);
    reqs.assertFragmentsRequested(1);
    progress.assertEvent("String_Node_Str",BEGIN,1);
    loadFailed(reqs,1);
    assertTrue(error.getWasCalled());
    progress.assertNoEvents();
  }
}
Program: 82518
Project: 82518
Buggy source:
/** 
 * A thorough exercise of loading with an initial load sequence specified.
 */
public void testWithInitialLoadSequence(){
  MockLoadStrategy reqs=new MockLoadStrategy();
  int numEntries=6;
  AsyncFragmentLoader loader=new AsyncFragmentLoader(numEntries,new int[]{1,2,3},reqs,NULL_LOGGER);
  loader.inject(1,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(1);
  loader.inject(3,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested();
  loader.inject(5,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested();
  loader.fragmentHasLoaded(1);
  reqs.assertFragmentsRequested(2);
  loader.fragmentHasLoaded(2);
  reqs.assertFragmentsRequested(3);
  loader.fragmentHasLoaded(3);
  reqs.assertFragmentsRequested(numEntries);
  loader.leftoversFragmentHasLoaded();
  reqs.assertFragmentsRequested(5);
  loader.fragmentHasLoaded(5);
  reqs.assertFragmentsRequested();
  loader.inject(4,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(4);
  loader.fragmentHasLoaded(4);
  reqs.assertFragmentsRequested();
}

Fixed version (ground truth):
/** 
 * A thorough exercise of loading with an initial load sequence specified.
 */
public void testWithInitialLoadSequence(){
  MockLoadStrategy reqs=new MockLoadStrategy();
  MockProgressLogger progress=new MockProgressLogger();
  int numEntries=6;
  AsyncFragmentLoader loader=new AsyncFragmentLoader(numEntries,new int[]{1,2,3},reqs,progress);
  loader.inject(1,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(1);
  progress.assertEvent("String_Node_Str",BEGIN,1);
  loader.inject(3,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested();
  progress.assertNoEvents();
  loader.inject(5,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested();
  progress.assertNoEvents();
  loader.fragmentHasLoaded(1);
  reqs.assertFragmentsRequested(2);
  progress.assertEvent("String_Node_Str",END,1);
  progress.assertEvent("String_Node_Str",BEGIN,2);
  loader.fragmentHasLoaded(2);
  reqs.assertFragmentsRequested(3);
  progress.assertEvent("String_Node_Str",END,2);
  progress.assertEvent("String_Node_Str",BEGIN,3);
  loader.fragmentHasLoaded(3);
  reqs.assertFragmentsRequested(numEntries);
  progress.assertEvent("String_Node_Str",END,3);
  progress.assertEvent("String_Node_Str",BEGIN,numEntries);
  loader.leftoversFragmentHasLoaded();
  reqs.assertFragmentsRequested(5);
  progress.assertEvent("String_Node_Str",END,numEntries);
  progress.assertEvent("String_Node_Str",BEGIN,5);
  loader.fragmentHasLoaded(5);
  reqs.assertFragmentsRequested();
  progress.assertEvent("String_Node_Str",END,5);
  progress.assertNoEvents();
  loader.inject(4,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(4);
  progress.assertEvent("String_Node_Str",BEGIN,4);
  loader.fragmentHasLoaded(4);
  reqs.assertFragmentsRequested();
  progress.assertEvent("String_Node_Str",END,4);
  progress.assertNoEvents();
}
Program: 82519
Project: 82519
Buggy source:
public void logEventProgress(String eventGroup,String type,Integer fragment,Integer size){
}

Fixed version (ground truth):
public void logEventProgress(String eventGroup,String type,Integer fragment,Integer size){
  events.add(new MockProgressEvent(eventGroup,type,fragment));
}
Program: 82520
Project: 82520
Buggy source:
public void testBasics(){
  MockLoadStrategy reqs=new MockLoadStrategy();
  int numEntries=5;
  AsyncFragmentLoader loader=new AsyncFragmentLoader(numEntries,new int[]{},reqs,NULL_LOGGER);
  loader.inject(1,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(numEntries);
  loader.leftoversFragmentHasLoaded();
  reqs.assertFragmentsRequested(1);
  loader.fragmentHasLoaded(1);
  loader.inject(2,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(2);
  loader.fragmentHasLoaded(2);
}

Fixed version (ground truth):
public void testBasics(){
  MockLoadStrategy reqs=new MockLoadStrategy();
  MockProgressLogger progress=new MockProgressLogger();
  int numEntries=5;
  AsyncFragmentLoader loader=new AsyncFragmentLoader(numEntries,new int[]{},reqs,progress);
  loader.inject(1,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(numEntries);
  progress.assertEvent(LEFTOVERS_DOWNLOAD,BEGIN,numEntries);
  loader.leftoversFragmentHasLoaded();
  reqs.assertFragmentsRequested(1);
  progress.assertEvent(LEFTOVERS_DOWNLOAD,END,numEntries);
  progress.assertEvent("String_Node_Str",BEGIN,1);
  loader.fragmentHasLoaded(1);
  progress.assertEvent("String_Node_Str",END,1);
  loader.inject(2,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(2);
  progress.assertEvent("String_Node_Str",BEGIN,2);
  loader.fragmentHasLoaded(2);
  progress.assertEvent("String_Node_Str",END,2);
  progress.assertNoEvents();
}
Program: 82521
Project: 82521
Buggy source:
/** 
 * If only the first part of the initial load sequence is requested, then don't request more.
 */
public void testLoadingPartOfInitialSequence(){
  MockLoadStrategy reqs=new MockLoadStrategy();
  int numEntries=6;
  AsyncFragmentLoader loader=new AsyncFragmentLoader(numEntries,new int[]{1,2,3},reqs,NULL_LOGGER);
  loader.inject(1,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(1);
  loader.fragmentHasLoaded(1);
  reqs.assertFragmentsRequested();
  loader.inject(2,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(2);
  loader.fragmentHasLoaded(2);
  reqs.assertFragmentsRequested();
  loader.inject(3,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(3);
  loader.fragmentHasLoaded(3);
  reqs.assertFragmentsRequested(numEntries);
  loader.fragmentHasLoaded(numEntries);
  reqs.assertFragmentsRequested();
  loader.inject(5,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(5);
  loader.fragmentHasLoaded(5);
  reqs.assertFragmentsRequested();
}

Fixed version (ground truth):
/** 
 * If only the first part of the initial load sequence is requested, then don't request more.
 */
public void testLoadingPartOfInitialSequence(){
  MockLoadStrategy reqs=new MockLoadStrategy();
  MockProgressLogger progress=new MockProgressLogger();
  int numEntries=6;
  AsyncFragmentLoader loader=new AsyncFragmentLoader(numEntries,new int[]{1,2,3},reqs,progress);
  loader.inject(1,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(1);
  progress.assertEvent("String_Node_Str",BEGIN,1);
  loader.fragmentHasLoaded(1);
  reqs.assertFragmentsRequested();
  progress.assertEvent("String_Node_Str",END,1);
  loader.inject(2,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(2);
  progress.assertEvent("String_Node_Str",BEGIN,2);
  loader.fragmentHasLoaded(2);
  reqs.assertFragmentsRequested();
  progress.assertEvent("String_Node_Str",END,2);
  loader.inject(3,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(3);
  progress.assertEvent("String_Node_Str",BEGIN,3);
  loader.fragmentHasLoaded(3);
  reqs.assertFragmentsRequested(numEntries);
  progress.assertEvent("String_Node_Str",END,3);
  progress.assertEvent(LEFTOVERS_DOWNLOAD,BEGIN,numEntries);
  loader.fragmentHasLoaded(numEntries);
  reqs.assertFragmentsRequested();
  progress.assertEvent(LEFTOVERS_DOWNLOAD,END,numEntries);
  loader.inject(5,NULL_ERROR_HANDLER);
  reqs.assertFragmentsRequested(5);
  progress.assertEvent("String_Node_Str",BEGIN,5);
  loader.fragmentHasLoaded(5);
  reqs.assertFragmentsRequested();
  progress.assertEvent("String_Node_Str",END,5);
  progress.assertNoEvents();
}
Program: 82522
Project: 82522
Buggy source:
public String getModuleName(){
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getModuleName(){
  return "String_Node_Str";
}
Program: 82523
Project: 82523
Buggy source:
public double getUnitSizeInPixels(Element parent,Unit unit,boolean vertical){
  if (unit == null) {
    return 1;
  }
switch (unit) {
default :
case PX:
    return 1;
case PCT:
  return (vertical ? parent.getClientHeight() : parent.getClientWidth()) / 100.0;
case EM:
return relativeRuler.getOffsetWidth();
case EX:
return relativeRuler.getOffsetHeight();
case CM:
return fixedRuler.getOffsetWidth();
case MM:
return fixedRuler.getOffsetWidth() / 10.0;
case IN:
return fixedRuler.getOffsetWidth() / 2.54;
case PT:
return fixedRuler.getOffsetWidth() / 28.4;
case PC:
return fixedRuler.getOffsetWidth() / 2.36;
}
}

Fixed version (ground truth):
public double getUnitSizeInPixels(Element parent,Unit unit,boolean vertical){
  if (unit == null) {
    return 1;
  }
switch (unit) {
case PCT:
    return (vertical ? parent.getClientHeight() : parent.getClientWidth()) / 100.0;
case EM:
  return relativeRuler.getOffsetWidth();
case EX:
return relativeRuler.getOffsetHeight();
case CM:
return fixedRuler.getOffsetWidth();
case MM:
return fixedRuler.getOffsetWidth() / 10.0;
case IN:
return fixedRuler.getOffsetWidth() / 2.54;
case PT:
return fixedRuler.getOffsetWidth() / 28.4;
case PC:
return fixedRuler.getOffsetWidth() / 2.36;
default :
case PX:
return 1;
}
}
Program: 82524
Project: 82524
Buggy source:
private void doGetModule(HttpServletRequest request,HttpServletResponse response,TreeLogger logger,RequestParts parts) throws IOException {
  String msg="String_Node_Str" + parts.moduleName + "String_Node_Str";
  logger=logger.branch(TreeLogger.TRACE,msg,null);
  try {
    getModuleDef(logger,parts.moduleName);
  }
 catch (  UnableToCompleteException e) {
    sendErrorResponse(response,HttpServletResponse.SC_NOT_FOUND,"String_Node_Str" + Util.escapeXml(parts.moduleName) + "String_Node_Str");
    return;
  }
  response.setContentType("String_Node_Str");
  PrintWriter writer=response.getWriter();
  writer.println("String_Node_Str");
  writer.print("String_Node_Str");
  writer.print(parts.moduleName);
  writer.println("String_Node_Str");
  Map<String,String[]> params=getParameterMap(request);
  for (  Map.Entry<String,String[]> entry : params.entrySet()) {
    String[] values=entry.getValue();
    if (values.length > 0) {
      writer.print("String_Node_Str");
      writer.print(entry.getKey());
      writer.print("String_Node_Str");
      writer.print(values[values.length - 1]);
      writer.println("String_Node_Str");
    }
  }
  writer.println("String_Node_Str");
  writer.println("String_Node_Str" + "String_Node_Str");
  writer.println("String_Node_Str");
}

Fixed version (ground truth):
private void doGetModule(HttpServletRequest request,HttpServletResponse response,TreeLogger logger,RequestParts parts) throws IOException {
  String msg="String_Node_Str" + parts.moduleName + "String_Node_Str";
  logger=logger.branch(TreeLogger.TRACE,msg,null);
  try {
    getModuleDef(logger,parts.moduleName);
  }
 catch (  UnableToCompleteException e) {
    sendErrorResponse(response,HttpServletResponse.SC_NOT_FOUND,"String_Node_Str" + Util.escapeXml(parts.moduleName) + "String_Node_Str");
    return;
  }
  response.setContentType("String_Node_Str");
  PrintWriter writer=response.getWriter();
  writer.println("String_Node_Str");
  writer.print("String_Node_Str");
  writer.print(parts.moduleName);
  writer.println("String_Node_Str");
  Map<String,String[]> params=getParameterMap(request);
  for (  Map.Entry<String,String[]> entry : params.entrySet()) {
    String[] values=entry.getValue();
    if (values.length > 0) {
      writer.print("String_Node_Str");
      writer.print(entry.getKey());
      writer.print("String_Node_Str");
      writer.print(values[values.length - 1]);
      writer.println("String_Node_Str");
    }
  }
  writer.println("String_Node_Str");
  writer.println("String_Node_Str" + "String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
}
Program: 82525
Project: 82525
Buggy source:
/** 
 * Returns the Object associated with the given key in the (key, value) mapping associated with the given Object instance.
 * @param instance the source Object.
 * @param key a String key.
 * @return an Object associated with that key on the given instance, or null.
 */
public static void set(Object instance,String key,Object value){
}

Fixed version (ground truth):
/** 
 * Associates a value with a given key in the (key, value) mapping associated with the given Object instance. Note that the key space is module-wide, so some care should be taken to choose sufficiently unique identifiers.
 * @param instance the source Object.
 * @param key a String key.
 * @param value the Object to associate with the key on the given sourceObject.
 */
public static void set(Object instance,String key,Object value){
}
Program: 82526
Project: 82526
Buggy source:
/** 
 * Associates a value with a given key in the (key, value) mapping associated with the given Object instance. Note that the key space is module-wide, so some care should be taken to choose sufficiently unique identifiers.
 * @param instance the source Object.
 * @param key a String key.
 * @param value the Object to associate with the key on the given sourceObject.
 */
public static native Object get(Object instance,String key);

Fixed version (ground truth):
/** 
 * Returns the Object associated with the given key in the (key, value) mapping associated with the given Object instance.
 * @param instance the source Object.
 * @param key a String key.
 * @return an Object associated with that key on the given instance, or null.
 */
public static native Object get(Object instance,String key);
Program: 82527
Project: 82527
Buggy source:
/** 
 * Forward link type.
 * @see <a href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/links.html#adef-rel">W3C HTML Specification</a>
 */
public final native void setRel(String name);

Fixed version (ground truth):
/** 
 * Forward link type.
 * @see <a href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/links.html#adef-rel">W3C HTML Specification</a>
 */
public final native void setRel(String rel);
Program: 82528
Project: 82528
Buggy source:
private void writeArtifactToFile(TreeLogger logger,EmittedArtifact artifact,File outFile,Set<String> createdDirs) throws UnableToCompleteException {
  if (!outFile.exists() || (outFile.lastModified() <= artifact.getLastModified())) {
    if (!mkdirs(outFile.getParentFile(),createdDirs)) {
      logger.log(TreeLogger.ERROR,"String_Node_Str" + outFile.getAbsolutePath() + "String_Node_Str");
    }
 else {
      try {
        FileOutputStream out=new FileOutputStream(outFile);
        artifact.writeTo(logger,out);
        out.close();
      }
 catch (      IOException e) {
        logger.log(TreeLogger.ERROR,"String_Node_Str" + outFile.getAbsolutePath() + "String_Node_Str",e);
        throw new UnableToCompleteException();
      }
      outFile.setLastModified(artifact.getLastModified());
    }
  }
}

Fixed version (ground truth):
private void writeArtifactToFile(TreeLogger logger,EmittedArtifact artifact,File outFile,Set<String> createdDirs) throws UnableToCompleteException {
  if (!outFile.exists() || (outFile.lastModified() < artifact.getLastModified())) {
    if (!mkdirs(outFile.getParentFile(),createdDirs)) {
      logger.log(TreeLogger.ERROR,"String_Node_Str" + outFile.getAbsolutePath() + "String_Node_Str");
    }
 else {
      try {
        FileOutputStream out=new FileOutputStream(outFile);
        artifact.writeTo(logger,out);
        out.close();
      }
 catch (      IOException e) {
        logger.log(TreeLogger.ERROR,"String_Node_Str" + outFile.getAbsolutePath() + "String_Node_Str",e);
        throw new UnableToCompleteException();
      }
      outFile.setLastModified(artifact.getLastModified());
    }
  }
}
Program: 82529
Project: 82529
Buggy source:
/** 
 * Timestamps have some non-obvious comparison semantics when compared to dates.
 */
public void testDateComparison(){
  long now=System.currentTimeMillis();
  Date d=new Date(now);
  Timestamp t=new Timestamp(d.getTime());
  if (now % 1000 == 0) {
    t.setNanos(1000001);
  }
 else {
    t.setNanos(1);
  }
  Date d2=new Date(t.getTime());
  assertFalse("String_Node_Str",d.equals(t));
  assertEquals("String_Node_Str",d2,t);
  assertEquals("String_Node_Str",d2.hashCode(),t.hashCode());
  assertFalse("String_Node_Str",t.equals(d2));
  if (GWT.isScript()) {
    try {
      t.compareTo(d2);
      fail("String_Node_Str");
    }
 catch (    ClassCastException e) {
    }
  }
  Timestamp t2=new Timestamp(d.getTime());
  t2.setNanos(2);
  assertFalse("String_Node_Str",t.equals(t2));
  assertEquals("String_Node_Str",t.hashCode(),t2.hashCode());
}

Fixed version (ground truth):
/** 
 * Timestamps have some non-obvious comparison semantics when compared to dates.
 */
public void testDateComparison(){
  long now=System.currentTimeMillis();
  Date d=new Date(now);
  Timestamp t=new Timestamp(d.getTime());
  if (now % 1000 == 0) {
    t.setNanos(1000001);
  }
 else {
    t.setNanos(1);
  }
  Date d2=new Date(t.getTime());
  assertFalse("String_Node_Str",d.equals(t));
  assertEquals("String_Node_Str",d2,t);
  assertEquals("String_Node_Str",d2.hashCode(),t.hashCode());
  assertFalse("String_Node_Str",t.equals(d2));
  if (GWT.isScript()) {
    try {
      t.compareTo(d2);
      fail("String_Node_Str");
    }
 catch (    ClassCastException e) {
    }
  }
  Timestamp t2=new Timestamp(d.getTime());
  t2.setNanos(t.getNanos() + 1);
  assertFalse("String_Node_Str",t.equals(t2));
  assertEquals("String_Node_Str",t.hashCode(),t2.hashCode());
}
Program: 82530
Project: 82530
Buggy source:
@Override public native Element eventGetToElement(Event evt);

Fixed version (ground truth):
@Override public Element eventGetToElement(Event evt){
  if (evt.getType().equals("String_Node_Str")) {
    return evt.getTarget().cast();
  }
  if (evt.getType().equals("String_Node_Str")) {
    return evt.getRelatedTarget().cast();
  }
  return null;
}
Program: 82531
Project: 82531
Buggy source:
@Override public native Element eventGetFromElement(Event evt);

Fixed version (ground truth):
@Override public Element eventGetFromElement(Event evt){
  if (evt.getType().equals("String_Node_Str")) {
    return evt.getRelatedTarget().cast();
  }
  if (evt.getType().equals("String_Node_Str")) {
    return evt.getTarget().cast();
  }
  return null;
}
Program: 82532
Project: 82532
Buggy source:
/** 
 * Call the toSource() on the JSO
 */
public native String toSource();

Fixed version (ground truth):
/** 
 * Call the toSource() on the JSO.
 */
public native String toSource();
Program: 82533
Project: 82533
Buggy source:
/** 
 * Check whether the given date and time falls within a daylight savings time period
 * @param date and time to check.
 * @return true if daylight savings time is in effect.
 */
public boolean isDaylightTime(Date date){
  return getDaylightAdjustment(date) > 0;
}

Fixed version (ground truth):
/** 
 * Check whether the given date and time falls within a daylight savings time period.
 * @param date and time to check.
 * @return true if daylight savings time is in effect.
 */
public boolean isDaylightTime(Date date){
  return getDaylightAdjustment(date) > 0;
}