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/LDAPModify.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.FileInputStream;
import java.io.IOException;
@@ -231,6 +232,7 @@
        return verbose.isPresent();
    }
    @SuppressWarnings("resource")
    private int run(final String[] args) {
        // Create the command-line argument parser for use with this
        // program.
@@ -471,8 +473,8 @@
        writer = new LDIFEntryWriter(getOutputStream());
        final VisitorImpl visitor = new VisitorImpl();
        ChangeRecordReader reader = null;
        try {
            ChangeRecordReader reader;
            if (filename.isPresent()) {
                try {
                    reader = new LDIFChangeRecordReader(new FileInputStream(filename.getValue()));
@@ -503,9 +505,7 @@
                return ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue();
            }
        } finally {
            if (connection != null) {
                connection.close();
            }
            closeSilently(reader, connection);
        }
        return ResultCode.SUCCESS.intValue();