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

Jean-Noel Rouvignac
16.59.2015 b0a00d248d3f6ae91627490e7a177d9ad5184331
AutoRefactor: booleans
36 files modified
608 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/admin/ads/ServerDescriptor.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/NodeRefresher.java 19 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/ServerDescriptor.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseSchemaPanel.java 20 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/JavaPropertiesPanel.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/renderer/LDAPEntryTableCellRenderer.java 16 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/DataReplicationPanel.java 9 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/client/spi/PropertySet.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/api/AttributeSyntax.java 9 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/api/Group.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciTargets.java 24 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/State.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/controls/ServerSideSortRequestControl.java 22 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/FilteredStaticGroupMemberList.java 17 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/StaticGroup.java 63 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/UserDefinedVirtualAttributeProvider.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractTextAccessLogPublisher.java 138 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/DirectoryRMIServerSocketFactory.java 9 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/NotAssuredUpdateMsg.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Record.java 13 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/schema/GuideSyntax.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliArgumentParser.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskClient.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/CommonSchemaElements.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/DITStructureRule.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/EntryEncodeConfig.java 26 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/LDAPSyntaxDescription.java 4 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/MatchingRuleUse.java 4 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/Modification.java 11 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/NameForm.java 11 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/ObjectClass.java 29 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/SubtreeSpecification.java 27 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/CertificateManager.java 4 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/util/VersionCompatibilityIssue.java 27 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/backends/task/TaskBackendTestCase.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LdapTestCase.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/admin/ads/ServerDescriptor.java
@@ -1074,7 +1074,7 @@
      }
    }
    desc.serverProperties.put(ServerProperty.IS_REPLICATION_ENABLED,
        replicationEnabled ? Boolean.TRUE : Boolean.FALSE);
        Boolean.valueOf(replicationEnabled));
    Set<String> allReplicationServers = new LinkedHashSet<String>();
@@ -1226,7 +1226,7 @@
      }
    }
    desc.serverProperties.put(ServerProperty.IS_REPLICATION_SECURE,
        replicationSecure ? Boolean.TRUE : Boolean.FALSE);
        Boolean.valueOf(replicationSecure));
  }
  /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/NodeRefresher.java
@@ -761,31 +761,20 @@
  // is listed in in the hacker.
  // Note: *usable* means *usable for detecting children presence*.
  private boolean isNumSubOrdinatesUsable() throws NamingException {
    boolean result;
    SearchResult entry = getDisplayedEntry();
    boolean hasSubOrdinates = BrowserController.getHasSubOrdinates(entry);
    if (!hasSubOrdinates) { // We must check
      LDAPURL url = getDisplayedUrl();
      if (controller.getNumSubordinateHacker().contains(url)) {
        // The numSubOrdinate we have is unreliable.
        result = false;
//        System.out.println("numSubOrdinates of " + url +
//                           " is not reliable");
      }
      else {
        result = true;
      }
      return !controller.getNumSubordinateHacker().contains(url);
    }
    else { // Other values are usable
      result = true;
    }
    return result;
    // Other values are usable
    return true;
  }
  /**
   * Searchs for the children.
   * Searches for the children.
   * @throws SearchAbandonException if an error occurs.
   */
  private void runSearchChildren() throws SearchAbandonException {
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/ServerDescriptor.java
@@ -528,11 +528,7 @@
      return false;
    }
    String os = getFirstValueAsString(sr, "operatingSystem");
    if (os != null)
    {
      return OperatingSystem.WINDOWS == OperatingSystem.forName(os);
    }
    return false;
    return os != null && OperatingSystem.WINDOWS.equals(OperatingSystem.forName(os));
  }
  /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/BrowseSchemaPanel.java
@@ -71,6 +71,9 @@
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
import org.forgerock.opendj.ldap.schema.MatchingRule;
import org.opends.guitools.controlpanel.browser.IconPool;
import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo;
import org.opends.guitools.controlpanel.datamodel.ServerDescriptor;
@@ -86,10 +89,7 @@
import org.opends.guitools.controlpanel.util.LowerCaseComparator;
import org.opends.guitools.controlpanel.util.Utilities;
import org.opends.guitools.controlpanel.util.ViewPositions;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
import org.opends.server.api.AttributeSyntax;
import org.forgerock.opendj.ldap.schema.MatchingRule;
import org.opends.server.types.AttributeType;
import org.opends.server.types.CommonSchemaElements;
import org.opends.server.types.ObjectClass;
@@ -97,7 +97,6 @@
/**
 * The pane that is displayed when the user clicks on 'Browse Schema'.
 *
 */
