mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
11.18.2014 ba07fc549fdcfe6d30524daf17ad33832b0efc75
opendj-cli/src/main/java/com/forgerock/opendj/cli/ConsoleApplication.java
@@ -505,14 +505,10 @@
     */
    public static final char[] readPassword() throws ClientException {
        try {
            char[] password = System.console().readPassword();
            if (password != null) {
                return password;
            }
            return System.console().readPassword();
        } catch (IOError e) {
            throw ClientException.adaptInputException(e);
        }
        return null;
    }
    /**
@@ -533,9 +529,8 @@
            final String s = reader.readLine();
            if (s == null) {
                throw ClientException.adaptInputException(new EOFException("End of input"));
            } else {
                return s;
            }
            return s;
        } catch (final IOException e) {
            throw ClientException.adaptInputException(e);
        }
@@ -559,20 +554,20 @@
                final String ninput = input.trim();
                if (ninput.length() == 0) {
                    return defaultValue;
                } else {
                    try {
                        int i = Integer.parseInt(ninput);
                        if (i < 1 || i > 65535) {
                            throw new NumberFormatException();
                        }
                        return i;
                    } catch (NumberFormatException e) {
                        // Try again...
                        app.println();
                        app.println(ERR_BAD_PORT_NUMBER.get(ninput));
                        app.println();
                        return null;
                }
                try {
                    int i = Integer.parseInt(ninput);
                    if (i < 1 || i > 65535) {
                        throw new NumberFormatException();
                    }
                    return i;
                } catch (NumberFormatException e) {
                    // Try again...
                    app.println();
                    app.println(ERR_BAD_PORT_NUMBER.get(ninput));
                    app.println();
                    return null;
                }
            }
@@ -658,9 +653,8 @@
    private PrintStream getErrStream() {
        if (isInteractive()) {
            return out;
        } else {
            return err;
        }
        return err;
    }
    /**