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

Violette Roche-Montane
07.47.2014 ee0f6d7f8391f7b8bddbc1a77442e1e2949c78e3
Checkpoint commit for OPENDJ-1303
Due to change in console application, modified files to redirect errors on err stream.

14 files modified
304 ■■■■ changed files
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AuthRate.java 8 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPCompare.java 38 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPModify.java 30 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPPasswordModify.java 20 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPSearch.java 80 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDIFDiff.java 16 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDIFModify.java 18 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDIFSearch.java 26 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/MakeLDIF.java 26 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/ModRate.java 6 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/PerformanceRunner.java 11 ●●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/SearchRate.java 8 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/Utils.java 14 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/test/java/com/forgerock/opendj/ldap/tools/MakeLDIFTestCase.java 3 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AuthRate.java
@@ -451,7 +451,7 @@
            argParser.addArgument(scriptFriendly);
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -475,7 +475,7 @@
            }
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -499,7 +499,7 @@
            runner.dereferencesAliasesPolicy = dereferencePolicy.getTypedValue();
            runner.invalidCredPercent = invalidCredPercent.getIntValue();
        } catch (final ArgumentException ex1) {
            println(ex1.getMessageObject());
            errPrintln(ex1.getMessageObject());
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -511,7 +511,7 @@
                String.format(runner.baseDN, data);
            }
        } catch (final Exception ex1) {
            println(LocalizableMessage.raw("Error formatting filter or base DN: " + ex1.toString()));
            errPrintln(LocalizableMessage.raw("Error formatting filter or base DN: " + ex1.toString()));
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPCompare.java
@@ -106,15 +106,15 @@
                }
            } catch (final ErrorResultException ere) {
                final LocalizableMessage msg = INFO_OPERATION_FAILED.get("COMPARE");
                println(msg);
                errPrintln(msg);
                final Result r = ere.getResult();
                println(ERR_TOOL_RESULT_CODE.get(r.getResultCode().intValue(), r.getResultCode()
                errPrintln(ERR_TOOL_RESULT_CODE.get(r.getResultCode().intValue(), r.getResultCode()
                        .toString()));
                if ((r.getDiagnosticMessage() != null) && (r.getDiagnosticMessage().length() > 0)) {
                    println(LocalizableMessage.raw(r.getDiagnosticMessage()));
                    errPrintln(LocalizableMessage.raw(r.getDiagnosticMessage()));
                }
                if (r.getMatchedDN() != null && r.getMatchedDN().length() > 0) {
                    println(ERR_TOOL_MATCHED_DN.get(r.getMatchedDN()));
                    errPrintln(ERR_TOOL_MATCHED_DN.get(r.getMatchedDN()));
                }
                return r.getResultCode().intValue();
            }
@@ -212,7 +212,7 @@
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -229,18 +229,18 @@
            connectionFactory = connectionFactoryProvider.getAuthenticatedConnectionFactory();
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
        try {
            final int versionNumber = version.getIntValue();
            if (versionNumber != 2 && versionNumber != 3) {
                println(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(versionNumber)));
                errPrintln(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(versionNumber)));
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
        } catch (final ArgumentException ae) {
            println(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(version.getValue())));
            errPrintln(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(version.getValue())));
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -249,7 +249,7 @@
        if (attrAndDNStrings.isEmpty()) {
            final LocalizableMessage message = ERR_LDAPCOMPARE_NO_ATTR.get();
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -263,14 +263,14 @@
        // If no DNs were provided, then exit with an error.
        if (dnStrings.isEmpty() && (!filename.isPresent())) {
            println(ERR_LDAPCOMPARE_NO_DNS.get());
            errPrintln(ERR_LDAPCOMPARE_NO_DNS.get());
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
        /* If trailing DNs were provided and the filename argument was also
         provided, exit with an error.*/
        if (!dnStrings.isEmpty() && filename.isPresent()) {
            println(ERR_LDAPCOMPARE_FILENAME_AND_DNS.get());
            errPrintln(ERR_LDAPCOMPARE_FILENAME_AND_DNS.get());
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -279,7 +279,7 @@
        if (idx == -1) {
            final LocalizableMessage message =
                    ERR_LDAPCOMPARE_INVALID_ATTR_STRING.get(attributeString);
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
        final String attributeType = attributeString.substring(0, idx);
@@ -292,7 +292,7 @@
                try {
                    attributeVal = ByteString.valueOfBase64(base64);
                } catch (final LocalizedIllegalArgumentException e) {
                    println(INFO_COMPARE_CANNOT_BASE64_DECODE_ASSERTION_VALUE.get());
                    errPrintln(INFO_COMPARE_CANNOT_BASE64_DECODE_ASSERTION_VALUE.get());
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            } else if (nextChar == '<') {
@@ -300,7 +300,7 @@
                    final String filePath = remainder.substring(1, remainder.length());
                    attributeVal = ByteString.wrap(readBytesFromFile(filePath));
                } catch (final Exception e) {
                    println(INFO_COMPARE_CANNOT_READ_ASSERTION_VALUE_FROM_FILE.get(String
                    errPrintln(INFO_COMPARE_CANNOT_READ_ASSERTION_VALUE_FROM_FILE.get(String
                            .valueOf(e)));
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
@@ -321,7 +321,7 @@
                } catch (final DecodeException de) {
                    final LocalizableMessage message =
                            ERR_TOOL_INVALID_CONTROL_STRING.get(ctrlString);
                    println(message);
                    errPrintln(message);
                    ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -346,7 +346,7 @@
            } catch (final LocalizedIllegalArgumentException le) {
                final LocalizableMessage message =
                        ERR_LDAP_ASSERTION_INVALID_FILTER.get(le.getMessage());
                println(message);
                errPrintln(message);
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
        }
@@ -359,7 +359,7 @@
            try {
                rdr = new BufferedReader(new FileReader(filename.getValue()));
            } catch (final FileNotFoundException t) {
                println(ERR_LDAPCOMPARE_ERROR_READING_FILE.get(filename.getValue(), t.toString()));
                errPrintln(ERR_LDAPCOMPARE_ERROR_READING_FILE.get(filename.getValue(), t.toString()));
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
        }
@@ -369,7 +369,7 @@
            try {
                connection = connectionFactory.getConnection();
            } catch (final ErrorResultException ere) {
                println(LocalizableMessage.raw(ere.getMessage()));
                errPrintln(LocalizableMessage.raw(ere.getMessage()));
                return ere.getResult().getResultCode().intValue();
            }
        }
@@ -395,7 +395,7 @@
                        }
                    }
                } catch (final IOException ioe) {
                    println(ERR_LDAPCOMPARE_ERROR_READING_FILE.get(filename.getValue(), ioe
                    errPrintln(ERR_LDAPCOMPARE_ERROR_READING_FILE.get(filename.getValue(), ioe
                            .toString()));
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPModify.java
@@ -156,20 +156,20 @@
        private void printResult(final String operationType, final String name, final Result r) {
            if (r.getResultCode() != ResultCode.SUCCESS && r.getResultCode() != ResultCode.REFERRAL) {
                final LocalizableMessage msg = INFO_OPERATION_FAILED.get(operationType);
                println(msg);
                println(ERR_TOOL_RESULT_CODE.get(r.getResultCode().intValue(), r.getResultCode()
                errPrintln(msg);
                errPrintln(ERR_TOOL_RESULT_CODE.get(r.getResultCode().intValue(), r.getResultCode()
                        .toString()));
                if ((r.getDiagnosticMessage() != null) && (r.getDiagnosticMessage().length() > 0)) {
                    println(LocalizableMessage.raw(r.getDiagnosticMessage()));
                    errPrintln(LocalizableMessage.raw(r.getDiagnosticMessage()));
                }
                if (r.getMatchedDN() != null && r.getMatchedDN().length() > 0) {
                    println(ERR_TOOL_MATCHED_DN.get(r.getMatchedDN()));
                    errPrintln(ERR_TOOL_MATCHED_DN.get(r.getMatchedDN()));
                }
            } else {
                final LocalizableMessage msg = INFO_OPERATION_SUCCESSFUL.get(operationType, name);
                println(msg);
                if ((r.getDiagnosticMessage() != null) && (r.getDiagnosticMessage().length() > 0)) {
                    println(LocalizableMessage.raw(r.getDiagnosticMessage()));
                    errPrintln(LocalizableMessage.raw(r.getDiagnosticMessage()));
                }
                if (r.getReferralURIs() != null) {
                    for (final String uri : r.getReferralURIs()) {
@@ -186,7 +186,7 @@
                    writer.writeEntry(control.getEntry());
                }
            } catch (final DecodeException de) {
                println(ERR_DECODE_CONTROL_FAILURE.get(de.getLocalizedMessage()));
                errPrintln(ERR_DECODE_CONTROL_FAILURE.get(de.getLocalizedMessage()));
            } catch (final IOException ioe) {
                throw new RuntimeException(ioe);
            }
@@ -199,7 +199,7 @@
                    writer.writeEntry(control.getEntry());
                }
            } catch (final DecodeException de) {
                println(ERR_DECODE_CONTROL_FAILURE.get(de.getLocalizedMessage()));
                errPrintln(ERR_DECODE_CONTROL_FAILURE.get(de.getLocalizedMessage()));
            } catch (final IOException ioe) {
                throw new RuntimeException(ioe);
            }
@@ -350,7 +350,7 @@
            argParser.setUsageArgument(showUsage, getOutputStream());
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -367,18 +367,18 @@
            connectionFactory = connectionFactoryProvider.getAuthenticatedConnectionFactory();
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
        try {
            final int versionNumber = version.getIntValue();
            if (versionNumber != 2 && versionNumber != 3) {
                println(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(versionNumber)));
                errPrintln(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(versionNumber)));
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
        } catch (final ArgumentException ae) {
            println(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(version.getValue())));
            errPrintln(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(version.getValue())));
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -397,7 +397,7 @@
                } catch (final DecodeException de) {
                    final LocalizableMessage message =
                            ERR_TOOL_INVALID_CONTROL_STRING.get(ctrlString);
                    println(message);
                    errPrintln(message);
                    ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -422,7 +422,7 @@
            } catch (final LocalizedIllegalArgumentException le) {
                final LocalizableMessage message =
                        ERR_LDAP_ASSERTION_INVALID_FILTER.get(le.getMessage());
                println(message);
                errPrintln(message);
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
        }
@@ -472,7 +472,7 @@
                    final LocalizableMessage message =
                            ERR_LDIF_FILE_CANNOT_OPEN_FOR_READ.get(filename.getValue(), e
                                    .getLocalizedMessage());
                    println(message);
                    errPrintln(message);
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            } else {
@@ -491,7 +491,7 @@
                final LocalizableMessage message =
                        ERR_LDIF_FILE_READ_ERROR
                                .get(filename.getValue(), ioe.getLocalizedMessage());
                println(message);
                errPrintln(message);
                return ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue();
            }
        } finally {
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPPasswordModify.java
@@ -174,7 +174,7 @@
            argParser.setUsageArgument(showUsage, getOutputStream());
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -191,7 +191,7 @@
            connectionFactory = connectionFactoryProvider.getAuthenticatedConnectionFactory();
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -199,11 +199,11 @@
        try {
            final int versionNumber = version.getIntValue();
            if (versionNumber != 2 && versionNumber != 3) {
                println(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(versionNumber)));
                errPrintln(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(versionNumber)));
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
        } catch (final ArgumentException ae) {
            println(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(version.getValue())));
            errPrintln(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(version.getValue())));
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -215,7 +215,7 @@
                } catch (final DecodeException de) {
                    final LocalizableMessage message =
                            ERR_TOOL_INVALID_CONTROL_STRING.get(ctrlString);
                    println(message);
                    errPrintln(message);
                    ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -225,7 +225,7 @@
            final LocalizableMessage message =
                    ERR_LDAPPWMOD_CONFLICTING_ARGS.get(newPW.getLongIdentifier(), newPWFile
                            .getLongIdentifier());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -233,7 +233,7 @@
            final LocalizableMessage message =
                    ERR_LDAPPWMOD_CONFLICTING_ARGS.get(currentPW.getLongIdentifier(), currentPWFile
                            .getLongIdentifier());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -267,18 +267,18 @@
            LocalizableMessage message =
                    ERR_LDAPPWMOD_FAILED.get(e.getResult().getResultCode().intValue(), e
                            .getResult().getResultCode().toString());
            println(message);
            errPrintln(message);
            final String errorMessage = e.getResult().getDiagnosticMessage();
            if ((errorMessage != null) && (errorMessage.length() > 0)) {
                message = ERR_LDAPPWMOD_FAILURE_ERROR_MESSAGE.get(errorMessage);
                println(message);
                errPrintln(message);
            }
            final String matchedDN = e.getResult().getMatchedDN();
            if (matchedDN != null && matchedDN.length() > 0) {
                message = ERR_LDAPPWMOD_FAILURE_MATCHED_DN.get(matchedDN);
                println(message);
                errPrintln(message);
            }
            return e.getResult().getResultCode().intValue();
        }
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPSearch.java
@@ -113,7 +113,7 @@
                    }
                }
            } catch (final DecodeException de) {
                println(ERR_DECODE_CONTROL_FAILURE.get(de.getLocalizedMessage()));
                errPrintln(ERR_DECODE_CONTROL_FAILURE.get(de.getLocalizedMessage()));
            }
            try {
@@ -165,7 +165,7 @@
                    }
                }
            } catch (final DecodeException de) {
                println(ERR_DECODE_CONTROL_FAILURE.get(de.getLocalizedMessage()));
                errPrintln(ERR_DECODE_CONTROL_FAILURE.get(de.getLocalizedMessage()));
            }
            try {
@@ -433,7 +433,7 @@
            argParser.setUsageArgument(showUsage, getOutputStream());
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -450,7 +450,7 @@
            connectionFactory = connectionFactoryProvider.getAuthenticatedConnectionFactory();
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -469,7 +469,7 @@
                try {
                    filters.add(Filter.valueOf(filterString));
                } catch (final LocalizedIllegalArgumentException e) {
                    println(e.getMessageObject());
                    errPrintln(e.getMessageObject());
                    return ResultCode.CLIENT_SIDE_FILTER_ERROR.intValue();
                }
            }
