From bd9ea3cf89f9cb8ce327702c3fd54c5cc66c0a9d Mon Sep 17 00:00:00 2001 From: Dain Sundstrom Date: Tue, 19 Mar 2024 22:52:21 -0700 Subject: [PATCH] Convert to Java 22 APIs --- .../io/airlift/compress/lzo/LzoHadoopStreams.java | 7 +------ .../java/io/airlift/compress/zstd/TestUtil.java | 14 +------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/main/java/io/airlift/compress/lzo/LzoHadoopStreams.java b/src/main/java/io/airlift/compress/lzo/LzoHadoopStreams.java index 377be7eb..a75718cd 100644 --- a/src/main/java/io/airlift/compress/lzo/LzoHadoopStreams.java +++ b/src/main/java/io/airlift/compress/lzo/LzoHadoopStreams.java @@ -21,15 +21,10 @@ import java.io.OutputStream; import java.util.List; -import static java.util.Arrays.asList; -import static java.util.Collections.unmodifiableList; - public class LzoHadoopStreams implements HadoopStreams { - private static final List HADOOP_CODEC_NAMES = unmodifiableList(asList( - "org.apache.hadoop.io.compress.LzoCodec", - "com.hadoop.compression.lzo.LzoCodec")); + private static final List HADOOP_CODEC_NAMES = List.of("org.apache.hadoop.io.compress.LzoCodec", "com.hadoop.compression.lzo.LzoCodec"); private static final int DEFAULT_OUTPUT_BUFFER_SIZE = 256 * 1024; private final int bufferSize; diff --git a/src/test/java/io/airlift/compress/zstd/TestUtil.java b/src/test/java/io/airlift/compress/zstd/TestUtil.java index b1f1f2db..75bcadf8 100644 --- a/src/test/java/io/airlift/compress/zstd/TestUtil.java +++ b/src/test/java/io/airlift/compress/zstd/TestUtil.java @@ -64,17 +64,5 @@ private static void testPut24BitLittleEndian(TestData testData) assertThat(outputBase).isEqualTo(testData.bytes); } - private static class TestData - { - final byte[] bytes; - final int offset; - final int value; - - public TestData(byte[] bytes, int offset, int value) - { - this.bytes = bytes; - this.offset = offset; - this.value = value; - } - } + private record TestData(byte[] bytes, int offset, int value) {} }