From 349b4ae7179173f9261d9a432094cb55dc433820 Mon Sep 17 00:00:00 2001 From: "adheli.tavares" Date: Fri, 21 Jul 2023 09:41:01 +0100 Subject: Java 17 Upgrade Issue-ID: POLICY-4668 Change-Id: If4e79224de61d66d7514f3abbd7b8bee1c3d5681 Signed-off-by: adheli.tavares --- .../org/onap/policy/common/utils/cmd/CommandLineArgumentsHandler.java | 4 ++-- .../java/org/onap/policy/common/utils/cmd/CommandLineException.java | 3 +++ .../main/java/org/onap/policy/common/utils/jpa/EntityMgrCloser.java | 3 ++- .../java/org/onap/policy/common/utils/jpa/EntityMgrFactoryCloser.java | 3 ++- .../main/java/org/onap/policy/common/utils/jpa/EntityTransCloser.java | 3 ++- .../main/java/org/onap/policy/common/utils/security/CryptoUtils.java | 3 ++- .../java/org/onap/policy/common/utils/services/ServiceManager.java | 2 +- 7 files changed, 14 insertions(+), 7 deletions(-) (limited to 'utils/src/main/java/org/onap/policy') diff --git a/utils/src/main/java/org/onap/policy/common/utils/cmd/CommandLineArgumentsHandler.java b/utils/src/main/java/org/onap/policy/common/utils/cmd/CommandLineArgumentsHandler.java index b9ba3fdd..970cebfe 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/cmd/CommandLineArgumentsHandler.java +++ b/utils/src/main/java/org/onap/policy/common/utils/cmd/CommandLineArgumentsHandler.java @@ -100,7 +100,7 @@ public class CommandLineArgumentsHandler { */ public CommandLineArgumentsHandler(String helpClassName, String component, Option... customOptions) { this(helpClassName, component); - if (customOptions != null && customOptions.length > 0) { + if (customOptions != null) { for (Option option : customOptions) { options.addOption(option); } @@ -108,7 +108,7 @@ public class CommandLineArgumentsHandler { } /** - * Construct the options with brand new options for the CLI editor. + * Construct the options with brand-new options for the CLI editor. */ public CommandLineArgumentsHandler(String helpClassName, String component, Options options) { this.options = options; diff --git a/utils/src/main/java/org/onap/policy/common/utils/cmd/CommandLineException.java b/utils/src/main/java/org/onap/policy/common/utils/cmd/CommandLineException.java index 95870f75..9cdf3d37 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/cmd/CommandLineException.java +++ b/utils/src/main/java/org/onap/policy/common/utils/cmd/CommandLineException.java @@ -20,6 +20,8 @@ package org.onap.policy.common.utils.cmd; +import java.io.Serial; + /** * Exception used for CommandLineArguments class. * @@ -31,6 +33,7 @@ public class CommandLineException extends Exception { /** * Generated serialVersionUID. */ + @Serial private static final long serialVersionUID = -1200607308084606425L; /** diff --git a/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityMgrCloser.java b/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityMgrCloser.java index f975422e..f1798516 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityMgrCloser.java +++ b/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityMgrCloser.java @@ -3,6 +3,7 @@ * Common Utils * ================================================================================ * Copyright (C) 2018, 2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +21,7 @@ package org.onap.policy.common.utils.jpa; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityMgrFactoryCloser.java b/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityMgrFactoryCloser.java index 8901277f..5f3a6ea8 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityMgrFactoryCloser.java +++ b/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityMgrFactoryCloser.java @@ -3,6 +3,7 @@ * Common Utils * ================================================================================ * Copyright (C) 2018, 2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +21,7 @@ package org.onap.policy.common.utils.jpa; -import javax.persistence.EntityManagerFactory; +import jakarta.persistence.EntityManagerFactory; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityTransCloser.java b/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityTransCloser.java index bc5623b0..131e87a4 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityTransCloser.java +++ b/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityTransCloser.java @@ -3,6 +3,7 @@ * Common Utils * ================================================================================ * Copyright (C) 2018, 2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +21,7 @@ package org.onap.policy.common.utils.jpa; -import javax.persistence.EntityTransaction; +import jakarta.persistence.EntityTransaction; import lombok.Getter; /** diff --git a/utils/src/main/java/org/onap/policy/common/utils/security/CryptoUtils.java b/utils/src/main/java/org/onap/policy/common/utils/security/CryptoUtils.java index 3de6df39..a974f1e5 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/security/CryptoUtils.java +++ b/utils/src/main/java/org/onap/policy/common/utils/security/CryptoUtils.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,12 +21,12 @@ package org.onap.policy.common.utils.security; +import jakarta.xml.bind.DatatypeConverter; import java.nio.charset.StandardCharsets; import java.util.Random; import javax.crypto.Cipher; import javax.crypto.spec.GCMParameterSpec; import javax.crypto.spec.SecretKeySpec; -import javax.xml.bind.DatatypeConverter; import org.apache.commons.lang3.ArrayUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/utils/src/main/java/org/onap/policy/common/utils/services/ServiceManager.java b/utils/src/main/java/org/onap/policy/common/utils/services/ServiceManager.java index 67a588fe..08994912 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/services/ServiceManager.java +++ b/utils/src/main/java/org/onap/policy/common/utils/services/ServiceManager.java @@ -213,7 +213,7 @@ public class ServiceManager implements Startable { /* * Cannot use a plain Runnable, because it can't throw exceptions. Could use a - * Callable, instead, but then all of the lambda expressions become rather messy, thus + * Callable, instead, but then all the lambda expressions become rather messy, thus * we'll stick with RunnableWithEx, and just disable the sonar warning. */ @FunctionalInterface -- cgit 1.2.3-korg