@@ -495,10 +495,10 @@
                    filters.add(ldapFilter);
                }
            } catch (final LocalizedIllegalArgumentException e) {
                println(e.getMessageObject());
                errPrintln(e.getMessageObject());
                return ResultCode.CLIENT_SIDE_FILTER_ERROR.intValue();
            } catch (final IOException e) {
                println(LocalizableMessage.raw(e.toString()));
                errPrintln(LocalizableMessage.raw(e.toString()));
                return ResultCode.CLIENT_SIDE_FILTER_ERROR.intValue();
            } finally {
                if (in != null) {
@@ -512,8 +512,8 @@
        }
        if (filters.isEmpty()) {
            println(ERR_SEARCH_NO_FILTERS.get());
            println(argParser.getUsageMessage());
            errPrintln(ERR_SEARCH_NO_FILTERS.get());
            errPrintln(argParser.getUsageMessage());
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -521,7 +521,7 @@
        try {
            scope = searchScope.getTypedValue();
        } catch (final ArgumentException ex1) {
            println(ex1.getMessageObject());
            errPrintln(ex1.getMessageObject());
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -531,7 +531,7 @@
                    Requests.newSearchRequest(DN.valueOf(baseDN.getValue()), scope, filters.get(0),
                            attributes.toArray(new String[attributes.size()]));
        } catch (final LocalizedIllegalArgumentException e) {
            println(e.getMessageObject());
            errPrintln(e.getMessageObject());
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -539,11 +539,11 @@
        try {
            final int versionNumber = version.getIntValue();
            if (versionNumber != 2 && versionNumber != 3) {
                println(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(versionNumber)));
                errPrintln(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(versionNumber)));
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
        } catch (final ArgumentException ae) {
            println(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(version.getValue())));
            errPrintln(ERR_DESCRIPTION_INVALID_VERSION.get(String.valueOf(version.getValue())));
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -557,13 +557,13 @@
            search.setTimeLimit(timeLimit.getIntValue());
            search.setSizeLimit(sizeLimit.getIntValue());
        } catch (final ArgumentException ex1) {
            println(ex1.getMessageObject());
            errPrintln(ex1.getMessageObject());
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
        try {
            search.setDereferenceAliasesPolicy(dereferencePolicy.getTypedValue());
        } catch (final ArgumentException ex1) {
            println(ex1.getMessageObject());
            errPrintln(ex1.getMessageObject());
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -575,7 +575,7 @@
                } catch (final DecodeException de) {
                    final LocalizableMessage message =
                            ERR_TOOL_INVALID_CONTROL_STRING.get(ctrlString);
                    println(message);
                    errPrintln(message);
                    ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -585,7 +585,7 @@
            final String authzID = effectiveRightsUser.getValue();
            if (!authzID.startsWith("dn:")) {
                final LocalizableMessage message = ERR_EFFECTIVERIGHTS_INVALID_AUTHZID.get(authzID);
                println(message);
                errPrintln(message);
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
            final Control effectiveRightsControl =
@@ -610,14 +610,14 @@
            if (!tokenizer.hasMoreTokens()) {
                final LocalizableMessage message = ERR_PSEARCH_MISSING_DESCRIPTOR.get();
                println(message);
                errPrintln(message);
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            } else {
                final String token = tokenizer.nextToken();
                if (!token.equals("ps")) {
                    final LocalizableMessage message =
                            ERR_PSEARCH_DOESNT_START_WITH_PS.get(String.valueOf(infoString));
                    println(message);
                    errPrintln(message);
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -651,7 +651,7 @@
                        } else {
                            final LocalizableMessage message =
                                    ERR_PSEARCH_INVALID_CHANGE_TYPE.get(String.valueOf(token));
                            println(message);
                            errPrintln(message);
                            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                        }
                    } while (st.hasMoreTokens());
@@ -667,7 +667,7 @@
                } else {
                    final LocalizableMessage message =
                            ERR_PSEARCH_INVALID_CHANGESONLY.get(String.valueOf(token));
                    println(message);
                    errPrintln(message);
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -681,7 +681,7 @@
                } else {
                    final LocalizableMessage message =
                            ERR_PSEARCH_INVALID_RETURN_ECS.get(String.valueOf(token));
                    println(message);
                    errPrintln(message);
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -705,7 +705,7 @@
            } catch (final LocalizedIllegalArgumentException le) {
                final LocalizableMessage message =
                        ERR_LDAP_ASSERTION_INVALID_FILTER.get(le.getMessage());
                println(message);
                errPrintln(message);
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
        }
@@ -720,7 +720,7 @@
                } catch (final LocalizedIllegalArgumentException le) {
                    final LocalizableMessage message =
                            ERR_LDAP_MATCHEDVALUES_INVALID_FILTER.get(le.getMessage());
                    println(message);
                    errPrintln(message);
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -737,7 +737,7 @@
            } catch (final LocalizedIllegalArgumentException le) {
                final LocalizableMessage message =
                        ERR_LDAP_SORTCONTROL_INVALID_ORDER.get(le.getMessageObject());
                println(message);
                errPrintln(message);
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
        }
@@ -747,7 +747,7 @@
                final LocalizableMessage message =
                        ERR_LDAPSEARCH_VLV_REQUIRES_SORT.get(vlvDescriptor.getLongIdentifier(),
                                sortOrder.getLongIdentifier());
                println(message);
                errPrintln(message);
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
@@ -762,7 +762,7 @@
                            assertionValue, beforeCount, afterCount, null));
                } catch (final Exception e) {
                    final LocalizableMessage message = ERR_LDAPSEARCH_VLV_INVALID_DESCRIPTOR.get();
                    println(message);
                    errPrintln(message);
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            } else if (numTokens == 4) {
@@ -775,12 +775,12 @@
                            contentCount, beforeCount, afterCount, null));
                } catch (final Exception e) {
                    final LocalizableMessage message = ERR_LDAPSEARCH_VLV_INVALID_DESCRIPTOR.get();
                    println(message);
                    errPrintln(message);
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            } else {
                final LocalizableMessage message = ERR_LDAPSEARCH_VLV_INVALID_DESCRIPTOR.get();
                println(message);
                errPrintln(message);
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
        }
