Skip to content

Commit

Permalink
Static-import UTF_8 in PluginReader
Browse files Browse the repository at this point in the history
  • Loading branch information
ksobolew authored and findepi committed May 12, 2022
1 parent d609a5e commit bff82d0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import java.io.FileReader;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.List;
Expand All @@ -51,6 +50,7 @@
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
import static io.trino.metadata.InternalFunctionBundle.extractFunctions;
import static java.lang.String.format;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Arrays.asList;
import static java.util.Objects.requireNonNull;
import static java.util.Objects.requireNonNullElse;
Expand Down Expand Up @@ -200,7 +200,7 @@ private static String readPluginClassName(File serviceJar)
.findFirst()
.map(entry -> {
try (BufferedInputStream bis = new BufferedInputStream(zipFile.getInputStream(entry))) {
return new String(ByteStreams.toByteArray(bis), StandardCharsets.UTF_8).trim();
return new String(ByteStreams.toByteArray(bis), UTF_8).trim();
}
catch (IOException e) {
throw new UncheckedIOException(format("Couldn't read plugin's service descriptor in %s", serviceJar), e);
Expand All @@ -219,7 +219,7 @@ private static String readPluginClassName(File serviceJar)
private static Optional<List<String>> readImpactedModules(File gibImpactedModules)
{
try {
return Optional.of(Files.asCharSource(gibImpactedModules, StandardCharsets.UTF_8).readLines());
return Optional.of(Files.asCharSource(gibImpactedModules, UTF_8).readLines());
}
catch (IOException e) {
log.warn(e, "Couldn't read file %s", gibImpactedModules);
Expand Down

0 comments on commit bff82d0

Please sign in to comment.