ARTEMIS-991 handle odd password input

This commit is contained in:
Justin Bertram 2017-02-23 12:22:50 -06:00 committed by Clebert Suconic
parent f6ed811c15
commit ef8f992ca2
1 changed files with 10 additions and 2 deletions

View File

@ -100,13 +100,21 @@ public class InputAbstract extends ActionAbstract {
return silentDefault;
}
String inputStr;
String inputStr = "";
boolean valid = false;
System.out.println();
do {
context.out.println(propertyName + ": is mandatory with this configuration:");
context.out.println(prompt);
inputStr = new String(System.console().readPassword());
char[] chars = System.console().readPassword();
// could be null if the user input something weird like Ctrl-d
if (chars == null) {
System.out.println("Invalid Entry!");
continue;
}
inputStr = new String(chars);
if (inputStr.trim().equals("")) {
System.out.println("Invalid Entry!");