Program: 4831
Project: 4831
Buggy source:
private void send(OutputStream out,int start,int stop) throws IOException {
  long t0=System.currentTimeMillis();
  if (minPollTime > 0)   Assert.that(t0 > minPollTime,"String_Node_Str" + (minPollTime - t0) + "String_Node_Str");
  if (maxPollTime > 0)   Assert.that(t0 < maxPollTime,"String_Node_Str" + (t0 - maxPollTime) + "String_Node_Str");
  String str=busy | queue ? "String_Node_Str" : "String_Node_Str";
  out.write(str.getBytes());
  if (busy) {
    String s="String_Node_Str";
    out.write(s.getBytes());
    out.flush();
    out.close();
    return;
  }
  if (queue) {
    String s="String_Node_Str";
    out.write(s.getBytes());
    s="String_Node_Str";
    out.write(s.getBytes());
    out.flush();
    long t=System.currentTimeMillis();
    minPollTime=t + MIN_POLL;
    maxPollTime=t + MAX_POLL;
    return;
  }
  str="String_Node_Str" + (stop - start) + "String_Node_Str";
  out.write(str.getBytes());
  if (start != 0) {
    str="String_Node_Str" + start + "String_Node_Str"+ (stop - 1)+ "String_Node_Str"+ TestFile.length()+ "String_Node_Str";
    out.write(str.getBytes());
  }
  if (storedAltLocs.hasAlternateLocations())   HTTPUtils.writeHeader(HTTPHeaderName.ALT_LOCATION,storedAltLocs,out);
  str="String_Node_Str";
  out.write(str.getBytes());
  out.flush();
  for (int i=start; i < stop; ) {
    long startTime=System.currentTimeMillis();
    for (int j=0; j < Math.max(1,(rate * 1024)) && i < stop; j++) {
      if (stopAfter > -1 && totalUploaded >= stopAfter) {
        stopped=true;
        out.flush();
        throw new IOException();
      }
      if (sendCorrupt)       out.write(TestFile.getByte(i) + (byte)1);
 else       out.write(TestFile.getByte(i));
      totalUploaded++;
      i++;
    }
    long elapsed=System.currentTimeMillis() - startTime;
    long wait=1000 - elapsed;
    if (wait > 0)     try {
      Thread.sleep(wait);
    }
 catch (    InterruptedException e) {
    }
  }
  out.flush();
}

Fixed version (ground truth):
private void send(OutputStream out,int start,int stop) throws IOException {
  long t0=System.currentTimeMillis();
  if (minPollTime > 0)   Assert.that(t0 > minPollTime,"String_Node_Str" + (minPollTime - t0) + "String_Node_Str");
  if (maxPollTime > 0)   Assert.that(t0 < maxPollTime,"String_Node_Str" + (t0 - maxPollTime) + "String_Node_Str");
  String str=busy | queue ? "String_Node_Str" : "String_Node_Str";
  out.write(str.getBytes());
  if (queue) {
    String s="String_Node_Str";
    out.write(s.getBytes());
    s="String_Node_Str";
    out.write(s.getBytes());
    out.flush();
    long t=System.currentTimeMillis();
    minPollTime=t + MIN_POLL;
    maxPollTime=t + MAX_POLL;
    return;
  }
  str="String_Node_Str" + (stop - start) + "String_Node_Str";
  out.write(str.getBytes());
  if (start != 0) {
    str="String_Node_Str" + start + "String_Node_Str"+ (stop - 1)+ "String_Node_Str"+ TestFile.length()+ "String_Node_Str";
    out.write(str.getBytes());
  }
  if (storedAltLocs.hasAlternateLocations())   HTTPUtils.writeHeader(HTTPHeaderName.ALT_LOCATION,storedAltLocs,out);
  str="String_Node_Str";
  out.write(str.getBytes());
  out.flush();
  if (busy) {
    out.close();
    return;
  }
  for (int i=start; i < stop; ) {
    long startTime=System.currentTimeMillis();
    for (int j=0; j < Math.max(1,(rate * 1024)) && i < stop; j++) {
      if (stopAfter > -1 && totalUploaded >= stopAfter) {
        stopped=true;
        out.flush();
        throw new IOException();
      }
      if (sendCorrupt)       out.write(TestFile.getByte(i) + (byte)1);
 else       out.write(TestFile.getByte(i));
      totalUploaded++;
      i++;
    }
    long elapsed=System.currentTimeMillis() - startTime;
    long wait=1000 - elapsed;
    if (wait > 0)     try {
      Thread.sleep(wait);
    }
 catch (    InterruptedException e) {
    }
  }
  out.flush();
}