From 1bc51514f3fa86c252cd486017db9b99f1b58298 Mon Sep 17 00:00:00 2001 From: Jaime Wren Date: Tue, 17 Dec 2024 14:01:22 -0800 Subject: [PATCH] Migrate from deprecated method: JsonParser().parse() to JsonParser.parseString(..) (#7868) https://github.com/flutter/flutter-intellij/issues/7718 --- flutter-idea/src/io/flutter/sdk/FlutterSdkUtil.java | 2 +- .../vmServiceDrivers/org/dartlang/vm/service/VmServiceBase.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flutter-idea/src/io/flutter/sdk/FlutterSdkUtil.java b/flutter-idea/src/io/flutter/sdk/FlutterSdkUtil.java index 75681a4b0d..a44625d3f8 100644 --- a/flutter-idea/src/io/flutter/sdk/FlutterSdkUtil.java +++ b/flutter-idea/src/io/flutter/sdk/FlutterSdkUtil.java @@ -330,7 +330,7 @@ private static JsonArray getPackagesFromPackageConfig(@NotNull List pub // parse it try { final String contents = new String(configFile.contentsToByteArray(true /* cache contents */)); - final JsonElement element = new JsonParser().parse(contents); + final JsonElement element = JsonParser.parseString(contents); if (element == null) { continue; } diff --git a/flutter-idea/third_party/vmServiceDrivers/org/dartlang/vm/service/VmServiceBase.java b/flutter-idea/third_party/vmServiceDrivers/org/dartlang/vm/service/VmServiceBase.java index b37643f3c1..8e7e1c82ea 100644 --- a/flutter-idea/third_party/vmServiceDrivers/org/dartlang/vm/service/VmServiceBase.java +++ b/flutter-idea/third_party/vmServiceDrivers/org/dartlang/vm/service/VmServiceBase.java @@ -394,7 +394,7 @@ void processMessage(String jsonText) { // Decode the JSON JsonObject json; try { - json = (JsonObject) new JsonParser().parse(jsonText); + json = (JsonObject) JsonParser.parseString(jsonText); } catch (Exception e) { Logging.getLogger().logError("Parse message failed: " + jsonText, e); return;