diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-09-21 21:53:49 +0200 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-09-22 18:18:29 +0200 |
commit | 51415ac5eb5c77809dc5eac5f50b5728b7dfd977 (patch) | |
tree | e0a37e7ac051a2f14cde4773a76382c4ad832bbd /aai-traversal | |
parent | bd91c546bf3089dff3c04fb096c9e2de58b1a6b6 (diff) |
Migrate JAXB to jakarta
- change javax.* JAXB packages to jakarta.*
- bump snapshot version to 1.15.0-SNAPSHOT
Issue-ID: AAI-4005
Change-Id: I5bf2735c5ef53c9162a56f6b5f78e02992a0e2a0
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'aai-traversal')
6 files changed, 18 insertions, 24 deletions
diff --git a/aai-traversal/pom.xml b/aai-traversal/pom.xml index f572ac5..66ab01d 100644 --- a/aai-traversal/pom.xml +++ b/aai-traversal/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>org.onap.aai.traversal</groupId> <artifactId>traversal</artifactId> - <version>1.14.7-SNAPSHOT</version> + <version>1.15.0-SNAPSHOT</version> </parent> <groupId>org.onap.aai.traversal</groupId> <artifactId>aai-traversal</artifactId> @@ -316,16 +316,12 @@ <version>2.1</version> </dependency> <dependency> - <groupId>javax.xml.bind</groupId> - <artifactId>jaxb-api</artifactId> + <groupId>jakarta.xml.bind</groupId> + <artifactId>jakarta.xml.bind-api</artifactId> </dependency> <dependency> - <groupId>com.sun.xml.bind</groupId> - <artifactId>jaxb-impl</artifactId> - </dependency> - <dependency> - <groupId>com.sun.xml.bind</groupId> - <artifactId>jaxb-core</artifactId> + <groupId>org.glassfish.jaxb</groupId> + <artifactId>jaxb-runtime</artifactId> </dependency> <dependency> <groupId>net.sf.jopt-simple</groupId> @@ -637,7 +633,7 @@ <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> - <version>1.18.30</version> + <version>1.18.34</version> <scope>provided</scope> </dependency> </dependencies> diff --git a/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java b/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java index 005d3dc..f262ac4 100644 --- a/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java +++ b/aai-traversal/src/main/java/org/onap/aai/dbgraphgen/ModelBasedProcessing.java @@ -269,7 +269,7 @@ public class ModelBasedProcessing { try { Optional<Vertex> result = dbMethHelper.searchVertexByIdentityMap(modTopNodeType, startNodeFilterArrayOfHashes.get(i)); - if (!result.isPresent()) { + if (result.isEmpty()) { throw new AAIException("AAI_6114", "No Node of type " + modTopNodeType + " found for properties"); } @@ -710,7 +710,7 @@ public class ModelBasedProcessing { Optional<Vertex> result = dbMethHelper.searchVertexByIdentityMap(topNodeTypeVal, startNodeFilterHash); - if (!result.isPresent()) { + if (result.isEmpty()) { throw new AAIException("AAI_6114", "No Node of type " + topNodeTypeVal + " found for properties"); } @@ -741,7 +741,7 @@ public class ModelBasedProcessing { } Optional<Vertex> result = dbMethHelper.locateUniqueVertex(widgModNodeType, startNodeFilterHash); - if (!result.isPresent()) { + if (result.isEmpty()) { throw new AAIException("AAI_6114", "No Node of type " + topNType + " found for properties"); } @@ -794,7 +794,7 @@ public class ModelBasedProcessing { // Locate the starting node that we'll use to start looking for instance data Optional<Vertex> result = dbMethHelper.searchVertexByIdentityMap(topNType, startNodeFilterHash); - if (!result.isPresent()) { + if (result.isEmpty()) { throw new AAIException("AAI_6114", "No Node of type " + topNType + " found for properties"); } @@ -2093,7 +2093,7 @@ public class ModelBasedProcessing { propHash.put(targetProp, valFromInstance); Optional<Vertex> result = dbMethHelper.locateUniqueVertex(targetNodeType, propHash); - if (!result.isPresent()) { + if (result.isEmpty()) { // If it can't find the lookup node, don't fail, just log that it couldn't be found // --- logger.debug("WARNING - Could not find lookup node that corresponds to nodeType [" diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/CQ2GremlinTest.java b/aai-traversal/src/main/java/org/onap/aai/rest/CQ2GremlinTest.java index bade2cd..76da9d8 100644 --- a/aai-traversal/src/main/java/org/onap/aai/rest/CQ2GremlinTest.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/CQ2GremlinTest.java @@ -204,7 +204,7 @@ public class CQ2GremlinTest extends RESTAPI { protected void addStartNode(GraphTraversal<Vertex, Vertex> g, CustomQueryTestDTO content) { Optional<LinkedHashMap<String, String>> startNodeVertex = content.getVerticesDtos().stream() .filter(map -> map.containsKey("start-node")).findFirst(); - if (!startNodeVertex.isPresent()) { + if (startNodeVertex.isEmpty()) { throw new IllegalArgumentException("start-node was not specified"); } startNodeVertex.get().forEach((k, v) -> { diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/search/LocalCQConfig.java b/aai-traversal/src/main/java/org/onap/aai/rest/search/LocalCQConfig.java index ebf49d7..ad5eb4e 100644 --- a/aai-traversal/src/main/java/org/onap/aai/rest/search/LocalCQConfig.java +++ b/aai-traversal/src/main/java/org/onap/aai/rest/search/LocalCQConfig.java @@ -25,7 +25,6 @@ import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.Date; import java.util.Timer; import java.util.TimerTask; @@ -56,7 +55,7 @@ public class LocalCQConfig extends CQConfig { String filepath = storedQueriesLocation + AAIConstants.AAI_FILESEP + "stored-queries.json"; logger.info("Using the Local stored queries"); - Path path = Paths.get(filepath); + Path path = Path.of(filepath); String customQueryConfigJson = new String(Files.readAllBytes(path)); queryConfig = new GetCustomQueryConfig(customQueryConfigJson); @@ -72,7 +71,7 @@ public class LocalCQConfig extends CQConfig { protected void onChange(File file) { try { String filepath = storedQueriesLocation; - Path path = Paths.get(filepath); + Path path = Path.of(filepath); String customQueryConfigJson = new String(Files.readAllBytes(path)); queryConfig = new GetCustomQueryConfig(customQueryConfigJson); diff --git a/aai-traversal/src/main/java/org/onap/aai/service/AuthorizationService.java b/aai-traversal/src/main/java/org/onap/aai/service/AuthorizationService.java index 10bee2b..c291551 100644 --- a/aai-traversal/src/main/java/org/onap/aai/service/AuthorizationService.java +++ b/aai-traversal/src/main/java/org/onap/aai/service/AuthorizationService.java @@ -22,7 +22,7 @@ package org.onap.aai.service; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.Base64; import java.util.HashMap; import java.util.Map; @@ -53,7 +53,7 @@ public class AuthorizationService { String basicAuthFile = getBasicAuthFilePath(); - try (Stream<String> stream = Files.lines(Paths.get(basicAuthFile))) { + try (Stream<String> stream = Files.lines(Path.of(basicAuthFile))) { stream.filter(line -> !line.startsWith("#")).forEach(str -> { byte[] bytes = null; diff --git a/aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphNamedQueryTest.java b/aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphNamedQueryTest.java index e3351ae..9b88c38 100644 --- a/aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphNamedQueryTest.java +++ b/aai-traversal/src/test/java/org/onap/aai/dbgraphmap/SearchGraphNamedQueryTest.java @@ -29,7 +29,6 @@ import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; @@ -101,7 +100,7 @@ public class SearchGraphNamedQueryTest extends AAISetup { assert files != null; for (File file : files) { try { - Path path = Paths.get(widgetPath + AAIConstants.AAI_FILESEP + file.getName()); + Path path = Path.of(widgetPath + AAIConstants.AAI_FILESEP + file.getName()); String widgetPayload = new String(Files.readAllBytes(path)); String modelInvariantId = getJsonValue(widgetPayload, "model-invariant-id"); String widgetUri = @@ -126,7 +125,7 @@ public class SearchGraphNamedQueryTest extends AAISetup { assert files != null; for (File file : files) { try { - Path path = Paths.get(namedQueryPath + AAIConstants.AAI_FILESEP + file.getName()); + Path path = Path.of(namedQueryPath + AAIConstants.AAI_FILESEP + file.getName()); String namedQueryPayload = new String(Files.readAllBytes(path)); String namedQueryUuid = getJsonValue(namedQueryPayload, "named-query-uuid"); String namedQueryUri = |