From 5c2e24008d5b093f86aa5dce8db1336d9211d1d2 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Wed, 11 Dec 2024 09:21:34 +0100 Subject: Reduce org.json usage in aai-common - org.json [is slow](https://github.com/fabienrenaud/java-json-benchmark?tab=readme-ov-file#users-model) - Jackson should be consistently used everywhere - only XmlFormatTransformer is left, but that warrants a dedicated change with (likely) further tests since it appears to be quite a critical execution path - remove unused imports - update org.json to a non-vulnerable version Issue-ID: AAI-4085 Change-Id: I84610523447d70a1729348392ffd302d17e9379d Signed-off-by: Fiete Ostkamp --- .../src/main/java/org/onap/aai/config/RestConfiguration.java | 5 ++++- .../src/main/java/org/onap/aai/config/TranslatorConfiguration.java | 2 +- aai-schema-ingest/src/main/java/org/onap/aai/setup/Translator.java | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'aai-schema-ingest/src/main/java') diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/config/RestConfiguration.java b/aai-schema-ingest/src/main/java/org/onap/aai/config/RestConfiguration.java index c46ab78d..01e265fa 100644 --- a/aai-schema-ingest/src/main/java/org/onap/aai/config/RestConfiguration.java +++ b/aai-schema-ingest/src/main/java/org/onap/aai/config/RestConfiguration.java @@ -22,7 +22,10 @@ package org.onap.aai.config; -import org.onap.aai.restclient.*; +import org.onap.aai.restclient.RestClient; +import org.onap.aai.restclient.SchemaServiceNoAuthClient; +import org.onap.aai.restclient.SchemaServiceOneWayClient; +import org.onap.aai.restclient.SchemaServiceRestClient; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/config/TranslatorConfiguration.java b/aai-schema-ingest/src/main/java/org/onap/aai/config/TranslatorConfiguration.java index d49e6ec7..8498d908 100644 --- a/aai-schema-ingest/src/main/java/org/onap/aai/config/TranslatorConfiguration.java +++ b/aai-schema-ingest/src/main/java/org/onap/aai/config/TranslatorConfiguration.java @@ -22,7 +22,7 @@ package org.onap.aai.config; -import org.onap.aai.setup.*; +import org.onap.aai.setup.ConfigTranslator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Configuration; diff --git a/aai-schema-ingest/src/main/java/org/onap/aai/setup/Translator.java b/aai-schema-ingest/src/main/java/org/onap/aai/setup/Translator.java index 45ca0cd6..a9144a6c 100644 --- a/aai-schema-ingest/src/main/java/org/onap/aai/setup/Translator.java +++ b/aai-schema-ingest/src/main/java/org/onap/aai/setup/Translator.java @@ -20,7 +20,8 @@ package org.onap.aai.setup; -import java.io.*; +import java.io.IOException; +import java.io.InputStream; import java.util.List; /** -- cgit 1.2.3-korg