@@ -789,7 +789,7 @@
        if (simplePageSize.isPresent()) {
            if (filters.size() > 1) {
                final LocalizableMessage message = ERR_PAGED_RESULTS_REQUIRES_SINGLE_FILTER.get();
                println(message);
                errPrintln(message);
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
@@ -799,7 +799,7 @@
                        .empty()));
            } catch (final ArgumentException ae) {
                final LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
                println(message);
                errPrintln(message);
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
        }
@@ -808,11 +808,11 @@
         * if(!connectionOptions.useSSL() && !connectionOptions.useStartTLS()) {
         * LocalizableMessage message =
         * ERR_TOOL_SASLEXTERNAL_NEEDS_SSL_OR_TLS.get();
         * err.println(wrapText(message, MAX_LINE_WIDTH)); return
         * errPrintln(wrapText(message, MAX_LINE_WIDTH)); return
         * CLIENT_SIDE_PARAM_ERROR; } if(keyStorePathValue == null) {
         * LocalizableMessage message =
         * ERR_TOOL_SASLEXTERNAL_NEEDS_KEYSTORE.get();
         * err.println(wrapText(message, MAX_LINE_WIDTH)); return
         * errPrintln(wrapText(message, MAX_LINE_WIDTH)); return
         * CLIENT_SIDE_PARAM_ERROR; } }
         * connectionOptions.setVerbose(verbose.isPresent());
         */
