From 2c2413371bc765b021e9551839b4097afe5fc5ad Mon Sep 17 00:00:00 2001 From: Adam Gent Date: Mon, 13 Jan 2025 11:52:44 -0500 Subject: [PATCH] Fix errprone issues with stdin work --- .../src/main/java/io/jstach/ezkv/kvs/KeyValuesEnvironment.java | 1 + .../src/test/java/io/jstach/ezkv/kvs/KeyValuesSystemTest.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ezkv-kvs/src/main/java/io/jstach/ezkv/kvs/KeyValuesEnvironment.java b/ezkv-kvs/src/main/java/io/jstach/ezkv/kvs/KeyValuesEnvironment.java index 379c9cc..b9bfba8 100644 --- a/ezkv-kvs/src/main/java/io/jstach/ezkv/kvs/KeyValuesEnvironment.java +++ b/ezkv-kvs/src/main/java/io/jstach/ezkv/kvs/KeyValuesEnvironment.java @@ -385,6 +385,7 @@ public void warn(String message) { } +@SuppressWarnings("ArrayRecordComponent") // TODO We will fix this later. record DefaultKeyValuesEnvironment(@NonNull String @Nullable [] mainArgs) implements KeyValuesEnvironment { @Override diff --git a/ezkv-kvs/src/test/java/io/jstach/ezkv/kvs/KeyValuesSystemTest.java b/ezkv-kvs/src/test/java/io/jstach/ezkv/kvs/KeyValuesSystemTest.java index d0b9d4a..2a9d396 100644 --- a/ezkv-kvs/src/test/java/io/jstach/ezkv/kvs/KeyValuesSystemTest.java +++ b/ezkv-kvs/src/test/java/io/jstach/ezkv/kvs/KeyValuesSystemTest.java @@ -9,6 +9,7 @@ import java.io.InputStream; import java.io.PrintStream; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; @@ -65,7 +66,7 @@ public Logger getLogger() { @Override public InputStream getStandardInput() { - return new ByteArrayInputStream(stdin.getBytes()); + return new ByteArrayInputStream(stdin.getBytes(StandardCharsets.UTF_8)); } @Override