Skip to content

Commit

Permalink
Add+fix annotations in zip+jar streams. (eisop#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpovirk authored Sep 6, 2023
1 parent cdf3431 commit 609f2cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private byte[] getBytes(InputStream is)
* @exception SecurityException if any of the jar file entries
* are incorrectly signed.
*/
public ZipEntry getNextEntry() throws IOException {
public @Nullable ZipEntry getNextEntry() throws IOException {
JarEntry e;
if (first == null) {
e = (JarEntry)super.getNextEntry();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
import org.checkerframework.checker.index.qual.LTEqLengthOf;
import org.checkerframework.framework.qual.AnnotatedFor;

import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

import java.io.InputStream;
import java.io.IOException;
import java.io.EOFException;
Expand All @@ -48,6 +51,7 @@
* @since 1.1
*/
@AnnotatedFor({"index"})
@NullMarked
public
class ZipInputStream extends InflaterInputStream implements ZipConstants {
private ZipEntry entry;
Expand Down Expand Up @@ -119,7 +123,7 @@ public ZipInputStream(InputStream in, Charset charset) {
* @exception ZipException if a ZIP file error has occurred
* @exception IOException if an I/O error has occurred
*/
public ZipEntry getNextEntry() throws IOException {
public @Nullable ZipEntry getNextEntry() throws IOException {
ensureOpen();
if (entry != null) {
closeEntry();
Expand Down

0 comments on commit 609f2cd

Please sign in to comment.