Skip to content

Commit b557a59

Browse files
authored
[verifier] migrate off deprecated Charsets.UTF_8 (#8768)
Docs: https://docs.oracle.com/javase/8/docs/api/java/nio/charset/StandardCharsets.html See: #8764 --- - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR. <details> <summary>Contribution guidelines:</summary><br> - See our [contributor guide]([https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Dart contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Java and Kotlin contributions should strive to follow Java and Kotlin best practices ([discussion](#8098)). </details>
1 parent c914ee1 commit b557a59

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/io/flutter/FlutterUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import java.io.InputStreamReader;
5151
import java.lang.reflect.InvocationTargetException;
5252
import java.lang.reflect.Method;
53+
import java.nio.charset.StandardCharsets;
5354
import java.nio.file.Paths;
5455
import java.util.Map;
5556
import java.util.Objects;
@@ -468,7 +469,7 @@ private static VirtualFile getFlutterManagedAndroidDir(VirtualFile dir) {
468469
if (meta != null) {
469470
try {
470471
final Properties properties = new Properties();
471-
properties.load(new InputStreamReader(meta.getInputStream(), Charsets.UTF_8));
472+
properties.load(new InputStreamReader(meta.getInputStream(), StandardCharsets.UTF_8));
472473
final String value = properties.getProperty("project_type");
473474
if (value == null) {
474475
return null;

src/io/flutter/run/daemon/DaemonApi.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import java.io.OutputStream;
3030
import java.io.OutputStreamWriter;
3131
import java.io.PrintWriter;
32+
import java.nio.charset.StandardCharsets;
3233
import java.util.ArrayDeque;
3334
import java.util.ArrayList;
3435
import java.util.Collections;
@@ -314,7 +315,7 @@ private static void sendCommand(String json, ProcessHandler handler) {
314315
private static PrintWriter getStdin(ProcessHandler processHandler) {
315316
final OutputStream stdin = processHandler.getProcessInput();
316317
if (stdin == null) return null;
317-
return new PrintWriter(new OutputStreamWriter(stdin, Charsets.UTF_8));
318+
return new PrintWriter(new OutputStreamWriter(stdin, StandardCharsets.UTF_8));
318319
}
319320

320321
public static class RestartResult {

0 commit comments

Comments
 (0)