diff options
author | waqas.ikram <waqas.ikram@ericsson.com> | 2018-06-07 16:01:35 +0100 |
---|---|---|
committer | waqas.ikram <waqas.ikram@ericsson.com> | 2018-06-08 11:48:06 +0100 |
commit | 6a9b54b275feff5369419a86997e94d0a95fc48e (patch) | |
tree | 8366bfb005057388b99c5639ed17496c881667f1 /auth/cli-editor/src/main | |
parent | 9289ac0afefe62f6c8e9cebddb611a8571bf5642 (diff) |
Fixing Sonar bugs and Vulnerabilities
Change-Id: Id5a95f23f1308dbb9f7f0c0f5567e238ecf830af
Issue-ID: POLICY-859
Signed-off-by: waqas.ikram <waqas.ikram@ericsson.com>
Diffstat (limited to 'auth/cli-editor/src/main')
-rw-r--r-- | auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/ApexCLIEditorMain.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/ApexCLIEditorMain.java b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/ApexCLIEditorMain.java index 4a2635efa..cb1a92eaf 100644 --- a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/ApexCLIEditorMain.java +++ b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/ApexCLIEditorMain.java @@ -78,7 +78,6 @@ public class ApexCLIEditorMain { // Read the command definitions try { commands = new JSONHandler<CLICommands>().read(CLICommands.class, parameters.getMetadataStream()); - LOGGER.debug("found " + commands.getCommandSet().size() + " commands"); } catch (final Exception e) { LOGGER.error("start of Apex command line editor failed, error reading command metadata from " + parameters.getMetadataLocation()); @@ -88,18 +87,19 @@ public class ApexCLIEditorMain { } // The JSON processing returns null if there is an empty file - if (null == commands) { + if (commands == null || commands.getCommandSet().isEmpty()) { LOGGER.error("start of Apex command line editor failed, no commands found in " + parameters.getApexPropertiesLocation()); errorCount++; return; } + LOGGER.debug("found " + commands.getCommandSet().size() + " commands"); + // Read the Apex properties try { apexModelProperties = new JSONHandler<ApexModelProperties>().read(ApexModelProperties.class, parameters.getApexPropertiesStream()); - LOGGER.debug("model properties are: " + apexModelProperties.toString()); } catch (final Exception e) { LOGGER.error("start of Apex command line editor failed, error reading Apex model properties from " + parameters.getApexPropertiesLocation()); @@ -116,6 +116,8 @@ public class ApexCLIEditorMain { return; } + LOGGER.debug("model properties are: " + apexModelProperties.toString()); + // Find the system commands final Set<KeywordNode> systemCommandNodes = new TreeSet<>(); for (final CLICommand command : commands.getCommandSet()) { |