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

Jean-Noël Rouvignac
06.57.2016 8ad9202de7c0b2828efedfdb836ca45c7e98557a
opendj-sdk/opendj-copyright-maven-plugin/src/main/java/org/forgerock/maven/UpdateCopyrightMojo.java
@@ -445,7 +445,6 @@
    }
    void setDryRun(final boolean dryRun) {
        this.dryRun = true;
        this.dryRun = dryRun;
    }
}
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/AnonymousSASLBindRequestImpl.java
@@ -22,13 +22,11 @@
 *
 *
 *      Copyright 2010 Sun Microsystems, Inc.
 *      Portions copyright 2012-2015 ForgeRock AS.
 *      Portions copyright 2012-2016 ForgeRock AS.
 */
package org.forgerock.opendj.ldap.requests;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.util.Reject;
/**
@@ -37,8 +35,7 @@
final class AnonymousSASLBindRequestImpl extends AbstractSASLBindRequest<AnonymousSASLBindRequest>
        implements AnonymousSASLBindRequest {
    private static final class Client extends SASLBindClientImpl {
        private Client(final AnonymousSASLBindRequestImpl initialBindRequest,
                final String serverName) {
        private Client(final AnonymousSASLBindRequestImpl initialBindRequest) {
            super(initialBindRequest);
            setNextSASLCredentials(ByteString.valueOfUtf8(initialBindRequest.getTraceString()));
        }
@@ -58,7 +55,7 @@
    @Override
    public BindClient createBindClient(final String serverName) {
        return new Client(this, serverName);
        return new Client(this);
    }
    @Override
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/Schema.java
@@ -1014,8 +1014,7 @@
     * <p>
     * This implementation first reads the {@code subschemaSubentry} attribute
     * of the entry in order to identify the schema and then invokes
     * {@link #readSchemaAsync(Connection, DN, ResultHandler)} to read the
     * schema.
     * {@link #readSchemaAsync(Connection, DN)} to read the schema.
     *
     * @param connection
     *            A connection to the Directory Server whose schema is to be
opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/CaseExactIA5SubstringMatchingRuleTest.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Portions Copyright 2016 ForgeRock AS.
 */
package org.forgerock.opendj.ldap.schema;
@@ -30,10 +31,7 @@
import org.forgerock.opendj.ldap.ConditionResult;
import org.testng.annotations.DataProvider;
/**
 * Test the CaseExactIA5SubstringMatchingRule.
 */
