Simplified readPassword method

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2017-04-19 15:41:48 +02:00
parent b0590a5597
commit 266e53aba1

View File

@ -57,11 +57,8 @@ class FormUtil {
* @return the entered password * @return the entered password
*/ */
static String readPassword(String oldPassword) { static String readPassword(String oldPassword) {
String password; String password = readPassword();
System.out.print("Password: "); return password.isEmpty() ? oldPassword : password;
password = String.valueOf(System.console().readPassword());
if(password.equals(""))return oldPassword;
return password;
} }
/** /**