From 87be30582d1db37bee7c6b456c0c5c3ca9584963 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 4 Sep 2018 17:24:15 +0100 Subject: Fix checkstyle issues in apex model basic CHeckstyle issues in apex model basic and knock on changes in other apex modules. Issue-ID: POLICY-1034 Change-Id: I65823f5e2e344526abc74b0812877113acb056ec Signed-off-by: liamfallon --- .../plugins/executor/jython/JythonTaskExecutor.java | 18 +++++++++--------- .../executor/jython/JythonTaskSelectExecutor.java | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'plugins/plugins-executor/plugins-executor-jython') 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 71dce5801..e1c0f096a 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 @@ -67,8 +67,8 @@ public class JythonTaskExecutor extends TaskExecutor { compiled = Py.compile_flags(logic, filename, CompileMode.exec, new CompilerFlags()); } } catch (final PyException e) { - LOGGER.warn("failed to compile Jython code for task " + getSubject().getKey().getID(), e); - throw new StateMachineException("failed to compile Jython code for task " + getSubject().getKey().getID(), + LOGGER.warn("failed to compile Jython code for task " + getSubject().getKey().getId(), e); + throw new StateMachineException("failed to compile Jython code for task " + getSubject().getKey().getId(), e); } @@ -104,24 +104,24 @@ public class JythonTaskExecutor extends TaskExecutor { final Object ret = interpreter.get("returnValue", java.lang.Boolean.class); if (ret == null) { LOGGER.error("execute: task logic failed to set a return value for task \"" - + getSubject().getKey().getID() + "\""); + + getSubject().getKey().getId() + "\""); throw new StateMachineException("execute: task logic failed to set a return value for task \"" - + getSubject().getKey().getID() + "\""); + + getSubject().getKey().getId() + "\""); } returnValue = (Boolean) ret; } catch (NullPointerException | ClassCastException e) { LOGGER.error("execute: task selection logic failed to set a correct return value for state \"" - + getSubject().getKey().getID() + "\"", e); + + getSubject().getKey().getId() + "\"", e); throw new StateMachineException( "execute: task selection logic failed to set a return value for state \"" - + getSubject().getKey().getID() + "\"", + + getSubject().getKey().getId() + "\"", e); } } /* */ } catch (final Exception e) { - LOGGER.warn("failed to execute Jython code for task " + getSubject().getKey().getID(), e); - throw new StateMachineException("failed to execute Jython code for task " + getSubject().getKey().getID(), + LOGGER.warn("failed to execute Jython code for task " + getSubject().getKey().getId(), e); + throw new StateMachineException("failed to execute Jython code for task " + getSubject().getKey().getId(), e); } @@ -144,7 +144,7 @@ public class JythonTaskExecutor extends TaskExecutor { @Override public void cleanUp() throws StateMachineException { interpreter.cleanup(); - LOGGER.debug("cleanUp:" + getSubject().getKey().getID() + "," + getSubject().getTaskLogic().getLogicFlavour() + LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + "," + getSubject().getTaskLogic().getLogicFlavour() + "," + getSubject().getTaskLogic().getLogic()); } } 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 d28001d87..4f4d38a19 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 @@ -66,10 +66,10 @@ public class JythonTaskSelectExecutor extends TaskSelectExecutor { compiled = Py.compile_flags(logic, filename, CompileMode.exec, new CompilerFlags()); } } catch (final PyException e) { - LOGGER.warn("failed to compile Jython code for task selection logic in " + getSubject().getKey().getID(), + LOGGER.warn("failed to compile Jython code for task selection logic in " + getSubject().getKey().getId(), e); throw new StateMachineException( - "failed to compile Jython code for task selection logic in " + getSubject().getKey().getID(), e); + "failed to compile Jython code for task selection logic in " + getSubject().getKey().getId(), e); } } @@ -104,27 +104,27 @@ public class JythonTaskSelectExecutor extends TaskSelectExecutor { 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 \"" - + getSubject().getKey().getID() + "\""); + + getSubject().getKey().getId() + "\""); throw new StateMachineException( "execute: task selection logic failed to set a return value for state \"" - + getSubject().getKey().getID() + "\""); + + getSubject().getKey().getId() + "\""); } returnValue = (Boolean) ret; } catch (NullPointerException | ClassCastException e) { LOGGER.error("execute: task selection logic failed to set a correct return value for state \"" - + getSubject().getKey().getID() + "\"", e); + + getSubject().getKey().getId() + "\"", e); throw new StateMachineException( "execute: task selection logic failed to set a return value for state \"" - + getSubject().getKey().getID() + "\"", + + getSubject().getKey().getId() + "\"", e); } } /* */ } catch (final Exception e) { - LOGGER.warn("failed to execute Jython code for task selection logic in " + getSubject().getKey().getID(), + LOGGER.warn("failed to execute Jython code for task selection logic in " + getSubject().getKey().getId(), e); throw new StateMachineException( - "failed to execute Jython code for task selection logic in " + getSubject().getKey().getID(), e); + "failed to execute Jython code for task selection logic in " + getSubject().getKey().getId(), e); } // Do the execution post work @@ -146,7 +146,7 @@ public class JythonTaskSelectExecutor extends TaskSelectExecutor { @Override public void cleanUp() throws StateMachineException { interpreter.cleanup(); - LOGGER.debug("cleanUp:" + getSubject().getKey().getID() + "," + LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + "," + getSubject().getTaskSelectionLogic().getLogicFlavour() + "," + getSubject().getTaskSelectionLogic().getLogic()); } -- cgit 1.2.3-korg