From 052038c7a7e0b385462b3b653b7d06094d472df3 Mon Sep 17 00:00:00 2001 From: Dinh Danh Le Date: Mon, 27 Aug 2018 15:57:41 +0100 Subject: Fix checkstyle warning in tools & context packages Change-Id: I5b72c7a35d56296cd5053659a9d4c1e8f3b058be Signed-off-by: Dinh Danh Le Issue-ID: POLICY-1034 --- .../tools/model/generator/model2cli/Model2Cli.java | 46 +++++++++++----------- .../model2event/Model2JsonEventSchema.java | 5 ++- 2 files changed, 26 insertions(+), 25 deletions(-) (limited to 'tools/model-generator/src') diff --git a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java index 5117a2ecf..d374a6c60 100644 --- a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java +++ b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java @@ -205,11 +205,11 @@ public class Model2Cli { * Gets the parameters for event. * * @param cg the code generator - * @param e the event + * @param event the event * @return the parameters for event */ - private List getParametersForEvent(final CGCliEditor cg, final AxEvent e) { - final Collection fields = e.getFields(); + private List getParametersForEvent(final CGCliEditor cg, final AxEvent event) { + final Collection fields = event.getFields(); final List ret = new ArrayList<>(fields.size()); for (final AxField f : fields) { final AxReferenceKey fkey = f.getKey(); @@ -226,13 +226,13 @@ public class Model2Cli { * Gets the context references for task. * * @param cg the code generator - * @param t the task + * @param task the task * @return the context references for task */ - private List getCtxtRefsForTask(final CGCliEditor cg, final AxTask t) { - final Collection ctxs = t.getContextAlbumReferences(); + private List getCtxtRefsForTask(final CGCliEditor cg, final AxTask task) { + final Collection ctxs = task.getContextAlbumReferences(); final List ret = new ArrayList<>(ctxs.size()); - final AxArtifactKey tkey = t.getKey(); + final AxArtifactKey tkey = task.getKey(); for (final AxArtifactKey ckey : ctxs) { final ST val = cg.createTaskDefinitionContextRef(kig.getName(tkey), kig.getVersion(tkey), kig.getName(ckey), @@ -247,11 +247,11 @@ public class Model2Cli { * Gets the parameters for task. * * @param cg the code generator - * @param t the task + * @param task the task * @return the parameters for task */ - private List getParametersForTask(final CGCliEditor cg, final AxTask t) { - final Collection pars = t.getTaskParameters().values(); + private List getParametersForTask(final CGCliEditor cg, final AxTask task) { + final Collection pars = task.getTaskParameters().values(); final List ret = new ArrayList<>(pars.size()); for (final AxTaskParameter p : pars) { final AxReferenceKey pkey = p.getKey(); @@ -268,12 +268,12 @@ public class Model2Cli { * Gets the logic for task. * * @param cg the code generator - * @param t the task + * @param task the task * @return the logic for task */ - private ST getLogicForTask(final CGCliEditor cg, final AxTask t) { - final AxArtifactKey tkey = t.getKey(); - final AxTaskLogic tl = t.getTaskLogic(); + private ST getLogicForTask(final CGCliEditor cg, final AxTask task) { + final AxArtifactKey tkey = task.getKey(); + final AxTaskLogic tl = task.getTaskLogic(); final ST val = cg.createTaskDefLogic(kig.getName(tkey), kig.getVersion(tkey), tl.getLogicFlavour(), tl.getLogic()); @@ -285,11 +285,11 @@ public class Model2Cli { * Gets the output fields for task. * * @param cg the code generator - * @param t the task + * @param task the task * @return the output fields for task */ - private List getOutfieldsForTask(final CGCliEditor cg, final AxTask t) { - final Collection fields = t.getOutputFields().values(); + private List getOutfieldsForTask(final CGCliEditor cg, final AxTask task) { + final Collection fields = task.getOutputFields().values(); final List ret = new ArrayList<>(fields.size()); for (final AxField f : fields) { final AxReferenceKey fkey = f.getKey(); @@ -306,11 +306,11 @@ public class Model2Cli { * Gets the input fields for task. * * @param cg the code generator - * @param t the task + * @param task the task * @return the input fields for task */ - private List getInfieldsForTask(final CGCliEditor cg, final AxTask t) { - final Collection fields = t.getInputFields().values(); + private List getInfieldsForTask(final CGCliEditor cg, final AxTask task) { + final Collection fields = task.getInputFields().values(); final List ret = new ArrayList<>(fields.size()); for (final AxField f : fields) { final AxReferenceKey fkey = f.getKey(); @@ -327,11 +327,11 @@ public class Model2Cli { * Gets the states for policy. * * @param cg the code generator - * @param p the policy + * @param pol the policy * @return the states for policy */ - private List getStatesForPolicy(final CGCliEditor cg, final AxPolicy p) { - final Collection states = p.getStateMap().values(); + private List getStatesForPolicy(final CGCliEditor cg, final AxPolicy pol) { + final Collection states = pol.getStateMap().values(); final List ret = new ArrayList<>(states.size()); for (final AxState st : states) { final AxReferenceKey skey = st.getKey(); diff --git a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2event/Model2JsonEventSchema.java b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2event/Model2JsonEventSchema.java index ec6d72c4b..b662f577c 100644 --- a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2event/Model2JsonEventSchema.java +++ b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2event/Model2JsonEventSchema.java @@ -136,9 +136,10 @@ public class Model2JsonEventSchema { /** * Runs the application. * + * + * @return status of the application execution, 0 for success, positive integer for exit + * condition (such as help or version), negative integer for errors * @throws ApexException if any problem occurred in the model - * @return status of the application execution, 0 for success, positive integer for exit condition (such as help or - * version), negative integer for errors */ public int runApp() throws ApexException { final STGroupFile stg = new STGroupFile("org/onap/policy/apex/tools/model/generator/event-json.stg"); -- cgit 1.2.3-korg