Automatic code cleanup.
PiperOrigin-RevId: 424714767
diff --git a/java/com/google/turbine/main/Main.java b/java/com/google/turbine/main/Main.java
index 07704df..da97bcd 100644
--- a/java/com/google/turbine/main/Main.java
+++ b/java/com/google/turbine/main/Main.java
@@ -344,7 +344,7 @@
for (SourceFile source : generatedSources.values()) {
Path to = path.resolve(source.path());
Files.createDirectories(to.getParent());
- Files.write(to, source.source().getBytes(UTF_8));
+ Files.writeString(to, source.source());
}
return;
}
diff --git a/java/com/google/turbine/options/TurbineOptionsParser.java b/java/com/google/turbine/options/TurbineOptionsParser.java
index e0b19f8..e68a546 100644
--- a/java/com/google/turbine/options/TurbineOptionsParser.java
+++ b/java/com/google/turbine/options/TurbineOptionsParser.java
@@ -17,7 +17,6 @@
package com.google.turbine.options;
import static com.google.common.base.Preconditions.checkArgument;
-import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.common.base.CharMatcher;
import com.google.common.base.Splitter;
@@ -187,8 +186,7 @@
if (!Files.exists(paramsPath)) {
throw new AssertionError("params file does not exist: " + paramsPath);
}
- expandParamsFiles(
- argumentDeque, ARG_SPLITTER.split(new String(Files.readAllBytes(paramsPath), UTF_8)));
+ expandParamsFiles(argumentDeque, ARG_SPLITTER.split(Files.readString(paramsPath)));
} else {
argumentDeque.addLast(arg);
}
diff --git a/javatests/com/google/turbine/zip/ZipTest.java b/javatests/com/google/turbine/zip/ZipTest.java
index 0d49e1a..e9dfc44 100644
--- a/javatests/com/google/turbine/zip/ZipTest.java
+++ b/javatests/com/google/turbine/zip/ZipTest.java
@@ -159,7 +159,7 @@
createEntry(zos, "hello", "world".getBytes(UTF_8));
zos.setComment("this is a comment");
}
- Files.write(path, "trailing garbage".getBytes(UTF_8), StandardOpenOption.APPEND);
+ Files.writeString(path, "trailing garbage", StandardOpenOption.APPEND);
ZipException e = assertThrows(ZipException.class, () -> actual(path));
assertThat(e).hasMessageThat().isEqualTo("zip file comment length was 33, expected 17");