@SuppressWarnings("javadoc")
/** Test the CaseExactIA5SubstringMatchingRule. */
public class CaseExactIA5SubstringMatchingRuleTest extends SubstringMatchingRuleTest {
    @Override
@@ -51,7 +49,6 @@
        return new Object[][] { { "12345678\uFFFD" }, };
    }
    /** {@inheritDoc} */
    @Override
    @DataProvider(name = "substringFinalMatchData")
    public Object[][] createSubstringFinalMatchData() {
@@ -69,7 +66,6 @@
            { "end with space    ", "space", ConditionResult.TRUE }, };
    }
    /** {@inheritDoc} */
    @Override
    @DataProvider(name = "substringInitialMatchData")
    public Object[][] createSubstringInitialMatchData() {
@@ -85,7 +81,6 @@
            { "this is a value", "THIS", ConditionResult.FALSE }, };
    }
    /** {@inheritDoc} */
    @Override
    @DataProvider(name = "substringMiddleMatchData")
    public Object[][] createSubstringMiddleMatchData() {
@@ -107,7 +102,6 @@
            { "this is a value", strings("    "), ConditionResult.TRUE }, };
    }
    /** {@inheritDoc} */
    @Override
    protected MatchingRule getRule() {
        return Schema.getCoreSchema().getMatchingRule(SMR_CASE_EXACT_IA5_OID);
opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/CaseExactSubstringMatchingRuleTest.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Portions Copyright 2016 ForgeRock AS.
 */
package org.forgerock.opendj.ldap.schema;
@@ -30,10 +31,7 @@
import org.forgerock.opendj.ldap.ConditionResult;
import org.testng.annotations.DataProvider;
/**
 * Test the CaseExactSubstringMatchingRule class.
 */
@SuppressWarnings("javadoc")
/** Test the CaseExactSubstringMatchingRule class. */
public class CaseExactSubstringMatchingRuleTest extends SubstringMatchingRuleTest {
    @Override
@@ -48,7 +46,6 @@
        return new Object[][] {};
    }
    /** {@inheritDoc} */
    @Override
    @DataProvider(name = "substringFinalMatchData")
    public Object[][] createSubstringFinalMatchData() {
@@ -66,7 +63,6 @@
            { "end with space    ", "space", ConditionResult.TRUE }, };
    }
    /** {@inheritDoc} */
    @Override
    @DataProvider(name = "substringInitialMatchData")
    public Object[][] createSubstringInitialMatchData() {
@@ -82,7 +78,6 @@
            { "this is a value", "THIS", ConditionResult.FALSE }, };
    }
    /** {@inheritDoc} */
    @Override
    @DataProvider(name = "substringMiddleMatchData")
    public Object[][] createSubstringMiddleMatchData() {
@@ -104,7 +99,6 @@
            { "this is a value", strings("    "), ConditionResult.TRUE }, };
    }
    /** {@inheritDoc} */
    @Override
    protected MatchingRule getRule() {
        return Schema.getCoreSchema().getMatchingRule(SMR_CASE_EXACT_OID);
opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/CaseIgnoreIA5SubstringMatchingRuleTest.java
@@ -31,10 +31,7 @@
import org.forgerock.opendj.ldap.ConditionResult;
import org.testng.annotations.DataProvider;
/**
 * Test the CaseIgnoreIA5SubstringMatchingRule.
 */
@SuppressWarnings("javadoc")
/** Test the CaseIgnoreIA5SubstringMatchingRule. */
public class CaseIgnoreIA5SubstringMatchingRuleTest extends SubstringMatchingRuleTest {
    @Override
@@ -51,7 +48,6 @@
        return new Object[][] { { "12345678\uFFFD" }, };
    }
    /** {@inheritDoc} */
    @Override
    @DataProvider(name = "substringFinalMatchData")
    public Object[][] createSubstringFinalMatchData() {
@@ -75,7 +71,6 @@
            { "end with space    ", "SPACE", ConditionResult.TRUE }, };
    }
    /** {@inheritDoc} */
    @Override
    @DataProvider(name = "substringInitialMatchData")
    public Object[][] createSubstringInitialMatchData() {
@@ -95,7 +90,6 @@
            { "this is a value", "THIS", ConditionResult.TRUE }, };
    }
    /** {@inheritDoc} */
    @Override
    @DataProvider(name = "substringMiddleMatchData")
    public Object[][] createSubstringMiddleMatchData() {
@@ -121,7 +115,6 @@
            { "this is a value", strings("    "), ConditionResult.TRUE }, };
    }
    /** {@inheritDoc} */
    @Override
    protected MatchingRule getRule() {
        return Schema.getCoreSchema().getMatchingRule(SMR_CASE_IGNORE_IA5_OID);
opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/CaseIgnoreSubstringMatchingRuleTest.java
@@ -31,10 +31,7 @@
import org.forgerock.opendj.ldap.ConditionResult;
import org.testng.annotations.DataProvider;
/**
 * Test the CaseIgnoreSubstringMatchingRule.
 */
@SuppressWarnings("javadoc")
/** Test the CaseIgnoreSubstringMatchingRule. */
public class CaseIgnoreSubstringMatchingRuleTest extends SubstringMatchingRuleTest {
    @Override
@@ -49,7 +46,6 @@
        return new Object[][] {};
    }
    /** {@inheritDoc} */
    @Override
    @DataProvider(name = "substringFinalMatchData")
    public Object[][] createSubstringFinalMatchData() {
@@ -73,7 +69,6 @@
            { "end with space    ", "SPACE", ConditionResult.TRUE }, };
    }
    /** {@inheritDoc} */
    @Override
    @DataProvider(name = "substringInitialMatchData")
    public Object[][] createSubstringInitialMatchData() {
@@ -93,7 +88,6 @@
            { "this is a value", "THIS", ConditionResult.TRUE }, };
    }
    /** {@inheritDoc} */
    @Override
    @DataProvider(name = "substringMiddleMatchData")
    public Object[][] createSubstringMiddleMatchData() {
@@ -119,7 +113,6 @@
            { "this is a value", strings("    "), ConditionResult.TRUE }, };
    }
    /** {@inheritDoc} */
    @Override
    protected MatchingRule getRule() {
        return Schema.getCoreSchema().getMatchingRule(SMR_CASE_IGNORE_OID);
opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/NumericStringSubstringMatchingRuleTest.java
@@ -22,6 +22,7 @@
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Portions Copyright 2016 ForgeRock AS.
 */
package org.forgerock.opendj.ldap.schema;
@@ -31,10 +32,7 @@
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
/**
 * Test the NumericStringSubstringMatchingRule.
 */
@SuppressWarnings("javadoc")
/** Test the NumericStringSubstringMatchingRule. */
@Test
public class NumericStringSubstringMatchingRuleTest extends SubstringMatchingRuleTest {
@@ -52,7 +50,6 @@
        };
    }
    /** {@inheritDoc} */
    @Override
    @DataProvider(name = "substringFinalMatchData")
    public Object[][] createSubstringFinalMatchData() {
@@ -67,7 +64,6 @@
        };
    }
    /** {@inheritDoc} */
    @Override
    @DataProvider(name = "substringInitialMatchData")
    public Object[][] createSubstringInitialMatchData() {
@@ -84,7 +80,6 @@
        };
    }
    /** {@inheritDoc} */
    @Override
    @DataProvider(name = "substringMiddleMatchData")
    public Object[][] createSubstringMiddleMatchData() {
@@ -108,7 +103,6 @@
        };
    }
    /** {@inheritDoc} */
    @Override
    protected MatchingRule getRule() {
        return Schema.getCoreSchema().getMatchingRule(SMR_NUMERIC_STRING_OID);
opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldif/ConnectionEntryWriterTestCase.java
@@ -22,9 +22,8 @@
 *
 *
 *      Copyright 2011 ForgeRock AS
 *      Portions copyright 2012 ForgeRock AS.
 *      Portions copyright 2012-2016 ForgeRock AS.
 */
package org.forgerock.opendj.ldif;
import org.forgerock.opendj.ldap.Connection;
@@ -56,7 +55,6 @@
    @Test
    public final void testConnectionEntryWriterWritesEntry() throws Exception {
        Connection connection = mock(Connection.class);
        ConnectionEntryWriter writer = null;
        final Entry entry =
                new LinkedHashMapEntry("cn=scarter,dc=example,dc=com").addAttribute("objectclass",
@@ -78,13 +76,10 @@
            }
        });
        try {
            writer = new ConnectionEntryWriter(connection);
        try (ConnectionEntryWriter writer = new ConnectionEntryWriter(connection)) {
            writer.writeComment("This is a test for the ConnectionEntryWriter");
            writer.writeEntry(entry);
            verify(connection, times(1)).add(any(Entry.class));
        } finally {
            writer.close();
        }
    }
