diff options
author | Alexander Kurtakov | 2021-01-23 11:41:35 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2021-01-23 12:26:12 +0000 |
commit | 5c2fb6488185a8b5d7e3e95be86a85f5d2efcbea (patch) | |
tree | bb56b16f66cc6cbc670704bc06c9dfa23509a9ce | |
parent | 8a1dc0525f17d15701d18c5760ca6e82f4486a89 (diff) | |
download | eclipse.platform.ua-5c2fb6488185a8b5d7e3e95be86a85f5d2efcbea.tar.gz eclipse.platform.ua-5c2fb6488185a8b5d7e3e95be86a85f5d2efcbea.tar.xz eclipse.platform.ua-5c2fb6488185a8b5d7e3e95be86a85f5d2efcbea.zip |
Move away of deprecated gson api.
Change-Id: Ia869d90dc4377b91db3e06eb4783993c759ae858
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r-- | org.eclipse.tips.json/src/org/eclipse/tips/json/JsonTipProvider.java | 4 | ||||
-rw-r--r-- | org.eclipse.tips.json/src/org/eclipse/tips/json/internal/Util.java | 15 |
2 files changed, 16 insertions, 3 deletions
diff --git a/org.eclipse.tips.json/src/org/eclipse/tips/json/JsonTipProvider.java b/org.eclipse.tips.json/src/org/eclipse/tips/json/JsonTipProvider.java index 50638114c..95d8fc78b 100644 --- a/org.eclipse.tips.json/src/org/eclipse/tips/json/JsonTipProvider.java +++ b/org.eclipse.tips.json/src/org/eclipse/tips/json/JsonTipProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018 Remain Software + * Copyright (c) 2018, 2021 Remain Software and others * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -106,7 +106,7 @@ public abstract class JsonTipProvider extends TipProvider { private JsonObject loadJsonObject() throws IOException { try (InputStream stream = fJsonUrl.openStream(); InputStreamReader reader = new InputStreamReader(stream)) { - Object result = new JsonParser().parse(reader); + Object result = JsonParser.parseReader(reader); if (result instanceof JsonObject) { return (JsonObject) result; } else { diff --git a/org.eclipse.tips.json/src/org/eclipse/tips/json/internal/Util.java b/org.eclipse.tips.json/src/org/eclipse/tips/json/internal/Util.java index d24f78d56..a4dda393b 100644 --- a/org.eclipse.tips.json/src/org/eclipse/tips/json/internal/Util.java +++ b/org.eclipse.tips.json/src/org/eclipse/tips/json/internal/Util.java @@ -1,3 +1,16 @@ +/******************************************************************************* + * Copyright (c) 2018, 2021 Remain Software and others + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * wim.jongman@remainsoftware.com - initial API and implementation + *******************************************************************************/ package org.eclipse.tips.json.internal; import java.io.ByteArrayInputStream; @@ -122,7 +135,7 @@ public class Util { public static JsonObject getJson(String input) throws IOException { try (InputStream stream = new ByteArrayInputStream(input.getBytes()); InputStreamReader reader = new InputStreamReader(stream)) { - JsonElement element = new JsonParser().parse(reader); + JsonElement element = JsonParser.parseReader(reader); if (element instanceof JsonObject) { return (JsonObject) element; } else { |