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

Jean-Noel Rouvignac
20.11.2014 7d7913228e6f52273f2fdada6822a380f95e0f8c
Autorefactored simplifying expressions:
- removed useless parentheses
- added parentheses to disambiguate expressions
- removed useless use of "this" keyword in method calls
- removed useless null checks in conjunction with use of instanceof operator


*.java:
Manually extracted local variables.

OperatingSystem.java:
Manually changed the code to use String.contains()
72 files modified
472 ■■■■ changed files
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/Argument.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/ArgumentGroup.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/MenuBuilder.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/TextTablePrinter.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/Utils.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandArgumentParserTestCase.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandTestCase.java 30 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/AbstractManagedObjectDefinition.java 10 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/DurationPropertyDefinition.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/DurationUnit.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/IntegerPropertyDefinition.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/SizePropertyDefinition.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/SizeUnit.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/ManagementContext.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/PropertyValueEditor.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ServerManagedObject.java 18 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ServerManagementContext.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/com/forgerock/opendj/ldap/extensions/PasswordPolicyStateExtendedRequest.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/com/forgerock/opendj/util/OperatingSystem.java 19 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/com/forgerock/opendj/util/StaticUtils.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1ByteSequenceReader.java 10 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1InputStreamReader.java 18 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/AVA.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/AbstractEntry.java 14 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeParser.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/Attributes.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/DN.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/Entries.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/Filter.java 33 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/GSERParser.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/GeneralizedTime.java 13 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/LDAPUrl.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/LinkedAttribute.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/CancelExtendedRequestImpl.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/WhoAmIExtendedResultImpl.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AttributeType.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AttributeTypeSyntaxImpl.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DITContentRuleSyntaxImpl.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DITStructureRule.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DITStructureRuleSyntaxImpl.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DoubleMetaphoneApproximateMatchingRuleImpl.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/FacsimileNumberSyntaxImpl.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/GuideSyntaxImpl.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/IntegerFirstComponentEqualityMatchingRuleImpl.java 6 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/LDAPSyntaxDescriptionSyntaxImpl.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRule.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRuleSyntaxImpl.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRuleUseSyntaxImpl.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/NameForm.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/NameFormSyntaxImpl.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/ObjectClass.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/ObjectClassSyntaxImpl.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/ObjectIdentifierFirstComponentEqualityMatchingRuleImpl.java 6 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/Syntax.java 10 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/TelexNumberSyntaxImpl.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIF.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldif/TemplateFile.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldif/TemplateTag.java 22 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFTestCase.java 14 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ASN1BufferReader.java 14 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ConnectionSecurityLayerFilter.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/UpdateGroup.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server/src/main/java/org/forgerock/opendj/server/setup/cli/SetupCli.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server/src/main/java/org/forgerock/opendj/server/setup/model/DataConfiguration.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server/src/main/java/org/forgerock/opendj/server/setup/model/Model.java 14 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server2x-adapter/src/main/java/org/forgerock/opendj/adapter/server2x/Adapters.java 13 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server2x-adapter/src/main/java/org/forgerock/opendj/adapter/server2x/Converters.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server2x-adapter/src/test/java/org/forgerock/opendj/adapter/server2x/AdaptersTestCase.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server2x-adapter/src/test/java/org/forgerock/opendj/adapter/server2x/ConvertersTestCase.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server3x-adapter/src/main/java/org/forgerock/opendj/adapter/server3x/Adapters.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server3x-adapter/src/test/java/org/forgerock/opendj/adapter/server3x/AdaptersTestCase.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server3x-adapter/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/Argument.java
@@ -153,12 +153,12 @@
        this.description = description;
        this.isValueSetByProperty = false;
        if ((shortIdentifier == null) && (longIdentifier == null)) {
        if (shortIdentifier == null && longIdentifier == null) {
            final LocalizableMessage message = ERR_ARG_NO_IDENTIFIER.get(name);
            throw new ArgumentException(message);
        }
        if (needsValue && (valuePlaceholder == null)) {
        if (needsValue && valuePlaceholder == null) {
            final LocalizableMessage message = ERR_ARG_NO_VALUE_PLACEHOLDER.get(name);
            throw new ArgumentException(message);
        }
@@ -457,7 +457,7 @@
     *         <CODE>false</CODE> if it does not have any values.
     */
    public boolean hasValue() {
        return (!values.isEmpty());
        return !values.isEmpty();
    }
    /**
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/ArgumentGroup.java
@@ -87,8 +87,8 @@
            // new argument should replace
            for (final Iterator<Argument> it = this.args.iterator(); it.hasNext();) {
                final Argument a = it.next();
                if (newShort != null && newShort.equals(a.getShortIdentifier()) || newLong != null
                        && newLong.equals(a.getLongIdentifier())) {
                if ((newShort != null && newShort.equals(a.getShortIdentifier()))
                        || (newLong != null && newLong.equals(a.getLongIdentifier()))) {
                    it.remove();
                    break;
                }
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/MenuBuilder.java
@@ -659,7 +659,7 @@
            callbacks.put(String.valueOf(i + 1), numericCallbacks.get(i));
            // Second column.
            if (useMultipleColumns && (j < sz)) {
            if (useMultipleColumns && j < sz) {
                nbuilder.appendCell(INFO_MENU_NUMERIC_OPTION.get(j + 1));
                for (LocalizableMessage field : numericFields.get(j)) {
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/TextTablePrinter.java
@@ -272,7 +272,7 @@
                            if (requestedSize == 0) {
                                // Calculate size based on requested actual size as a
                                // proportion of the total.
                                requestedSize = ((actualSize * available) / expandableColumnSize);
                                requestedSize = (actualSize * available) / expandableColumnSize;
                                columnWidths.set(i, requestedSize);
                            }
                        }
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/Utils.java
@@ -450,8 +450,8 @@
    public static boolean isCertificateException(Throwable t) {
        boolean returnValue = false;
        while (!returnValue && (t != null)) {
            returnValue = (t instanceof SSLHandshakeException) || (t instanceof GeneralSecurityException);
        while (!returnValue && t != null) {
            returnValue = t instanceof SSLHandshakeException || t instanceof GeneralSecurityException;
            t = t.getCause();
        }
@@ -530,7 +530,7 @@
            return file.canWrite();
        }
        final File parentFile = file.getParentFile();
        return (parentFile != null && parentFile.canWrite());
        return parentFile != null && parentFile.canWrite();
    }
@@ -575,7 +575,7 @@
     */
    private static boolean isOutOfMemory(Throwable t) {
        boolean isOutOfMemory = false;
        while (!isOutOfMemory && (t != null)) {
        while (!isOutOfMemory && t != null) {
            if (t instanceof OutOfMemoryError) {
                isOutOfMemory = true;
            } else if (t instanceof IOException) {
opendj-sdk/opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandArgumentParserTestCase.java
@@ -61,8 +61,7 @@
     */
    @BeforeClass
    public void setup() throws Exception {
        parser = new SubCommandArgumentParser(this.getClass().getName(), LocalizableMessage.raw("test description"),
                true);
        parser = new SubCommandArgumentParser(getClass().getName(), LocalizableMessage.raw("test description"), true);
        sc1 = new SubCommand(parser, "sub-command1", INFO_BACKUPDB_DESCRIPTION_BACKEND_ID.get());
        sc2 = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]",
opendj-sdk/opendj-cli/src/test/java/com/forgerock/opendj/cli/TestSubCommandTestCase.java
@@ -46,7 +46,7 @@
     */
    @Test
    public void testAllowsTrailingArgumentsFalse1() throws Exception {
        SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
        SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
                LocalizableMessage.raw("test description"), true);
        SubCommand sc = new SubCommand(parser, "sub-command1", LocalizableMessage.raw("XXX"));
        Assert.assertFalse(sc.allowsTrailingArguments());
@@ -60,7 +60,7 @@
     */
    @Test
    public void testAllowsTrailingArgumentsFalse2() throws Exception {
        SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
        SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
                LocalizableMessage.raw("test description"), true);
        SubCommand sc = new SubCommand(parser, "sub-command2", false, 0, 0, null, LocalizableMessage.raw("XXX"));
        Assert.assertFalse(sc.allowsTrailingArguments());
@@ -74,7 +74,7 @@
     */
    @Test
    public void testAllowsTrailingArgumentsTrue() throws Exception {
        SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
        SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
                LocalizableMessage.raw("test description"), true);
        SubCommand sc = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]",
                LocalizableMessage.raw("XXX"));
@@ -89,7 +89,7 @@
     */
    @Test
    public void testGetMaxTrailingArguments1() throws Exception {
        SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
        SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
                LocalizableMessage.raw("test description"), true);
        SubCommand sc = new SubCommand(parser, "sub-command1", LocalizableMessage.raw("XXX"));
        Assert.assertEquals(sc.getMaxTrailingArguments(), 0);
@@ -103,7 +103,7 @@
     */
    @Test
    public void testGetMaxTrailingArguments2() throws Exception {
        SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
        SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
                LocalizableMessage.raw("test description"), true);
        SubCommand sc = new SubCommand(parser, "sub-command2", false, 0, 0, null, LocalizableMessage.raw("XXX"));
        Assert.assertEquals(sc.getMaxTrailingArguments(), 0);
@@ -117,7 +117,7 @@
     */
    @Test
    public void testGetMaxTrailingArguments3() throws Exception {
        SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
        SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
                LocalizableMessage.raw("test description"), true);
        SubCommand sc = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]",
                LocalizableMessage.raw("XXX"));
@@ -132,7 +132,7 @@
     */
    @Test
    public void testGetMinTrailingArguments1() throws Exception {
        SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
        SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
                LocalizableMessage.raw("test description"), true);
        SubCommand sc = new SubCommand(parser, "sub-command1", LocalizableMessage.raw("XXX"));
        Assert.assertEquals(sc.getMinTrailingArguments(), 0);
@@ -146,7 +146,7 @@
     */
    @Test
    public void testGetMinTrailingArguments2() throws Exception {
        SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
        SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
                LocalizableMessage.raw("test description"), true);
        SubCommand sc = new SubCommand(parser, "sub-command2", false, 0, 0, null, LocalizableMessage.raw("XXX"));
        Assert.assertEquals(sc.getMinTrailingArguments(), 0);
@@ -160,7 +160,7 @@
     */
    @Test
    public void testGetMinTrailingArguments3() throws Exception {
        SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
        SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
                LocalizableMessage.raw("test description"), true);
        SubCommand sc = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]",
                LocalizableMessage.raw("XXX"));
