diff options
author | Jim Hahn <jrh3@att.com> | 2021-05-07 15:50:22 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-05-07 16:04:58 -0400 |
commit | c2cbd89fea87897b6868b036d87d97916e89734e (patch) | |
tree | ff611957eba521fabac337d8436bb0a415330430 /controlloop/common/coordination/src/main | |
parent | 2faa81d80569ce38a014e2a2ab404b1ea9f6899e (diff) |
Fix sonars in drools-apps
Fixed:
- use "var"
- add @Override annotation
- change constructor to "protected"
- use Xxx.class::isIstance
Issue-ID: POLICY-3290
Change-Id: I7f0795af306ea5afb46d12a4fe0b22adcbce683a
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop/common/coordination/src/main')
-rw-r--r-- | controlloop/common/coordination/src/main/java/org/onap/policy/coordination/Util.java | 11 |
1 files changed, 5 insertions, 6 deletions
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 03b041a59..af8cc2529 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 @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,6 @@ package org.onap.policy.coordination; import java.io.File; import java.io.FileInputStream; import java.io.IOException; -import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; @@ -52,12 +51,12 @@ public final class Util { * @return the CoordinationDirective */ public static CoordinationDirective loadCoordinationDirectiveFromFile(String directiveFilename) { - try (InputStream is = new FileInputStream(new File(directiveFilename))) { - String contents = IOUtils.toString(is, StandardCharsets.UTF_8); + try (var is = new FileInputStream(new File(directiveFilename))) { + var contents = IOUtils.toString(is, StandardCharsets.UTF_8); // // Read the yaml into our Java Object // - Yaml yaml = new Yaml(new Constructor(CoordinationDirective.class)); + var yaml = new Yaml(new Constructor(CoordinationDirective.class)); Object obj = yaml.load(contents); logger.debug(contents); @@ -86,7 +85,7 @@ public final class Util { /* * Values to be used for placeholders */ - final String uniqueId = UUID.randomUUID().toString(); + final var uniqueId = UUID.randomUUID().toString(); final String cLOne = cd.getControlLoop(0); final String cLTwo = cd.getControlLoop(1); /* |