@@ -858,7 +858,7 @@
                        }
                    }
                } catch (final DecodeException e) {
                    println(ERR_DECODE_CONTROL_FAILURE.get(e.getLocalizedMessage()));
                    errPrintln(ERR_DECODE_CONTROL_FAILURE.get(e.getLocalizedMessage()));
                }
                try {
@@ -881,7 +881,7 @@
                        }
                    }
                } catch (final DecodeException e) {
                    println(ERR_DECODE_CONTROL_FAILURE.get(e.getLocalizedMessage()));
                    errPrintln(ERR_DECODE_CONTROL_FAILURE.get(e.getLocalizedMessage()));
                }
                try {
@@ -907,18 +907,18 @@
                        }
                    }
                } catch (final DecodeException e) {
                    println(ERR_DECODE_CONTROL_FAILURE.get(e.getLocalizedMessage()));
                    errPrintln(ERR_DECODE_CONTROL_FAILURE.get(e.getLocalizedMessage()));
                }
                println();
                println(ERR_TOOL_RESULT_CODE.get(result.getResultCode().intValue(), result
                errPrintln();
                errPrintln(ERR_TOOL_RESULT_CODE.get(result.getResultCode().intValue(), result
                        .getResultCode().toString()));
                if ((result.getDiagnosticMessage() != null)
                        && (result.getDiagnosticMessage().length() > 0)) {
                    println(LocalizableMessage.raw(result.getDiagnosticMessage()));
                    errPrintln(LocalizableMessage.raw(result.getDiagnosticMessage()));
                }
                if (result.getMatchedDN() != null && result.getMatchedDN().length() > 0) {
                    println(ERR_TOOL_MATCHED_DN.get(result.getMatchedDN()));
                    errPrintln(ERR_TOOL_MATCHED_DN.get(result.getMatchedDN()));
                }
                filterIndex++;
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDIFDiff.java
@@ -100,7 +100,7 @@
            argParser.setUsageArgument(showUsage, getOutputStream());
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -115,7 +115,7 @@
            }
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -136,7 +136,7 @@
                    final LocalizableMessage message =
                            ERR_LDIF_FILE_CANNOT_OPEN_FOR_READ.get(trailingArguments.get(0), e
                                    .getLocalizedMessage());
                    println(message);
                    errPrintln(message);
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -149,7 +149,7 @@
                    final LocalizableMessage message =
                            ERR_LDIF_FILE_CANNOT_OPEN_FOR_READ.get(trailingArguments.get(1), e
                                    .getLocalizedMessage());
                    println(message);
                    errPrintln(message);
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -162,7 +162,7 @@
                    final LocalizableMessage message =
                            ERR_LDIF_FILE_CANNOT_OPEN_FOR_WRITE.get(outputFilename.getValue(), e
                                    .getLocalizedMessage());
                    println(message);
                    errPrintln(message);
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -185,7 +185,7 @@
             target from stdin.*/
            if (sourceInputStream == targetInputStream) {
                final LocalizableMessage message = ERR_LDIFDIFF_MULTIPLE_USES_OF_STDIN.get();
                println(message);
                errPrintln(message);
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
@@ -196,9 +196,9 @@
            LDIF.copyTo(LDIF.diff(sourceReader, targetReader), outputWriter);
        } catch (final IOException e) {
            if (e instanceof LocalizableException) {
                println(ERR_LDIFDIFF_DIFF_FAILED.get(((LocalizableException) e).getMessageObject()));
                errPrintln(ERR_LDIFDIFF_DIFF_FAILED.get(((LocalizableException) e).getMessageObject()));
            } else {
                println(ERR_LDIFDIFF_DIFF_FAILED.get(e.getLocalizedMessage()));
                errPrintln(ERR_LDIFDIFF_DIFF_FAILED.get(e.getLocalizedMessage()));
            }
            return ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue();
        } finally {
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDIFModify.java
@@ -111,7 +111,7 @@
            argParser.setUsageArgument(showUsage, getOutputStream());
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -126,7 +126,7 @@
            }
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -147,7 +147,7 @@
                    final LocalizableMessage message =
                            ERR_LDIF_FILE_CANNOT_OPEN_FOR_READ.get(trailingArguments.get(0), e
                                    .getLocalizedMessage());
                    println(message);
                    errPrintln(message);
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -160,7 +160,7 @@
                    final LocalizableMessage message =
                            ERR_LDIF_FILE_CANNOT_OPEN_FOR_READ.get(trailingArguments.get(1), e
                                    .getLocalizedMessage());
                    println(message);
                    errPrintln(message);
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -173,7 +173,7 @@
                    final LocalizableMessage message =
                            ERR_LDIF_FILE_CANNOT_OPEN_FOR_WRITE.get(outputFilename.getValue(), e
                                    .getLocalizedMessage());
                    println(message);
                    errPrintln(message);
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -196,7 +196,7 @@
             changes from stdin.*/
            if (sourceInputStream == changesInputStream) {
                final LocalizableMessage message = ERR_LDIFMODIFY_MULTIPLE_USES_OF_STDIN.get();
                println(message);
                errPrintln(message);
                return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
            }
@@ -276,7 +276,7 @@
                private void logErrorOrFail(final DecodeException e) throws DecodeException {
                    if (continueOnError.isPresent()) {
                        println(e.getMessageObject());
                        errPrintln(e.getMessageObject());
                    } else {
                        throw e;
                    }
@@ -286,10 +286,10 @@
            LDIF.copyTo(LDIF.patch(sourceReader, changesReader, listener), outputWriter);
        } catch (final IOException e) {
            if (e instanceof LocalizableException) {
                println(ERR_LDIFMODIFY_PATCH_FAILED.get(((LocalizableException) e)
                errPrintln(ERR_LDIFMODIFY_PATCH_FAILED.get(((LocalizableException) e)
                        .getMessageObject()));
            } else {
                println(ERR_LDIFMODIFY_PATCH_FAILED.get(e.getLocalizedMessage()));
                errPrintln(ERR_LDIFMODIFY_PATCH_FAILED.get(e.getLocalizedMessage()));
            }
            return ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue();
        } finally {
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDIFSearch.java
@@ -157,7 +157,7 @@
            argParser.setUsageArgument(showUsage, getOutputStream());
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -172,7 +172,7 @@
            }
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -193,7 +193,7 @@
                try {
                    filters.add(Filter.valueOf(filterString));
                } catch (final LocalizedIllegalArgumentException e) {
                    println(e.getMessageObject());
                    errPrintln(e.getMessageObject());
                    return ResultCode.CLIENT_SIDE_FILTER_ERROR.intValue();
                }
            }
@@ -219,10 +219,10 @@
                    filters.add(ldapFilter);
                }
            } catch (final LocalizedIllegalArgumentException e) {
                println(e.getMessageObject());
                errPrintln(e.getMessageObject());
                return ResultCode.CLIENT_SIDE_FILTER_ERROR.intValue();
            } catch (final IOException e) {
                println(LocalizableMessage.raw(e.toString()));
                errPrintln(LocalizableMessage.raw(e.toString()));
                return ResultCode.CLIENT_SIDE_FILTER_ERROR.intValue();
            } finally {
                closeIfNotNull(in);
@@ -230,8 +230,8 @@
        }
        if (filters.isEmpty()) {
            println(ERR_SEARCH_NO_FILTERS.get());
            println(argParser.getUsageMessage());
            errPrintln(ERR_SEARCH_NO_FILTERS.get());
            errPrintln(argParser.getUsageMessage());
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -244,10 +244,10 @@
                            typesOnly.isPresent()).setTimeLimit(timeLimit.getIntValue())
                            .setSizeLimit(sizeLimit.getIntValue());
        } catch (final ArgumentException e) {
            println(e.getMessageObject());
            errPrintln(e.getMessageObject());
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        } catch (final LocalizedIllegalArgumentException e) {
            println(e.getMessageObject());
            errPrintln(e.getMessageObject());
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -265,7 +265,7 @@
                    final LocalizableMessage message =
                            ERR_LDIF_FILE_CANNOT_OPEN_FOR_READ.get(trailingArguments.get(0), e
                                    .getLocalizedMessage());
                    println(message);
                    errPrintln(message);
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -278,7 +278,7 @@
                    final LocalizableMessage message =
                            ERR_LDIF_FILE_CANNOT_OPEN_FOR_WRITE.get(outputFilename.getValue(), e
                                    .getLocalizedMessage());
                    println(message);
                    errPrintln(message);
                    return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
                }
            }
