Program: 89704
Project: 89704
Buggy source:
/** 
 * Look up a given URI and return the contents as an InputStream. The uri is first checked using url-decoding (e.g. "," in the argument is converted to "%2C"). If this returns no match, the method then searches for a non-url-decoded match. If neither returns a match the method returns null.
 * @param uri The URI to find in the archive.  If the URI does notmatch any entries in the archive, null is returned.
 * @return An InputStream Containing all the data in the entry, ornull if the entry was not found
 * @throws IOFailure If the ARC file was found in the Lucene index but notin the bit archive, or if some other failure happened while finding the file.
 */
public InputStream lookup(URI uri){
  ArgumentNotValid.checkNotNull(uri,"String_Node_Str");
  ARCKey key=luceneLookup(uri.getScheme() + "String_Node_Str" + uri.getSchemeSpecificPart());
  if (key == null) {
    key=luceneLookup(uri.getScheme() + "String_Node_Str" + uri.getRawSchemeSpecificPart());
  }
  if (key == null) {
    return null;
  }
 else {
    final BitarchiveRecord bitarchiveRecord=arcRepositoryClient.get(key.getFile().getName(),key.getOffset());
    if (bitarchiveRecord == null) {
      String message="String_Node_Str" + key.getFile().getName() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
      log.debug(message);
      throw new IOFailure(message);
    }
    return bitarchiveRecord.getData();
  }
}

Fixed version (ground truth):
/** 
 * Look up a given URI and return the contents as an InputStream. The uri is first checked using url-decoding (e.g. "," in the argument is converted to "%2C"). If this returns no match, the method then searches for a non-url-decoded match. If neither returns a match the method returns null. If the tryToLookupUriAsFtp field is set to true, we will try exchanging the schema with ftp, whenever we can't lookup the uri with the original schema.
 * @param uri The URI to find in the archive.  If the URI does notmatch any entries in the archive, null is returned.
 * @return An InputStream Containing all the data in the entry, ornull if the entry was not found
 * @throws IOFailure If the ARC file was found in the Lucene index but notin the bit archive, or if some other failure happened while finding the file.
 */
public InputStream lookup(URI uri){
  ArgumentNotValid.checkNotNull(uri,"String_Node_Str");
  ARCKey key=luceneLookup(uri.getScheme() + "String_Node_Str" + uri.getSchemeSpecificPart());
  if (key == null) {
    key=luceneLookup(uri.getScheme() + "String_Node_Str" + uri.getRawSchemeSpecificPart());
  }
  if (key == null && tryToLookupUriAsFtp) {
    log.debug("String_Node_Str" + uri.getScheme() + "String_Node_Str");
    final String ftpSchema="String_Node_Str";
    key=luceneLookup(ftpSchema + "String_Node_Str" + uri.getSchemeSpecificPart());
    if (key == null) {
      key=luceneLookup(ftpSchema + "String_Node_Str" + uri.getRawSchemeSpecificPart());
    }
  }
  if (key == null) {
    return null;
  }
 else {
    final BitarchiveRecord bitarchiveRecord=arcRepositoryClient.get(key.getFile().getName(),key.getOffset());
    if (bitarchiveRecord == null) {
      String message="String_Node_Str" + key.getFile().getName() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
      log.debug(message);
      throw new IOFailure(message);
    }
    return bitarchiveRecord.getData();
  }
}