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

Jean-Noel Rouvignac
29.33.2015 d1f67709ff8706f0276920574b5a1461451eb137
AutoRefactor'ed code cleanups
6 files modified
49 ■■■■ changed files
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIFChangeRecordWriter.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldif/TemplateFile.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AuthRate.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java 10 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/ReferenceAttributeMapper.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server2x-adapter/src/main/java/org/forgerock/opendj/adapter/server2x/Converters.java 12 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldif/LDIFChangeRecordWriter.java
@@ -344,10 +344,10 @@
         * changetype, so only use it if a newSuperior element has been
         * provided, but use modrdn elsewhere.
         */
        if (change.getNewSuperior() == null) {
            writeLine("changetype: modrdn");
        } else {
        if (change.getNewSuperior() != null) {
            writeLine("changetype: moddn");
        } else {
            writeLine("changetype: modrdn");
        }
        writeKeyAndValue("newrdn", change.getNewRDN().toString());
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldif/TemplateFile.java
@@ -660,10 +660,10 @@
                if ((openPos > 0 && newLine.charAt(openPos - 1) != '\\') || (openPos == 0)) {
                    final String constantName = newLine.substring(openPos + 1, closePos).toLowerCase();
                    final String constantValue = constants.get(constantName);
                    if (constantValue == null) {
                        warnings.add(WARN_ENTRY_GENERATOR_WARNING_UNDEFINED_CONSTANT.get(constantName, lineNumber));
                    } else {
                    if (constantValue != null) {
                        lineBuffer.replace(openPos, closePos + 1, constantValue);
                    } else {
                        warnings.add(WARN_ENTRY_GENERATOR_WARNING_UNDEFINED_CONSTANT.get(constantName, lineNumber));
                    }
                }
                if (openPos >= 0) {
opendj-sdk/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AuthRate.java
@@ -148,11 +148,12 @@
                Promise<BindResult, LdapException> returnedPromise;
                if (filter != null && baseDN != null) {
                    if (sr == null) {
                        if (dataSources == null) {
                            sr = Requests.newSearchRequest(baseDN, scope, filter, attributes);
                        if (dataSources != null) {
                            final String newBaseDN = String.format(baseDN, data);
                            final String newFilter = String.format(filter, data);
                            sr = Requests.newSearchRequest(newBaseDN, scope, newFilter, attributes);
                        } else {
                            sr = Requests.newSearchRequest(String.format(baseDN, data), scope,
                                    String.format(filter, data), attributes);
                            sr = Requests.newSearchRequest(baseDN, scope, filter, attributes);
                        }
                        sr.setDereferenceAliasesPolicy(dereferencesAliasesPolicy);
                    } else if (dataSources != null) {
opendj-sdk/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/AuthzIdTemplate.java
@@ -135,14 +135,14 @@
            final Object value = principals.get(key);
            if (isJSONPrimitive(value)) {
                values[i] = String.valueOf(value);
            } else if (value == null) {
                throw new ForbiddenException(i18n(
                        "The request could not be authorized because the required "
                                + "security principal '%s' could not be determined", key));
            } else {
            } else if (value != null) {
                throw new ForbiddenException(i18n(
                        "The request could not be authorized because the required "
                                + "security principal '%s' had an invalid data type", key));
            } else {
                throw new ForbiddenException(i18n(
                        "The request could not be authorized because the required "
                                + "security principal '%s' could not be determined", key));
            }
        }
        return values;
opendj-sdk/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/ReferenceAttributeMapper.java
@@ -266,10 +266,10 @@
                private void completeIfNecessary() {
                    if (pendingSearches.decrementAndGet() == 0) {
                        if (exception.get() == null) {
                            h.handleResult(newLDAPAttribute);
                        } else {
                        if (exception.get() != null) {
                            h.handleError(exception.get());
                        } else {
                            h.handleResult(newLDAPAttribute);
                        }
                    }
                }
opendj-sdk/opendj-server2x-adapter/src/main/java/org/forgerock/opendj/adapter/server2x/Converters.java
@@ -168,10 +168,10 @@
     */
    public static org.opends.server.types.SearchScope to(
            final org.forgerock.opendj.ldap.SearchScope searchScope) {
        if (searchScope == null) {
            return null;
        if (searchScope != null) {
            return org.opends.server.types.SearchScope.values()[searchScope.intValue()];
        }
        return org.opends.server.types.SearchScope.values()[searchScope.intValue()];
        return null;
    }
    /**
@@ -436,10 +436,10 @@
     */
    public static org.forgerock.opendj.ldap.SearchScope from(
            final org.opends.server.types.SearchScope searchScope) {
        if (searchScope == null) {
            return null;
        if (searchScope != null) {
            return org.forgerock.opendj.ldap.SearchScope.values().get(searchScope.intValue());
        }
        return org.forgerock.opendj.ldap.SearchScope.values().get(searchScope.intValue());
        return null;
    }
    /**