diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-09-21 21:11:50 +0200 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-09-21 21:11:50 +0200 |
commit | fb6d819a5175e154c56810e47282d7e7fd7ef9d8 (patch) | |
tree | fab85b942faf19d3abf2551a8f726ead4a6e8088 /aai-core | |
parent | fa81fb202babb8ee183a342f37f3bbe952ad2023 (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: I2a208f717206a2ee8c2acaec8abb0a04fc620123
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'aai-core')
11 files changed, 20 insertions, 24 deletions
diff --git a/aai-core/pom.xml b/aai-core/pom.xml index e53d233c..b66e1374 100644 --- a/aai-core/pom.xml +++ b/aai-core/pom.xml @@ -26,7 +26,7 @@ limitations under the License. <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-parent</artifactId> - <version>1.14.7-SNAPSHOT</version> + <version>1.15.0-SNAPSHOT</version> <relativePath>../aai-parent/pom.xml</relativePath> </parent> <artifactId>aai-core</artifactId> @@ -213,16 +213,12 @@ limitations under the License. <artifactId>json-simple</artifactId> </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>org.eclipse.persistence</groupId> @@ -410,7 +406,7 @@ limitations under the License. <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-core/src/main/java/org/onap/aai/introspection/sideeffect/SideEffect.java b/aai-core/src/main/java/org/onap/aai/introspection/sideeffect/SideEffect.java index bec46520..ce802c7a 100644 --- a/aai-core/src/main/java/org/onap/aai/introspection/sideeffect/SideEffect.java +++ b/aai-core/src/main/java/org/onap/aai/introspection/sideeffect/SideEffect.java @@ -136,7 +136,7 @@ public abstract class SideEffect { } private Optional<String> resolveRelativePath(Optional<String> populatedUri) throws UnsupportedEncodingException { - if (!populatedUri.isPresent()) { + if (populatedUri.isEmpty()) { return Optional.empty(); } else { return Optional.of(populatedUri.get().replaceFirst("\\./", this.serializer.getURIForVertex(self) + "/")); diff --git a/aai-core/src/main/java/org/onap/aai/parsers/relationship/RelationshipToURI.java b/aai-core/src/main/java/org/onap/aai/parsers/relationship/RelationshipToURI.java index 95b1517d..af9d8aa1 100644 --- a/aai-core/src/main/java/org/onap/aai/parsers/relationship/RelationshipToURI.java +++ b/aai-core/src/main/java/org/onap/aai/parsers/relationship/RelationshipToURI.java @@ -112,12 +112,12 @@ public class RelationshipToURI { try { if (loader.getVersion().compareTo(schemaVersions.getRelatedLinkVersion()) >= 0) { result = processRelatedLink(relatedLink); - if (!result.isPresent()) { + if (result.isEmpty()) { result = processRelationshipData(); } } else { result = processRelationshipData(); - if (!result.isPresent()) { + if (result.isEmpty()) { result = processRelatedLink(relatedLink); } } diff --git a/aai-core/src/main/java/org/onap/aai/rest/db/HttpEntry.java b/aai-core/src/main/java/org/onap/aai/rest/db/HttpEntry.java index 94dc63aa..c4f84396 100644 --- a/aai-core/src/main/java/org/onap/aai/rest/db/HttpEntry.java +++ b/aai-core/src/main/java/org/onap/aai/rest/db/HttpEntry.java @@ -384,7 +384,7 @@ public class HttpEntry { if (obj != null) { status = Status.OK; MarshallerProperties properties; - if (!request.getMarshallerProperties().isPresent()) { + if (request.getMarshallerProperties().isEmpty()) { properties = new MarshallerProperties.Builder( org.onap.aai.restcore.MediaType.getEnum(outputMediaType)).build(); } else { diff --git a/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeSerializer.java b/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeSerializer.java index 0d491c9d..ce3891ee 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeSerializer.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/db/EdgeSerializer.java @@ -112,7 +112,7 @@ public class EdgeSerializer { if (message.isPresent() && !isBestEffort) { throw new EdgeMultiplicityException(message.get()); } - if (!message.isPresent()) { + if (message.isEmpty()) { if (rule.getDirection().equals(Direction.OUT)) { e = aVertex.addEdge(rule.getLabel(), bVertex); } else if (rule.getDirection().equals(Direction.IN)) { @@ -185,7 +185,7 @@ public class EdgeSerializer { if (message.isPresent() && !isBestEffort) { throw new EdgeMultiplicityException(message.get()); } - if (!message.isPresent()) { + if (message.isEmpty()) { if (rule.getDirection().equals(Direction.OUT)) { e = aVertex.addEdge(rule.getLabel(), bVertex); } else if (rule.getDirection().equals(Direction.IN)) { diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java index 71f7bc78..54fc4eb0 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java @@ -177,7 +177,7 @@ public class Aggregate extends MultiFormatMapper { } return Optional.<JsonObject>empty(); - }).filter(Optional::isPresent).map(Optional::get).forEach(json -> { + }).flatMap(Optional::stream).forEach(json -> { if (isParallel) { synchronized (body) { body.add(json); diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Count.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Count.java index 216d021d..c736eab8 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Count.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Count.java @@ -44,7 +44,7 @@ public class Count implements FormatMapper { final JsonObject countResult = new JsonObject(); - list.stream().map(this::getCount).filter(Optional::isPresent).map(Optional::get) + list.stream().map(this::getCount).flatMap(Optional::stream) .collect(Collectors.toConcurrentMap(Pair::getValue0, Pair::getValue1, Long::sum)) .forEach(countResult::addProperty); diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Formatter.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Formatter.java index da5d5425..10f1edc4 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Formatter.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Formatter.java @@ -102,7 +102,7 @@ public class Formatter { } return Optional.<JsonObject>empty(); - }).filter(Optional::isPresent).map(Optional::get).forEach(json -> { + }).flatMap(Optional::stream).forEach(json -> { if (isParallel) { synchronized (body) { body.add(json); diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/LifecycleFormat.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/LifecycleFormat.java index 74742c98..fbe74e28 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/LifecycleFormat.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/LifecycleFormat.java @@ -267,7 +267,7 @@ public class LifecycleFormat extends HistoryFormat { } return Optional.<JsonObject>empty(); - }).filter(Optional::isPresent).map(Optional::get).forEach(json -> { + }).flatMap(Optional::stream).forEach(json -> { if (isParallel) { synchronized (body) { body.add(json); diff --git a/aai-core/src/test/java/org/onap/aai/kafka/AAIKafkaEventIntegrationTest.java b/aai-core/src/test/java/org/onap/aai/kafka/AAIKafkaEventIntegrationTest.java index 56a6a857..ce636a51 100644 --- a/aai-core/src/test/java/org/onap/aai/kafka/AAIKafkaEventIntegrationTest.java +++ b/aai-core/src/test/java/org/onap/aai/kafka/AAIKafkaEventIntegrationTest.java @@ -26,7 +26,7 @@ import static org.mockito.Mockito.when; import java.io.IOException; import java.net.URI; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -129,7 +129,7 @@ public class AAIKafkaEventIntegrationTest extends AAISetup { traversalUriHttpEntry.setHttpEntryProperties(new SchemaVersion("v14")); String pserverUri = "/aai/v14/cloud-infrastructure/pservers/pserver/pserver1"; - String entity = new String(Files.readAllBytes(Paths.get("src/test/resources/payloads/templates/pserver.json"))).replace("${hostname}", "pserver1"); + String entity = new String(Files.readAllBytes(Path.of("src/test/resources/payloads/templates/pserver.json"))).replace("${hostname}", "pserver1"); DBRequest dbRequest = createDBRequest(pserverUri, entity); List<DBRequest> dbRequests = new ArrayList<>(); dbRequests.add(dbRequest); diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/PathedURLTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/PathedURLTest.java index 6ed42539..cd2c3af3 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/PathedURLTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/PathedURLTest.java @@ -127,7 +127,7 @@ public class PathedURLTest extends AAISetup { when(urlBuilder.pathed(pserver)).thenReturn("/aai/v14/cloud-infrastructure/pservers/pserver/hostname-1"); Optional<JsonObject> jsonObjectOptional = pathedURL.getJsonFromVertex(pserver); - if (!jsonObjectOptional.isPresent()) { + if (jsonObjectOptional.isEmpty()) { fail("Expecting an json object returned from pathed url but returned none"); } @@ -150,7 +150,7 @@ public class PathedURLTest extends AAISetup { when(urlBuilder.pathed(pserver)).thenReturn("/aai/v14/cloud-infrastructure/pservers/pserver/hostname-1"); Optional<JsonObject> jsonObjectOptional = pathedURL.getJsonFromVertex(pserver); - if (!jsonObjectOptional.isPresent()) { + if (jsonObjectOptional.isEmpty()) { fail("Expecting an json object returned from pathed url but returned none"); } |