Program: 45978
Project: 45978
Buggy source:
/** 
 * Downloads the asset from the server and returns the asset upon success or null upon failure
 */
private Object doAssetDownload(){
  AssetURI assetURI=asset.getAssetURI();
  String uriString=assetURI.toExternalForm();
  AssetRepository repositories[]=factory.getAssetRepositories();
  logger.fine("String_Node_Str" + repositories + "String_Node_Str"+ uriString);
  for (  AssetRepository repository : repositories) {
    logger.fine("String_Node_Str" + repository.toString() + "String_Node_Str"+ assetURI);
    AssetStream stream=repository.openAssetStream(assetURI);
    AssetResponse response=stream.getResponse();
    logger.fine("String_Node_Str" + response + "String_Node_Str"+ uriString);
    if (response == AssetResponse.ASSET_CACHED) {
      AssetID assetID=new AssetID(assetURI,asset.getChecksum());
      asset.setLocalCacheFile(new File(assetCache.getAssetCacheFileName(assetID)));
      return loadAssetFromCache(asset);
    }
 else     if (response == AssetResponse.STREAM_READY) {
      try {
        stream.open();
        loadAssetFromServer(asset,stream);
        assetCache.addAsset(asset,stream.getCachePolicy());
        stream.close();
        return loadAssetFromCache(asset);
      }
 catch (      java.io.IOException excp) {
        logger.log(Level.WARNING,"String_Node_Str" + "String_Node_Str" + uriString,excp);
        continue;
      }
catch (      AssetCacheException excp) {
        logger.log(Level.WARNING,"String_Node_Str" + "String_Node_Str" + uriString,excp);
        continue;
      }
    }
 else {
      continue;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Downloads the asset from the server and returns the asset upon success or null upon failure
 */
private Object doAssetDownload(){
  AssetURI assetURI=asset.getAssetURI();
  String uriString=assetURI.toExternalForm();
  String originalChecksum=asset.getChecksum();
  AssetRepository repositories[]=factory.getAssetRepositories();
  logger.fine("String_Node_Str" + repositories + "String_Node_Str"+ uriString);
  for (  AssetRepository repository : repositories) {
    logger.fine("String_Node_Str" + repository.toString() + "String_Node_Str"+ assetURI);
    AssetStream stream=repository.openAssetStream(assetURI);
    AssetResponse response=stream.getResponse();
    logger.fine("String_Node_Str" + response + "String_Node_Str"+ uriString);
    if (response == AssetResponse.ASSET_CACHED) {
      AssetID assetID=new AssetID(assetURI,asset.getChecksum());
      asset.setLocalCacheFile(new File(assetCache.getAssetCacheFileName(assetID)));
      return loadAssetFromCache(asset,originalChecksum);
    }
 else     if (response == AssetResponse.STREAM_READY) {
      try {
        stream.open();
        loadAssetFromServer(asset,stream);
        assetCache.addAsset(asset,stream.getCachePolicy());
        stream.close();
        return loadAssetFromCache(asset,originalChecksum);
      }
 catch (      java.io.IOException excp) {
        logger.log(Level.WARNING,"String_Node_Str" + "String_Node_Str" + uriString,excp);
        continue;
      }
catch (      AssetCacheException excp) {
        logger.log(Level.WARNING,"String_Node_Str" + "String_Node_Str" + uriString,excp);
        continue;
      }
    }
 else {
      continue;
    }
  }
  return null;
}