[PATCH] for error message not containing file name of jar with bad manifest

Philipp Kunz philipp.kunz at paratix.ch
Mon Jan 7 22:39:38 UTC 2019


I suspect that the filename of a jar never gets into the error message
because the only place Manifest.jarFilename is assigned is in
Manifest.Manifest(JarVerifier,InputStream,String) only after a
successful call to Manifest.read by which the manifest is already fully
read and parsed and after which no error from reading and parsing it
could possibly occur any more.

The closest related bug I found is 8205525. I would have considered
filing a new bug if I had the privileges. For now, I put the existing
8205525 bug number in the @bug tag of the test.

Another flaw is that after the manifest has been read from the jar that
the jar file name is not reset and a subsequent call to Manifest.read
would report the name of the jar file of which the manifest was loaded
initially which is admittedly somewhat a strange form of use but
absolutely possible with the API as it currently is. I figure the jar
file name could go instead to Manifest.jarFilename be added to
Manifest.read as a new overloaded kind of optional parameter and then
be set in a new Manifest.FastInputStream member variable. Worth a bug?

I found an opening bracket missing in an error message fragment and
included it in the attached patch without a separate bug or patch.

Curiously looking forward to any comment,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 8205525.patch
Type: text/x-patch
Size: 4724 bytes
Desc: not available
URL: <https://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20190107/89cc2567/8205525-0001.patch>

More information about the core-libs-dev mailing list