Program: 101676
Project: 101676
Buggy source:
/** 
 * Load the cached index file into memory
 */
private void loadCachedIndex() throws InstallException {
  BookDriver fake=SwordBookDriver.instance();
  entries.clear();
  URL cache=getCachedIndexFile();
  if (!NetUtil.isFile(cache)) {
    reloadBookList();
  }
  InputStream in=null;
  GZIPInputStream gin=null;
  TarInputStream tin=null;
  try {
    ConfigEntry.resetStatistics();
    in=cache.openStream();
    gin=new GZIPInputStream(in);
    tin=new TarInputStream(gin);
    while (true) {
      TarEntry entry=tin.getNextEntry();
      if (entry == null) {
        break;
      }
      String internal=entry.getName();
      if (!entry.isDirectory()) {
        try {
          int size=(int)entry.getSize();
          byte[] buffer=new byte[size];
          if (tin.read(buffer) != size) {
            log.warn("String_Node_Str" + internal);
          }
          if (internal.endsWith(SwordConstants.EXTENSION_CONF)) {
            internal=internal.substring(0,internal.length() - 5);
          }
          if (internal.startsWith(SwordConstants.DIR_CONF + '/')) {
            internal=internal.substring(7);
          }
          Reader rin=new InputStreamReader(new ByteArrayInputStream(buffer));
          SwordBookMetaData sbmd=new SwordBookMetaData(rin,internal);
          sbmd.setDriver(fake);
          Book book=new SwordBook(sbmd,null);
          entries.put(book.getName(),book);
        }
 catch (        Exception ex) {
          log.warn("String_Node_Str" + internal,ex);
        }
      }
    }
    loaded=true;
    ConfigEntry.dumpStatistics();
  }
 catch (  IOException ex) {
    throw new InstallException(Msg.CACHE_ERROR,ex);
  }
 finally {
    IOUtil.close(tin);
    IOUtil.close(gin);
    IOUtil.close(in);
  }
}

Fixed version (ground truth):
/** 
 * Load the cached index file into memory
 */
private void loadCachedIndex() throws InstallException {
  BookDriver fake=SwordBookDriver.instance();
  entries.clear();
  URL cache=getCachedIndexFile();
  if (!NetUtil.isFile(cache)) {
    reloadBookList();
  }
  InputStream in=null;
  GZIPInputStream gin=null;
  TarInputStream tin=null;
  try {
    ConfigEntry.resetStatistics();
    in=cache.openStream();
    gin=new GZIPInputStream(in);
    tin=new TarInputStream(gin);
    while (true) {
      TarEntry entry=tin.getNextEntry();
      if (entry == null) {
        break;
      }
      String internal=entry.getName();
      if (!entry.isDirectory()) {
        try {
          int size=(int)entry.getSize();
          byte[] buffer=new byte[size];
          if (tin.read(buffer) != size) {
            log.warn("String_Node_Str" + internal);
          }
          if (internal.endsWith(SwordConstants.EXTENSION_CONF)) {
            internal=internal.substring(0,internal.length() - 5);
          }
          if (internal.startsWith(SwordConstants.DIR_CONF + '/')) {
            internal=internal.substring(7);
          }
          SwordBookMetaData sbmd=new SwordBookMetaData(buffer,internal);
          sbmd.setDriver(fake);
          Book book=new SwordBook(sbmd,null);
          entries.put(book.getName(),book);
        }
 catch (        Exception ex) {
          log.warn("String_Node_Str" + internal,ex);
        }
      }
    }
    loaded=true;
    ConfigEntry.dumpStatistics();
  }
 catch (  IOException ex) {
    throw new InstallException(Msg.CACHE_ERROR,ex);
  }
 finally {
    IOUtil.close(tin);
    IOUtil.close(gin);
    IOUtil.close(in);
  }
}