diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-09-13 15:25:32 +0100 |
---|---|---|
committer | liamfallon <liam.fallon@ericsson.com> | 2018-09-13 15:26:47 +0100 |
commit | 4cfa2e2d98f6877d54da304ef17f096284430908 (patch) | |
tree | c9452d2bf6bb96fae9c1e8e2d8ce8f8d01e69d22 /plugins/plugins-executor/plugins-executor-jython | |
parent | 0e23f7634e1e1fb31454c516974613335fcea1a4 (diff) |
Sonar/Checkstyle in service/plugins
Sonar and Checkstyle changes in plugins and services, and
knock on changes
Issue-ID: POLICY-1034
Change-Id: Iff7df74e54fce2c661dcc2fae75ae93d4cacfe5b
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'plugins/plugins-executor/plugins-executor-jython')
3 files changed, 16 insertions, 12 deletions
diff --git a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonStateFinalizerExecutor.java b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonStateFinalizerExecutor.java index ea8f027c5..ecd9f7ae1 100644 --- a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonStateFinalizerExecutor.java +++ b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonStateFinalizerExecutor.java @@ -75,20 +75,20 @@ public class JythonStateFinalizerExecutor extends StateFinalizerExecutor { /** * Executes the executor for the state finalizer logic in a sequential manner. * - * @param executionID the execution ID for the current APEX policy execution + * @param executionId the execution ID for the current APEX policy execution * @param incomingFields the incoming fields for finalisation * @return The state output for the state * @throws StateMachineException on an execution error * @throws ContextException on context errors */ @Override - public String execute(final long executionID, final Map<String, Object> incomingFields) + public String execute(final long executionId, final Map<String, Object> incomingFields) throws StateMachineException, ContextException { boolean returnValue = false; // Do execution pre work - executePre(executionID, incomingFields); + executePre(executionId, incomingFields); try { diff --git a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskExecutor.java b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskExecutor.java index e1c0f096a..39ca0dc43 100644 --- a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskExecutor.java +++ b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskExecutor.java @@ -77,20 +77,20 @@ public class JythonTaskExecutor extends TaskExecutor { /** * Executes the executor for the task in a sequential manner. * - * @param executionID the execution ID for the current APEX policy execution + * @param executionId the execution ID for the current APEX policy execution * @param incomingFields the incoming fields * @return The outgoing fields * @throws StateMachineException on an execution error * @throws ContextException on context errors */ @Override - public Map<String, Object> execute(final long executionID, final Map<String, Object> incomingFields) + public Map<String, Object> execute(final long executionId, final Map<String, Object> incomingFields) throws StateMachineException, ContextException { boolean returnValue = false; // Do execution pre work - executePre(executionID, incomingFields); + executePre(executionId, incomingFields); try { diff --git a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskSelectExecutor.java b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskSelectExecutor.java index 4f4d38a19..3ff061fa4 100644 --- a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskSelectExecutor.java +++ b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskSelectExecutor.java @@ -43,6 +43,10 @@ import org.slf4j.ext.XLoggerFactory; public class JythonTaskSelectExecutor extends TaskSelectExecutor { private static final XLogger LOGGER = XLoggerFactory.getXLogger(JythonTaskSelectExecutor.class); + // Recurring string constants + private static final String TSL_FAILED_PREFIX = + "execute: task selection logic failed to set a return value for state \""; + // The Jython interpreter private final PythonInterpreter interpreter = new PythonInterpreter(); private PyCode compiled = null; @@ -77,20 +81,20 @@ public class JythonTaskSelectExecutor extends TaskSelectExecutor { /** * Executes the executor for the task in a sequential manner. * - * @param executionID the execution ID for the current APEX policy execution + * @param executionId the execution ID for the current APEX policy execution * @param incomingEvent the incoming event * @return The outgoing event * @throws StateMachineException on an execution error * @throws ContextException on context errors */ @Override - public AxArtifactKey execute(final long executionID, final EnEvent incomingEvent) + public AxArtifactKey execute(final long executionId, final EnEvent incomingEvent) throws StateMachineException, ContextException { boolean returnValue = false; // Do execution pre work - executePre(executionID, incomingEvent); + executePre(executionId, incomingEvent); try { // Check and execute the Jython logic @@ -103,10 +107,10 @@ public class JythonTaskSelectExecutor extends TaskSelectExecutor { try { final Object ret = interpreter.get("returnValue", java.lang.Boolean.class); if (ret == null) { - LOGGER.error("execute: task selection logic failed to set a return value for state \"" + LOGGER.error(TSL_FAILED_PREFIX + getSubject().getKey().getId() + "\""); throw new StateMachineException( - "execute: task selection logic failed to set a return value for state \"" + TSL_FAILED_PREFIX + getSubject().getKey().getId() + "\""); } returnValue = (Boolean) ret; @@ -114,7 +118,7 @@ public class JythonTaskSelectExecutor extends TaskSelectExecutor { LOGGER.error("execute: task selection logic failed to set a correct return value for state \"" + getSubject().getKey().getId() + "\"", e); throw new StateMachineException( - "execute: task selection logic failed to set a return value for state \"" + TSL_FAILED_PREFIX + getSubject().getKey().getId() + "\"", e); } |