Program: 141302
Project: 141302
Buggy source:
/** 
 * Upload the file.
 */
public void upload() throws IOException {
  LOGGER.info("String_Node_Str" + s3url.getSource());
  final ObjectMetadata md=new ObjectMetadata();
  if (this.metadata.getContentType() != null)   md.setContentType(this.metadata.getContentType());
  if (this.metadata.getContentEncoding() != null)   md.setContentEncoding(this.metadata.getContentEncoding());
  md.setContentLength(this.metadata.getContentLength());
  LOGGER.info("String_Node_Str" + this.s3url + "String_Node_Str"+ md.getContentType()+ "String_Node_Str"+ md.getContentEncoding()+ "String_Node_Str"+ this.metadata.getContentLength()+ "String_Node_Str");
  int tryCount=0;
  boolean uploadOk=false;
  final long start=System.currentTimeMillis();
  AmazonClientException ace=null;
  if (multipartUpload) {
    LOGGER.info("String_Node_Str");
    final Transfer myUpload=tx.upload(s3url.bucket,s3url.getFilePath(),this.is,md);
    try {
      while (myUpload.isDone() == false) {
        Thread.sleep(500);
      }
      if (myUpload.getState() != TransferState.Completed)       throw new IOException("String_Node_Str" + myUpload.getState());
    }
 catch (    InterruptedException e) {
      LOGGER.warning(e.getMessage());
      throw new IOException(e.getMessage());
    }
    uploadOk=true;
  }
 else   do {
    tryCount++;
    try {
      final PutObjectRequest or=new PutObjectRequest(s3url.bucket,s3url.getFilePath(),this.is,md);
      getS3().putObject(or);
      uploadOk=true;
    }
 catch (    AmazonClientException e) {
      ace=e;
      LOGGER.warning("String_Node_Str" + this.s3url + "String_Node_Str"+ tryCount+ "String_Node_Str"+ e.getMessage());
      try {
        Thread.sleep(10000);
      }
 catch (      InterruptedException e1) {
        e1.printStackTrace();
      }
    }
  }
 while (!uploadOk && tryCount < 3);
  if (!uploadOk)   throw new IOException(ace.getMessage());
  final long end=System.currentTimeMillis();
  final long duration=end - start;
  final int speedKiB=(int)(this.metadata.getContentLength() / (duration / 1000.0) / 1024.0);
  LOGGER.info("String_Node_Str" + this.s3url + "String_Node_Str"+ this.metadata.getContentLength()+ "String_Node_Str"+ StringUtils.toTimeHumanReadable(duration)+ "String_Node_Str"+ speedKiB+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Upload the file.
 */
public void upload() throws IOException {
  LOGGER.info("String_Node_Str" + s3url.getSource());
  final ObjectMetadata md=new ObjectMetadata();
  if (this.metadata.getContentType() != null)   md.setContentType(this.metadata.getContentType());
  if (this.metadata.getContentEncoding() != null)   md.setContentEncoding(this.metadata.getContentEncoding());
  if (file == null)   md.setContentLength(this.metadata.getContentLength());
  final long fileLength=this.file == null ? this.metadata.getContentLength() : this.file.length();
  LOGGER.info("String_Node_Str" + this.s3url + "String_Node_Str"+ md.getContentType()+ "String_Node_Str"+ md.getContentEncoding()+ "String_Node_Str"+ fileLength+ "String_Node_Str");
  int tryCount=0;
  boolean uploadOk=false;
  final long start=System.currentTimeMillis();
  AmazonClientException ace=null;
  if (multipartUpload) {
    LOGGER.info("String_Node_Str");
    final Transfer myUpload;
    if (file != null)     myUpload=tx.upload(s3url.bucket,s3url.getFilePath(),file);
 else     myUpload=tx.upload(s3url.bucket,s3url.getFilePath(),this.is,md);
    try {
      while (myUpload.isDone() == false) {
        Thread.sleep(500);
      }
      if (myUpload.getState() != TransferState.Completed)       throw new IOException("String_Node_Str" + myUpload.getState());
    }
 catch (    InterruptedException e) {
      LOGGER.warning(e.getMessage());
      throw new IOException(e.getMessage());
    }
    uploadOk=true;
  }
 else   do {
    tryCount++;
    try {
      final PutObjectRequest or;
      if (file != null)       or=new PutObjectRequest(s3url.bucket,s3url.getFilePath(),file);
 else       or=new PutObjectRequest(s3url.bucket,s3url.getFilePath(),this.is,md);
      getS3().putObject(or);
      uploadOk=true;
    }
 catch (    AmazonClientException e) {
      ace=e;
      LOGGER.warning("String_Node_Str" + this.s3url + "String_Node_Str"+ tryCount+ "String_Node_Str"+ e.getMessage());
      try {
        Thread.sleep(10000);
      }
 catch (      InterruptedException e1) {
        e1.printStackTrace();
      }
    }
  }
 while (!uploadOk && tryCount < 3);
  if (!uploadOk)   throw new IOException(ace.getMessage());
  final long end=System.currentTimeMillis();
  final long duration=end - start;
  final int speedKiB=(int)(fileLength / (duration / 1000.0) / 1024.0);
  LOGGER.info("String_Node_Str" + this.s3url + "String_Node_Str"+ fileLength+ "String_Node_Str"+ StringUtils.toTimeHumanReadable(duration)+ "String_Node_Str"+ speedKiB+ "String_Node_Str");
}