Resolve itest runbundles for Gson and Commons Lang upgrades and fix JsonParser deprecations (#10345)
* Resolve itest runbundles for Gson and Commons Lang upgrades * Fix JsonParser deprecations too * Fix feature verification Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -36,8 +36,6 @@ import com.google.gson.JsonParser;
|
||||
@NonNullByDefault
|
||||
public class Parser {
|
||||
|
||||
private static JsonParser parser = new JsonParser();
|
||||
|
||||
/**
|
||||
* Parse a json string received from Smhi containing forecasts.
|
||||
*
|
||||
@@ -46,7 +44,7 @@ public class Parser {
|
||||
*/
|
||||
public static TimeSeries parseTimeSeries(String json) {
|
||||
ZonedDateTime referenceTime;
|
||||
JsonObject object = parser.parse(json).getAsJsonObject();
|
||||
JsonObject object = JsonParser.parseString(json).getAsJsonObject();
|
||||
|
||||
referenceTime = parseApprovedTime(json);
|
||||
JsonArray timeSeries = object.get("timeSeries").getAsJsonArray();
|
||||
@@ -65,7 +63,7 @@ public class Parser {
|
||||
* @return {@link ZonedDateTime} of the reference time
|
||||
*/
|
||||
public static ZonedDateTime parseApprovedTime(String json) {
|
||||
JsonObject timeObj = parser.parse(json).getAsJsonObject();
|
||||
JsonObject timeObj = JsonParser.parseString(json).getAsJsonObject();
|
||||
|
||||
return ZonedDateTime.parse(timeObj.get("referenceTime").getAsString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user