diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2019-04-29 13:07:09 -0400 |
---|---|---|
committer | Pamela Dragosh <pdragosh@research.att.com> | 2019-04-29 13:07:14 -0400 |
commit | 71b3a6b68a1a27839fde863b46c74587131be313 (patch) | |
tree | 4ca8d00285dd5a0f142d1ac7d7e316d3a959765e | |
parent | 74f5aea3da13f47573bff055397c5bbe5e1db55f (diff) |
Fix sonar bug and upgrade parent
* Fix simple sonar bug for logging errors
* Private constructors to hide implicit.
* Not enough arguments for debug statement
* Upgrade to policy/parent released version
Issue-ID: POLICY-1700
Change-Id: Id8040c2aa0abdbe4946db60f97cb279974817447
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 files changed, 19 insertions, 2 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 d76684093..12b361f9f 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 @@ -42,6 +42,10 @@ public final class Util { private static final Logger logger = LoggerFactory.getLogger(Util.class); + private Util() { + super(); + } + /** * Load YAML coordination directive. * diff --git a/controlloop/common/database/src/main/java/org/onap/policy/database/operationshistory/GetOperationOutcomePip.java b/controlloop/common/database/src/main/java/org/onap/policy/database/operationshistory/GetOperationOutcomePip.java index 01b0709b2..20c8f028a 100644 --- a/controlloop/common/database/src/main/java/org/onap/policy/database/operationshistory/GetOperationOutcomePip.java +++ b/controlloop/common/database/src/main/java/org/onap/policy/database/operationshistory/GetOperationOutcomePip.java @@ -124,7 +124,7 @@ public class GetOperationOutcomePip extends StdOnapPip { } private String doDatabaseQuery(String clname, String target) { - logger.info("Querying operations history for {} {} {} {} {}", + logger.info("Querying operations history for {} {}", clname, target); // // Do the query diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/utils/ControlLoopUtils.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/utils/ControlLoopUtils.java index 8b7876c71..8684a9198 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/utils/ControlLoopUtils.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/utils/ControlLoopUtils.java @@ -36,6 +36,10 @@ public class ControlLoopUtils { public static final Logger logger = LoggerFactory.getLogger(ControlLoopUtils.class); public static final String TOSCA_POLICY_PROPERTY_CONTENT = "content"; + private ControlLoopUtils() { + super(); + } + /** * Get a Control Loop Parameters object from a Tosca Policy. */ diff --git a/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java b/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java index 0b4005a17..57ef17a33 100644 --- a/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java +++ b/controlloop/common/feature-controlloop-management/src/main/java/org/onap/policy/drools/server/restful/RestControlLoopManager.java @@ -45,6 +45,8 @@ import org.onap.policy.controlloop.processor.ControlLoopProcessor; import org.onap.policy.drools.apps.controlloop.feature.management.ControlLoopManagementFeature; import org.onap.policy.drools.controller.DroolsController; import org.onap.policy.drools.system.PolicyController; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Telemetry Extensions for Control Loops in the PDP-D. @@ -55,6 +57,7 @@ import org.onap.policy.drools.system.PolicyController; @Consumes(MediaType.APPLICATION_JSON) @Api public class RestControlLoopManager { + private static final Logger logger = LoggerFactory.getLogger(RestControlLoopManager.class); /** * GET control loops. @@ -79,6 +82,7 @@ public class RestControlLoopManager { return Response.status(Response.Status.OK).entity(controlLoopNames).build(); } catch (IllegalArgumentException e) { + logger.error("{}", e); return Response.status(Response.Status.NOT_FOUND).entity(e.getMessage()).build(); } } @@ -108,6 +112,7 @@ public class RestControlLoopManager { return Response.status(Response.Status.OK).entity(controlLoopParams).build(); } catch (IllegalArgumentException e) { + logger.error("{}", e); return Response.status(Response.Status.NOT_FOUND).entity(e.getMessage()).build(); } } @@ -145,8 +150,10 @@ public class RestControlLoopManager { return Response.status(Status.OK) .entity(URLDecoder.decode(controlLoopParams.getControlLoopYaml(), "UTF-8")).build(); } catch (IllegalArgumentException e) { + logger.error("{}", e); return Response.status(Response.Status.NOT_FOUND).entity(e.getMessage()).build(); } catch (UnsupportedEncodingException e) { + logger.error("{}", e); return Response.status(Status.INTERNAL_SERVER_ERROR).entity("Unreadable Policy").build(); } } @@ -207,8 +214,10 @@ public class RestControlLoopManager { return Response.status(Status.OK).entity(controlLoop).build(); } catch (IllegalArgumentException i) { + logger.error("{}", i); return Response.status(Response.Status.NOT_FOUND).entity(i).build(); } catch (ControlLoopException | UnsupportedEncodingException e) { + logger.error("{}", e); return Response.status(Status.NOT_ACCEPTABLE).entity(e).build(); } } @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.policy.parent</groupId> <artifactId>integration</artifactId> - <version>2.1.0-SNAPSHOT</version> + <version>2.1.0</version> <relativePath /> </parent> |