From 3751c3aa75e5a9497a01a22fc8966e719ec68111 Mon Sep 17 00:00:00 2001
From: Gaetan Boismal <gaetan.boismal@forgerock.com>
Date: Thu, 24 Nov 2016 12:51:28 +0000
Subject: [PATCH] Code cleanup
---
opendj-cli/src/main/java/com/forgerock/opendj/cli/ConsoleApplication.java | 33 ++++++++++++++++-----------------
1 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/opendj-cli/src/main/java/com/forgerock/opendj/cli/ConsoleApplication.java b/opendj-cli/src/main/java/com/forgerock/opendj/cli/ConsoleApplication.java
index 388db59..0d5cea5 100644
--- a/opendj-cli/src/main/java/com/forgerock/opendj/cli/ConsoleApplication.java
+++ b/opendj-cli/src/main/java/com/forgerock/opendj/cli/ConsoleApplication.java
@@ -310,7 +310,7 @@
* @param progress
* The current percentage progress to print.
*/
- private final void printProgressBar(final int linePos, final int progress) {
+ private void printProgressBar(final int linePos, final int progress) {
if (!isQuiet()) {
final int spacesLeft = MAX_LINE_WIDTH - linePos - 10;
StringBuilder bar = new StringBuilder();
@@ -464,24 +464,23 @@
if (msgStyle != null && msgStyle == Style.TITLE) {
println();
}
- while (true) {
- if (defaultValue != null) {
- prompt = INFO_PROMPT_SINGLE_DEFAULT.get(prompt, defaultValue);
- }
- final String response = readLineOfInput(prompt);
- if (msgStyle != null && (msgStyle == Style.TITLE || msgStyle == Style.SUBTITLE)) {
- println();
- }
-
- if ("".equals(response)) {
- if (defaultValue != null) {
- return defaultValue;
- }
- println(INFO_ERROR_EMPTY_RESPONSE.get());
- }
- return response;
+ if (defaultValue != null) {
+ prompt = INFO_PROMPT_SINGLE_DEFAULT.get(prompt, defaultValue);
}
+ final String response = readLineOfInput(prompt);
+
+ if (msgStyle != null && (msgStyle == Style.TITLE || msgStyle == Style.SUBTITLE)) {
+ println();
+ }
+
+ if ("".equals(response)) {
+ if (defaultValue != null) {
+ return defaultValue;
+ }
+ println(INFO_ERROR_EMPTY_RESPONSE.get());
+ }
+ return response;
}
/**
--
Gitblit v1.10.0