-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
7
-
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);
}
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);
}
- relates to
-
JDK-6429613 tools/javac/Paths/Diagnostics.sh fails: bad files in extdirs doesn't cause an error
- Resolved