Use JsonParser.parseString() 42/99642/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 8 Feb 2022 09:20:23 +0000 (10:20 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 8 Feb 2022 09:20:43 +0000 (10:20 +0100)
Instantiating JsonParser is deprecate, do not use it.

Change-Id: I5486632f3ac00c89941df93096817fca2f820b22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/realm/MoonRealm.java

index e288a96f9d677afc7f77add3093ab7be1db0332c..f531354aad45da9a09800f000e6ae51602cec161 100644 (file)
@@ -111,7 +111,7 @@ public class MoonRealm extends AuthorizingRealm {
         final String output = webTarget.request(MediaType.APPLICATION_JSON)
                 .post(Entity.entity(input, MediaType.APPLICATION_JSON), String.class);
 
-        final JsonElement element = new JsonParser().parse(output);
+        final JsonElement element = JsonParser.parseString(output);
         if (!element.isJsonObject()) {
             throw new IllegalStateException("Authentication error: returned output is not a JSON object");
         }