From c6e60291d8e698572867a51dd0fbbf7f55b533b9 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Sat, 9 Mar 2024 15:32:01 +0100 Subject: [PATCH] Do not use java.util.zip.Checksum We are using this interface only for local variable type declaration, use CRC32 directly, just as MappedJournalSegmentWriter does. JIRA: CONTROLLER-2095 Change-Id: I054c639ae49b4fccef863a363c6e8665ea1322f6 Signed-off-by: Robert Varga --- .../storage/journal/FileChannelJournalSegmentWriter.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/atomix-storage/src/main/java/io/atomix/storage/journal/FileChannelJournalSegmentWriter.java b/atomix-storage/src/main/java/io/atomix/storage/journal/FileChannelJournalSegmentWriter.java index 62e0002a38..b399b5f9c8 100644 --- a/atomix-storage/src/main/java/io/atomix/storage/journal/FileChannelJournalSegmentWriter.java +++ b/atomix-storage/src/main/java/io/atomix/storage/journal/FileChannelJournalSegmentWriter.java @@ -24,7 +24,6 @@ import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; import java.util.zip.CRC32; -import java.util.zip.Checksum; /** * Segment writer. @@ -97,7 +96,7 @@ class FileChannelJournalSegmentWriter implements JournalWriter { final long checksum = memory.getInt() & 0xFFFFFFFFL; // Compute the checksum for the entry bytes. - final Checksum crc32 = new CRC32(); + final CRC32 crc32 = new CRC32(); crc32.update(memory.array(), memory.position(), length); // If the stored checksum equals the computed checksum, return the entry. @@ -207,7 +206,7 @@ class FileChannelJournalSegmentWriter implements JournalWriter { } // Compute the checksum for the entry. - final Checksum crc32 = new CRC32(); + final CRC32 crc32 = new CRC32(); crc32.update(memory.array(), Integer.BYTES + Integer.BYTES, memory.limit() - (Integer.BYTES + Integer.BYTES)); final long checksum = crc32.getValue(); -- 2.36.6