Replace deprecated methods in aai-common
[aai/aai-common.git] / aai-core / src / main / java / org / onap / aai / serialization / queryformats / PathedURL.java
index f052f77..0331925 100644 (file)
@@ -45,19 +45,16 @@ import org.onap.aai.serialization.queryformats.utils.UrlBuilder;
 public final class PathedURL extends MultiFormatMapper {
 
     private final UrlBuilder urlBuilder;
-    private final JsonParser parser;
     private final Loader loader;
     private boolean includeUrl = false;
 
     public PathedURL(Loader loader, UrlBuilder urlBuilder) throws AAIException {
         this.urlBuilder = urlBuilder;
-        this.parser = new JsonParser();
         this.loader = loader;
     }
 
     public PathedURL(Builder builder) {
         this.urlBuilder = builder.getUrlBuilder();
-        this.parser = new JsonParser();
         this.loader = builder.getLoader();
         this.isTree = builder.isTree();
         this.includeUrl = builder.isIncludeUrl();
@@ -82,7 +79,7 @@ public final class PathedURL extends MultiFormatMapper {
                 searchResult.setValue("resource-version", v.value(AAIProperties.RESOURCE_VERSION));
 
             final String json = searchResult.marshal(false);
-            return Optional.of(this.parser.parse(json).getAsJsonObject());
+            return Optional.of(JsonParser.parseString(json).getAsJsonObject());
 
         } catch (AAIUnknownObjectException e) {
             throw new RuntimeException("Fatal error - result-data does not exist!", e);