public class BrowseSchemaPanel extends StatusGenericPanel
{
@@ -109,7 +108,6 @@
  private JButton newObjectClass;
  private JLabel lNumberOfElements;
  private JLabel lFilter;
  private SchemaBrowserRightPanel entryPane;
@@ -652,13 +650,9 @@
    {
      schemaChanged = false;
    }
    else if (lastSchema == null && schema != null)
    {
      schemaChanged = true;
    }
    else
    {
      schemaChanged = false;
      schemaChanged = schema != null && lastSchema == null;
    }
    if (schemaChanged)
    {
@@ -863,12 +857,6 @@
    names.add(matchingRuleNames);
    names.add(syntaxNames);
    int size = 0;
    for (TreeSet<String> set : names)
    {
      size += set.size();
    }
    ArrayList<HashMap<String, ? extends DefaultMutableTreeNode>> nodes =
      new ArrayList<HashMap<String, ? extends DefaultMutableTreeNode>>();
    nodes.add(hmStandardOcs);
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/JavaPropertiesPanel.java
@@ -1312,13 +1312,7 @@
     */
    @Override
    public boolean isCellEditable(int row, int col) {
      if (col == 0)
      {
        return false;
      } else
      {
        return true;
      }
      return col != 0;
    }
    /**
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/renderer/LDAPEntryTableCellRenderer.java
@@ -98,21 +98,13 @@
    }
    else if (value instanceof ObjectClassValue)
    {
      if (!table.isCellEditable(row, column))
      {
        ocPanel.setLockIconVisible(true);
        ocPanel.setEditButtonVisible(false);
      }
      else
      {
        ocPanel.setLockIconVisible(false);
        ocPanel.setEditButtonVisible(true);
      }
      final boolean cellEditable = table.isCellEditable(row, column);
      ocPanel.setLockIconVisible(!cellEditable);
      ocPanel.setEditButtonVisible(cellEditable);
      ocPanel.setValue((ObjectClassValue)value);
      if (hasFocus)
      {
        ocPanel.setBorder(getDefaultFocusBorder(table, value, isSelected,
            row, column));
        ocPanel.setBorder(getDefaultFocusBorder(table, value, isSelected, row, column));
      }
      else
      {
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/DataReplicationPanel.java
@@ -119,14 +119,7 @@
    }
    else if (fieldName == FieldName.REPLICATION_SECURE)
    {
      if (cbSecureReplication.isSelected())
      {
        value = Boolean.TRUE;
      }
      else
      {
        value = Boolean.FALSE;
      }
      value = Boolean.valueOf(cbSecureReplication.isSelected());
    }
    else
    {
opendj-server-legacy/src/main/java/org/opends/server/admin/client/spi/PropertySet.java
@@ -173,11 +173,8 @@
     * {@inheritDoc}
     */
    public boolean isModified() {
      if (activeValues.size() == pendingValues.size()
          && activeValues.containsAll(pendingValues)) {
        return false;
      }
      return true;
      return activeValues.size() != pendingValues.size()
          || !activeValues.containsAll(pendingValues);
    }
opendj-server-legacy/src/main/java/org/opends/server/api/AttributeSyntax.java
@@ -267,21 +267,14 @@
   */
  public final boolean equals(Object o)
  {
    if (o == null)
    {
      return false;
    }
    if (this == o)
    {
      return true;
    }
    if (! (o instanceof AttributeSyntax))
    if (!(o instanceof AttributeSyntax))
    {
      return false;
    }
    return getOID().equals(((AttributeSyntax<?>) o).getOID());
  }
opendj-server-legacy/src/main/java/org/opends/server/api/Group.java
@@ -300,12 +300,9 @@
   * @throws  DirectoryException  If a problem occurs while attempting
   *                              to make the determination.
   */
  public boolean isMember(DN userDN)
         throws DirectoryException
  public boolean isMember(DN userDN) throws DirectoryException
  {
    if (userDN != null)
      return isMember(userDN, new HashSet<DN>());
    return false;
    return userDN != null && isMember(userDN, new HashSet<DN>());
  }
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciTargets.java
@@ -423,9 +423,7 @@
    public static boolean isTargetFilterApplicable(Aci aci,
                                              AciTargetMatchContext matchCtx) {
        TargetFilter targetFilter=aci.getTargets().getTargetFilter();
        if(targetFilter != null)
             return targetFilter.isApplicable(matchCtx);
        return true;
        return targetFilter == null || targetFilter.isApplicable(matchCtx);
    }
    /**
@@ -439,9 +437,7 @@
    public static boolean isTargetControlApplicable(Aci aci,
                                            AciTargetMatchContext matchCtx) {
      TargetControl targetControl=aci.getTargets().getTargetControl();
      if(targetControl != null)
        return targetControl.isApplicable(matchCtx);
      return false;
      return targetControl != null && targetControl.isApplicable(matchCtx);
    }
    /**
@@ -455,9 +451,7 @@
    public static boolean isExtOpApplicable(Aci aci,
                                              AciTargetMatchContext matchCtx) {
      ExtOp extOp=aci.getTargets().getExtOp();
      if(extOp != null)
        return extOp.isApplicable(matchCtx);
      return false;
      return extOp != null && extOp.isApplicable(matchCtx);
    }
@@ -515,13 +509,13 @@
              setEvalAttributes(targetMatchCtx,targetAttr,ret);
            } else if (attrType != null || targetAttr != null) {
                if (aci.hasRights(skipRights)
                        && skipRightsHasRights(targetMatchCtx.getRights()))
                        && skipRightsHasRights(targetMatchCtx.getRights())) {
                    ret = true;
                else if (attrType == null && targetAttr != null
                            && aci.hasRights(ACI_WRITE))
                    ret = true;
                else
                    ret = false;
                } else {
                    ret = attrType == null
                        && targetAttr != null
                        && aci.hasRights(ACI_WRITE);
                }
            }
            if (isFirstAttr && targetAttr == null
                && aci.getTargets().getTargAttrFilters() == null)
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/State.java
@@ -96,11 +96,7 @@
    ByteString key = keyForIndex(index);
    ByteString value = read(txn, key, false);
    if (value != null)
    {
      return value.equals(trueBytes);
    }
    return false;
    return value != null && value.equals(trueBytes);
  }
  /**
opendj-server-legacy/src/main/java/org/opends/server/controls/ServerSideSortRequestControl.java
@@ -25,10 +25,9 @@
 *      Portions Copyright 2014 ForgeRock AS
 */
package org.opends.server.controls;
import org.forgerock.i18n.LocalizableMessage;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.IOException;
@@ -44,8 +43,6 @@
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
/**
 * This class implements the server-side sort request control as defined in RFC
 * 2891 section 1.1. The subclass ServerSideSortRequestControl.ClientRequest
@@ -470,20 +467,13 @@
        }
      }
      boolean ascending = true;
      if(decodedKey[2] != null && decodedKey[2].equals("r"))
      String decodedKey2 = decodedKey[2];
      boolean ascending = decodedKey2 == null || !decodedKey2.equals("r");
      if (orderingRule == null
          && attrType.getOrderingMatchingRule() == null)
      {
        ascending = false;
      }
      if ((orderingRule == null) &&
          (attrType.getOrderingMatchingRule() == null))
      {
        LocalizableMessage message =
            INFO_SORTREQ_CONTROL_NO_ORDERING_RULE_FOR_ATTR.get(
                decodedKey[0]);
        throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION,
            message);
            INFO_SORTREQ_CONTROL_NO_ORDERING_RULE_FOR_ATTR.get(decodedKey[0]));
      }
      sortKeys.add(new SortKey(attrType, ascending, orderingRule));
opendj-server-legacy/src/main/java/org/opends/server/extensions/FilteredStaticGroupMemberList.java
@@ -26,25 +26,25 @@
 */
package org.opends.server.extensions;
import static org.forgerock.util.Reject.*;
import static org.opends.messages.ExtensionMessages.*;
import java.util.Iterator;
import java.util.Set;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizedIllegalArgumentException;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import org.forgerock.opendj.ldap.SearchScope;
import org.forgerock.opendj.ldap.DN.CompactDn;
import org.forgerock.opendj.ldap.SearchScope;
import org.opends.server.types.DN;
import org.opends.server.types.DirectoryConfig;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.MemberList;
import org.opends.server.types.MembershipException;
import org.opends.server.types.SearchFilter;
import static org.forgerock.util.Reject.*;
import static org.opends.messages.ExtensionMessages.*;
/**
 * This class provides an implementation of the {@code MemberList} class that
 * may be used in conjunction when static groups when additional criteria is to
@@ -218,11 +218,8 @@
  @Override
  public boolean hasMoreMembers()
  {
    if (! memberDNIterator.hasNext())
    {
      return false;
    }
    return ((nextMatchingEntry != null) || (nextMembershipException != null));
    return memberDNIterator.hasNext()
        && (nextMatchingEntry != null || nextMembershipException != null);
  }
  /** {@inheritDoc} */
opendj-server-legacy/src/main/java/org/opends/server/extensions/StaticGroup.java
@@ -61,7 +61,6 @@
import org.opends.server.types.MemberList;
import org.opends.server.types.MembershipException;
import org.opends.server.types.Modification;
import org.opends.server.types.ObjectClass;
import org.opends.server.types.SearchFilter;
import static org.opends.messages.ExtensionMessages.*;
@@ -153,18 +152,18 @@
    // Determine whether it is a groupOfNames, groupOfEntries or
    // groupOfUniqueNames entry.  If not, then that's a problem.
    AttributeType someMemberAttributeType;
    ObjectClass groupOfEntriesClass = DirectoryConfig.getObjectClass(OC_GROUP_OF_ENTRIES_LC, true);
    ObjectClass groupOfNamesClass = DirectoryConfig.getObjectClass(OC_GROUP_OF_NAMES_LC, true);
    ObjectClass groupOfUniqueNamesClass = DirectoryConfig.getObjectClass(OC_GROUP_OF_UNIQUE_NAMES_LC, true);
    if (groupEntry.hasObjectClass(groupOfEntriesClass))
    boolean hasGroupOfEntriesClass = hasObjectClass(groupEntry, OC_GROUP_OF_ENTRIES_LC);
    boolean hasGroupOfNamesClass = hasObjectClass(groupEntry, OC_GROUP_OF_NAMES_LC);
    boolean hasGroupOfUniqueNamesClass = hasObjectClass(groupEntry, OC_GROUP_OF_UNIQUE_NAMES_LC);
    if (hasGroupOfEntriesClass)
    {
      if (groupEntry.hasObjectClass(groupOfNamesClass))
      if (hasGroupOfNamesClass)
      {
        LocalizableMessage message = ERR_STATICGROUP_INVALID_OC_COMBINATION.get(
            groupEntry.getName(), OC_GROUP_OF_ENTRIES, OC_GROUP_OF_NAMES);
        throw new DirectoryException(ResultCode.OBJECTCLASS_VIOLATION, message);
      }
      else if (groupEntry.hasObjectClass(groupOfUniqueNamesClass))
      else if (hasGroupOfUniqueNamesClass)
      {
        LocalizableMessage message = ERR_STATICGROUP_INVALID_OC_COMBINATION.get(
            groupEntry.getName(), OC_GROUP_OF_ENTRIES, OC_GROUP_OF_UNIQUE_NAMES);
@@ -173,9 +172,9 @@
      someMemberAttributeType = DirectoryConfig.getAttributeType(ATTR_MEMBER, true);
    }
    else if (groupEntry.hasObjectClass(groupOfNamesClass))
    else if (hasGroupOfNamesClass)
    {
      if (groupEntry.hasObjectClass(groupOfUniqueNamesClass))
      if (hasGroupOfUniqueNamesClass)
      {
        LocalizableMessage message = ERR_STATICGROUP_INVALID_OC_COMBINATION.get(
            groupEntry.getName(), OC_GROUP_OF_NAMES, OC_GROUP_OF_UNIQUE_NAMES);
@@ -184,7 +183,7 @@
      someMemberAttributeType = DirectoryConfig.getAttributeType(ATTR_MEMBER, true);
    }
    else if (groupEntry.hasObjectClass(groupOfUniqueNamesClass))
    else if (hasGroupOfUniqueNamesClass)
    {
      someMemberAttributeType = DirectoryConfig.getAttributeType(ATTR_UNIQUE_MEMBER_LC, true);
    }
@@ -247,48 +246,34 @@
    ifNull(entry);
    // FIXME -- This needs to exclude enhanced groups once we have support for them.
    ObjectClass virtualStaticGroupClass =
         DirectoryConfig.getObjectClass(OC_VIRTUAL_STATIC_GROUP, true);
    if (entry.hasObjectClass(virtualStaticGroupClass))
    if (hasObjectClass(entry, OC_VIRTUAL_STATIC_GROUP))
    {
      return false;
    }
    ObjectClass groupOfEntriesClass =
         DirectoryConfig.getObjectClass(OC_GROUP_OF_ENTRIES_LC, true);
    ObjectClass groupOfNamesClass =
         DirectoryConfig.getObjectClass(OC_GROUP_OF_NAMES_LC, true);
    ObjectClass groupOfUniqueNamesClass =
         DirectoryConfig.getObjectClass(OC_GROUP_OF_UNIQUE_NAMES_LC, true);
    if (entry.hasObjectClass(groupOfEntriesClass))
    boolean hasGroupOfEntriesClass = hasObjectClass(entry, OC_GROUP_OF_ENTRIES_LC);
    boolean hasGroupOfNamesClass = hasObjectClass(entry, OC_GROUP_OF_NAMES_LC);
    boolean hasGroupOfUniqueNamesClass = hasObjectClass(entry, OC_GROUP_OF_UNIQUE_NAMES_LC);
    if (hasGroupOfEntriesClass)
    {
      if (entry.hasObjectClass(groupOfNamesClass) ||
          entry.hasObjectClass(groupOfUniqueNamesClass))
      {
        return false;
      }
      return true;
      return !hasGroupOfNamesClass
          && !hasGroupOfUniqueNamesClass;
    }
    else if (entry.hasObjectClass(groupOfNamesClass))
    else if (hasGroupOfNamesClass)
    {
      if (entry.hasObjectClass(groupOfUniqueNamesClass))
      {
        return false;
      }
      return true;
    }
    else if (entry.hasObjectClass(groupOfUniqueNamesClass))
    {
      return true;
      return !hasGroupOfUniqueNamesClass;
    }
    else
    {
      return false;
      return hasGroupOfUniqueNamesClass;
    }
  }
  private boolean hasObjectClass(Entry entry, String ocName)
  {
    return entry.hasObjectClass(DirectoryConfig.getObjectClass(ocName, true));
  }
  /** {@inheritDoc} */
  @Override
  public DN getGroupDN()
opendj-server-legacy/src/main/java/org/opends/server/extensions/UserDefinedVirtualAttributeProvider.java
@@ -99,11 +99,7 @@
  @Override
  public boolean isMultiValued()
  {
    if (currentConfig != null)
    {
      return currentConfig.getValue().size() > 1;
    }
    return true;
    return currentConfig == null || currentConfig.getValue().size() > 1;
  }
opendj-server-legacy/src/main/java/org/opends/server/loggers/AbstractTextAccessLogPublisher.java
@@ -38,22 +38,22 @@
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageDescriptor.Arg2;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import org.forgerock.opendj.config.server.ConfigChangeResult;
import org.forgerock.opendj.config.server.ConfigException;
import org.forgerock.opendj.ldap.AddressMask;
import org.forgerock.opendj.ldap.ByteString;
import org.opends.server.admin.server.ConfigurationAddListener;
import org.opends.server.admin.server.ConfigurationChangeListener;
import org.opends.server.admin.server.ConfigurationDeleteListener;
import org.opends.server.admin.std.meta.AccessLogFilteringCriteriaCfgDefn.*;
import org.opends.server.admin.std.meta.AccessLogPublisherCfgDefn.*;
import org.opends.server.admin.std.meta.AccessLogFilteringCriteriaCfgDefn.LogRecordType;
import org.opends.server.admin.std.meta.AccessLogPublisherCfgDefn.FilteringPolicy;
import org.opends.server.admin.std.server.AccessLogFilteringCriteriaCfg;
import org.opends.server.admin.std.server.AccessLogPublisherCfg;
import org.opends.server.api.ClientConnection;
import org.opends.server.api.Group;
import org.opends.server.authorization.dseecompat.PatternDN;
import org.forgerock.opendj.config.server.ConfigChangeResult;
import org.forgerock.opendj.config.server.ConfigException;
import org.opends.server.core.*;
import org.opends.server.types.*;
import org.forgerock.opendj.ldap.AddressMask;
import org.forgerock.opendj.ldap.ByteString;
/**
 * This class provides the base implementation of the access loggers used by the
@@ -222,17 +222,7 @@
    @Override
    public boolean isConnectLoggable(final ClientConnection connection)
    {
      if (!logConnectRecords)
      {
        return false;
      }
      if (!filterClientConnection(connection))
      {
        return false;
      }
      return true;
      return logConnectRecords && filterClientConnection(connection);
    }
@@ -243,22 +233,9 @@
    @Override
    public boolean isDisconnectLoggable(final ClientConnection connection)
    {
      if (!logDisconnectRecords)
      {
        return false;
      }
      if (!filterClientConnection(connection))
      {
        return false;
      }
      if (!filterUser(connection))
      {
        return false;
      }
      return true;
      return logDisconnectRecords
          && filterClientConnection(connection)
          && filterUser(connection);
    }
@@ -270,8 +247,7 @@
    public boolean isRequestLoggable(final Operation operation)
    {
      final ClientConnection connection = operation.getClientConnection();
      final boolean matches = logOperationRecords.contains(operation
          .getOperationType())
      final boolean matches = logOperationRecords.contains(operation.getOperationType())
          && filterClientConnection(connection)
          && filterUser(connection) && filterRequest(operation);
@@ -291,8 +267,7 @@
    public boolean isResponseLoggable(final Operation operation)
    {
      // First check the result that was computed for the initial request.
      Boolean requestMatched = (Boolean) operation
          .getAttachment(attachmentName);
      Boolean requestMatched = (Boolean) operation.getAttachment(attachmentName);
      if (requestMatched == null)
      {
        // This should not happen.
@@ -301,18 +276,8 @@
        requestMatched = isRequestLoggable(operation);
      }
      if (!requestMatched)
      {
        return false;
      }
      // Check the response parameters.
      if (!filterResponse(operation))
      {
        return false;
      }
      return true;
      return requestMatched && filterResponse(operation);
    }
@@ -322,58 +287,59 @@
      // Check protocol.
      if (clientProtocols.length > 0)
      {
        boolean found = false;
        final String protocol = toLowerCase(connection.getProtocol());
        for (final String p : clientProtocols)
        {
          if (protocol.equals(p))
          {
            found = true;
            break;
          }
        }
        if (!found)
        {
        if (!find(clientProtocols, protocol)) {
          return false;
        }
      }
      // Check server port.
      if (clientPorts.length > 0)
      if (clientPorts.length > 0
          && !find(clientPorts, connection.getServerPort()))
      {
        boolean found = false;
        final int port = connection.getServerPort();
        for (final int p : clientPorts)
        {
          if (port == p)
          {
            found = true;
            break;
          }
        }
        if (!found)
        {
          return false;
        }
        return false;
      }
      // Check client address.
      final InetAddress ipAddr = connection.getRemoteAddress();
      if (!clientAddressNotEqualTo.isEmpty()
          && AddressMask.matchesAny(clientAddressNotEqualTo, ipAddr))
      {
        return false;
      }
      if (!clientAddressEqualTo.isEmpty()
          && !AddressMask.matchesAny(clientAddressEqualTo, ipAddr))
      {
        return false;
      }
      return true;
      return !AddressMask.matchesAny(clientAddressNotEqualTo, ipAddr)
          && emptyOrMatchesAny(clientAddressEqualTo, ipAddr);
    }
    private boolean emptyOrMatchesAny(Collection<AddressMask> masks, final InetAddress address)
    {
      return masks.isEmpty() || AddressMask.matchesAny(masks, address);
    }
    private boolean find(String[] strings, String toFind)
    {
      if (strings.length > 0)
      {
        for (final String s : strings)
        {
          if (toFind.equals(s))
          {
            return true;
          }
        }
      }
      return false;
    }
    private boolean find(int[] ports, final int toFind)
    {
      if (ports.length > 0)
      {
        for (final int i : ports)
        {
          if (toFind == i)
          {
            return true;
          }
        }
      }
      return false;
    }
    private boolean filterRequest(final Operation operation)
    {
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/DirectoryRMIServerSocketFactory.java
@@ -178,13 +178,8 @@
   */
  private boolean checkParameters(DirectoryRMIServerSocketFactory that)
  {
    if (needClientCertificate != that.needClientCertificate)
      return false;
    if (!sslSocketFactory.equals(that.sslSocketFactory))
      return false;
    return true;
    return needClientCertificate == that.needClientCertificate
        && sslSocketFactory.equals(that.sslSocketFactory);
  }
  /**
opendj-server-legacy/src/main/java/org/opends/server/replication/server/NotAssuredUpdateMsg.java
@@ -225,12 +225,8 @@
  @Override
  public boolean equals(Object obj)
  {
    // Compare with the underlying real update message
    if (obj == null)
    {
      return false;
    }
    return obj.getClass() == realUpdateMsg.getClass()
    return obj != null
        && obj.getClass() == realUpdateMsg.getClass()
        && realUpdateMsg.getCSN().equals(((UpdateMsg) obj).getCSN());
  }
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/Record.java
@@ -125,12 +125,13 @@
      return false;
    }
    Record<?, ?> other = (Record<?, ?>) that;
    final boolean keyEquals = key == null ?  other.key == null : key.equals(other.key);
    if (!keyEquals)
    {
      return false;
    }
    return value == null ?  other.value == null : value.equals(other.value);
    return equals(key, other.key)
        && equals(value, other.value);
  }
  private boolean equals(Object o1, Object o2)
  {
    return o1 == null ? o2 == null : o1.equals(o2);
  }
  /** {@inheritDoc} */
opendj-server-legacy/src/main/java/org/opends/server/schema/GuideSyntax.java
@@ -242,15 +242,9 @@
      return false;
    }
    if (! isValidSchemaElement(ocName, 0, ocLength, invalidReason))
    {
      return false;
    }
    // The rest of the value must be the criteria.
    return criteriaIsValid(valueStr.substring(sharpPos+1), valueStr,
            invalidReason);
    return isValidSchemaElement(ocName, 0, ocLength, invalidReason)
        // The rest of the value must be the criteria.
        && criteriaIsValid(valueStr.substring(sharpPos+1), valueStr, invalidReason);
  }
opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliArgumentParser.java
@@ -1794,11 +1794,7 @@
  private boolean isSubcommand(String name)
  {
    SubCommand subCommand = getSubCommand();
    if (subCommand != null)
    {
      return subCommand.getName().equalsIgnoreCase(name);
    }
    return false;
    return subCommand != null && subCommand.getName().equalsIgnoreCase(name);
  }
  /**
opendj-server-legacy/src/main/java/org/opends/server/tools/tasks/TaskClient.java
@@ -157,15 +157,9 @@
    return entryDN;
  }
  private static boolean isScheduleRecurring(
      TaskScheduleInformation information)
  private static boolean isScheduleRecurring(TaskScheduleInformation information)
  {
    boolean scheduleRecurring = false;
    if (information.getRecurringDateTime() != null) {
      scheduleRecurring = true;
    }
    return scheduleRecurring;
    return information.getRecurringDateTime() != null;
  }
  /**
opendj-server-legacy/src/main/java/org/opends/server/types/CommonSchemaElements.java
@@ -348,11 +348,7 @@
   */
  public final boolean hasNameOrOID(String lowerValue) {
    if (names.containsKey(lowerValue)) {
      return true;
    }
    return oid.equals(lowerValue);
    return names.containsKey(lowerValue) || oid.equals(lowerValue);
  }
opendj-server-legacy/src/main/java/org/opends/server/types/DITStructureRule.java
@@ -349,13 +349,11 @@
    {
      return true;
    }
    if ((o == null) || (! (o instanceof DITStructureRule)))
    if (!(o instanceof DITStructureRule))
    {
      return false;
    }
    return (ruleID == ((DITStructureRule) o).ruleID);
    return ruleID == ((DITStructureRule) o).ruleID;
  }
