aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDinh Danh Le <dinh.danh.le@ericsson.com>2018-08-27 15:57:41 +0100
committerDinh Danh Le <dinh.danh.le@ericsson.com>2018-08-27 16:17:04 +0100
commit052038c7a7e0b385462b3b653b7d06094d472df3 (patch)
tree4ba5dd833f7f459d93c80754ee21d64ddcc27f18 /tools
parent6a2abc8402af63dd8941b4652278a6df404d781a (diff)
Fix checkstyle warning in tools & context packages
Change-Id: I5b72c7a35d56296cd5053659a9d4c1e8f3b058be Signed-off-by: Dinh Danh Le <dinh.danh.le@ericsson.com> Issue-ID: POLICY-1034
Diffstat (limited to 'tools')
-rw-r--r--tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java46
-rw-r--r--tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2event/Model2JsonEventSchema.java5
-rw-r--r--tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/CliOptions.java3
-rw-r--r--tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/Console.java20
4 files changed, 38 insertions, 36 deletions
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<ST> getParametersForEvent(final CGCliEditor cg, final AxEvent e) {
- final Collection<AxField> fields = e.getFields();
+ private List<ST> getParametersForEvent(final CGCliEditor cg, final AxEvent event) {
+ final Collection<AxField> fields = event.getFields();
final List<ST> 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<ST> getCtxtRefsForTask(final CGCliEditor cg, final AxTask t) {
- final Collection<AxArtifactKey> ctxs = t.getContextAlbumReferences();
+ private List<ST> getCtxtRefsForTask(final CGCliEditor cg, final AxTask task) {
+ final Collection<AxArtifactKey> ctxs = task.getContextAlbumReferences();
final List<ST> 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<ST> getParametersForTask(final CGCliEditor cg, final AxTask t) {
- final Collection<AxTaskParameter> pars = t.getTaskParameters().values();
+ private List<ST> getParametersForTask(final CGCliEditor cg, final AxTask task) {
+ final Collection<AxTaskParameter> pars = task.getTaskParameters().values();
final List<ST> 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<ST> getOutfieldsForTask(final CGCliEditor cg, final AxTask t) {
- final Collection<? extends AxField> fields = t.getOutputFields().values();
+ private List<ST> getOutfieldsForTask(final CGCliEditor cg, final AxTask task) {
+ final Collection<? extends AxField> fields = task.getOutputFields().values();
final List<ST> 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<ST> getInfieldsForTask(final CGCliEditor cg, final AxTask t) {
- final Collection<? extends AxField> fields = t.getInputFields().values();
+ private List<ST> getInfieldsForTask(final CGCliEditor cg, final AxTask task) {
+ final Collection<? extends AxField> fields = task.getInputFields().values();
final List<ST> 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<ST> getStatesForPolicy(final CGCliEditor cg, final AxPolicy p) {
- final Collection<AxState> states = p.getStateMap().values();
+ private List<ST> getStatesForPolicy(final CGCliEditor cg, final AxPolicy pol) {
+ final Collection<AxState> states = pol.getStateMap().values();
final List<ST> 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");
diff --git a/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/CliOptions.java b/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/CliOptions.java
index 277769be2..aea984fb1 100644
--- a/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/CliOptions.java
+++ b/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/CliOptions.java
@@ -88,7 +88,8 @@ public final class CliOptions {
/** A type option defining what type is used for events with "-t" and "--type". */
public static final Option TYPE = Option.builder("t").hasArg().argName("TYPE").longOpt("type").desc(
- "set the event type for generation, one of: stimuli (trigger events), response (action events), internal (events between states)")
+ "set the event type for generation, one of: stimuli (trigger events), response (action events),"
+ + " internal (events between states)")
.build();
/** A server option with "-s" and "--server". */
diff --git a/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/Console.java b/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/Console.java
index d76caa333..28337fdeb 100644
--- a/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/Console.java
+++ b/tools/tools-common/src/main/java/org/onap/policy/apex/tools/common/Console.java
@@ -151,16 +151,6 @@ public final class Console {
}
/**
- * Configures the console. Use the configuration flags in combination for the required configuration. For instance,
- * to collect errors and warnings use <code>CONFIG_COLLECT_ERRORS | CONFIG_COLLECT_WARNINGS</code>.
- *
- * @param config the new configuration, overwrites the current configuration, 0 deactivates all settings
- */
- public void configure(final int config) {
- this.configuration = config;
- }
-
- /**
* Sets the type to the given types, effectively deactivating all other types.
*
* @param ts array of types to set
@@ -173,6 +163,16 @@ public final class Console {
}
/**
+ * Configures the console. Use the configuration flags in combination for the required configuration. For instance,
+ * to collect errors and warnings use <code>CONFIG_COLLECT_ERRORS | CONFIG_COLLECT_WARNINGS</code>.
+ *
+ * @param config the new configuration, overwrites the current configuration, 0 deactivates all settings
+ */
+ public void configure(final int config) {
+ this.configuration = config;
+ }
+
+ /**
* Prints an error message with message and objects if {@link #TYPE_ERROR} is set; and increases the error count.
* Errors are collected (if configuration is set) and the error counter is increased regardless of the console error
* type settings.