Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8215788: Clarify JarInputStream Manifest access #10045

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/java.base/share/classes/java/util/jar/JarInputStream.java
Original file line number Diff line number Diff line change
@@ -41,11 +41,11 @@
* <h2>Accessing the Manifest</h2>
* <p>
* The {@link #getManifest() getManifest} method is used to return the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be more simply said as "... method returns the ..."

* <a href="{@docRoot}/../specs/jar/jar.html#jar-manifest">JAR Manifest</a>
* <a href="{@docRoot}/../specs/jar/jar.html#jar-manifest">Manifest</a>
* from the entry {@code META-INF/MANIFEST.MF} when it is the first entry
* in the stream (or the second entry the first entry in the stream is
* {@code META-INF/} and the second entry {@code META-INF/MANIFEST.MF}).
*</p>
* in the stream (or the second entry if the first entry in the stream is
* {@code META-INF/} and the second entry is {@code META-INF/MANIFEST.MF}).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you also want to say "Otherwise, the method returns null."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you also want to say "Otherwise, the method returns null."

The method description has that already, it might be too much detail to include in the class description,.

* </p>
* <p> The {@link #getNextJarEntry()} and {@link #getNextEntry()} methods are
* used to read JAR file entries from the stream. These methods skip over the
* Manifest ({@code META-INF/MANIFEST.MF}) when it is at the beginning of the
@@ -55,8 +55,7 @@
* over by these methods. Whether these methods skip over the Manifest when it
* appears later in the stream is not specified.
* </p>
*
* <h2>Verifying a JarInputStream</h2>
* <h2>Verifying a JarInputStream</h2>
*
* A {@code JarInputStream} may be used to verify the signatures of a
* <a href="{@docRoot}/../specs/jar/jar.html#signed-jar-file">signed JAR file</a>
@@ -146,8 +145,8 @@ private JarEntry checkManifest(JarEntry e)

/**
* Returns the {@code Manifest} for this JAR file when it is the first entry
* in the stream (or the second entry the first entry in the stream is
* {@code META-INF/} and the second entry {@code META-INF/MANIFEST.MF}), or
* in the stream (or the second entry if the first entry in the stream is
* {@code META-INF/} and the second entry is {@code META-INF/MANIFEST.MF}), or
* {@code null} otherwise.
*
* @return the {@code Manifest} for this JAR file, or