opendj-server-legacy/src/main/java/org/opends/server/types/EntryEncodeConfig.java
@@ -303,31 +303,19 @@
                     message);
    }
    boolean excludeDN = false;
    byte b = buffer.get();
    if ((b & ENCODE_FLAG_EXCLUDE_DN) == ENCODE_FLAG_EXCLUDE_DN)
    {
      excludeDN = true;
    }
    boolean compressAttrDescriptions = false;
    if ((b & ENCODE_FLAG_COMPRESS_ADS) == ENCODE_FLAG_COMPRESS_ADS)
    {
      compressAttrDescriptions = true;
    }
    boolean compressObjectClassSets = false;
    if ((b & ENCODE_FLAG_COMPRESS_OCS) == ENCODE_FLAG_COMPRESS_OCS)
    {
      compressObjectClassSets = true;
    }
    boolean excludeDN = is(b, ENCODE_FLAG_EXCLUDE_DN);
    boolean compressAttrDescriptions = is(b, ENCODE_FLAG_COMPRESS_ADS);
    boolean compressObjectClassSets = is(b, ENCODE_FLAG_COMPRESS_OCS);
    return new EntryEncodeConfig(excludeDN, compressAttrDescriptions,
                                 compressObjectClassSets,
                                 compressedSchema);
  }
  private static boolean is(byte b, byte flag)
  {
    return (b & flag) == flag;
  }
  /**
   * Retrieves a string representation of this entry encode
opendj-server-legacy/src/main/java/org/opends/server/types/LDAPSyntaxDescription.java
@@ -242,12 +242,10 @@
    {
      return true;
    }
    if ((o == null) || (! (o instanceof LDAPSyntaxDescription)))
    if (!(o instanceof LDAPSyntaxDescription))
    {
      return false;
    }
    return oid.equals(((LDAPSyntaxDescription) o).oid);
  }
opendj-server-legacy/src/main/java/org/opends/server/types/MatchingRuleUse.java
@@ -328,12 +328,10 @@
    {
      return true;
    }
    if ((o == null) || (! (o instanceof MatchingRuleUse)))
    if (!(o instanceof MatchingRuleUse))
    {
      return false;
    }
    return matchingRule.equals(((MatchingRuleUse) o).matchingRule);
  }
opendj-server-legacy/src/main/java/org/opends/server/types/Modification.java
@@ -202,19 +202,14 @@
    {
      return true;
    }
    if ((o == null) || (! (o instanceof Modification)))
    if (!(o instanceof Modification))
    {
      return false;
    }
    Modification m = (Modification) o;
    if (modificationType != m.modificationType)
    {
      return false;
    }
    return attribute.equals(m.attribute);
    return modificationType == m.modificationType
        && attribute.equals(m.attribute);
  }
opendj-server-legacy/src/main/java/org/opends/server/types/NameForm.java
@@ -272,12 +272,7 @@
   */
  public boolean hasNameOrOID(String lowerValue)
  {
    if (names.containsKey(lowerValue))
    {
      return true;
    }
    return lowerValue.equals(oid);
    return names.containsKey(lowerValue) || lowerValue.equals(oid);
  }