@@ -299,9 +299,9 @@
            LDIF.copyTo(LDIF.search(sourceReader, search), outputWriter);
        } catch (final IOException e) {
            if (e instanceof LocalizableException) {
                println(ERR_LDIFSEARCH_FAILED.get(((LocalizableException) e).getMessageObject()));
                errPrintln(ERR_LDIFSEARCH_FAILED.get(((LocalizableException) e).getMessageObject()));
            } else {
                println(ERR_LDIFSEARCH_FAILED.get(e.getLocalizedMessage()));
                errPrintln(ERR_LDIFSEARCH_FAILED.get(e.getLocalizedMessage()));
            }
            return ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue();
        } finally {
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/MakeLDIF.java
@@ -106,7 +106,7 @@
            argParser.addArgument(showUsage);
            argParser.setUsageArgument(showUsage, getOutputStream());
        } catch (ArgumentException ae) {
            println(ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage()));
            errPrintln(ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage()));
            return EXIT_CODE_FAILURE;
        }
@@ -114,8 +114,8 @@
        try {
            argParser.parseArguments(args);
        } catch (ArgumentException ae) {
            println(ERR_ERROR_PARSING_ARGS.get(ae.getMessage()));
            println(argParser.getUsageMessage());
            errPrintln(ERR_ERROR_PARSING_ARGS.get(ae.getMessage()));
            errPrintln(argParser.getUsageMessage());
            return EXIT_CODE_FAILURE;
        }