@@ -175,7 +175,7 @@
     */
    @Test
    public void testGetTrailingArgumentsDisplayName1() throws Exception {
        SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
        SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
                LocalizableMessage.raw("test description"), true);
        SubCommand sc = new SubCommand(parser, "sub-command1", LocalizableMessage.raw("XXX"));
        Assert.assertNull(sc.getTrailingArgumentsDisplayName());
@@ -189,7 +189,7 @@
     */
    @Test
    public void testGetTrailingArgumentsDisplayName2() throws Exception {
        SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
        SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
                LocalizableMessage.raw("test description"), true);
        SubCommand sc = new SubCommand(parser, "sub-command2", false, 0, 0, null, LocalizableMessage.raw("XXX"));
        Assert.assertNull(sc.getTrailingArgumentsDisplayName());
@@ -203,7 +203,7 @@
     */
    @Test
    public void testGetTrailingArgumentsDisplayName3() throws Exception {
        SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
        SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
                LocalizableMessage.raw("test description"), true);
        SubCommand sc = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]",
                LocalizableMessage.raw("XXX"));
@@ -218,7 +218,7 @@
     */
    @Test
    public void testGetTrailingArguments1() throws Exception {
        SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
        SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
                LocalizableMessage.raw("test description"), true);
        SubCommand sc = new SubCommand(parser, "sub-command1", LocalizableMessage.raw("XXX"));
        parser.parseArguments(new String[] { "sub-command1" });
@@ -233,7 +233,7 @@
     */
    @Test
    public void testGetTrailingArguments2() throws Exception {
        SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
        SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
                LocalizableMessage.raw("test description"), true);
        SubCommand sc = new SubCommand(parser, "sub-command2", false, 0, 0, null, LocalizableMessage.raw("XXX"));
        parser.parseArguments(new String[] { "sub-command2" });