@@ -433,12 +428,10 @@
    {
      return true;
    }
    if ((o == null) || (! (o instanceof NameForm)))
    if (!(o instanceof NameForm))
    {
      return false;
    }
    return oid.equals(((NameForm) o).oid);
  }
opendj-server-legacy/src/main/java/org/opends/server/types/ObjectClass.java
@@ -195,14 +195,9 @@
      this.definition = definition;
    }
    // Set flag indicating whether or not this object class allows any
    // attributes.
    if (hasName(OC_EXTENSIBLE_OBJECT_LC)
        || oid.equals(OID_EXTENSIBLE_OBJECT)) {
      this.isExtensibleObject = true;
    } else {
      this.isExtensibleObject = false;
    }
    // Set flag indicating whether or not this object class allows any attributes
    this.isExtensibleObject = hasName(OC_EXTENSIBLE_OBJECT_LC)
        || oid.equals(OID_EXTENSIBLE_OBJECT);
    // Construct unmodifiable views of the required attributes.
    if (requiredAttributes != null) {
@@ -393,19 +388,11 @@
   */
  public boolean isOptional(AttributeType attributeType) {
    if (optionalAttributesChain.contains(attributeType)) {
      return true;
    }
    if (isExtensibleObject
        && !requiredAttributesChain.contains(attributeType)) {
      // FIXME -- Do we need to do other checks here, like whether the
      // attribute type is actually defined in the schema?
      // What about DIT content rules?
      return true;
    }
    return false;
    return optionalAttributesChain.contains(attributeType)
        || (isExtensibleObject && !requiredAttributesChain.contains(attributeType));
        // FIXME -- Do we need to do other checks here, like whether the
        // attribute type is actually defined in the schema?
        // What about DIT content rules?
  }
opendj-server-legacy/src/main/java/org/opends/server/types/SubtreeSpecification.java
@@ -1770,33 +1770,14 @@
  private boolean commonComponentsEquals(
      final SubtreeSpecification other)
  {
    if (this == other)
    {
      return true;
    }
    if (minimumDepth != other.minimumDepth)
    {
      return false;
    }
    if (maximumDepth != other.maximumDepth)
    {
      return false;
    }
    if (!chopBefore.values().equals(other.chopBefore.values()))
    {
      return false;
    }
    if (!chopAfter.values().equals(other.chopAfter.values()))
    {
      return false;
    }
    return true;
    return minimumDepth == other.minimumDepth
        && maximumDepth == other.maximumDepth
        && chopBefore.values().equals(other.chopBefore.values())
        && chopAfter.values().equals(other.chopAfter.values());
  }
opendj-server-legacy/src/main/java/org/opends/server/util/CertificateManager.java
@@ -189,9 +189,7 @@
  throws KeyStoreException {
    ensureValid(alias, CERT_ALIAS_MSG);
    KeyStore keyStore = getKeyStore();
    if (keyStore == null)
      return false;
    return keyStore.containsAlias(alias);
    return keyStore != null && keyStore.containsAlias(alias);
  }
opendj-server-legacy/src/main/java/org/opends/server/util/VersionCompatibilityIssue.java
@@ -552,31 +552,16 @@
            new ArrayList<VersionCompatibilityIssue>();
    for (VersionCompatibilityIssue evt : VERSION_COMPATIBILITY_ISSUES) {
      if (!excludeIds.contains(evt.getCause().getId())) {
        boolean isUpgrade = neu.compareTo(current) >= 0;
        BuildVersion currentVersion = new BuildVersion(
            current.getMajorVersion(), current.getMinorVersion(),
            current.getPointVersion(), current.getRevisionNumber());
        if (isUpgrade)
        // If the currentVersion is newer than the issue described, then there
        // is no problem.  This can occur for instance when we discovered a
        // flag day too late (and we added the flag day description to the
        // code way after the revision).
        if (currentVersion.compareTo(evt.getVersion()) < 0)
        {
          // If the currentVersion is newer than the issue described, then there
          // is no problem.  This can occur for instance when we discovered a
          // flag day too late (and we added the flag day description to the
          // code way after the revision).
          if (currentVersion.compareTo(evt.getVersion()) < 0)
          {
            issueList.add(evt);
          }
        }
        else
        {
          // If the newVersion in the reversion is newer than the issue
          // described, then there is no problem.  This can occur for instance
          // when we discovered a flag day too late (and we added the flag day
          // description to the code way after the revision).
          if (currentVersion.compareTo(evt.getVersion()) < 0)
          {
            issueList.add(evt);
          }
          issueList.add(evt);
        }
      }
    }
opendj-server-legacy/src/test/java/org/opends/server/backends/task/TaskBackendTestCase.java
@@ -606,10 +606,7 @@
      "ds-task-class-name: org.opends.server.tasks.DummyTask",
      "ds-task-dummy-sleep-time: 0");
    if (rc != ResultCode.SUCCESS) {
      return false;
    }
    return DirectoryServer.entryExists(DN.valueOf(taskDN));
    return rc == ResultCode.SUCCESS
        && DirectoryServer.entryExists(DN.valueOf(taskDN));
  }
}
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/LdapTestCase.java
@@ -58,11 +58,8 @@
   */
  static boolean testEqual(LDAPAttribute a1, LDAPAttribute a2)
  {
    if (a1.getAttributeType().equals(a2.getAttributeType()))
    {
      return a1.getValues().equals(a2.getValues());
    }
    return false;
    return a1.getAttributeType().equals(a2.getAttributeType())
        && a1.getValues().equals(a2.getValues());
  }
  /**