@@ -95,12 +90,8 @@
     */
    @Test(expectedExceptions = NullPointerException.class)
    public final void testConnectionEntryWriterDoesntAllowNullComment() throws Exception {
        ConnectionEntryWriter writer = null;
        try {
            writer = new ConnectionEntryWriter(null);
        try (ConnectionEntryWriter writer = new ConnectionEntryWriter(null)) {
            writer.writeComment(null);
        } finally {
            writer.close();
        }
    }
@@ -111,11 +102,8 @@
     */
    @Test(expectedExceptions = NullPointerException.class)
    public final void testConnectionEntryWriterDoesntAllowNull() throws Exception {
        ConnectionEntryWriter writer = null;
        try {
            writer = new ConnectionEntryWriter(null);
        } finally {
            writer.close();
        try (ConnectionEntryWriter writer = new ConnectionEntryWriter(null)) {
            // nothing to do
        }
    }
@@ -128,11 +116,9 @@
    @Test
    public final void testConnectionEntryWriterClose() throws Exception {
        Connection connection = mock(Connection.class);
        ConnectionEntryWriter writer = null;
        try {
            writer = new ConnectionEntryWriter(connection);
        try (ConnectionEntryWriter writer = new ConnectionEntryWriter(connection)) {
            // nothing to do
        } finally {
            writer.close();
            verify(connection, times(1)).close();
        }
    }
opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFTestCase.java
@@ -22,9 +22,8 @@
 *
 *
 *      Copyright 2009-2010 Sun Microsystems, Inc.
 *      Portions copyright 2012-2015 ForgeRock AS.
 *      Portions copyright 2012-2016 ForgeRock AS.
 */
package org.forgerock.opendj.ldif;
import java.io.File;
@@ -684,13 +683,8 @@
     */
    @Test(expectedExceptions = NullPointerException.class)
    public final void testLdifNewEntryCollectionDoesntAllowNull() throws Exception {
        EntryReader resultReader = null;
        try {
            resultReader = LDIF.newEntryCollectionReader(null);
        try (EntryReader resultReader = LDIF.newEntryCollectionReader(null)) {
            resultReader.readEntry();
        } finally {
            resultReader.close();
        }
    }
@@ -739,13 +733,8 @@
     */
    @Test(expectedExceptions = NullPointerException.class)
    public final void testLdifNewEntryIteratorReaderDoesntAllowsNull() throws Exception {
        EntryReader resultReader = null;
        try {
            resultReader = LDIF.newEntryIteratorReader(null);
        try (EntryReader resultReader = LDIF.newEntryIteratorReader(null)) {
            resultReader.readEntry();
        } finally {
            resultReader.close();
        }
    }
opendj-sdk/opendj-doc-maven-plugin/src/main/java/org/forgerock/opendj/maven/doc/GenerateConfigurationReferenceMojo.java
@@ -21,7 +21,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2015 ForgeRock AS.
 *      Copyright 2015-2016 ForgeRock AS.
 */
package org.forgerock.opendj.maven.doc;
@@ -54,7 +54,7 @@
    /**
     * The path to the directory where the configuration reference should be written.
     * This path must be under {@code ${project.build.directory} }.
     * This path must be under <code>${project.build.directory}</code>.
     */
    @Parameter(defaultValue = "${project.build.directory}/site/configref")
    private String outputDirectory;
@@ -77,7 +77,7 @@
    /**
     * Creates the output directory where the configuration reference is written.
     * @throws MojoExecutionException   The output directory is not under {@code ${project.build.directory} }
     * @throws MojoExecutionException   The output directory is not under <code>${project.build.directory}</code>
     *                                  or could not be created.
     */
    private void createOutputDirectory() throws MojoExecutionException {
opendj-sdk/opendj-doc-maven-plugin/src/main/java/org/forgerock/opendj/maven/doc/GenerateGlobalAcisTableMojo.java
@@ -20,7 +20,7 @@
 *
 * CDDL HEADER END
 *
 *      Copyright 2015 ForgeRock AS.
 *      Copyright 2015-2016 ForgeRock AS.
 */
package org.forgerock.opendj.maven.doc;
@@ -67,9 +67,6 @@
    @Parameter(defaultValue = "${project.build.directory}/docbkx-sources/shared")
    private File outputDirectory;
    /** Holds descriptions for ACIs. */
    private Map<String, String> descriptions;
    /** Holds documentation for an ACI. */
    private class Aci {
        String name;
opendj-sdk/opendj-doc-maven-plugin/src/main/java/org/forgerock/opendj/maven/doc/GenerateMessageFileMojo.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2015 ForgeRock AS.
 *      Portions Copyright 2011-2016 ForgeRock AS.
 */
package org.forgerock.opendj.maven.doc;
@@ -361,10 +361,8 @@
    private void createOutputDirectory() throws IOException {
        File outputDir = new File(outputDirectory);
        if (outputDir != null && !outputDir.exists()) {
            if (!outputDir.mkdirs()) {
                throw new IOException("Failed to create output directory.");
            }
        if (!outputDir.exists() && !outputDir.mkdirs()) {
            throw new IOException("Failed to create output directory.");
        }
    }
opendj-sdk/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/ProxyBackend.java
@@ -22,9 +22,8 @@
 *
 *
 *      Copyright 2009-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011-2015 ForgeRock AS.
 *      Portions Copyright 2011-2016 ForgeRock AS.
 */
package org.forgerock.opendj.examples;
import java.util.concurrent.atomic.AtomicReference;
@@ -78,7 +77,6 @@
 * client connection. The following code illustrates how this may be achieved:
 *
 * <pre>
 *     {@code
 * final RequestHandlerFactory<LDAPClientContext, RequestContext> proxyFactory =
 *     new RequestHandlerFactory<LDAPClientContext, RequestContext>() {
 *         @Override