aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-11-16 17:27:35 +0000
committerGerrit Code Review <gerrit@onap.org>2020-11-16 17:27:35 +0000
commit1ec08dc844b064174926550543f3843f824c159c (patch)
tree3fd26359f1f79b469d3926d2e02e5050522e8b56
parentffdb10c078b5f6a0991a0a414ad8362d2e3f17df (diff)
parente02adfc4c3243778c83c6ab44fae359019b164e3 (diff)
Merge "Apex CLI editor closes standard input/output/error" into guilin
-rw-r--r--auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineEditorLoop.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineEditorLoop.java b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineEditorLoop.java
index 3adea1a89..991257e6b 100644
--- a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineEditorLoop.java
+++ b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CommandLineEditorLoop.java
@@ -131,8 +131,15 @@ public class CommandLineEditorLoop {
}
}
- reader.close();
- writer.close();
+ writer.flush();
+
+ if (!System.in.equals(inputStream)) {
+ reader.close();
+ }
+
+ if (!System.out.equals(outputStream) && !System.err.equals(outputStream)) {
+ writer.close();
+ }
return executionStatus.getRight();
}