RFR: 8215788: Clarify JarInputStream Manifest access
Weijun Wang
weijun at openjdk.org
Tue Sep 13 17:24:47 UTC 2022
On Thu, 1 Sep 2022 11:06:41 GMT, Lance Andersen <lancea at openjdk.org> wrote:
>> That's right. But I think we care about the MANIFEST more. It's not that important whether META-INF is there.
>
> True we do care more about the manifest, but was also trying to address the difference between ZipInputStream which will always return both entries regardless of location
>
> We also have the case such where you the 1st entry in the jar is a normal file and the 2nd entry is the manifest., getManifest() will return null.
>
> I guess I could say:
>
> _"getManifest will return the Manifest if it is the first entry or META-INF/ is the first entry and the Manifest is the second entry within the Jar file. For all cases, getManifest will return null."
>
> Is the above any better?
It's better. Do you need to explicitly say "For all other cases"?
My original comment was more about explaining `getManifest()` and `getNextEntry()` in the same if. It's still doable.
-------------
PR: https://git.openjdk.org/jdk/pull/10045
More information about the core-libs-dev
mailing list