@@ -248,7 +248,7 @@
     */
    @Test
    public void testGetTrailingArguments3() throws Exception {
        SubCommandArgumentParser parser = new SubCommandArgumentParser(this.getClass().getName(),
        SubCommandArgumentParser parser = new SubCommandArgumentParser(getClass().getName(),
                LocalizableMessage.raw("test description"), true);
        SubCommand sc = new SubCommand(parser, "sub-command2", true, 2, 4, "args1 arg2 [arg3 arg4]",
                LocalizableMessage.raw("XXX"));
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/AbstractManagedObjectDefinition.java
@@ -330,7 +330,7 @@
     *             definition was not found.
     */
    public final AbstractManagedObjectDefinition<? extends C, ? extends S> getChild(String name) {
        if ((name == null) || (name.length() == 0)) {
        if (name == null || name.length() == 0) {
            throw new IllegalArgumentException("null or empty managed object name");
        }
@@ -444,7 +444,7 @@
     *             requested property definition was not found.
     */
    public final PropertyDefinition<?> getPropertyDefinition(String name) {
        if ((name == null) || (name.length() == 0)) {
        if (name == null || name.length() == 0) {
            throw new IllegalArgumentException("null or empty property name");
        }
@@ -481,7 +481,7 @@
     *             requested relation definition was not found.
     */
    public final RelationDefinition<?, ?> getRelationDefinition(String name) {
        if ((name == null) || (name.length() == 0)) {
        if (name == null || name.length() == 0) {
            throw new IllegalArgumentException("null or empty relation name");
        }
@@ -533,7 +533,7 @@
     *             found.
     */
    public final AggregationPropertyDefinition<?, ?> getAggregationPropertyDefinition(String name) {
        if ((name == null) || (name.length() == 0)) {
        if (name == null || name.length() == 0) {
            throw new IllegalArgumentException("null or empty aggregation property name");
        }
@@ -740,7 +740,7 @@
     *         the {@link TopCfgDefn}.
     */
    public final boolean isTop() {
        return (this instanceof TopCfgDefn);
        return this instanceof TopCfgDefn;
    }
    /**
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/DurationPropertyDefinition.java
@@ -403,7 +403,7 @@
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        if ((upperLimit != null) && (nvalue > upperLimit)) {
        if (upperLimit != null && nvalue > upperLimit) {
            throw PropertyException.illegalPropertyValueException(this, value);
        }
    }
@@ -451,7 +451,7 @@
        // Check the unit is in range - values must not be more granular
        // than the base unit.
        if ((ms % baseUnit.getDuration()) != 0) {
        if (ms % baseUnit.getDuration() != 0) {
            throw PropertyException.illegalPropertyValueException(this, value);
        }
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/DurationUnit.java
@@ -296,7 +296,7 @@
     * @return Returns milliseconds in this unit.
     */
    public double fromMilliSeconds(long duration) {
        return ((double) duration / sz);
        return (double) duration / sz;
    }
    /**
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/IntegerPropertyDefinition.java
@@ -239,7 +239,7 @@
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        if ((upperLimit != null) && (value > upperLimit)) {
        if (upperLimit != null && value > upperLimit) {
            throw PropertyException.illegalPropertyValueException(this, value);
        }
    }
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/SizePropertyDefinition.java
@@ -240,7 +240,7 @@
            throw PropertyException.illegalPropertyValueException(this, value);
        }
        if ((upperLimit != null) && (value > upperLimit)) {
        if (upperLimit != null && value > upperLimit) {
            throw PropertyException.illegalPropertyValueException(this, value);
        }
    }
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/SizeUnit.java
@@ -293,7 +293,7 @@
     * @return Returns size in this unit.
     */
    public double fromBytes(long amount) {
        return ((double) amount / sz);
        return (double) amount / sz;
    }
    /**
@@ -337,7 +337,7 @@
        if (value > Long.MAX_VALUE) {
            throw new NumberFormatException("number too big (exceeded long.MAX_VALUE");
        }
        return (long) (value);
        return (long) value;
    }
    /**
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/client/ManagementContext.java
@@ -409,7 +409,7 @@
     */
    @Override
    public final void close() {
        this.getDriver().close();
        getDriver().close();
    }
}
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/PropertyValueEditor.java
@@ -1759,7 +1759,7 @@
            builder.appendCell("*)");
            builder.appendCell(valuePrinter.print(pd, vl.get(i)));
            if (useMultipleColumns && (j < sz)) {
            if (useMultipleColumns && j < sz) {
                builder.appendCell();
                builder.appendCell("*)");
                builder.appendCell(valuePrinter.print(pd, vl.get(j)));
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ServerManagedObject.java
@@ -1123,7 +1123,7 @@
        extractIntermediateListener(ConfigAddListener configListener) {
        // @Checkstyle:on
        if (configListener instanceof ConfigAddListenerAdaptor) {
            ConfigAddListenerAdaptor<T> adaptor = ((ConfigAddListenerAdaptor<T>) configListener);
            ConfigAddListenerAdaptor<T> adaptor = (ConfigAddListenerAdaptor<T>) configListener;
            return Pair.of(adaptor, adaptor.getServerManagedObjectAddListener());
        }
        return Pair.empty();
@@ -1239,7 +1239,7 @@
                        int i = delayWrappers;
                        for (; i > 0; i--) {
                            wrappedListener = delayListener.getDelayedAddListener();
                            if (wrappedListener != null && wrappedListener instanceof DelayedConfigAddListener) {
                            if (wrappedListener instanceof DelayedConfigAddListener) {
                                delayListener = (DelayedConfigAddListener) configListener;
                            } else {
                                break;
@@ -1254,7 +1254,7 @@
                        ConfigAddListener delayedListener = delayListener.getDelayedAddListener();
                        if (delayedListener != null && delayedListener instanceof ConfigAddListenerAdaptor) {
                        if (delayedListener instanceof ConfigAddListenerAdaptor) {
                            ConfigAddListenerAdaptor<?> adaptor = (ConfigAddListenerAdaptor<?>) delayedListener;
                            ServerManagedObjectAddListener<?> l2 = adaptor.getServerManagedObjectAddListener();
                            if (l2 instanceof ServerManagedObjectAddListenerAdaptor<?>) {
@@ -1293,7 +1293,7 @@
                        int i = delayWrappers;
                        for (; i > 0; i--) {
                            wrappedListener = delayListener.getDelayedAddListener();
                            if (wrappedListener != null && wrappedListener instanceof DelayedConfigAddListener) {
                            if (wrappedListener instanceof DelayedConfigAddListener) {
                                delayListener = (DelayedConfigAddListener) l;
                            } else {
                                break;
@@ -1308,7 +1308,7 @@
                        ConfigDeleteListener delayedListener = delayListener.getDelayedDeleteListener();
                        if (delayedListener != null && delayedListener instanceof ConfigDeleteListenerAdaptor) {
                        if (delayedListener instanceof ConfigDeleteListenerAdaptor) {
                            ConfigDeleteListenerAdaptor<?> adaptor = (ConfigDeleteListenerAdaptor<?>) delayedListener;
                            ServerManagedObjectDeleteListener<?> l2 = adaptor.getServerManagedObjectDeleteListener();
                            if (l2 instanceof ServerManagedObjectDeleteListenerAdaptor<?>) {
@@ -1347,7 +1347,7 @@
                        int i = delayWrappers;
                        for (; i > 0; i--) {
                            wrappedListener = delayListener.getDelayedAddListener();
                            if (wrappedListener != null && wrappedListener instanceof DelayedConfigAddListener) {
                            if (wrappedListener instanceof DelayedConfigAddListener) {
                                delayListener = (DelayedConfigAddListener) configListener;
                            } else {
                                break;
@@ -1362,7 +1362,7 @@
                        ConfigAddListener delayedListener = delayListener.getDelayedAddListener();
                        if (delayedListener != null && delayedListener instanceof ConfigAddListenerAdaptor) {
                        if (delayedListener instanceof ConfigAddListenerAdaptor) {
                            ConfigAddListenerAdaptor<?> adaptor = (ConfigAddListenerAdaptor<?>) delayedListener;
                            if (adaptor.getServerManagedObjectAddListener() == listener) {
                                configRepository.deregisterAddListener(parentDN, configListener);
@@ -1396,7 +1396,7 @@
                        int i = delayWrappers;
                        for (; i > 0; i--) {
                            wrappedListener = delayListener.getDelayedAddListener();
                            if (wrappedListener != null && wrappedListener instanceof DelayedConfigAddListener) {
                            if (wrappedListener instanceof DelayedConfigAddListener) {
                                delayListener = (DelayedConfigAddListener) configListener;
                            } else {
                                break;
@@ -1411,7 +1411,7 @@
                        ConfigDeleteListener delayedListener = delayListener.getDelayedDeleteListener();
                        if (delayedListener != null && delayedListener instanceof ConfigDeleteListenerAdaptor) {
                        if (delayedListener instanceof ConfigDeleteListenerAdaptor) {
                            ConfigDeleteListenerAdaptor<?> adaptor = (ConfigDeleteListenerAdaptor<?>) delayedListener;
                            if (adaptor.getServerManagedObjectDeleteListener() == listener) {
                                configRepository.deregisterAddListener(parentDN, configListener);
opendj-sdk/opendj-config/src/main/java/org/forgerock/opendj/config/server/ServerManagementContext.java
@@ -575,7 +575,7 @@
        // Get the configuration entry.
        DN targetDN = DNBuilder.create(path);
        try {
            return (configRepository.getEntry(targetDN) != null);
            return configRepository.getEntry(targetDN) != null;
        } catch (ConfigException e) {
            // Assume it doesn't exist.
            return false;
opendj-sdk/opendj-core/src/main/java/com/forgerock/opendj/ldap/extensions/PasswordPolicyStateExtendedRequest.java
@@ -165,7 +165,7 @@
                final ExtendedRequest<?> request, final DecodeOptions options)
                throws DecodeException {
            final ByteString requestValue = request.getValue();
            if ((requestValue == null) || (requestValue.length() <= 0)) {
            if (requestValue == null || requestValue.length() <= 0) {
                throw DecodeException.error(ERR_PWPSTATE_EXTOP_NO_REQUEST_VALUE.get());
            }
            try {
opendj-sdk/opendj-core/src/main/java/com/forgerock/opendj/util/OperatingSystem.java
@@ -135,16 +135,17 @@
        }
        final String lowerName = osName.toLowerCase();
        if ((lowerName.indexOf("solaris") >= 0) || (lowerName.indexOf("sunos") >= 0)) {
        if (lowerName.contains("solaris") || lowerName.contains("sunos")) {
            return SOLARIS;
        } else if (lowerName.indexOf("linux") >= 0) {
        } else if (lowerName.contains("linux")) {
            return LINUX;
        } else if ((lowerName.indexOf("hp-ux") >= 0) || (lowerName.indexOf("hp ux") >= 0)
                || (lowerName.indexOf("hpux") >= 0)) {
        } else if (lowerName.contains("hp-ux")
                || lowerName.contains("hp ux")
                || lowerName.contains("hpux")) {
            return HPUX;
        } else if (lowerName.indexOf("aix") >= 0) {
        } else if (lowerName.contains("aix")) {
            return AIX;
        } else if (lowerName.indexOf("windows") >= 0) {
        } else if (lowerName.contains("windows")) {
            if (lowerName.indexOf("windows 7") != -1) {
                return WINDOWS7;
            } else if (lowerName.indexOf("vista") != -1) {
@@ -153,11 +154,11 @@
                return WINDOWS_SERVER_2008;
            }
            return WINDOWS;
        } else if ((lowerName.indexOf("freebsd") >= 0) || (lowerName.indexOf("free bsd") >= 0)) {
        } else if (lowerName.contains("freebsd") || lowerName.contains("free bsd")) {
            return FREEBSD;
        } else if ((lowerName.indexOf("macos x") >= 0) || (lowerName.indexOf("mac os x") >= 0)) {
        } else if (lowerName.contains("macos x") || lowerName.contains("mac os x")) {
            return MACOSX;
        } else if (lowerName.indexOf("z/os") >= 0) {
        } else if (lowerName.contains("z/os")) {
            return ZOS;
        }
        return UNKNOWN;
opendj-sdk/opendj-core/src/main/java/com/forgerock/opendj/util/StaticUtils.java
@@ -1510,7 +1510,7 @@
                }
            }
        } else {
            if ((throwable instanceof InvocationTargetException) && (throwable.getCause() != null)) {
            if (throwable instanceof InvocationTargetException && throwable.getCause() != null) {
                throwable = throwable.getCause();
            }
            // add class name and message of the exception
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1ByteSequenceReader.java
@@ -180,7 +180,7 @@
        // Read the header if haven't done so already
        peekLength();
        if ((peekLength < 1) || (peekLength > 4)) {
        if (peekLength < 1 || peekLength > 4) {
            final LocalizableMessage message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
            throw DecodeException.fatalError(message);
        }
@@ -195,7 +195,7 @@
        // Read the header if haven't done so already
        peekLength();
        if ((peekLength < 1) || (peekLength > 8)) {
        if (peekLength < 1 || peekLength > 8) {
            final LocalizableMessage message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
            throw DecodeException.fatalError(message);
        }
@@ -208,7 +208,7 @@
            long longValue = 0;
            for (int i = 0; i < peekLength; i++) {
                final int readByte = reader.get();
                if ((i == 0) && (readByte < 0)) {
                if (i == 0 && readByte < 0) {
                    longValue = 0xFFFFFFFFFFFFFFFFL;
                }
                longValue = (longValue << 8) | (readByte & 0xFF);
@@ -220,7 +220,7 @@
            int intValue = 0;
            for (int i = 0; i < peekLength; i++) {
                final int readByte = reader.get();
                if ((i == 0) && (readByte < 0)) {
                if (i == 0 && readByte < 0) {
                    intValue = 0xFFFFFFFF;
                }
                intValue = (intValue << 8) | (readByte & 0xFF);
@@ -387,7 +387,7 @@
        // Make sure that the element is not larger than the maximum allowed
        // message size.
        if ((maxElementSize > 0) && (peekLength > maxElementSize)) {
        if (maxElementSize > 0 && peekLength > maxElementSize) {
            final LocalizableMessage message =
                    ERR_LDAP_CLIENT_DECODE_MAX_REQUEST_SIZE_EXCEEDED
                            .get(peekLength, maxElementSize);
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/io/ASN1InputStreamReader.java
@@ -207,7 +207,7 @@
        // Read the header if haven't done so already
        peekLength();
        if ((peekLength < 1) || (peekLength > 4)) {
        if (peekLength < 1 || peekLength > 4) {
            final LocalizableMessage message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
            throw DecodeException.fatalError(message);
        }
@@ -222,7 +222,7 @@
        // Read the header if haven't done so already
        peekLength();
        if ((peekLength < 1) || (peekLength > 8)) {
        if (peekLength < 1 || peekLength > 8) {
            final LocalizableMessage message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
            throw DecodeException.fatalError(message);
        }
@@ -236,7 +236,7 @@
                            ERR_ASN1_INTEGER_TRUNCATED_VALUE.get(peekLength);
                    throw DecodeException.fatalError(message);
                }
                if ((i == 0) && (((byte) readByte) < 0)) {
                if (i == 0 && ((byte) readByte) < 0) {
                    longValue = 0xFFFFFFFFFFFFFFFFL;
                }
                longValue = (longValue << 8) | (readByte & 0xFF);
@@ -253,7 +253,7 @@
                            ERR_ASN1_INTEGER_TRUNCATED_VALUE.get(peekLength);
                    throw DecodeException.fatalError(message);
                }
                if ((i == 0) && (((byte) readByte) < 0)) {
                if (i == 0 && ((byte) readByte) < 0) {
                    intValue = 0xFFFFFFFF;
                }
                intValue = (intValue << 8) | (readByte & 0xFF);
@@ -464,7 +464,7 @@
        // Make sure that the element is not larger than the maximum allowed
        // message size.
        if ((maxElementSize > 0) && (peekLength > maxElementSize)) {
        if (maxElementSize > 0 && peekLength > maxElementSize) {
            final LocalizableMessage message =
                    ERR_LDAP_CLIENT_DECODE_MAX_REQUEST_SIZE_EXCEEDED
                            .get(peekLength, maxElementSize);
@@ -490,7 +490,7 @@
     */
    private boolean needFirstLengthByteState(final boolean isBlocking,
            final boolean throwEofException) throws IOException {
        if (!isBlocking && (in.available() <= 0)) {
        if (!isBlocking && in.available() <= 0) {
            return false;
        }
@@ -502,7 +502,7 @@
            }
            return false;
        }
        peekLength = (readByte & 0x7F);
        peekLength = readByte & 0x7F;
        if (peekLength != readByte) {
            lengthBytesNeeded = peekLength;
            if (lengthBytesNeeded > 4) {
@@ -535,7 +535,7 @@
        // Make sure that the element is not larger than the maximum allowed
        // message size.
        if ((maxElementSize > 0) && (peekLength > maxElementSize)) {
        if (maxElementSize > 0 && peekLength > maxElementSize) {
            final LocalizableMessage message =
                    ERR_LDAP_CLIENT_DECODE_MAX_REQUEST_SIZE_EXCEEDED
                            .get(peekLength, maxElementSize);
@@ -562,7 +562,7 @@
    private boolean needTypeState(final boolean isBlocking, final boolean throwEofException)
            throws IOException {
        // Read just the type.
        if (!isBlocking && (in.available() <= 0)) {
        if (!isBlocking && in.available() <= 0) {
            return false;
        }
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/AVA.java
@@ -152,7 +152,7 @@
        if (str.length() > 0) {
            char c = str.charAt(0);
            int startPos = 0;
            if ((c == ' ') || (c == '#')) {
            if (c == ' ' || c == '#') {
                builder.append('\\');
                builder.append(c);
                startPos = 1;
@@ -190,7 +190,7 @@
        }
        int pos = 0;
        final int arrayLength = (length / 2);
        final int arrayLength = length / 2;
        final byte[] hexArray = new byte[arrayLength];
        for (int i = 0; i < arrayLength; i++) {
            switch (hexBuffer.charAt(pos++)) {
@@ -516,7 +516,7 @@
                                ERR_ATTR_SYNTAX_DN_HEX_VALUE_TOO_SHORT.get(reader.getString());
                        throw new LocalizedIllegalArgumentException(message);
                    }
                } else if ((c == ' ') || (c == ',') || (c == ';')) {
                } else if (c == ' ' || c == ',' || c == ';') {
                    // This denotes the end of the value.
                    break;
                } else {
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/AbstractEntry.java
@@ -103,14 +103,14 @@
            return true;
        } else if (object instanceof Entry) {
            final Entry other = (Entry) object;
            if (!this.getName().equals(other.getName())) {
            if (!getName().equals(other.getName())) {
                return false;
            }
            // Distinguished name is the same, compare attributes.
            if (this.getAttributeCount() != other.getAttributeCount()) {
            if (getAttributeCount() != other.getAttributeCount()) {
                return false;
            }
            for (final Attribute attribute : this.getAllAttributes()) {
            for (final Attribute attribute : getAllAttributes()) {
                final Attribute otherAttribute =
                        other.getAttribute(attribute.getAttributeDescription());
                if (!attribute.equals(otherAttribute)) {
@@ -154,8 +154,8 @@
    @Override
    public int hashCode() {
        int hashCode = this.getName().hashCode();
        for (final Attribute attribute : this.getAllAttributes()) {
        int hashCode = getName().hashCode();
        for (final Attribute attribute : getAllAttributes()) {
            hashCode += attribute.hashCode();
        }
        return hashCode;
@@ -245,10 +245,10 @@
    public String toString() {
        final StringBuilder builder = new StringBuilder();
        builder.append('"');
        builder.append(this.getName());
        builder.append(getName());
        builder.append("\":{");
        boolean firstValue = true;
        for (final Attribute attribute : this.getAllAttributes()) {
        for (final Attribute attribute : getAllAttributes()) {
            if (!firstValue) {
                builder.append(',');
            }
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/AttributeParser.java
@@ -85,7 +85,7 @@
    }
    private static boolean isEmpty(final Attribute attribute) {
        return (attribute == null) || attribute.isEmpty();
        return attribute == null || attribute.isEmpty();
    }
    private final Attribute attribute;
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/Attributes.java
@@ -352,7 +352,7 @@
        @Override
        public boolean equals(final Object object) {
            return (object == this || attribute.equals(object));
            return object == this || attribute.equals(object);
        }
        @Override
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/DN.java
@@ -916,12 +916,12 @@
     * @return The normalized string representation of the provided DN.
     */
    public String toNormalizedString() {
        final StringBuilder builder = new StringBuilder(this.size());
        final StringBuilder builder = new StringBuilder(size());
        if (rdn() == null) {
            return builder.toString();
        }
        int i = this.size() - 1;
        int i = size() - 1;
        normalizeRDN(builder, parent(i).rdn());
        for (i--; i >= 0; i--) {
            final RDN rdn = parent(i).rdn();
@@ -1013,7 +1013,7 @@
                }
                char c = str.charAt(0);
                int startPos = 0;
                if ((c == ' ') || (c == '#')) {
                if (c == ' ' || c == '#') {
                    builder.append('\\');
                    builder.append(c);
                    startPos = 1;
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/Entries.java
@@ -246,7 +246,7 @@
        /** {@inheritDoc} */
        @Override
        public boolean equals(final Object object) {
            return (object == this || entry.equals(object));
            return object == this || entry.equals(object);
        }
        @Override
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/Filter.java
@@ -490,7 +490,7 @@
     * @return The newly created {@code and} filter.
     */
    public static Filter and(final Filter... subFilters) {
        if ((subFilters == null) || (subFilters.length == 0)) {
        if (subFilters == null || subFilters.length == 0) {
            // RFC 4526 - TRUE filter.
            return alwaysTrue();
        } else if (subFilters.length == 1) {
@@ -771,7 +771,7 @@
     * @return The newly created {@code or} filter.
     */
    public static Filter or(final Filter... subFilters) {
        if ((subFilters == null) || (subFilters.length == 0)) {
        if (subFilters == null || subFilters.length == 0) {
            // RFC 4526 - FALSE filter.
            return alwaysFalse();
        } else if (subFilters.length == 1) {
@@ -829,12 +829,13 @@
            final Object initialSubstring, final Collection<?> anySubstrings,
            final Object finalSubstring) {
        Reject.ifNull(attributeDescription);
        Reject.ifFalse((initialSubstring != null) || (finalSubstring != null)
                || ((anySubstrings != null) && (anySubstrings.size() > 0)),
                "at least one substring (initial, any or final)" + " must be specified");
        Reject.ifFalse(initialSubstring != null
                || finalSubstring != null
                || (anySubstrings != null && anySubstrings.size() > 0),
                "at least one substring (initial, any or final) must be specified");
        List<ByteString> anySubstringList;
        if ((anySubstrings == null) || (anySubstrings.size() == 0)) {
        if (anySubstrings == null || anySubstrings.size() == 0) {
            anySubstringList = Collections.emptyList();
        } else if (anySubstrings.size() == 1) {
            final Object anySubstring = anySubstrings.iterator().next();
@@ -889,7 +890,7 @@
        // If the filter is enclosed in a pair of single quotes it
        // is invalid (issue #1024).
        if ((string.length() > 1) && string.startsWith("'") && string.endsWith("'")) {
        if (string.length() > 1 && string.startsWith("'") && string.endsWith("'")) {
            final LocalizableMessage message = ERR_LDAP_FILTER_ENCLOSED_IN_APOSTROPHES.get(string);
            throw new LocalizedIllegalArgumentException(message);
        }
@@ -1040,7 +1041,7 @@
            if (valueBytes[i] == 0x5C /* The backslash character */) {
                // The next two bytes must be the hex characters that comprise
                // the binary value.
                if ((i + 2) >= valueBytes.length) {
                if (i + 2 >= valueBytes.length) {
                    final LocalizableMessage message =
                            ERR_LDAP_FILTER_INVALID_ESCAPED_BYTE.get(string, errorIndex + i + 1);
                    throw new LocalizedIllegalArgumentException(message);
@@ -1436,7 +1437,7 @@
        // Make sure that the filter has at least one of an attribute
        // description and/or a matching rule ID.
        if ((attributeDescription == null) && (matchingRule == null)) {
        if (attributeDescription == null && matchingRule == null) {
            final LocalizableMessage message =
                    ERR_LDAP_FILTER_EXTENSIBLE_MATCH_NO_AD_OR_MR.get(string, startIndex);
            throw new LocalizedIllegalArgumentException(message);
@@ -1563,13 +1564,13 @@
            // TODO: this is a bit overkill - it will escape all non-ascii
            // chars!
            final byte b = value.byteAt(i);
            if (((b & 0x7F) != b) || // Not 7-bit clean
                    (b <= 0x1F) || // Below the printable character range
                    (b == 0x28) || // Open parenthesis
                    (b == 0x29) || // Close parenthesis
                    (b == 0x2A) || // Asterisk
                    (b == 0x5C) || // Backslash
                    (b == 0x7F) /* Delete character */) {
            if (((b & 0x7F) != b) // Not 7-bit clean
                    || b <= 0x1F  // Below the printable character range
                    || b == 0x28  // Open parenthesis
                    || b == 0x29  // Close parenthesis
                    || b == 0x2A  // Asterisk
                    || b == 0x5C  // Backslash
                    || b == 0x7F  /* Delete character */) {
                builder.append('\\');
                builder.append(byteToHex(b));
            } else {
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/GSERParser.java
@@ -161,7 +161,7 @@
     * <code>false</code> otherwise.
     */
    public boolean hasNext() {
        return (pos < length);
        return pos < length;
    }
    /**
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/GeneralizedTime.java
@@ -25,8 +25,6 @@
 */
package org.forgerock.opendj.ldap;
import static com.forgerock.opendj.ldap.CoreMessages.*;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
@@ -37,6 +35,8 @@
import org.forgerock.i18n.LocalizedIllegalArgumentException;
import org.forgerock.util.Reject;
import static com.forgerock.opendj.ldap.CoreMessages.*;
/**
 * An LDAP generalized time as defined in RFC 4517. This class facilitates
 * parsing of generalized time values to and from {@link Date} and
@@ -357,7 +357,7 @@
        case '-':
            // These are fine only if there are exactly two or four more
            // digits that specify a valid offset.
            if ((length == 13) || (length == 15)) {
            if (length == 13 || length == 15) {
                final TimeZone tz = getTimeZoneForOffset(valueString, 10);
                return createTime(valueString, year, month, day, hour, minute, second, tz);
            } else {
@@ -427,7 +427,7 @@
        case '-':
            // These are fine only if there are exactly two or four more
            // digits that specify a valid offset.
            if ((length == 15) || (length == 17)) {
            if (length == 15 || length == 17) {
                final TimeZone tz = getTimeZoneForOffset(valueString, 12);
                return createTime(valueString, year, month, day, hour, minute, second, tz);
            } else {
@@ -466,7 +466,7 @@
        case '-':
            // These are fine only if there are exactly two or four more
            // digits that specify a valid offset.
            if ((length == 17) || (length == 19)) {
            if (length == 17 || length == 19) {
                final TimeZone tz = getTimeZoneForOffset(valueString, 14);
                return createTime(valueString, year, month, day, hour, minute, second, tz);
            } else {
@@ -684,7 +684,8 @@
     */
    private static TimeZone getTimeZoneForOffset(final String value, final int startPos) {
        final String offSetStr = value.substring(startPos);
        if ((offSetStr.length() != 3) && (offSetStr.length() != 5)) {
        final int len = offSetStr.length();
        if (len != 3 && len != 5) {
            final LocalizableMessage message =
                    WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_OFFSET.get(value, offSetStr);
            throw new LocalizedIllegalArgumentException(message);
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/LDAPUrl.java
@@ -497,7 +497,7 @@
        final StringBuilder builder = new StringBuilder();
        if (hostPortIdx < 0) {
            // We got anything here like the host and port?
            if (urlLength > (schemeIdx + 3)) {
            if (urlLength > schemeIdx + 3) {
                final String hostAndPort = urlString.substring(schemeIdx + 3, urlLength);
                port = parseHostPort(urlString, hostAndPort, builder);
                host = builder.toString();
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/LinkedAttribute.java
@@ -89,7 +89,7 @@
        @Override
        boolean add(final LinkedAttribute attribute, final ByteString value) {
            final ByteString normalizedValue = normalizeValue(attribute, value);
            return (attribute.multipleValues.put(normalizedValue, value) == null);
            return attribute.multipleValues.put(normalizedValue, value) == null;
        }
        @Override
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/requests/CancelExtendedRequestImpl.java
@@ -60,7 +60,7 @@
        public CancelExtendedRequest decodeExtendedRequest(final ExtendedRequest<?> request,
                final DecodeOptions options) throws DecodeException {
            final ByteString requestValue = request.getValue();
            if ((requestValue == null) || (requestValue.length() <= 0)) {
            if (requestValue == null || requestValue.length() <= 0) {
                throw DecodeException.error(ERR_EXTOP_CANCEL_NO_REQUEST_VALUE.get());
            }
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/responses/WhoAmIExtendedResultImpl.java
@@ -71,7 +71,7 @@
    @Override
    public boolean hasValue() {
        return (authorizationID != null);
        return authorizationID != null;
    }
    @Override
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AttributeType.java
@@ -804,7 +804,7 @@
            warnings.add(message);
        }
        return (isValid = true);
        return isValid = true;
    }
    private void failValidation(final List<AttributeType> invalidSchemaElements,
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AttributeTypeSyntaxImpl.java
@@ -83,10 +83,9 @@
            // then that is an error.
            final char c = reader.read();
            if (c != '(') {
                final LocalizableMessage message =
                        ERR_ATTR_SYNTAX_ATTRTYPE_EXPECTED_OPEN_PARENTHESIS.get(definition, (reader
                                .pos() - 1), String.valueOf(c));
                final DecodeException e = DecodeException.error(message);
                final DecodeException e = DecodeException.error(
                    ERR_ATTR_SYNTAX_ATTRTYPE_EXPECTED_OPEN_PARENTHESIS.get(
                        definition, reader.pos() - 1, String.valueOf(c)));
                logger.debug(LocalizableMessage.raw("%s", e));
                throw e;
            }
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DITContentRuleSyntaxImpl.java
@@ -85,9 +85,8 @@
            // then that is an error.
            final char c = reader.read();
            if (c != '(') {
                final LocalizableMessage message =
                        ERR_ATTR_SYNTAX_DCR_EXPECTED_OPEN_PARENTHESIS.get(definition, (reader.pos() - 1), c);
                final DecodeException e = DecodeException.error(message);
                final DecodeException e = DecodeException.error(
                        ERR_ATTR_SYNTAX_DCR_EXPECTED_OPEN_PARENTHESIS.get(definition, reader.pos() - 1, c));
                logger.debug(LocalizableMessage.raw("%s", e));
                throw e;
            }
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DITStructureRule.java
@@ -293,7 +293,7 @@
        }
        superiorRules = Collections.unmodifiableSet(superiorRules);
        return (isValid = true);
        return isValid = true;
    }
    private void failValidation(final List<DITStructureRule> invalidSchemaElements,
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DITStructureRuleSyntaxImpl.java
@@ -84,9 +84,8 @@
            // then that is an error.
            final char c = reader.read();
            if (c != '(') {
                final LocalizableMessage message =
                        ERR_ATTR_SYNTAX_DSR_EXPECTED_OPEN_PARENTHESIS.get(definition, (reader.pos() - 1), c);
                final DecodeException e = DecodeException.error(message);
                final DecodeException e = DecodeException.error(
                        ERR_ATTR_SYNTAX_DSR_EXPECTED_OPEN_PARENTHESIS.get(definition, reader.pos() - 1, c));
                logger.debug(LocalizableMessage.raw("%s", e));
                throw e;
            }
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/DoubleMetaphoneApproximateMatchingRuleImpl.java
@@ -228,7 +228,7 @@
                if (posPlusOne == 'C' && !(pos == 1 && valueString.charAt(0) == 'M')) {
                    if (((posPlusTwo = valueString.charAt(pos + 2)) == 'I' || posPlusTwo == 'E' || posPlusTwo == 'H')
                            && !(posPlusTwo == 'H' && valueString.charAt(pos + 3) == 'U')) {
                        if (pos == 1 && valueString.charAt(pos - 1) == 'A'
                        if ((pos == 1 && valueString.charAt(pos - 1) == 'A')
                                || hasSubstring(valueString, pos - 1, "UCCEE")
                                || hasSubstring(valueString, pos - 1, "UCCES")) {
                            // Values like "accident", "accede", and "succeed".
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/FacsimileNumberSyntaxImpl.java
@@ -168,7 +168,7 @@
                final String paramStr = valueString.substring(paramStartPos, pos);
                if (!ALLOWED_FAX_PARAMETERS.contains(paramStr)) {
                    invalidReason.append(ERR_ATTR_SYNTAX_FAXNUMBER_ILLEGAL_PARAMETER.get(
                            valueString, paramStr, paramStartPos, (pos - 1)));
                            valueString, paramStr, paramStartPos, pos - 1));
                    return false;
                }
@@ -180,8 +180,8 @@
        // make sure it is valid.
        final String paramStr = valueString.substring(paramStartPos);
        if (!ALLOWED_FAX_PARAMETERS.contains(paramStr)) {
            invalidReason.append(ERR_ATTR_SYNTAX_FAXNUMBER_ILLEGAL_PARAMETER.get(valueString,
                    paramStr, paramStartPos, (pos - 1)));
            invalidReason.append(ERR_ATTR_SYNTAX_FAXNUMBER_ILLEGAL_PARAMETER.get(
                    valueString, paramStr, paramStartPos, pos - 1));
            return false;
        }
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/GuideSyntaxImpl.java
@@ -99,7 +99,7 @@
                                        invalidReason);
                            } else {
                                invalidReason.append(ERR_ATTR_SYNTAX_GUIDE_ILLEGAL_CHAR.get(
                                        valueStr, criteria, c, (i + 1)));
                                        valueStr, criteria, c, i + 1));
                                return false;
                            }
                        }
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/IntegerFirstComponentEqualityMatchingRuleImpl.java
@@ -85,10 +85,8 @@
        // If it is not, then that is an error.
        final char c = reader.read();
        if (c != '(') {
            final LocalizableMessage message =
                    ERR_ATTR_SYNTAX_EXPECTED_OPEN_PARENTHESIS.get(definition, (reader.pos() - 1),
                            String.valueOf(c));
            throw DecodeException.error(message);
            throw DecodeException.error(ERR_ATTR_SYNTAX_EXPECTED_OPEN_PARENTHESIS.get(
                    definition, reader.pos() - 1, c));
        }
        // Skip over any spaces immediately following the opening parenthesis.
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/LDAPSyntaxDescriptionSyntaxImpl.java
@@ -92,9 +92,8 @@
            // then that is an error.
            final char c = reader.read();
            if (c != '(') {
                final LocalizableMessage message =
                        ERR_ATTR_SYNTAX_ATTRSYNTAX_EXPECTED_OPEN_PARENTHESIS.get(definition, (reader.pos() - 1), c);
                final DecodeException e = DecodeException.error(message);
                final DecodeException e = DecodeException.error(
                        ERR_ATTR_SYNTAX_ATTRSYNTAX_EXPECTED_OPEN_PARENTHESIS.get(definition, reader.pos() - 1, c));
                logger.debug(LocalizableMessage.raw("%s", e));
                throw e;
            }
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRule.java
@@ -80,7 +80,7 @@
        Builder(final String oid, final SchemaBuilder builder) {
            super(builder);
            this.oid(oid);
            oid(oid);
        }
        /**
@@ -89,7 +89,7 @@
         * @return The parent schema builder.
         */
        public SchemaBuilder addToSchemaOverwrite() {
            return this.getSchemaBuilder().addMatchingRule(new MatchingRule(this), true);
            return getSchemaBuilder().addMatchingRule(new MatchingRule(this), true);
        }
        /**
@@ -101,7 +101,7 @@
         *             If there is an existing matching rule with the same numeric OID.
         */
        public SchemaBuilder addToSchema() {
            return this.getSchemaBuilder().addMatchingRule(new MatchingRule(this), false);
            return getSchemaBuilder().addMatchingRule(new MatchingRule(this), false);
        }
        @Override
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRuleSyntaxImpl.java
@@ -99,8 +99,7 @@
            final char c = reader.read();
            if (c != '(') {
                final LocalizableMessage message =
                        ERR_ATTR_SYNTAX_MR_EXPECTED_OPEN_PARENTHESIS.get(definition,
                                (reader.pos() - 1), c);
                        ERR_ATTR_SYNTAX_MR_EXPECTED_OPEN_PARENTHESIS.get(definition, reader.pos() - 1, c);
                final DecodeException e = DecodeException.error(message);
                logger.debug(LocalizableMessage.raw("%s", e));
                throw e;
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRuleUseSyntaxImpl.java
@@ -103,8 +103,7 @@
            final char c = reader.read();
            if (c != '(') {
                final LocalizableMessage message =
                        ERR_ATTR_SYNTAX_MRUSE_EXPECTED_OPEN_PARENTHESIS.get(definition,
                                (reader.pos() - 1), c);
                        ERR_ATTR_SYNTAX_MRUSE_EXPECTED_OPEN_PARENTHESIS.get(definition, reader.pos() - 1, c);
                final DecodeException e = DecodeException.error(message);
                logger.debug(LocalizableMessage.raw("%s", e));
                throw e;
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/NameForm.java
@@ -74,7 +74,7 @@
        Builder(final String oid, final SchemaBuilder builder) {
            super(builder);
            this.oid(oid);
            oid(oid);
        }
        /**
@@ -84,7 +84,7 @@
         * @return The parent schema builder.
         */
        public SchemaBuilder addToSchemaOverwrite() {
            return this.getSchemaBuilder().addNameForm(new NameForm(this), true);
            return getSchemaBuilder().addNameForm(new NameForm(this), true);
        }
        /**
@@ -98,7 +98,7 @@
         *             OID.
         */
        public SchemaBuilder addToSchema() {
            return this.getSchemaBuilder().addNameForm(new NameForm(this), false);
            return getSchemaBuilder().addNameForm(new NameForm(this), false);
        }
        @Override
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/NameFormSyntaxImpl.java
@@ -89,8 +89,7 @@
            final char c = reader.read();
            if (c != '(') {
                final LocalizableMessage message =
                        ERR_ATTR_SYNTAX_NAME_FORM_EXPECTED_OPEN_PARENTHESIS.get(definition, (reader
                                .pos() - 1), c);
                        ERR_ATTR_SYNTAX_NAME_FORM_EXPECTED_OPEN_PARENTHESIS.get(definition, reader.pos() - 1, c);
                final DecodeException e = DecodeException.error(message);
                logger.debug(LocalizableMessage.raw("%s", e));
                throw e;
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/ObjectClass.java
@@ -657,7 +657,7 @@
        requiredAttributes = Collections.unmodifiableSet(requiredAttributes);
        superiorClasses = Collections.unmodifiableSet(superiorClasses);
        return (isValid = true);
        return isValid = true;
    }
    private void failValidation(final List<ObjectClass> invalidSchemaElements,
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/ObjectClassSyntaxImpl.java
@@ -87,8 +87,7 @@
            final char c = reader.read();
            if (c != '(') {
                final LocalizableMessage message =
                        ERR_ATTR_SYNTAX_OBJECTCLASS_EXPECTED_OPEN_PARENTHESIS1.get(definition,
                                (reader.pos() - 1), c);
                        ERR_ATTR_SYNTAX_OBJECTCLASS_EXPECTED_OPEN_PARENTHESIS1.get(definition, reader.pos() - 1, c);
                final DecodeException e = DecodeException.error(message);
                logger.debug(LocalizableMessage.raw("%s", e));
                throw e;
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/ObjectIdentifierFirstComponentEqualityMatchingRuleImpl.java
@@ -77,10 +77,8 @@
        // If it is not, then that is an error.
        final char c = reader.read();
        if (c != '(') {
            final LocalizableMessage message =
                    ERR_ATTR_SYNTAX_EXPECTED_OPEN_PARENTHESIS.get(definition, (reader.pos() - 1),
                            String.valueOf(c));
            throw DecodeException.error(message);
            throw DecodeException.error(ERR_ATTR_SYNTAX_EXPECTED_OPEN_PARENTHESIS.get(
                    definition, reader.pos() - 1, c));
        }
        // Skip over any spaces immediately following the opening parenthesis.
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/Syntax.java
@@ -71,7 +71,7 @@
        Builder(final String oid, final SchemaBuilder builder) {
            super(builder);
            this.oid(oid);
            oid(oid);
        }
        /**
@@ -80,7 +80,7 @@
         * @return The parent schema builder.
         */
        public SchemaBuilder addToSchemaOverwrite() {
            return this.getSchemaBuilder().addSyntax(new Syntax(this), true);
            return getSchemaBuilder().addSyntax(new Syntax(this), true);
        }
        /**
@@ -92,7 +92,7 @@
         *             If there is an existing syntax with the same numeric OID.
         */
        public SchemaBuilder addToSchema() {
            return this.getSchemaBuilder().addSyntax(new Syntax(this), false);
            return getSchemaBuilder().addSyntax(new Syntax(this), false);
        }
        /**
@@ -105,9 +105,9 @@
         */
        SchemaBuilder addToSchema(final boolean overwrite) {
            if (overwrite) {
                return this.addToSchemaOverwrite();
                return addToSchemaOverwrite();
            }
            return this.addToSchema();
            return addToSchema();
        }
        @Override
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/TelexNumberSyntaxImpl.java
@@ -125,8 +125,7 @@
        // The next character must be a printable string character.
        c = valueString.charAt(pos++);
        if (!PrintableStringSyntaxImpl.isPrintableCharacter(c)) {
            invalidReason.append(ERR_ATTR_SYNTAX_TELEX_NOT_PRINTABLE.get(valueString, String
                    .valueOf(c), (pos - 1)));
            invalidReason.append(ERR_ATTR_SYNTAX_TELEX_NOT_PRINTABLE.get(valueString, c, pos - 1));
            return false;
        }
@@ -155,7 +154,7 @@
        c = valueString.charAt(pos++);
        if (!PrintableStringSyntaxImpl.isPrintableCharacter(c)) {
            invalidReason.append(ERR_ATTR_SYNTAX_TELEX_NOT_PRINTABLE.get(valueString, String
                    .valueOf(c), (pos - 1)));
                    .valueOf(c), pos - 1));
            return false;
        }
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIF.java
@@ -187,7 +187,7 @@
            @Override
            public boolean hasNext() {
                return (sourceEntry != null || targetEntry != null);
                return sourceEntry != null || targetEntry != null;
            }
            @Override
@@ -535,7 +535,7 @@
                                // @formatter:off
                                final Iterator<Map.Entry<byte[], byte[]>> i =
                                    entries.subMap(changeNormDN,
                                        getBytes((changeDN.child(RDN.maxValue())).
                                        getBytes(changeDN.child(RDN.maxValue()).
                                                toNormalizedString())).entrySet().iterator();
                                // @formatter:on
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldif/TemplateFile.java
@@ -456,7 +456,7 @@
            final String line = replaceConstants(lines[lineNumber], lineNumber, constants, warnings);
            final String lowerLine = line.toLowerCase();
            if ((line.length() == 0) || line.startsWith("#")) {
            if (line.length() == 0 || line.startsWith("#")) {
                // This is a comment or a blank line, so we'll ignore it.
                continue;
            } else if (lowerLine.startsWith(INCLUDE_LABEL)) {
@@ -933,7 +933,7 @@
            }
        }
        // Then, find the position of the first non-blank character in the line.
        while ((pos < length) && (lowerLine.charAt(pos) == ' ')) {
        while (pos < length && lowerLine.charAt(pos) == ' ') {
            pos++;
        }
@@ -1759,7 +1759,7 @@
            if (nextEntry != null) {
                return true;
            }
            while ((entriesCount < numberOfEntries) || generateForever()) {
            while (entriesCount < numberOfEntries || generateForever()) {
                // get the template entry
                if (!currentEntryIsInitialized) {
                    nextEntry = buildTemplateEntry();
@@ -1904,7 +1904,7 @@
         */
        TemplateValue getValue(final AttributeType attributeType) {
            final List<TemplateValue> values = attributes.get(attributeType);
            if ((values != null)) {
            if (values != null) {
                return values.get(0);
            }
            return null;
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldif/TemplateTag.java
@@ -202,7 +202,7 @@
        private void initialize(Schema schema, Branch branch, Template template, String[] arguments, int lineNumber)
                throws DecodeException {
            if ((arguments.length < 1) || (arguments.length > 2)) {
            if (arguments.length < 1 || arguments.length > 2) {
                LocalizableMessage message = ERR_ENTRY_GENERATOR_TAG_INVALID_ARGUMENT_RANGE_COUNT.get(getName(),
                        lineNumber, 1, 2, arguments.length);
                throw DecodeException.fatalError(message);
@@ -312,7 +312,7 @@
        final TagResult generateValue(TemplateEntry templateEntry, TemplateValue templateValue,
                String separator) {
            DN dn = templateEntry.getDN();
            if ((dn == null) || dn.isRootDN()) {
            if (dn == null || dn.isRootDN()) {
                return TagResult.SUCCESS;
            }
@@ -387,7 +387,7 @@
            random = templateFile.getRandom();
            // There must be at least one argument, and possibly two.
            if ((arguments.length < 1) || (arguments.length > 2)) {
            if (arguments.length < 1 || arguments.length > 2) {
                LocalizableMessage message = ERR_ENTRY_GENERATOR_TAG_INVALID_ARGUMENT_RANGE_COUNT.get(getName(),
                        lineNumber, 1, 2, arguments.length);
                throw DecodeException.fatalError(message);
@@ -540,7 +540,7 @@
        private void initialize(Schema schema, Branch branch, Template template, String[] arguments, int lineNumber)
                throws DecodeException {
            if ((arguments.length < 1) || (arguments.length > 2)) {
            if (arguments.length < 1 || arguments.length > 2) {
                LocalizableMessage message = ERR_ENTRY_GENERATOR_TAG_INVALID_ARGUMENT_RANGE_COUNT.get(getName(),
                        lineNumber, 1, 2, arguments.length);
                throw DecodeException.fatalError(message);
@@ -601,7 +601,7 @@
        @Override
        TagResult generateValue(TemplateEntry templateEntry, TemplateValue templateValue) {
            List<TemplateValue> values = templateEntry.getValues(attributeType);
            if ((values == null) || values.isEmpty()) {
            if (values == null || values.isEmpty()) {
                return TagResult.FAILURE;
            }
@@ -779,7 +779,7 @@
        @Override
        TagResult generateValue(TemplateEntry templateEntry, TemplateValue templateValue) {
            DN parentDN = templateEntry.getParentDN();
            if ((parentDN == null) || parentDN.isRootDN()) {
            if (parentDN == null || parentDN.isRootDN()) {
                return TagResult.SUCCESS;
            }
            templateValue.append(parentDN);
@@ -1005,7 +1005,7 @@
            // There must be at least one argument, to specify the type of
            // random value to generate.
            if ((arguments == null) || (arguments.length == 0)) {
            if (arguments == null || arguments.length == 0) {
                LocalizableMessage message = ERR_ENTRY_GENERATOR_TAG_NO_RANDOM_TYPE_ARGUMENT.get(lineNumber);
                throw DecodeException.fatalError(message);
            }
@@ -1037,7 +1037,7 @@
                                getName(), lineNumber);
                        throw DecodeException.fatalError(message, nfe);
                    }
                } else if ((numArgs == 3) || (numArgs == 4)) {
                } else if (numArgs == 3 || numArgs == 4) {
                    randomType = RandomType.NUMERIC;
                    if (numArgs == 4) {
@@ -1083,7 +1083,7 @@
                characterSet = ALPHANUMERIC_CHARS;
                decodeLength(arguments, 1, lineNumber, warnings);
            } else if (randomTypeString.equals("chars")) {
                if ((numArgs < 3) || (numArgs > 4)) {
                if (numArgs < 3 || numArgs > 4) {
                    LocalizableMessage message = ERR_ENTRY_GENERATOR_TAG_INVALID_ARGUMENT_RANGE_COUNT.get(getName(),
                            lineNumber, 3, 4, numArgs);
                    throw DecodeException.fatalError(message);
@@ -1304,7 +1304,7 @@
        @Override
        TagResult generateValue(TemplateEntry templateEntry, TemplateValue templateValue) {
            DN dn = templateEntry.getDN();
            if ((dn == null) || dn.isRootDN()) {
            if (dn == null || dn.isRootDN()) {
                return TagResult.SUCCESS;
            } else {
                templateValue.append(dn.rdn());
@@ -1475,7 +1475,7 @@
        @Override
        TagResult generateValue(TemplateEntry templateEntry, TemplateValue templateValue) {
            DN parentDN = templateEntry.getParentDN();
            if ((parentDN == null) || parentDN.isRootDN()) {
            if (parentDN == null || parentDN.isRootDN()) {
                return TagResult.SUCCESS;
            }
            templateValue.append(parentDN.rdn());
opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldif/LDIFTestCase.java
@@ -956,17 +956,13 @@
        assertThat(((ModifyRequest) cr).getModifications().size()).isEqualTo(3);
        for (Modification mod : ((ModifyRequest) cr).getModifications()) {
            if (mod.getModificationType() == ModificationType.ADD) {
                assertThat((mod.getAttribute().getAttributeDescription().toString())
                        .equals("description")
                        || (mod.getAttribute().getAttributeDescription().toString())
                                .equals("userPassword"));
                assertThat((mod.getAttribute().firstValueAsString()).equals("A new description.")
                        || (mod.getAttribute().firstValueAsString()).equals("secret12"));
                assertThat(mod.getAttribute().getAttributeDescription().toString().equals("description")
                        || mod.getAttribute().getAttributeDescription().toString().equals("userPassword"));
                assertThat(mod.getAttribute().firstValueAsString().equals("A new description.")
                        || mod.getAttribute().firstValueAsString().equals("secret12"));
            }
            if (mod.getModificationType() == ModificationType.DELETE) {
                assertThat(mod.getAttribute().getAttributeDescription().toString()).isEqualTo(
                        "userPassword");
                assertThat(mod.getAttribute().getAttributeDescription().toString()).isEqualTo("userPassword");
                assertThat(mod.getAttribute().firstValueAsString()).isEqualTo("changeme");
            }
        }
opendj-sdk/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ASN1BufferReader.java
@@ -273,7 +273,7 @@
        // Read the header if haven't done so already
        peekLength();
        if ((peekLength < 1) || (peekLength > 4)) {
        if (peekLength < 1 || peekLength > 4) {
            final LocalizableMessage message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
            throw DecodeException.fatalError(message);
        }
@@ -288,7 +288,7 @@
        // Read the header if haven't done so already
        peekLength();
        if ((peekLength < 1) || (peekLength > 8)) {
        if (peekLength < 1 || peekLength > 8) {
            final LocalizableMessage message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
            throw DecodeException.fatalError(message);
        }
@@ -298,7 +298,7 @@
            long longValue = 0;
            for (int i = 0; i < peekLength; i++) {
                final int readByte = buffer.get();
                if ((i == 0) && (((byte) readByte) < 0)) {
                if (i == 0 && ((byte) readByte) < 0) {
                    longValue = 0xFFFFFFFFFFFFFFFFL;
                }
                longValue = (longValue << 8) | (readByte & 0xFF);
@@ -310,7 +310,7 @@
            int intValue = 0;
            for (int i = 0; i < peekLength; i++) {
                final int readByte = buffer.get();
                if ((i == 0) && (((byte) readByte) < 0)) {
                if (i == 0 && ((byte) readByte) < 0) {
                    intValue = 0xFFFFFFFF;
                }
                intValue = (intValue << 8) | (readByte & 0xFF);
@@ -492,7 +492,7 @@
        // Make sure that the element is not larger than the maximum allowed
        // message size.
        if ((maxElementSize > 0) && (peekLength > maxElementSize)) {
        if (maxElementSize > 0 && peekLength > maxElementSize) {
            final LocalizableMessage m =
                    ERR_LDAP_CLIENT_DECODE_MAX_REQUEST_SIZE_EXCEEDED
                            .get(peekLength, maxElementSize);
@@ -544,7 +544,7 @@
        // Make sure that the element is not larger than the maximum allowed
        // message size.
        if ((maxElementSize > 0) && (peekLength > maxElementSize)) {
        if (maxElementSize > 0 && peekLength > maxElementSize) {
            final LocalizableMessage m =
                    ERR_LDAP_CLIENT_DECODE_MAX_REQUEST_SIZE_EXCEEDED
                            .get(peekLength, maxElementSize);
@@ -566,7 +566,7 @@
     */
    private boolean needTypeState(final boolean ensureRead) throws IOException {
        // Read just the type.
        if (ensureRead && (readLimiter.remaining() <= 0)) {
        if (ensureRead && readLimiter.remaining() <= 0) {
            return false;
        }
opendj-sdk/opendj-grizzly/src/main/java/org/forgerock/opendj/grizzly/ConnectionSecurityLayerFilter.java
@@ -56,7 +56,7 @@
        }
        public String getName() {
            return this.getClass().getName();
            return getClass().getName();
        }
        public boolean hasInputRemaining(final AttributeStorage storage, final Buffer input) {
@@ -95,7 +95,7 @@
        }
        public String getName() {
            return this.getClass().getName();
            return getClass().getName();
        }
        public boolean hasInputRemaining(final AttributeStorage storage, final Buffer input) {
opendj-sdk/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/UpdateGroup.java
@@ -163,11 +163,11 @@
     * @param operation Operation specified as an argument (add or del).
     */
    private static ModificationType getModificationType(String operation) {
        if (!(operation.equalsIgnoreCase("add") || operation.equalsIgnoreCase("del"))) {
        final boolean isAdd = operation.equalsIgnoreCase("add");
        if (!(isAdd || operation.equalsIgnoreCase("del"))) {
            printUsage();
        }
        return (operation.equalsIgnoreCase("add"))
                ? ModificationType.ADD : ModificationType.DELETE;
        return isAdd ? ModificationType.ADD : ModificationType.DELETE;
    }
    /**
opendj-sdk/opendj-server/src/main/java/org/forgerock/opendj/server/setup/cli/SetupCli.java
@@ -331,7 +331,7 @@
     * @return <CODE>true</CODE> if the command was launched to setup a proxy and <CODE>false</CODE> otherwise.
     */
    public boolean isCreateProxy() {
        return (argParser.getSubCommand("create-proxy") != null);
        return argParser.getSubCommand("create-proxy") != null;
    }
    /**
@@ -454,7 +454,7 @@
            errorMessages.add(ERR_SEVERAL_CERTIFICATE_TYPE_SPECIFIED.get());
        }
        if (certificateRequired && noPrompt.isPresent() && (certificateType == 0)) {
        if (certificateRequired && noPrompt.isPresent() && certificateType == 0) {
            errorMessages.add(ERR_CERTIFICATE_REQUIRED_FOR_SSL_OR_STARTTLS.get());
        }
opendj-sdk/opendj-server/src/main/java/org/forgerock/opendj/server/setup/model/DataConfiguration.java
@@ -85,19 +85,19 @@
    }
    public boolean isOnlyBaseEntry() {
        return (type == Type.BASE_ENTRY_ONLY);
        return type == Type.BASE_ENTRY_ONLY;
    }
    public boolean isEmptyDatabase() {
        return (type == Type.EMPTY_DATABASE);
        return type == Type.EMPTY_DATABASE;
    }
    public boolean isImportLDIF() {
        return (type == Type.IMPORT_LDIF);
        return type == Type.IMPORT_LDIF;
    }
    public boolean isAutomaticallyImportGenerated() {
        return (type == Type.AUTOMATICALLY_GENERATED);
        return type == Type.AUTOMATICALLY_GENERATED;
    }
    public File getLdifImportDataPath() {
opendj-sdk/opendj-server/src/main/java/org/forgerock/opendj/server/setup/model/Model.java
@@ -143,14 +143,14 @@
     * Sets the type of this server as : replication activated and this is the first server in topology.
     */
    void setFirstInTopology() {
        this.setType(Type.FIRST_IN_TOPOLOGY);
        setType(Type.FIRST_IN_TOPOLOGY);
    }
    /**
     * Sets the type of this server as : replication activated and this is a server in an existing topology.
     */
    void setInExistingTopology() {
        this.setType(Type.IN_EXISTING_TOPOLOGY);
        setType(Type.IN_EXISTING_TOPOLOGY);
    }
    /**
@@ -368,16 +368,16 @@
     */
    void validate() throws ConfigException {
        if (isFirstInTopology() || isPartOfReplicationTopology()) {
            if (this.getReplicationConfiguration() == null) {
            if (getReplicationConfiguration() == null) {
                throw new ConfigException(LocalizableMessage.raw("No replication configuration found"));
            }
            if (isPartOfReplicationTopology()) {
                Reject.ifNull(this.getReplicationConfiguration().getAdministrator(),
                Reject.ifNull(getReplicationConfiguration().getAdministrator(),
                        "Administrator name should not be null");
                Reject.ifNull(this.getReplicationConfiguration().getPassword(), "Admin password should not be null");
                Reject.ifNull(this.getReplicationConfiguration().getGlobalAdministrator(),
                Reject.ifNull(getReplicationConfiguration().getPassword(), "Admin password should not be null");
                Reject.ifNull(getReplicationConfiguration().getGlobalAdministrator(),
                        "Global administrator should not be null");
                Reject.ifNull(this.getReplicationConfiguration().getGlobalAdministratorPassword(),
                Reject.ifNull(getReplicationConfiguration().getGlobalAdministratorPassword(),
                        "Global administrator should not be null");
                if (getReplicationConfiguration().getSuffixes() == null
                        || getReplicationConfiguration().getSuffixes().size() == 0) {
opendj-sdk/opendj-server2x-adapter/src/main/java/org/forgerock/opendj/adapter/server2x/Adapters.java
@@ -235,10 +235,11 @@
            @Override
            public Result modifyDN(final ModifyDNRequest request) throws LdapException {
                final ModifyDNOperation modifyDNOperation =
                        icc.processModifyDN(to(valueOf(request.getName())), to(valueOf(request
                                .getNewRDN())), request.isDeleteOldRDN(),
                                (request.getNewSuperior() != null ? to(valueOf(request
                                        .getNewSuperior())) : null), to(request.getControls()));
                        icc.processModifyDN(to(valueOf(request.getName())),
                                to(valueOf(request.getNewRDN())),
                                request.isDeleteOldRDN(),
                                (request.getNewSuperior() != null ? to(valueOf(request.getNewSuperior())) : null),
                                to(request.getControls()));
                return getResponseResult(modifyDNOperation);
            }
@@ -285,10 +286,10 @@
                    return extendedResult;
                } catch (DecodeException e) {
                    org.opends.server.types.DN matchedDN = extendedOperation.getMatchedDN();
                    return request.getResultDecoder().newExtendedErrorResult(
                            ResultCode.valueOf(extendedOperation.getResultCode().getIntValue()),
                            (extendedOperation.getMatchedDN() != null ? extendedOperation
                                    .getMatchedDN().toString() : null),
                            matchedDN != null ? matchedDN.toString() : null,
                            extendedOperation.getErrorMessage().toString());
                }
            }
opendj-sdk/opendj-server2x-adapter/src/main/java/org/forgerock/opendj/adapter/server2x/Converters.java
@@ -44,6 +44,7 @@
import org.forgerock.opendj.ldap.responses.Responses;
import org.forgerock.opendj.ldap.responses.Result;
import org.forgerock.opendj.ldap.responses.SearchResultEntry;
import org.opends.messages.MessageBuilder;
import org.opends.server.core.BindOperation;
import org.opends.server.core.CompareOperation;
import org.opends.server.core.ExtendedOperation;
@@ -630,10 +631,10 @@
                result.addControl(from(c));
            }
        }
        result.setDiagnosticMessage((operation.getErrorMessage() != null ? operation
                .getErrorMessage().toString() : null));
        result.setMatchedDN((operation.getMatchedDN() != null) ? operation.getMatchedDN()
                .toString() : null);
        final MessageBuilder errorMsg = operation.getErrorMessage();
        org.opends.server.types.DN matchedDN = operation.getMatchedDN();
        result.setDiagnosticMessage(errorMsg != null ? errorMsg.toString() : null);
        result.setMatchedDN(matchedDN != null ? matchedDN.toString() : null);
        if (result.isSuccess()) {
            return result;
        } else {
opendj-sdk/opendj-server2x-adapter/src/test/java/org/forgerock/opendj/adapter/server2x/AdaptersTestCase.java
@@ -244,7 +244,7 @@
        Connection connection = factory.getConnection();
        PlainSASLBindRequest request =
                Requests.newPlainSASLBindRequest("u:user.0", ("password").toCharArray());
                Requests.newPlainSASLBindRequest("u:user.0", "password".toCharArray());
        try {
            connection.bind(request);
        } finally {
@@ -266,7 +266,7 @@
        final Connection connection = Adapters.newRootConnection();
        PlainSASLBindRequest request =
                Requests.newPlainSASLBindRequest("u:user.0", ("password").toCharArray());
                Requests.newPlainSASLBindRequest("u:user.0", "password".toCharArray());
        try {
            connection.bind(request);
        } finally {
opendj-sdk/opendj-server2x-adapter/src/test/java/org/forgerock/opendj/adapter/server2x/ConvertersTestCase.java
@@ -521,7 +521,7 @@
    @Test(groups = { "needRunningServer" })
    public static void testgetCredentials() throws Exception {
        final PlainSASLBindRequest request =
                Requests.newPlainSASLBindRequest("u:user.0", ("password").toCharArray());
                Requests.newPlainSASLBindRequest("u:user.0", "password".toCharArray());
        String serverName = InetAddress.getByName(null).getCanonicalHostName();
        final BindClient bindClient = request.createBindClient(serverName);
@@ -539,7 +539,7 @@
    @Test(groups = { "needRunningServer" })
    public static void testgetCredentialsEmptyByteString() throws Exception {
        final CRAMMD5SASLBindRequest request =
                Requests.newCRAMMD5SASLBindRequest("u:user.2", ("password").toCharArray());
                Requests.newCRAMMD5SASLBindRequest("u:user.2", "password".toCharArray());
        String serverName = InetAddress.getByName(null).getCanonicalHostName();
        final BindClient bindClient = request.createBindClient(serverName);
opendj-sdk/opendj-server3x-adapter/src/main/java/org/forgerock/opendj/adapter/server3x/Adapters.java
@@ -238,9 +238,10 @@
            @Override
            public Result modifyDN(final ModifyDNRequest request) throws LdapException {
                final ModifyDNOperation modifyDNOperation =
                        icc.processModifyDN(valueOf(request.getName()), valueOf(request.getNewRDN()),
                        icc.processModifyDN(valueOf(request.getName()),
                                valueOf(request.getNewRDN()),
                                request.isDeleteOldRDN(),
                                (request.getNewSuperior() != null ? valueOf(request.getNewSuperior()) : null),
                                request.getNewSuperior() != null ? valueOf(request.getNewSuperior()) : null,
                                to(request.getControls()));
                return getResponseResult(modifyDNOperation);
            }
opendj-sdk/opendj-server3x-adapter/src/test/java/org/forgerock/opendj/adapter/server3x/AdaptersTestCase.java
@@ -244,7 +244,7 @@
        Connection connection = factory.getConnection();
        PlainSASLBindRequest request =
                Requests.newPlainSASLBindRequest("u:user.0", ("password").toCharArray());
                Requests.newPlainSASLBindRequest("u:user.0", "password".toCharArray());
        try {
            connection.bind(request);
        } finally {
@@ -266,7 +266,7 @@
        final Connection connection = Adapters.newRootConnection();
        PlainSASLBindRequest request =
                Requests.newPlainSASLBindRequest("u:user.0", ("password").toCharArray());
                Requests.newPlainSASLBindRequest("u:user.0", "password".toCharArray());
        try {
            connection.bind(request);
        } finally {
opendj-sdk/opendj-server3x-adapter/src/test/java/org/forgerock/opendj/adapter/server3x/ConvertersTestCase.java
@@ -520,7 +520,7 @@
    @Test(groups = { "needRunningServer" })
    public static void testgetCredentials() throws Exception {
        final PlainSASLBindRequest request =
                Requests.newPlainSASLBindRequest("u:user.0", ("password").toCharArray());
                Requests.newPlainSASLBindRequest("u:user.0", "password".toCharArray());
        String serverName = InetAddress.getByName(null).getCanonicalHostName();
        final BindClient bindClient = request.createBindClient(serverName);
@@ -536,7 +536,7 @@
    @Test(groups = { "needRunningServer" })
    public static void testgetCredentialsEmptyByteString() throws Exception {
        final CRAMMD5SASLBindRequest request =
                Requests.newCRAMMD5SASLBindRequest("u:user.2", ("password").toCharArray());
                Requests.newCRAMMD5SASLBindRequest("u:user.2", "password".toCharArray());
        String serverName = InetAddress.getByName(null).getCanonicalHostName();
        final BindClient bindClient = request.createBindClient(serverName);