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

Gaetan Boismal
28.56.2016 e6c02ba81b613c9eecd09ffeff8257ee402f984e
Fix ldifmodify tool
1 files modified
8 ■■■■ changed files
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDIFModify.java 8 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDIFModify.java
@@ -145,9 +145,10 @@
        final List<String> trailingArguments = argParser.getTrailingArguments();
        LDIFEntryReader sourceReader = null;
        LDIFChangeRecordReader changesReader = null;
        LDIFEntryWriter outputWriter = null;
        try (InputStream sourceInputStream = getLDIFToolInputStream(this, trailingArguments.get(0));
                OutputStream outputStream = getLDIFToolOutputStream(this, outputFilename)) {
             OutputStream outputStream = getLDIFToolOutputStream(this, outputFilename);
             LDIFEntryWriter outputWriter = new LDIFEntryWriter(outputStream)) {
            outputWriter.setWrapColumn(computeWrapColumn(wrapColumn));
            final int nbTrailingArgs = trailingArguments.size();
            final boolean readChangesFromStdin = nbTrailingArgs == 1
                    || (nbTrailingArgs == 2 && USE_SYSTEM_STREAM_TOKEN.equals(trailingArguments.get(1)));
@@ -162,7 +163,6 @@
                changesReader = new LDIFChangeRecordReader(
                        Utils.getLinesFromFiles(trailingArguments.subList(1, nbTrailingArgs)));
            }
            outputWriter = new LDIFEntryWriter(outputStream).setWrapColumn(computeWrapColumn(wrapColumn));
            final RejectedChangeRecordListener listener = new RejectedChangeRecordListener() {
                @Override
@@ -248,7 +248,7 @@
        } catch (final ArgumentException ae) {
            throw newToolParamException(ae, ae.getMessageObject());
        } finally {
            closeSilently(sourceReader, changesReader, outputWriter);
            closeSilently(sourceReader, changesReader);
        }
        return ResultCode.SUCCESS.intValue();