summaryrefslogtreecommitdiffstats
path: root/auth/cli-editor/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'auth/cli-editor/src/main')
-rw-r--r--auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/ApexCLIEditorMain.java8
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()) {