From fe63dc4e556f6f0f31ad695d829db11d23e21942 Mon Sep 17 00:00:00 2001 From: Chris Povirk Date: Tue, 12 Nov 2024 09:52:09 -0500 Subject: [PATCH] Annotate `CRC32` and `GZIPOutputStream`. Prompted by https://github.com/google/xplat/commit/7eaf9ad1f2071823b2706513f29b641161cdeee3. --- src/java.base/share/classes/java/util/zip/CRC32.java | 2 ++ src/java.base/share/classes/java/util/zip/GZIPOutputStream.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/java.base/share/classes/java/util/zip/CRC32.java b/src/java.base/share/classes/java/util/zip/CRC32.java index 944ccaa7e21..78050672ceb 100644 --- a/src/java.base/share/classes/java/util/zip/CRC32.java +++ b/src/java.base/share/classes/java/util/zip/CRC32.java @@ -31,6 +31,7 @@ import sun.nio.ch.DirectBuffer; import jdk.internal.util.Preconditions; import jdk.internal.vm.annotation.IntrinsicCandidate; +import org.jspecify.annotations.NullMarked; import static java.util.zip.ZipUtils.NIO_ACCESS; @@ -43,6 +44,7 @@ * @author David Connelly * @since 1.1 */ +@NullMarked public class CRC32 implements Checksum { private int crc; diff --git a/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java b/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java index cea0880fca6..d449717ff04 100644 --- a/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java +++ b/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java @@ -27,6 +27,7 @@ import java.io.OutputStream; import java.io.IOException; +import org.jspecify.annotations.NullMarked; /** * This class implements a stream filter for writing compressed data in @@ -39,6 +40,7 @@ * @since 1.1 * */ +@NullMarked public class GZIPOutputStream extends DeflaterOutputStream { /** * CRC-32 of uncompressed data.