Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6571913

JavacFileManager may not silently ignore missing archives

XMLWordPrintable

    • generic
    • generic

      The semantics of opening an archive are to silently ignore missing files. See 6429613.

      However, ZipFile(File) simply specifies that IOException is thrown in the case of an error, subsuming the possibility of using FileNotFoundException.

      This means that the following code in JavacFileManager, about line 560, may not correctly respond to "file not found", if an IOException is thrown instead of FileNotFoundException.


                  try {
                      ZipFile zdir = new ZipFile(zipFileName);
                      if (origZipFileName == zipFileName)
                          archive = new ZipArchive(zdir);
                      else
                          archive = new SymbolArchive(origZipFileName, zdir);
                  } catch (FileNotFoundException ex) {
                      archive = new MissingArchive(zipFileName);
                  } catch (IOException ex) {
       ******** log.error("error.reading.file", zipFileName, ex.getLocalizedMessage());
                      archive = new MissingArchive(zipFileName);
                  }

            jjg Jonathan Gibbons
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: