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

Matthew Swift
30.42.2012 7934d276c1dfdc3224c391c23f574d244c5b0a10
opendj3/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPSearch.java
@@ -30,6 +30,7 @@
import static com.forgerock.opendj.ldap.tools.ToolConstants.*;
import static com.forgerock.opendj.ldap.tools.ToolsMessages.*;
import static com.forgerock.opendj.ldap.tools.Utils.filterExitCode;
import static com.forgerock.opendj.util.StaticUtils.closeSilently;
import java.io.BufferedReader;
import java.io.FileReader;
@@ -220,6 +221,7 @@
        return verbose.isPresent();
    }
    @SuppressWarnings("resource")
    private int run(final String[] args, final boolean returnMatchingEntries) {
        // Create the command-line argument parser for use with this
        // program.
@@ -833,10 +835,8 @@
            // We don't actually need to open a connection or perform the
            // search, so we're done. We should return 0 to either mean that the
            // processing was successful or that there were no matching entries,
            // based
            // on countEntries.isPresent() (but in either case the return value
            // should
            // be zero).
            // based on countEntries.isPresent() (but in either case the return value
            // should be zero).
            return 0;
        }
@@ -946,7 +946,7 @@
        } catch (final ErrorResultException ere) {
            return Utils.printErrorMessage(this, ere);
        } finally {
            connection.close();
            closeSilently(ldifWriter, connection);
        }
        return 0;