This is an automated email from the ASF dual-hosted git repository.
mbudiu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git
The following commit(s) were added to refs/heads/main by this push:
new 45169e3237 Use StandardCharsets in RuleMatchVisualizer.java
45169e3237 is described below
commit 45169e323773799f4da1f002c83c5f5ff8e83eea
Author: Kurt Alfred Kluever <[email protected]>
AuthorDate: Thu May 8 10:41:02 2025 -0400
Use StandardCharsets in RuleMatchVisualizer.java
The Charset constants in Guava's Charsets are deprecated in favor of
StandardCharsets.
---
.../org/apache/calcite/plan/visualizer/RuleMatchVisualizer.java | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git
a/core/src/main/java/org/apache/calcite/plan/visualizer/RuleMatchVisualizer.java
b/core/src/main/java/org/apache/calcite/plan/visualizer/RuleMatchVisualizer.java
index 18f4719b66..5cbc6aa10e 100644
---
a/core/src/main/java/org/apache/calcite/plan/visualizer/RuleMatchVisualizer.java
+++
b/core/src/main/java/org/apache/calcite/plan/visualizer/RuleMatchVisualizer.java
@@ -30,14 +30,12 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.base.Charsets;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
-import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -57,6 +55,7 @@
import static org.apache.calcite.util.Util.transform;
+import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Objects.requireNonNull;
/**
@@ -388,7 +387,7 @@ public void writeToFile() {
final ClassLoader cl = requireNonNull(getClass().getClassLoader());
final InputStream resourceAsStream =
requireNonNull(cl.getResourceAsStream(templatePath));
- String htmlTemplate = IOUtils.toString(resourceAsStream,
StandardCharsets.UTF_8);
+ String htmlTemplate = IOUtils.toString(resourceAsStream, UTF_8);
String htmlFileName = "planner-viz" + outputSuffix + ".html";
String dataFileName = "planner-viz-data" + outputSuffix + ".js";
@@ -409,9 +408,9 @@ public void writeToFile() {
Files.createDirectories(outputDirPath);
}
- Files.write(htmlOutput, htmlContent.getBytes(Charsets.UTF_8),
StandardOpenOption.CREATE,
+ Files.write(htmlOutput, htmlContent.getBytes(UTF_8),
StandardOpenOption.CREATE,
StandardOpenOption.TRUNCATE_EXISTING);
- Files.write(dataOutput, dataJsContent.getBytes(Charsets.UTF_8),
StandardOpenOption.CREATE,
+ Files.write(dataOutput, dataJsContent.getBytes(UTF_8),
StandardOpenOption.CREATE,
StandardOpenOption.TRUNCATE_EXISTING);
} catch (IOException e) {
throw new UncheckedIOException(e);