aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/coordination
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2023-08-30 14:57:10 +0100
committerFrancescoFioraEst <francesco.fiora@est.tech>2023-09-01 13:36:40 +0100
commitb2d624d4655fa4b4e0cebbf7e41dc96b38fa0df5 (patch)
treeb978965fb8469ae9499d1e3d6d2e18c53aa71a37 /controlloop/common/coordination
parentd7d54fef032a2ba3118232506a7ed37f24eb4131 (diff)
Upgrade Java 17 in policy-drools-apps
Issue-ID: POLICY-4816 Change-Id: I456cacfd700fd4613e2b752d9766788858e0c67b Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'controlloop/common/coordination')
-rw-r--r--controlloop/common/coordination/pom.xml3
-rw-r--r--controlloop/common/coordination/src/main/java/org/onap/policy/coordination/Util.java6
-rw-r--r--controlloop/common/coordination/src/test/resources/test_coordination_directive.yaml3
3 files changed, 8 insertions, 4 deletions
diff --git a/controlloop/common/coordination/pom.xml b/controlloop/common/coordination/pom.xml
index 622d01416..99adc6e14 100644
--- a/controlloop/common/coordination/pom.xml
+++ b/controlloop/common/coordination/pom.xml
@@ -4,6 +4,7 @@
================================================================================
Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
Modifications Copyright (C) 2020 Bell Canada.
+ 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.
@@ -24,7 +25,7 @@
<parent>
<groupId>org.onap.policy.drools-applications.controlloop.common</groupId>
<artifactId>drools-applications-common</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.1-SNAPSHOT</version>
</parent>
<artifactId>coordination</artifactId>
diff --git a/controlloop/common/coordination/src/main/java/org/onap/policy/coordination/Util.java b/controlloop/common/coordination/src/main/java/org/onap/policy/coordination/Util.java
index af8cc2529..bfacc496e 100644
--- a/controlloop/common/coordination/src/main/java/org/onap/policy/coordination/Util.java
+++ b/controlloop/common/coordination/src/main/java/org/onap/policy/coordination/Util.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.
@@ -32,6 +33,7 @@ import java.util.stream.Stream;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;
@@ -51,12 +53,12 @@ public final class Util {
* @return the CoordinationDirective
*/
public static CoordinationDirective loadCoordinationDirectiveFromFile(String directiveFilename) {
- try (var is = new FileInputStream(new File(directiveFilename))) {
+ try (var is = new FileInputStream(directiveFilename)) {
var contents = IOUtils.toString(is, StandardCharsets.UTF_8);
//
// Read the yaml into our Java Object
//
- var yaml = new Yaml(new Constructor(CoordinationDirective.class));
+ var yaml = new Yaml(new Constructor(CoordinationDirective.class, new LoaderOptions()));
Object obj = yaml.load(contents);
logger.debug(contents);
diff --git a/controlloop/common/coordination/src/test/resources/test_coordination_directive.yaml b/controlloop/common/coordination/src/test/resources/test_coordination_directive.yaml
index ede643c90..5f862e1df 100644
--- a/controlloop/common/coordination/src/test/resources/test_coordination_directive.yaml
+++ b/controlloop/common/coordination/src/test/resources/test_coordination_directive.yaml
@@ -1,4 +1,5 @@
# Copyright 2019 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.
@@ -12,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-!!org.onap.policy.coordination.CoordinationDirective
+#org.onap.policy.coordination.CoordinationDirective
controlLoop:
- cl1