From 9ee4561bcd28b7199fd1ffed118f122a8435203a Mon Sep 17 00:00:00 2001 From: Ram Krishna Verma Date: Fri, 27 Aug 2021 16:53:11 -0400 Subject: Fix sonar issues in apex-pdp Issue-ID: POLICY-3077 Change-Id: Id5e7c2ddada2bac3b73fe543f9adade6f9b83e6c Signed-off-by: Ram Krishna Verma --- .../apex/core/engine/executor/StateMachineExecutor.java | 6 +++--- .../executor/context/StateFinalizerExecutionContext.java | 3 ++- .../executor/context/TaskSelectionExecutionContext.java | 3 ++- .../apex/core/engine/executor/impl/ExecutorFactoryImpl.java | 3 ++- .../onap/policy/apex/core/engine/monitoring/EventMonitor.java | 11 ++++++----- 5 files changed, 15 insertions(+), 11 deletions(-) (limited to 'core/core-engine/src') diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java index 3f6d6cfe6..6cbc04678 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java @@ -93,7 +93,7 @@ public class StateMachineExecutor implements Executor parentExecutor, final AxTask task, final ApexInternalContext context) { // Create task executor - final TaskExecutor taskExecutor = (TaskExecutor) createExecutor(task.getTaskLogic().getLogicFlavour(), + final var taskExecutor = (TaskExecutor) createExecutor(task.getTaskLogic().getLogicFlavour(), taskExecutorPluginClassMap.get(task.getTaskLogic().getLogicFlavour()), TaskExecutor.class); taskExecutor.setParameters(implementationParameterMap.get(task.getTaskLogic().getLogicFlavour())); taskExecutor.setContext(parentExecutor, task, context); diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/EventMonitor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/EventMonitor.java index de2639dcb..ca564ca81 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/EventMonitor.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/EventMonitor.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2021 Bell Canada. 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. @@ -44,7 +45,7 @@ public class EventMonitor { * @param userArtifactStack the keys of the artifacts using the event at the moment */ public void monitorGet(final AxField eventParameter, final Object value, final AxConcept[] userArtifactStack) { - String monitorGetString = monitor("GET", userArtifactStack, eventParameter, value); + var monitorGetString = monitor("GET", userArtifactStack, eventParameter, value); LOGGER.trace(monitorGetString); } @@ -56,7 +57,7 @@ public class EventMonitor { * @param userArtifactStack the keys of the artifacts using the event at the moment */ public void monitorSet(final AxField eventParameter, final Object value, final AxConcept[] userArtifactStack) { - String monitorSetString = monitor("SET", userArtifactStack, eventParameter, value); + var monitorSetString = monitor("SET", userArtifactStack, eventParameter, value); LOGGER.trace(monitorSetString); } @@ -69,7 +70,7 @@ public class EventMonitor { */ public void monitorRemove(final AxField eventParameter, final Object removedValue, final AxConcept[] userArtifactStack) { - String monitorRemoveString = monitor("REMOVE", userArtifactStack, eventParameter, removedValue); + var monitorRemoveString = monitor("REMOVE", userArtifactStack, eventParameter, removedValue); LOGGER.trace(monitorRemoveString); } @@ -84,13 +85,13 @@ public class EventMonitor { */ private String monitor(final String preamble, final AxConcept[] userArtifactStack, final AxField eventParameter, final Object value) { - final StringBuilder builder = new StringBuilder(); + final var builder = new StringBuilder(); builder.append(preamble); builder.append(",["); if (userArtifactStack != null) { - boolean first = true; + var first = true; for (final AxConcept stackKey : userArtifactStack) { if (first) { first = false; -- cgit 1.2.3-korg