@@ -139,7 +139,7 @@
            if (generator.hasWarnings()) {
                for (LocalizableMessage warn : generator.getWarnings()) {
                    println(warn);
                    errPrintln(warn);
                }
            }
@@ -147,7 +147,7 @@
                try {
                    writer = new LDIFEntryWriter(new BufferedWriter(new FileWriter(new File(ldifFile.getValue()))));
                } catch (IOException e) {
                    println(ERR_MAKELDIF_UNABLE_TO_CREATE_LDIF.get(ldifFile.getValue(), e.getMessage()));
                    errPrintln(ERR_MAKELDIF_UNABLE_TO_CREATE_LDIF.get(ldifFile.getValue(), e.getMessage()));
                    return EXIT_CODE_FAILURE;
                }
            } else {
@@ -158,7 +158,7 @@
                return EXIT_CODE_FAILURE;
            }
            println(INFO_MAKELDIF_PROCESSING_COMPLETE.get(numberOfEntriesWritten));
            errPrintln(INFO_MAKELDIF_PROCESSING_COMPLETE.get(numberOfEntriesWritten));
        } finally {
            closeIfNotNull(generator, writer);
@@ -177,7 +177,7 @@
        if (resourcePath.isPresent()) {
            final File resourceDir = new File(resourcePath.getValue());
            if (!resourceDir.exists()) {
                println(ERR_MAKELDIF_NO_SUCH_RESOURCE_DIRECTORY.get(resourcePath.getValue()));
                errPrintln(ERR_MAKELDIF_NO_SUCH_RESOURCE_DIRECTORY.get(resourcePath.getValue()));
                generator.close();
                return null;
            }
@@ -188,7 +188,7 @@
            try {
                generator.setRandomSeed(randomSeedArg.getIntValue());
            } catch (ArgumentException ae) {
                println(ERR_ERROR_PARSING_ARGS.get(ae.getMessage()));
                errPrintln(ERR_ERROR_PARSING_ARGS.get(ae.getMessage()));
                generator.close();
                return null;
            }
@@ -205,7 +205,7 @@
        try {
            generator.hasNext();
        } catch (IOException e) {
            println(ERR_MAKELDIF_EXCEPTION_DURING_PARSE.get(e.getMessage()));
            errPrintln(ERR_MAKELDIF_EXCEPTION_DURING_PARSE.get(e.getMessage()));
            generator.close();
            return null;
        }
@@ -220,7 +220,7 @@
        for (final String constant : constants.getValues()) {
            final String[] chunks = constant.split("=");
            if (chunks.length != 2) {
                println(ERR_CONSTANT_ARG_CANNOT_DECODE.get(constant));
                errPrintln(ERR_CONSTANT_ARG_CANNOT_DECODE.get(constant));
                return false;
            }
            generator.setConstant(chunks[0], chunks[1]);
@@ -239,15 +239,15 @@
                try {
                    writer.writeEntry(entry);
                } catch (IOException e) {
                    println(ERR_MAKELDIF_ERROR_WRITING_LDIF.get(ldifFile.getValue(), e.getMessage()));
                    errPrintln(ERR_MAKELDIF_ERROR_WRITING_LDIF.get(ldifFile.getValue(), e.getMessage()));
                    return false;
                }
                if ((++numberOfEntriesWritten % 1000) == 0) {
                    println(INFO_MAKELDIF_PROCESSED_N_ENTRIES.get(numberOfEntriesWritten));
                    errPrintln(INFO_MAKELDIF_PROCESSED_N_ENTRIES.get(numberOfEntriesWritten));
                }
            }
        } catch (Exception e) {
            println(ERR_MAKELDIF_EXCEPTION_DURING_PROCESSING.get(e.getMessage()));
            errPrintln(ERR_MAKELDIF_EXCEPTION_DURING_PROCESSING.get(e.getMessage()));
            return false;
        }
        return true;
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/ModRate.java
@@ -204,7 +204,7 @@
            argParser.addArgument(scriptFriendly);
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -222,7 +222,7 @@
            runner.validate();
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -241,7 +241,7 @@
            }
            String.format(runner.baseDN, data);
        } catch (final Exception ex1) {
            println(LocalizableMessage.raw("Error formatting filter or base DN: " + ex1.toString()));
            errPrintln(LocalizableMessage.raw("Error formatting filter or base DN: " + ex1.toString()));
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/PerformanceRunner.java
@@ -361,10 +361,7 @@
        public void handleErrorResult(final ErrorResultException error) {
            failedRecentCount.getAndIncrement();
            updateStats();
            if (app.isVerbose()) {
                app.println(LocalizableMessage.raw(error.getResult().toString()));
            }
            app.errPrintVerboseMessage(LocalizableMessage.raw(error.getResult().toString()));
        }
        @Override
@@ -421,7 +418,7 @@
                        // Ignore and check stop requested
                        continue;
                    } catch (final ErrorResultException e) {
                        app.println(LocalizableMessage.raw(e.getResult().getDiagnosticMessage()));
                        app.errPrintln(LocalizableMessage.raw(e.getResult().getDiagnosticMessage()));
                        if (e.getCause() != null && app.isVerbose()) {
                            e.getCause().printStackTrace(app.getErrorStream());
                        }
@@ -438,7 +435,7 @@
                            // Ignore and check stop requested
                            continue;
                        } catch (final ErrorResultException e) {
                            app.println(LocalizableMessage.raw(e.getResult().toString()));
                            app.errPrintln(LocalizableMessage.raw(e.getResult().toString()));
                            if (e.getCause() != null && app.isVerbose()) {
                                e.getCause().printStackTrace(app.getErrorStream());
                            }
@@ -782,7 +779,7 @@
    public synchronized void handleConnectionError(final boolean isDisconnectNotification,
            final ErrorResultException error) {
        if (!stopRequested) {
            app.println(LocalizableMessage.raw("Error occurred on one or more connections: "
            app.errPrintln(LocalizableMessage.raw("Error occurred on one or more connections: "
                    + error.getResult()));
            if (error.getCause() != null && app.isVerbose()) {
                error.getCause().printStackTrace(app.getErrorStream());
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/SearchRate.java
@@ -264,7 +264,7 @@
            argParser.addArgument(scriptFriendly);
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -282,7 +282,7 @@
            runner.validate();
        } catch (final ArgumentException ae) {
            final LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
            println(message);
            errPrintln(message);
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -303,7 +303,7 @@
            runner.scope = searchScope.getTypedValue();
            runner.dereferencesAliasesPolicy = dereferencePolicy.getTypedValue();
        } catch (final ArgumentException ex1) {
            println(ex1.getMessageObject());
            errPrintln(ex1.getMessageObject());
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
@@ -314,7 +314,7 @@
            String.format(runner.filter, data);
            String.format(runner.baseDN, data);
        } catch (final Exception ex1) {
            println(LocalizableMessage.raw("Error formatting filter or base DN: " + ex1.toString()));
            errPrintln(LocalizableMessage.raw("Error formatting filter or base DN: " + ex1.toString()));
            return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
        }
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/Utils.java
@@ -176,17 +176,17 @@
         }*/
        if (ere.getResult().getResultCode().intValue() >= 0) {
            app.println(ERR_TOOL_RESULT_CODE.get(ere.getResult().getResultCode().intValue(), ere
            app.errPrintln(ERR_TOOL_RESULT_CODE.get(ere.getResult().getResultCode().intValue(), ere
                    .getResult().getResultCode().toString()));
        }
        if ((ere.getResult().getDiagnosticMessage() != null)
                && (ere.getResult().getDiagnosticMessage().length() > 0)) {
            app.println(ERR_TOOL_ERROR_MESSAGE.get(ere.getResult().getDiagnosticMessage()));
            app.errPrintln(ERR_TOOL_ERROR_MESSAGE.get(ere.getResult().getDiagnosticMessage()));
        }
        if (ere.getResult().getMatchedDN() != null && ere.getResult().getMatchedDN().length() > 0) {
            app.println(ERR_TOOL_MATCHED_DN.get(ere.getResult().getMatchedDN()));
            app.errPrintln(ERR_TOOL_MATCHED_DN.get(ere.getResult().getMatchedDN()));
        }
        if (app.isVerbose() && ere.getResult().getCause() != null) {
@@ -211,7 +211,7 @@
                    app.println(message);
                }
            } catch (final DecodeException e) {
                app.println(ERR_DECODE_CONTROL_FAILURE.get(e.getLocalizedMessage()));
                app.errPrintln(ERR_DECODE_CONTROL_FAILURE.get(e.getLocalizedMessage()));
            }
            try {
@@ -223,7 +223,7 @@
                    app.println(message);
                }
            } catch (final DecodeException e) {
                app.println(ERR_DECODE_CONTROL_FAILURE.get(e.getLocalizedMessage()));
                app.errPrintln(ERR_DECODE_CONTROL_FAILURE.get(e.getLocalizedMessage()));
            }
            try {
@@ -237,7 +237,7 @@
                    app.println(message);
                }
            } catch (final DecodeException e) {
                app.println(ERR_DECODE_CONTROL_FAILURE.get(e.getLocalizedMessage()));
                app.errPrintln(ERR_DECODE_CONTROL_FAILURE.get(e.getLocalizedMessage()));
            }
            try {
@@ -272,7 +272,7 @@
                    }
                }
            } catch (final DecodeException e) {
                app.println(ERR_DECODE_CONTROL_FAILURE.get(e.getLocalizedMessage()));
                app.errPrintln(ERR_DECODE_CONTROL_FAILURE.get(e.getLocalizedMessage()));
            }
        }
    }
opendj-ldap-toolkit/src/test/java/com/forgerock/opendj/ldap/tools/MakeLDIFTestCase.java
@@ -29,6 +29,7 @@
import static com.forgerock.opendj.ldap.tools.ToolsMessages.*;
import static com.forgerock.opendj.cli.Utils.MAX_LINE_WIDTH;
import static com.forgerock.opendj.cli.Utils.wrapText;
import static org.forgerock.util.Utils.closeSilently;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
@@ -111,7 +112,7 @@
            assertThat(err.toString("UTF-8")).contains(wrapText(expectedErrOutput, MAX_LINE_WIDTH));
        } finally {
            org.forgerock.util.Utils.closeSilently(outStream, errStream);
            closeSilently(outStream, errStream);
        }
    }