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

Jean-Noël Rouvignac
14.27.2016 7028d9f1483d6f1e77bb0f5ebd0ecc6239e431c5
AutoRefactor'ed use Map.entrySet() instead of Map.keySet() in a loop
43 files modified
529 ■■■■ changed files
opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/SetPropSubCommandHandler.java 11 ●●●●● patch | view | raw | blame | history
opendj-core/src/main/java/org/forgerock/opendj/ldif/TemplateFile.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/forgerock/opendj/reactive/LDAPClientConnection2.java 13 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/admin/ads/ADSContext.java 20 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/LDAPConnectionPool.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/NodeSearcherQueue.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/DeleteSchemaElementsTask.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java 17 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/ConfigFromConnection.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/Installer.java 20 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/InstallerHelper.java 14 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/DataOptionsPanel.java 16 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/DataReplicationPanel.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/GlobalAdministratorPanel.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/InstallReviewPanel.java 10 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/RemoteReplicationPortsPanel.java 30 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/ServerSettingsPanel.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/SuffixesToReplicatePanel.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/Utils.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/ZipExtractor.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/doc/ConfigGuideGeneration.java 11 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/BackupBackend.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/CharacterSetPasswordValidator.java 21 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroupMemberList.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/extensions/FIFOEntryCache.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileViewer.java 11 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfilerThread.java 10 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPClientConnection.java 6 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/common/MultiDomainServerState.java 9 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/common/ServerState.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java 21 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationBroker.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/schema/SchemaFilesWriter.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/ListBackends.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/ManageTasks.java 15 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java 16 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/BackupInfo.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java 35 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordControlTest.java 98 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/controls/PersistentSearchControlTest.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerLoadBalancingTest.java 2 ●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/SetPropSubCommandHandler.java
@@ -73,9 +73,8 @@
 * This sub-command implements the various set-xxx-prop sub-commands.
 */
final class SetPropSubCommandHandler extends SubCommandHandler {
    /** Type of modification being performed. */
    private static enum ModificationType {
    private enum ModificationType {
        /** Append a single value to the property. */
        ADD,
        /** Remove a single value from the property. */
@@ -443,8 +442,7 @@
                            } else {
                                app.println();
                                if (app.confirmAction(INFO_DSCFG_PROMPT_EDIT_TO_ENABLE.get(rufn, name, ufn), true)) {
                                    MenuResult<Void> result = SetPropSubCommandHandler.modifyManagedObject(app,
                                            context, ref, handler);
                                    MenuResult<Void> result = modifyManagedObject(app, context, ref, handler);
                                    if (result.isQuit()) {
                                        return result;
                                    } else if (result.isSuccess()) {
@@ -641,7 +639,6 @@
        // Reset properties.
        for (String m : propertyResetArgument.getValues()) {
            // Check one does not try to reset with a value
            if (m.contains(":")) {
                throw ArgumentExceptionFactory.unableToResetPropertyWithValue(m, OPTION_DSCFG_LONG_RESET);
@@ -714,9 +711,9 @@
        }
        // Apply the command line changes.
        for (PropertyDefinition<?> pd : changes.keySet()) {
        for (Map.Entry<PropertyDefinition, Set> entry : changes.entrySet()) {
            try {
                child.setPropertyValues(pd, changes.get(pd));
                child.setPropertyValues(entry.getKey(), entry.getValue());
            } catch (PropertyException e) {
                throw ArgumentExceptionFactory.adaptPropertyException(e, d);
            }
opendj-core/src/main/java/org/forgerock/opendj/ldif/TemplateFile.java
@@ -1934,8 +1934,9 @@
        Entry toEntry() {
            final Entry entry = new LinkedHashMapEntry(getDN());
            for (final AttributeType attributeType : attributes.keySet()) {
                final List<TemplateValue> valueList = attributes.get(attributeType);
            for (Map.Entry<AttributeType, List<TemplateValue>> mapEntry : attributes.entrySet()) {
                AttributeType attributeType = mapEntry.getKey();
                final List<TemplateValue> valueList = mapEntry.getValue();
                final Attribute newAttribute =
                        new LinkedAttribute(AttributeDescription.create(attributeType));
                for (final TemplateValue value : valueList) {
opendj-server-legacy/src/main/java/org/forgerock/opendj/reactive/LDAPClientConnection2.java
@@ -34,6 +34,7 @@
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
@@ -56,7 +57,6 @@
import org.forgerock.opendj.ldap.DN;
import org.forgerock.opendj.ldap.LDAPClientContext;
import org.forgerock.opendj.ldap.LDAPClientContext.ConnectionEventListener;
import org.forgerock.opendj.ldap.LdapException;
import org.forgerock.opendj.ldap.ResultCode;
import org.forgerock.opendj.ldap.requests.UnbindRequest;
import org.forgerock.opendj.ldap.responses.CompareResult;
@@ -199,9 +199,6 @@
     *            The socket channel that may be used to communicate with the client.
     * @param protocol
     *            String representing the protocol (LDAP or LDAP+SSL).
     * @throws LdapException
     * @throws DirectoryException
     *             If SSL initialisation fails.
     */
    LDAPClientConnection2(LDAPConnectionHandler2 connectionHandler, LDAPClientContext clientContext, String protocol,
            boolean keepStats) {
@@ -765,8 +762,7 @@
            }
            // Try to add the operation to the work queue,
            // or run it synchronously (typically for the administration
            // connector)
            // or run it synchronously (typically for the administration connector)
            queueingStrategy.enqueueRequest(operation);
        } catch (DirectoryException de) {
            logger.traceException(de);
@@ -890,12 +886,13 @@
        // Make sure that no one can add any new operations.
        synchronized (opsInProgressLock) {
            try {
                for (int msgID : operationsInProgress.keySet()) {
                for (Map.Entry<Integer, Operation> entry : operationsInProgress.entrySet()) {
                    int msgID = entry.getKey();
                    if (msgID == messageID) {
                        continue;
                    }
                    Operation o = operationsInProgress.get(msgID);
                    Operation o = entry.getValue();
                    if (o != null) {
                        try {
                            o.abort(cancelRequest);
opendj-server-legacy/src/main/java/org/opends/admin/ads/ADSContext.java
@@ -330,9 +330,10 @@
    DN dn = makeDNFromServerProperties(serverProperties);
    AddRequest request = newAddRequest(dn);
    for (ServerProperty prop : serverProperties.keySet())
    for (Map.Entry<ServerProperty, Object> entry : serverProperties.entrySet())
    {
      Attribute attribute = makeAttrFromServerProperty(prop, serverProperties.get(prop));
      ServerProperty prop = entry.getKey();
      Attribute attribute = makeAttrFromServerProperty(prop, entry.getValue());
      if (attribute != null)
      {
        request.addAttribute(attribute);
@@ -414,9 +415,10 @@
    try
    {
      ModifyRequest request = newModifyRequest(dn);
      for (ServerProperty prop : serverProperties.keySet())
      for (Map.Entry<ServerProperty, Object> entry : serverProperties.entrySet())
      {
        Attribute attr = makeAttrFromServerProperty(prop, serverProperties.get(prop));
        ServerProperty prop = entry.getKey();
        Attribute attr = makeAttrFromServerProperty(prop, entry.getValue());
        if (attr != null)
        {
          request.addModification(new Modification(REPLACE, attr));
@@ -725,9 +727,10 @@
    String dn = makeDNFromServerGroupProperties(serverGroupProperties);
    AddRequest request = newAddRequest(dn)
        .addAttribute("objectclass", "top", "groupOfUniqueNames");
    for (ServerGroupProperty prop : serverGroupProperties.keySet())
    for (Map.Entry<ServerGroupProperty, Object> entry : serverGroupProperties.entrySet())
    {
      request.addAttribute(makeAttrFromServerGroupProperty(prop, serverGroupProperties.get(prop)));
      ServerGroupProperty prop = entry.getKey();
      request.addAttribute(makeAttrFromServerGroupProperty(prop, entry.getValue()));
    }
    try
@@ -782,10 +785,11 @@
      // Transform 'properties' into 'attributes'
      ModifyRequest request = newModifyRequest(dn);
      for (ServerGroupProperty prop : serverGroupProperties.keySet())
      for (Map.Entry<ServerGroupProperty, Object> entry : serverGroupProperties.entrySet())
      {
        ServerGroupProperty prop = entry.getKey();
        request.addModification(new Modification(
            REPLACE, makeAttrFromServerGroupProperty(prop, serverGroupProperties.get(prop))));
            REPLACE, makeAttrFromServerGroupProperty(prop, entry.getValue())));
      }
      throwIfNotSuccess(connectionWrapper.getConnection().modify(request));
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/LDAPConnectionPool.java
@@ -20,6 +20,7 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import javax.net.ssl.KeyManager;
@@ -85,9 +86,8 @@
   *         {@code false} otherwise.
   */
  public boolean isConnectionRegistered(ConnectionWrapper conn) {
    for (String key : connectionTable.keySet())
    for (ConnectionRecord cr : connectionTable.values())
    {
      final ConnectionRecord cr = connectionTable.get(key);
      if (cr.conn != null)
      {
        final ConnectionWrapper c = cr.conn.getConnectionWrapper();
@@ -245,8 +245,9 @@
    String targetKey = null;
    ConnectionRecord targetRecord = null;
    synchronized(this) {
      for (String key : connectionTable.keySet()) {
        ConnectionRecord cr = connectionTable.get(key);
      for (Map.Entry<String, ConnectionRecord> entry : connectionTable.entrySet()) {
        String key = entry.getKey();
        ConnectionRecord cr = entry.getValue();
        if (cr.conn == conn) {
          targetKey = key;
          targetRecord = cr;
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/NodeSearcherQueue.java
@@ -132,9 +132,10 @@
  /** Cancel all the object from this queue. */
  public synchronized void cancelAll() {
    waitingQueue.clear();
    for (BasicNode node : workingList.keySet())
    for (Map.Entry<BasicNode, AbstractNodeTask> entry : workingList.entrySet())
    {
      AbstractNodeTask task = workingList.get(node);
      BasicNode node = entry.getKey();
      AbstractNodeTask task = entry.getValue();
      cancelList.put(node, node);
      task.cancel();
    }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/DeleteSchemaElementsTask.java
@@ -626,9 +626,10 @@
  {
    Map<String, List<String>> extraProperties = new HashMap<>();
    Map<String, List<String>> props = element.getExtraProperties();
    for (String name : props.keySet())
    for (Map.Entry<String, List<String>> entry : props.entrySet())
    {
      extraProperties.put(name, new ArrayList<>(props.get(name)));
      String name = entry.getKey();
      extraProperties.put(name, new ArrayList<>(entry.getValue()));
    }
    return extraProperties;
  }
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java
@@ -413,9 +413,10 @@
        gbc.fill = GridBagConstraints.NONE;
        gbc.anchor = GridBagConstraints.NORTHWEST;
        gbc.insets.top = 10;
        for (LocalizableMessage label : taskSpecificAttrs.keySet())
        for (Map.Entry<LocalizableMessage, List<String>> entry : taskSpecificAttrs.entrySet())
        {
          List<String> values = taskSpecificAttrs.get(label);
          LocalizableMessage label = entry.getKey();
          List<String> values = entry.getValue();
          gbc.gridx = 0;
          gbc.insets.left = 10;
          gbc.insets.right = 0;
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java
@@ -83,6 +83,7 @@
import org.forgerock.opendj.ldap.RDN;
import org.forgerock.opendj.ldap.schema.AttributeType;
import org.forgerock.opendj.ldap.schema.ObjectClass;
import org.forgerock.opendj.ldap.schema.Schema;
import org.forgerock.opendj.ldap.schema.Syntax;
import org.forgerock.opendj.ldif.LDIFEntryReader;
import org.opends.guitools.controlpanel.datamodel.BinaryValue;
@@ -97,7 +98,6 @@
import org.opends.guitools.controlpanel.util.Utilities;
import org.opends.server.schema.SchemaConstants;
import org.opends.server.types.OpenDsException;
import org.forgerock.opendj.ldap.schema.Schema;
/** The panel displaying a simplified view of an entry. */
class SimplifiedViewEntryPanel extends ViewEntryPanel
@@ -1178,9 +1178,10 @@
      errors.add(ERR_CTRL_PANEL_DN_NOT_VALID.get());
    }
    for (String attrName : hmLabels.keySet())
    for (Map.Entry<String, JComponent> mapEntry : hmLabels.entrySet())
    {
      setPrimaryValid(hmLabels.get(attrName));
      mapEntry.getKey();
      setPrimaryValid(mapEntry.getValue());
    }
    // Check passwords
@@ -1416,13 +1417,14 @@
          Schema schema = getInfo().getServerDescriptor().getSchema();
          if (schema != null)
          {
            for (String attrName : hmEditors.keySet())
            for (Map.Entry<String, List<EditorComponent>> entry : hmEditors.entrySet())
            {
              String attrName = entry.getKey();
              if (isPassword(attrName) || isConfirmPassword(attrName))
              {
                continue;
              }
              List<EditorComponent> comps = hmEditors.get(attrName);
              List<EditorComponent> comps = entry.getValue();
              if (!comps.isEmpty())
              {
                Object o = comps.iterator().next().getValue();
@@ -1666,10 +1668,11 @@
  private void updateAttributeVisibility(boolean showAll)
  {
    for (String attrName : hmLabels.keySet())
    for (Map.Entry<String, JComponent> entry : hmLabels.entrySet())
    {
      String attrName = entry.getKey();
      final boolean visible = showAll || requiredAttrs.contains(attrName) || hasValue(hmEditors.get(attrName));
      hmLabels    .get(attrName).setVisible(visible);
      entry.getValue().setVisible(visible);
      hmComponents.get(attrName).setVisible(visible);
    }
    repaint();
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/ConfigFromConnection.java
@@ -1070,8 +1070,9 @@
    Set<SearchResultEntry> monitorEntries = new HashSet<>();
    if (ch.getState() == ConnectionHandlerDescriptor.State.ENABLED)
    {
      for (String key : hmConnectionHandlersMonitor.keySet())
      for (Map.Entry<String, SearchResultEntry> entry : hmConnectionHandlersMonitor.entrySet())
      {
        String key = entry.getKey();
        // The name of the connection handler does not appear necessarily in the
        // key (which is based on the DN of the monitoring entry).  In general
        // the DN contains the String specified in
@@ -1082,7 +1083,7 @@
        if (key.contains(getKey("port " + ch.getPort()))
            && hasAllAddresses(ch, key))
        {
          monitorEntries.add(hmConnectionHandlersMonitor.get(key));
          monitorEntries.add(entry.getValue());
        }
      }
    }
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/Installer.java
@@ -1831,12 +1831,13 @@
      }
    }
    InstallerHelper helper = new InstallerHelper();
    for (ServerDescriptor server : hmConfiguredRemoteReplication.keySet())
    for (Map.Entry<ServerDescriptor, ConfiguredReplication> entry : hmConfiguredRemoteReplication.entrySet())
    {
      ServerDescriptor server = entry.getKey();
      notifyListeners(getFormattedWithPoints(INFO_PROGRESS_UNCONFIGURING_REPLICATION_REMOTE.get(getHostPort(server))));
      try (ConnectionWrapper connectionWrapper = getRemoteConnection(server))
      {
        helper.unconfigureReplication(connectionWrapper, hmConfiguredRemoteReplication.get(server));
        helper.unconfigureReplication(connectionWrapper, entry.getValue());
      }
      catch (ApplicationException ae)
      {
@@ -1939,9 +1940,10 @@
    try (ConnectionWrapper connection = createLocalConnection())
    {
      final InstallerHelper helper = new InstallerHelper();
      for (String backendId : hmBackendSuffix.keySet())
      for (Map.Entry<String, Set<DN>> entry : hmBackendSuffix.entrySet())
      {
        helper.createBackend(connection, backendId, hmBackendSuffix.get(backendId),
        String backendId = entry.getKey();
        helper.createBackend(connection, backendId, entry.getValue(),
            backendTypes.get(backendId).getBackend());
      }
    }
@@ -2087,8 +2089,9 @@
          replicas.add(replica);
        }
      }
      for (ServerDescriptor server : hm.keySet())
      for (Map.Entry<ServerDescriptor, Set<ReplicaDescriptor>> entry : hm.entrySet())
      {
        ServerDescriptor server = entry.getKey();
        notifyListeners(getFormattedWithPoints(INFO_PROGRESS_CONFIGURING_REPLICATION_REMOTE.get(getHostPort(server))));
        Integer v = (Integer) server.getServerProperties().get(REPLICATION_SERVER_PORT);
        int replicationPort;
@@ -2114,7 +2117,7 @@
          }
        }
        Set<DN> dns = new HashSet<>();
        for (ReplicaDescriptor replica : hm.get(server))
        for (ReplicaDescriptor replica : entry.getValue())
        {
          dns.add(replica.getSuffix().getDN());
        }
@@ -2127,11 +2130,12 @@
          if (repServer == null)
          {
            // Do the comparison manually
            for (DN dn1 : replicationServers.keySet())
            for (Map.Entry<DN, Set<HostPort>> rs1 : replicationServers.entrySet())
            {
              DN dn1 = rs1.getKey();
              if (dn.equals(dn1))
              {
                repServer = replicationServers.get(dn1);
                repServer = rs1.getValue();
                dn = dn1;
                break;
              }
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/InstallerHelper.java
@@ -504,8 +504,9 @@
      {
        domains[i] = sync.getReplicationDomain(domainNames[i]);
      }
      for (DN dn : replicationServers.keySet())
      for (Map.Entry<DN, Set<HostPort>> entry : replicationServers.entrySet())
      {
        DN dn = entry.getKey();
        ReplicationDomainCfgClient domain = null;
        boolean isCreated;
        String domainName = null;
@@ -538,7 +539,7 @@
        {
          oldServers = new TreeSet<>();
        }
        servers = toLowerCaseStrings(replicationServers.get(dn));
        servers = toLowerCaseStrings(entry.getValue());
        domain.setReplicationServer(servers);
        usedReplicaServerIds.add(domain.getServerId());
@@ -961,15 +962,16 @@
        writer.newLine();
      }
      for (String key : otherProperties.keySet())
      for (Map.Entry<String, String> entry : otherProperties.entrySet())
      {
        writer.write(key + "=" + otherProperties.get(key));
        writer.write(entry.getKey() + "=" + entry.getValue());
        writer.newLine();
      }
      for (String scriptName : arguments.keySet())
      for (Map.Entry<String, JavaArguments> entry : arguments.entrySet())
      {
        String argument = arguments.get(scriptName).getStringArguments();
        String scriptName = entry.getKey();
        String argument = entry.getValue().getStringArguments();
        writer.newLine();
        writer.write(getJavaArgPropertyForScript(scriptName) + "=" + argument);
      }
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/DataOptionsPanel.java
@@ -27,6 +27,7 @@
import java.awt.event.FocusListener;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.swing.Box;
import javax.swing.ButtonGroup;
@@ -92,9 +93,10 @@
  {
    if (fieldName == FieldName.DATA_OPTIONS)
    {
      for (NewSuffixOptions.Type type : hmRadioButtons.keySet())
      for (Map.Entry<NewSuffixOptions.Type, JRadioButton> entry : hmRadioButtons.entrySet())
      {
        if (hmRadioButtons.get(type).isSelected())
        NewSuffixOptions.Type type = entry.getKey();
        if (entry.getValue().isSelected())
        {
          return type;
        }
@@ -402,9 +404,10 @@
        LabelFieldDescriptor.LabelType.SECONDARY, UIFactory.NUMBER_ENTRIES_FIELD_SIZE);
    hm.put(FieldName.NUMBER_ENTRIES, entryNumberLabelDescriptor);
    for (final FieldName fieldName : hm.keySet())
    for (Map.Entry<FieldName, LabelFieldDescriptor> entry : hm.entrySet())
    {
      final LabelFieldDescriptor desc = hm.get(fieldName);
      FieldName fieldName = entry.getKey();
      final LabelFieldDescriptor desc = entry.getValue();
      final String defaultValue = fieldName == FieldName.NUMBER_ENTRIES ?
                                            Integer.toString(defaultUserData.getNewSuffixOptions().getNumberEntries())
                                          : getDefaultValue(fieldName);
@@ -461,9 +464,10 @@
    final NewSuffixOptions.Type defaultType = defaultUserData.getNewSuffixOptions().getType();
    final ButtonGroup buttonGroup = new ButtonGroup();
    for (NewSuffixOptions.Type type : hmRadioButtons.keySet())
    for (Map.Entry<NewSuffixOptions.Type, JRadioButton> entry : hmRadioButtons.entrySet())
    {
      final JRadioButton radioButton = hmRadioButtons.get(type);
      NewSuffixOptions.Type type = entry.getKey();
      final JRadioButton radioButton = entry.getValue();
      radioButton.setSelected(type == defaultType);
      buttonGroup.add(radioButton);
    }
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/DataReplicationPanel.java
@@ -27,6 +27,7 @@
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.util.HashMap;
import java.util.Map;
import javax.swing.Box;
import javax.swing.ButtonGroup;
@@ -368,9 +369,10 @@
        LabelFieldDescriptor.LabelType.SECONDARY,
        UIFactory.PORT_FIELD_SIZE));
    for (FieldName fieldName : hm.keySet())
    for (Map.Entry<FieldName, LabelFieldDescriptor> entry : hm.entrySet())
    {
      LabelFieldDescriptor desc = hm.get(fieldName);
      FieldName fieldName = entry.getKey();
      LabelFieldDescriptor desc = entry.getValue();
      String defaultValue = getDefaultStringValue(fieldName);
      JTextComponent field = UIFactory.makeJTextComponent(desc, defaultValue);
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/GlobalAdministratorPanel.java
@@ -25,6 +25,7 @@
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.util.HashMap;
import java.util.Map;
import javax.swing.Box;
import javax.swing.JLabel;
@@ -234,9 +235,10 @@
        LabelFieldDescriptor.LabelType.PRIMARY,
        UIFactory.PASSWORD_FIELD_SIZE));
    for (FieldName fieldName : hm.keySet())
    for (Map.Entry<FieldName, LabelFieldDescriptor> entry : hm.entrySet())
    {
      LabelFieldDescriptor desc = hm.get(fieldName);
      FieldName fieldName = entry.getKey();
      LabelFieldDescriptor desc = entry.getValue();
      String defaultValue = getDefaultValue(fieldName);
      JTextComponent field = UIFactory.makeJTextComponent(desc, defaultValue);
      JLabel label = UIFactory.makeJLabel(desc);
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/InstallReviewPanel.java
@@ -300,9 +300,10 @@
            LabelFieldDescriptor.FieldType.READ_ONLY,
            LabelFieldDescriptor.LabelType.PRIMARY, 0));
    for (final FieldName fieldName : hm.keySet())
    for (Map.Entry<FieldName, org.opends.quicksetup.ui.LabelFieldDescriptor> entry : hm.entrySet())
    {
      final LabelFieldDescriptor desc = hm.get(fieldName);
      FieldName fieldName = entry.getKey();
      final LabelFieldDescriptor desc = entry.getValue();
      final JLabel label = UIFactory.makeJLabel(desc);
      final JTextComponent field = UIFactory.makeJTextComponent(desc, null);
      field.setOpaque(false);
@@ -354,8 +355,9 @@
      buf.append(s);
      final TreeSet<LocalizableMessage> remoteServerLines = new TreeSet<>();
      for (final ServerDescriptor server : remotePorts.keySet())
      for (Map.Entry<ServerDescriptor, AuthenticationData> entry : remotePorts.entrySet())
      {
        ServerDescriptor server = entry.getKey();
        HostPort serverDisplay;
        if (server.getHostPort(false).equals(serverToConnectDisplay))
        {
@@ -366,7 +368,7 @@
          serverDisplay = server.getHostPort(true);
        }
        final AuthenticationData repPort = remotePorts.get(server);
        final AuthenticationData repPort = entry.getValue();
        if (repPort.useSecureConnection())
        {
          s = INFO_SECURE_REPLICATION_PORT_LABEL.get(repPort.getPort()).toString();
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/RemoteReplicationPortsPanel.java
@@ -84,18 +84,20 @@
    if (fieldName == FieldName.REMOTE_REPLICATION_PORT)
    {
      Map<String, String> hm = new HashMap<>();
      for (String id : hmFields.keySet())
      for (Map.Entry<String, JTextComponent> entry : hmFields.entrySet())
      {
        hm.put(id, hmFields.get(id).getText());
        String id = entry.getKey();
        hm.put(id, entry.getValue().getText());
      }
      value = hm;
    }
    else if (fieldName == FieldName.REMOTE_REPLICATION_SECURE)
    {
      Map<String, Boolean> hm = new HashMap<>();
      for (String id : hmCbs.keySet())
      for (Map.Entry<String, JCheckBox> entry : hmCbs.entrySet())
      {
        hm.put(id, hmCbs.get(id).isSelected());
        String id = entry.getKey();
        hm.put(id, entry.getValue().isSelected());
      }
      value = hm;
    }
@@ -107,19 +109,21 @@
  {
    if (fieldName == FieldName.REMOTE_REPLICATION_PORT)
    {
      for (String id : hmLabels.keySet())
      for (Map.Entry<String, JLabel> entry : hmLabels.entrySet())
      {
        UIFactory.setTextStyle(hmLabels.get(id),
        String id = entry.getKey();
        UIFactory.setTextStyle(entry.getValue(),
            UIFactory.TextStyle.SECONDARY_FIELD_VALID);
      }
      if (invalid)
      {
        for (String id : hmLabels.keySet())
        for (Map.Entry<String, JLabel> entry : hmLabels.entrySet())
        {
          String id = entry.getKey();
          String sPort = hmFields.get(id).getText();
          if (!isValid(sPort))
          {
            UIFactory.setTextStyle(hmLabels.get(id),
            UIFactory.setTextStyle(entry.getValue(),
              UIFactory.TextStyle.SECONDARY_FIELD_INVALID);
          }
        }
@@ -218,14 +222,16 @@
      };
      lastFocusComponent = null;
      HashMap<String, String> hmOldValues = new HashMap<>();
      for (String id : hmFields.keySet())
      for (Map.Entry<String, JTextComponent> entry : hmFields.entrySet())
      {
        hmOldValues.put(id, hmFields.get(id).getText());
        String id = entry.getKey();
        hmOldValues.put(id, entry.getValue().getText());
      }
      HashMap<String, Boolean> hmOldSecureValues = new HashMap<>();
      for (String id : hmCbs.keySet())
      for (Map.Entry<String, JCheckBox> entry : hmCbs.entrySet())
      {
        hmOldSecureValues.put(id, hmCbs.get(id).isSelected());
        String id = entry.getKey();
        hmOldSecureValues.put(id, entry.getValue().isSelected());
      }
      orderedServers.clear();
      orderedServers.addAll(array);
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/ServerSettingsPanel.java
@@ -27,6 +27,7 @@
import java.awt.event.FocusListener;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import javax.swing.Box;
import javax.swing.JButton;
@@ -411,9 +412,10 @@
        LabelFieldDescriptor.LabelType.PRIMARY,
        UIFactory.PASSWORD_FIELD_SIZE));
    for (FieldName fieldName : hm.keySet())
    for (Map.Entry<FieldName, LabelFieldDescriptor> entry : hm.entrySet())
    {
      LabelFieldDescriptor desc = hm.get(fieldName);
      FieldName fieldName = entry.getKey();
      LabelFieldDescriptor desc = entry.getValue();
      String defaultValue = getDefaultValue(fieldName);
      JLabel label = UIFactory.makeJLabel(desc);
opendj-server-legacy/src/main/java/org/opends/quicksetup/installer/ui/SuffixesToReplicatePanel.java
@@ -219,9 +219,10 @@
    {
      serverToConnectDisplay = newServerDisplay;
      Map<String, Boolean> hmOldValues = new HashMap<>();
      for (String id : hmCheckBoxes.keySet())
      for (Entry<String, JCheckBox> entry : hmCheckBoxes.entrySet())
      {
        hmOldValues.put(id, hmCheckBoxes.get(id).isSelected());
        String id = entry.getKey();
        hmOldValues.put(id, entry.getValue().isSelected());
      }
      orderedSuffixes.clear();
      for (SuffixDescriptor suffix : array)
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/Utils.java
@@ -1557,9 +1557,10 @@
  {
    final List<List<String>> cmdLines = new ArrayList<>();
    final Map<ServerDescriptor, Set<DN>> hmServerBaseDNs = getServerDescriptorBaseDNMap(userData);
    for (ServerDescriptor server : hmServerBaseDNs.keySet())
    for (Map.Entry<ServerDescriptor, Set<DN>> entry : hmServerBaseDNs.entrySet())
    {
      cmdLines.add(getDsReplicationEquivalentCommandLine(subcommand, userData, hmServerBaseDNs.get(server), server));
      ServerDescriptor server = entry.getKey();
      cmdLines.add(getDsReplicationEquivalentCommandLine(subcommand, userData, entry.getValue(), server));
    }
    return cmdLines;
  }
opendj-server-legacy/src/main/java/org/opends/quicksetup/util/ZipExtractor.java
@@ -217,8 +217,9 @@
      if (isUnix()) {
        // Change the permissions for UNIX systems
        for (String perm : permissions.keySet()) {
          List<String> paths = permissions.get(perm);
        for (Map.Entry<String, List<String>> mapEntry : permissions.entrySet()) {
          String perm = mapEntry.getKey();
          List<String> paths = mapEntry.getValue();
          try {
            int result = Utils.setPermissionsUnix(paths, perm);
            if (result != 0) {
opendj-server-legacy/src/main/java/org/opends/server/admin/doc/ConfigGuideGeneration.java
@@ -21,6 +21,7 @@
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;
import java.util.TreeSet;
@@ -241,10 +242,11 @@
      "configuration components.");
    jumpSection();
    for (String catName : list.keySet()) {
    for (Map.Entry<String, TreeMap<String, AbstractManagedObjectDefinition>> entry : list.entrySet()) {
      String catName = entry.getKey();
      heading3(getFriendlyName(catName));
      // Get the list of the category
      TreeMap<String, AbstractManagedObjectDefinition> catList = list.get(catName);
      TreeMap<String, AbstractManagedObjectDefinition> catList = entry.getValue();
      for (AbstractManagedObjectDefinition mo : catList.values()) {
        RelationDefinition relDefn = relList.get(mo.getName());
        if (relDefn != null && relDefn.hasOption(RelationOption.HIDDEN)) {
@@ -307,10 +309,11 @@
      "container components.");
    jumpSection();
    for (String catName : list.keySet()) {
    for (Map.Entry<String, TreeMap<String, RelationDefinition>> entry : list.entrySet()) {
      String catName = entry.getKey();
      heading3(getFriendlyName(catName));
      // Get the list of the category
      TreeMap<String, RelationDefinition> catList = list.get(catName);
      TreeMap<String, RelationDefinition> catList = entry.getValue();
      genMORelationTree(catList);
    }
opendj-server-legacy/src/main/java/org/opends/server/backends/BackupBackend.java
@@ -336,8 +336,9 @@
    if (backupBaseDN.equals(entryDN))
    {
      long count = 0;
      for (File dir : backupDirectories.keySet())
      for (Map.Entry<File, CachedBackupDirectory> entry : backupDirectories.entrySet())
      {
        File dir = entry.getKey();
        // Check to see if the descriptor file exists.  If not, then skip this
        // backup directory.
        File descriptorFile = new File(dir, BACKUP_DIRECTORY_DESCRIPTOR_FILE);
@@ -353,8 +354,8 @@
          count++;
          try
          {
            BackupDirectory backupDirectory = backupDirectories.get(dir).getBackupDirectory();
            count += backupDirectory.getBackups().keySet().size();
            BackupDirectory backupDirectory = entry.getValue().getBackupDirectory();
            count += backupDirectory.getBackups().size();
          }
          catch (Exception e)
          {
@@ -390,7 +391,7 @@
        {
          File dir = new File(v.toString());
          BackupDirectory backupDirectory = backupDirectories.get(dir).getBackupDirectory();
          count += backupDirectory.getBackups().keySet().size();
          count += backupDirectory.getBackups().size();
        }
        catch (Exception e)
        {
opendj-server-legacy/src/main/java/org/opends/server/extensions/CharacterSetPasswordValidator.java
@@ -22,6 +22,7 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.forgerock.i18n.LocalizableMessage;
@@ -159,9 +160,10 @@
    int usedOptionalCharacterSets = 0;
    int optionalCharacterSets = 0;
    int mandatoryCharacterSets = 0;
    for (String characterSet : characterSets.keySet())
    for (Map.Entry<String, Integer> entry : characterSets.entrySet())
    {
      int minimumCount = characterSets.get(characterSet);
      String characterSet = entry.getKey();
      int minimumCount = entry.getValue();
      Integer passwordCount = setCounts.get(characterSet);
      if (minimumCount > 0)
      {
@@ -185,9 +187,10 @@
        }
      }
    }
    for (String characterRange : characterRanges.keySet())
    for (Map.Entry<String, Integer> entry : characterRanges.entrySet())
    {
      int minimumCount = characterRanges.get(characterRange);
      String characterRange = entry.getKey();
      int minimumCount = entry.getValue();
      Integer passwordCount = rangeCounts.get(characterRange);
      if (minimumCount > 0)
      {
@@ -229,9 +232,10 @@
      if (usedOptionalCharacterSets < requiredOptionalCharacterSets)
      {
        StringBuilder builder = new StringBuilder();
        for (String characterSet : characterSets.keySet())
        for (Map.Entry<String, Integer> entry : characterSets.entrySet())
        {
          if (characterSets.get(characterSet) == 0)
          String characterSet = entry.getKey();
          if (entry.getValue() == 0)
          {
            if (builder.length() > 0)
            {
@@ -242,9 +246,10 @@
            builder.append('\'');
          }
        }
        for (String characterRange : characterRanges.keySet())
        for (Map.Entry<String, Integer> entry : characterRanges.entrySet())
        {
          if (characterRanges.get(characterRange) == 0)
          String characterRange = entry.getKey();
          if (entry.getValue() == 0)
          {
            if (builder.length() > 0)
            {
opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroupMemberList.java
@@ -22,6 +22,7 @@
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
@@ -213,9 +214,10 @@
    // optimizations that we can do here, but in general the filter will look
    // like "(&(filter)(|(urlFilters)))".
    LinkedHashMap<DN,SearchFilter> searchMap = new LinkedHashMap<>();
    for (DN urlBaseDN : baseDNs.keySet())
    for (Map.Entry<DN, LinkedList<LDAPURL>> entry : baseDNs.entrySet())
    {
      LinkedList<LDAPURL> urlList = baseDNs.get(urlBaseDN);
      DN urlBaseDN = entry.getKey();
      LinkedList<LDAPURL> urlList = entry.getValue();
      LinkedHashSet<SearchFilter> urlFilters = new LinkedHashSet<>();
      for (LDAPURL url : urlList)
      {
opendj-server-legacy/src/main/java/org/opends/server/extensions/FIFOEntryCache.java
@@ -906,8 +906,9 @@
    }
    // Check dnMap first.
    for (DN dn : dnMapCopy.keySet()) {
      final CacheEntry cacheEntry = dnMapCopy.get(dn);
    for (Map.Entry<DN, CacheEntry> mapEntry : dnMapCopy.entrySet()) {
      DN dn = mapEntry.getKey();
      final CacheEntry cacheEntry = mapEntry.getValue();
      sb.append(dn);
      sb.append(":");
      sb.append(cacheEntry != null ? Long.toString(cacheEntry.getEntryID()) : null);
opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfileViewer.java
@@ -23,6 +23,7 @@
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
@@ -528,11 +529,12 @@
      html.append("</B><BR><BR>Occurrences by Source Line Number:<BR>");
      HashMap<Integer,Long> lineNumbers = frame.getLineNumbers();
      for (Integer lineNumber : lineNumbers.keySet())
      for (Map.Entry<Integer, Long> entry : lineNumbers.entrySet())
      {
        Integer lineNumber = entry.getKey();
        html.append("     ");
        long count = lineNumbers.get(lineNumber);
        long count = entry.getValue();
        if (lineNumber == ProfileStack.LINE_NUMBER_NATIVE)
        {
@@ -568,10 +570,11 @@
                              frame.getMethodName();
      HashMap<ProfileStack,Long> stacks = stacksByMethod.get(classAndMethod);
      for (ProfileStack stack : stacks.keySet())
      for (Map.Entry<ProfileStack, Long> entry : stacks.entrySet())
      {
        ProfileStack stack = entry.getKey();
        html.append("<BR><BR>");
        html.append(stacks.get(stack));
        html.append(entry.getValue());
        html.append(" occurrence(s):");
        appendHTMLStack(stack, html, classAndMethod);
opendj-server-legacy/src/main/java/org/opends/server/plugins/profiler/ProfilerThread.java
@@ -110,8 +110,9 @@
      // Iterate through the threads and process their associated stack traces.
      for (Thread t : stacks.keySet())
      for (Map.Entry<Thread, StackTraceElement[]> entry : stacks.entrySet())
      {
        Thread t = entry.getKey();
        // We don't want to capture information about the profiler thread.
        if (t == currentThread())
        {
@@ -120,7 +121,7 @@
        // We'll skip over any stack that doesn't have any information.
        StackTraceElement[] threadStack = stacks.get(t);
        StackTraceElement[] threadStack = entry.getValue();
        if (threadStack == null || threadStack.length == 0)
        {
          continue;
@@ -234,10 +235,11 @@
      // For each unique stack captured, write it to the file followed by the
      // number of occurrences.
      for (ProfileStack s : stackTraces.keySet())
      for (Map.Entry<ProfileStack, Long> entry : stackTraces.entrySet())
      {
        ProfileStack s = entry.getKey();
        s.write(writer);
        writer.writeInteger(stackTraces.get(s));
        writer.writeInteger(entry.getValue());
      }
    }
    finally
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPClientConnection.java
@@ -38,6 +38,7 @@
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
@@ -1334,14 +1335,15 @@
    {
      try
      {
        for (int msgID : operationsInProgress.keySet())
        for (Map.Entry<Integer, Operation> entry : operationsInProgress.entrySet())
        {
          int msgID = entry.getKey();
          if (msgID == messageID)
          {
            continue;
          }
          Operation o = operationsInProgress.get(msgID);
          Operation o = entry.getValue();
          if (o != null)
          {
            try
opendj-server-legacy/src/main/java/org/opends/server/replication/common/MultiDomainServerState.java
@@ -29,9 +29,9 @@
import java.util.concurrent.ConcurrentSkipListMap;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.opendj.ldap.DN;
import org.forgerock.opendj.ldap.ResultCode;
import org.forgerock.util.Pair;
import org.forgerock.opendj.ldap.DN;
import org.opends.server.types.DirectoryException;
/**
@@ -63,7 +63,7 @@
  {
    list = new ConcurrentSkipListMap<>();
    for (Map.Entry<DN, ServerState> mapEntry : cookie.list.entrySet())
    for (Entry<DN, ServerState> mapEntry : cookie.list.entrySet())
    {
      DN dn = mapEntry.getKey();
      ServerState state = mapEntry.getValue();
@@ -346,10 +346,11 @@
   */
  public boolean cover(MultiDomainServerState covered)
  {
    for (DN baseDN : covered.list.keySet())
    for (Entry<DN, ServerState> entry : covered.list.entrySet())
    {
      DN baseDN = entry.getKey();
      ServerState state = list.get(baseDN);
      ServerState coveredState = covered.list.get(baseDN);
      ServerState coveredState = entry.getValue();
      if (state == null || coveredState == null || !state.cover(coveredState))
      {
        return false;
opendj-server-legacy/src/main/java/org/opends/server/replication/common/ServerState.java
@@ -372,9 +372,10 @@
    }
    int diff = 0;
    for (Integer serverId : ss1.serverIdToCSN.keySet())
    for (Map.Entry<Integer, CSN> entry : ss1.serverIdToCSN.entrySet())
    {
      CSN csn1 = ss1.serverIdToCSN.get(serverId);
      Integer serverId = entry.getKey();
      CSN csn1 = entry.getValue();
      if (csn1 != null)
      {
        CSN csn2 = ss2.serverIdToCSN.get(serverId);
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java
@@ -74,14 +74,15 @@
import org.forgerock.opendj.ldap.SearchScope;
import org.forgerock.opendj.ldap.schema.AttributeType;
import org.forgerock.opendj.ldap.schema.ObjectClass;
import org.forgerock.opendj.ldap.schema.Schema;
import org.forgerock.opendj.server.config.meta.ReplicationDomainCfgDefn.IsolationPolicy;
import org.forgerock.opendj.server.config.server.ExternalChangelogDomainCfg;
import org.forgerock.opendj.server.config.server.ReplicationDomainCfg;
import org.opends.server.api.AlertGenerator;
import org.opends.server.api.DirectoryThread;
import org.opends.server.api.LocalBackend;
import org.opends.server.api.LocalBackend.BackendOperation;
import org.opends.server.api.LocalBackendInitializationListener;
import org.opends.server.api.DirectoryThread;
import org.opends.server.api.MonitorData;
import org.opends.server.api.ServerShutdownListener;
import org.opends.server.api.SynchronizationProvider;
@@ -142,7 +143,6 @@
import org.opends.server.types.Operation;
import org.opends.server.types.OperationType;
import org.opends.server.types.RawModification;
import org.forgerock.opendj.ldap.schema.Schema;
import org.opends.server.types.SearchFilter;
import org.opends.server.types.SearchResultEntry;
import org.opends.server.types.SearchResultReference;
@@ -966,8 +966,9 @@
    // Check consistency of specific classes attributes
    Schema schema = DirectoryServer.getSchema();
    int fractionalMode = newFractionalConfig.fractionalConfigToInt();
    for (String className : newFractionalSpecificClassesAttributes.keySet())
    for (Map.Entry<String, Set<String>> entry : newFractionalSpecificClassesAttributes.entrySet())
    {
      String className = entry.getKey();
      // Does the class exist ?
      ObjectClass fractionalClass = schema.getObjectClass(className);
      if (fractionalClass.isPlaceHolder())
@@ -978,9 +979,7 @@
      boolean isExtensibleObjectClass = fractionalClass.isExtensible();
      Set<String> attributes =
        newFractionalSpecificClassesAttributes.get(className);
      Set<String> attributes = entry.getValue();
      for (String attrName : attributes)
      {
        // Not a prohibited attribute ?
@@ -4826,8 +4825,9 @@
       * list is equivalent to specificClassesAttributes2 attribute list
       */
      Schema schema = DirectoryServer.getSchema();
      for (String className1 : specificClassesAttrs1.keySet())
      for (Map.Entry<String, Set<String>> entry : specificClassesAttrs1.entrySet())
      {
        String className1 = entry.getKey();
        // Get class from specificClassesAttributes1
        ObjectClass objectClass1 = schema.getObjectClass(className1);
        if (objectClass1.isPlaceHolder())
@@ -4838,8 +4838,9 @@
        // Look for matching one in specificClassesAttributes2
        boolean foundClass = false;
        for (String className2 : specificClassesAttrs2.keySet())
        for (Map.Entry<String, Set<String>> mapEntry : specificClassesAttrs2.entrySet())
        {
          String className2 = mapEntry.getKey();
          ObjectClass objectClass2 = schema.getObjectClass(className2);
          if (objectClass2.isPlaceHolder())
          {
@@ -4850,8 +4851,8 @@
          {
            foundClass = true;
            // Now compare the 2 attribute lists
            Set<String> attributes1 = specificClassesAttrs1.get(className1);
            Set<String> attributes2 = specificClassesAttrs2.get(className2);
            Set<String> attributes1 = entry.getValue();
            Set<String> attributes2 = mapEntry.getValue();
            if (!areAttributesEquivalent(attributes1, attributes2))
            {
              return false;
opendj-server-legacy/src/main/java/org/opends/server/replication/service/ReplicationBroker.java
@@ -1894,8 +1894,9 @@
    boolean allRsWithZeroDistance = true;
    int highestWeightRsId = -1;
    int highestWeight = -1;
    for (Integer rsId : bestServers.keySet())
    for (Entry<Integer, ReplicationServerInfo> entry : bestServers.entrySet())
    {
      Integer rsId = entry.getKey();
      float loadDistance = loadDistances.get(rsId).floatValue();
      if (loadDistance > highestDistance)
      {
@@ -1907,7 +1908,7 @@
      {
        allRsWithZeroDistance = false;
      }
      int weight = bestServers.get(rsId).getWeight();
      int weight = entry.getValue().getWeight();
      if (weight > highestWeight)
      {
        // This server has a higher weight
opendj-server-legacy/src/main/java/org/opends/server/schema/SchemaFilesWriter.java
@@ -992,10 +992,11 @@
    File schemaInstanceDir = serverContext.getSchemaHandler().getSchemaDirectoryPath();
    for (String name : tempSchemaFiles.keySet())
    for (Map.Entry<String, File> entry : tempSchemaFiles.entrySet())
    {
      String name = entry.getKey();
      installedFileList.add(new File(schemaInstanceDir, name));
      tempFileList.add(tempSchemaFiles.get(name));
      tempFileList.add(entry.getValue());
      origFileList.add(new File(schemaInstanceDir, name + ".orig"));
    }
opendj-server-legacy/src/main/java/org/opends/server/tools/ListBackends.java
@@ -228,9 +228,10 @@
    {
      // Create a map from the base DNs of the backends to the corresponding backend ID.
      Map<DN, String> baseToIDMap = new TreeMap<>();
      for (String id : backends.keySet())
      for (Map.Entry<String, Set<DN>> entry : backends.entrySet())
      {
        for (DN dn : backends.get(id))
        String id = entry.getKey();
        for (DN dn : entry.getValue())
        {
          baseToIDMap.put(dn, id);
        }
opendj-server-legacy/src/main/java/org/opends/server/tools/ManageTasks.java
@@ -332,8 +332,9 @@
      table.appendHeading(INFO_TASKINFO_FIELD_ID.get());
      table.appendHeading(INFO_TASKINFO_FIELD_TYPE.get());
      table.appendHeading(INFO_TASKINFO_FIELD_STATUS.get());
      for (String taskId : mapIdToEntry.keySet()) {
        TaskEntry entryWrapper = mapIdToEntry.get(taskId);
      for (Map.Entry<String, TaskEntry> mapEntry : mapIdToEntry.entrySet()) {
        String taskId = mapEntry.getKey();
        TaskEntry entryWrapper = mapEntry.getValue();
        table.startRow();
        table.appendCell(taskId);
        table.appendCell(entryWrapper.getType());
@@ -382,9 +383,10 @@
              INFO_TASKINFO_FIELD_STATUS.get());
      menuBuilder.setColumnWidths(null, null, 0);
      int index = 0;
      for (final String taskId : mapIdToEntry.keySet()) {
      for (Map.Entry<String, TaskEntry> mapEntry : mapIdToEntry.entrySet()) {
        String taskId = mapEntry.getKey();
        taskIds.add(taskId);
        final TaskEntry taskEntry = mapIdToEntry.get(taskId);
        final TaskEntry taskEntry = mapEntry.getValue();
        menuBuilder.addNumberedOption(
                LocalizableMessage.raw(taskEntry.getId()),
                new TaskDrilldownMenu(taskId),
@@ -643,10 +645,11 @@
        table.appendHeading(INFO_TASKINFO_OPTIONS.get(taskEntry.getType()));
        Map<LocalizableMessage,List<String>> taskSpecificAttrs =
                taskEntry.getTaskSpecificAttributeValuePairs();
        for (LocalizableMessage attrName : taskSpecificAttrs.keySet()) {
        for (Map.Entry<LocalizableMessage, List<String>> entry : taskSpecificAttrs.entrySet()) {
          LocalizableMessage attrName = entry.getKey();
          table.startRow();
          table.appendCell(attrName);
          List<String> values = taskSpecificAttrs.get(attrName);
          List<String> values = entry.getValue();
          if (!values.isEmpty()) {
            table.appendCell(values.get(0));
          }
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java
@@ -23,6 +23,7 @@
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.forgerock.opendj.ldap.AVA;
import org.forgerock.opendj.ldap.ByteString;
@@ -240,9 +241,10 @@
    LinkedHashMap<AttributeType, List<Attribute>> urlAttributes = new LinkedHashMap<>();
    LinkedHashMap<AttributeType, List<Attribute>> base64Attributes = new LinkedHashMap<>();
    for (AttributeType t : attributes.keySet())
    for (Map.Entry<AttributeType, ArrayList<TemplateValue>> entry : attributes.entrySet())
    {
      ArrayList<TemplateValue> valueList = attributes.get(t);
      AttributeType t = entry.getKey();
      ArrayList<TemplateValue> valueList = entry.getValue();
      if (t.isObjectClass())
      {
        for (TemplateValue v : valueList)
@@ -334,11 +336,12 @@
    // Now the set of user attributes.
    for (AttributeType attrType : userAttributes.keySet())
    for (Map.Entry<AttributeType, List<Attribute>> entry : userAttributes.entrySet())
    {
      AttributeType attrType = entry.getKey();
      if (exportConfig.includeAttribute(attrType))
      {
        for (Attribute a : userAttributes.get(attrType))
        for (Attribute a : entry.getValue())
        {
          if (a.isVirtual() && !exportConfig.includeVirtualAttributes())
          {
@@ -378,11 +381,12 @@
    // Next, the set of operational attributes.
    if (exportConfig.includeOperationalAttributes())
    {
      for (AttributeType attrType : operationalAttributes.keySet())
      for (Map.Entry<AttributeType, List<Attribute>> entry : operationalAttributes.entrySet())
      {
        AttributeType attrType = entry.getKey();
        if (exportConfig.includeAttribute(attrType))
        {
          for (Attribute a : operationalAttributes.get(attrType))
          for (Attribute a : entry.getValue())
          {
            if (a.isVirtual() && !exportConfig.includeVirtualAttributes())
            {
opendj-server-legacy/src/main/java/org/opends/server/types/BackupInfo.java
@@ -352,9 +352,10 @@
    if (! backupProperties.isEmpty())
    {
      for (String name : backupProperties.keySet())
      for (Map.Entry<String, String> entry : backupProperties.entrySet())
      {
        String value = backupProperties.get(name);
        String name = entry.getKey();
        String value = entry.getValue();
        if (value == null)
        {
          value = "";
opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
@@ -1379,8 +1379,9 @@
    switch (mod.getModificationType().asEnum())
    {
    case ADD:
      for (ObjectClass oc : ocs.keySet())
      for (Map.Entry<ObjectClass, String> entry : ocs.entrySet())
      {
        ObjectClass oc = entry.getKey();
        if (objectClasses.containsKey(oc))
        {
          if (!relaxConstraints)
@@ -1391,7 +1392,7 @@
        }
        else
        {
          objectClasses.put(oc, ocs.get(oc));
          objectClasses.put(oc, entry.getValue());
        }
      }
      objectClassAttribute = null;
@@ -1776,8 +1777,9 @@
    // Make sure all the user attributes are allowed, have at least
    // one value, and if they are single-valued that they have exactly
    // one value.
    for (AttributeType t : userAttributes.keySet())
    for (Map.Entry<AttributeType, List<Attribute>> entry : userAttributes.entrySet())
    {
      AttributeType t = entry.getKey();
      boolean found = false;
      for (ObjectClass o : objectClasses.keySet())
      {
@@ -1802,7 +1804,7 @@
        return false;
      }
      List<Attribute> attrList = userAttributes.get(t);
      List<Attribute> attrList = entry.getValue();
      if (attrList != null)
      {
        for (Attribute a : attrList)
@@ -1824,11 +1826,12 @@
    // Iterate through all of the operational attributes and make sure
    // that all of the single-valued attributes only have one value.
    for (AttributeType t : operationalAttributes.keySet())
    for (Map.Entry<AttributeType, List<Attribute>> entry : operationalAttributes.entrySet())
    {
      AttributeType t = entry.getKey();
      if (t.isSingleValue())
      {
        List<Attribute> attrList = operationalAttributes.get(t);
        List<Attribute> attrList = entry.getValue();
        if (attrList != null)
        {
          for (Attribute a : attrList)
@@ -2353,9 +2356,10 @@
    // Put back all the suppressed attributes where they belonged to.
    // Then hopefully processVirtualAttributes() will rebuild the suppressed
    // attribute list correctly.
    for (AttributeType t : suppressedAttributes.keySet())
    for (Map.Entry<AttributeType, List<Attribute>> entry : suppressedAttributes.entrySet())
    {
      List<Attribute> attrList = suppressedAttributes.get(t);
      AttributeType t = entry.getKey();
      List<Attribute> attrList = entry.getValue();
      if (t.isOperational())
      {
        operationalAttrsCopy.put(t, attrList);
@@ -3765,11 +3769,12 @@
    // virtual attribute.
    if (! exportConfig.includeVirtualAttributes())
    {
      for (AttributeType t : suppressedAttributes.keySet())
      for (Map.Entry<AttributeType, List<Attribute>> entry : suppressedAttributes.entrySet())
      {
        AttributeType t = entry.getKey();
        if (exportConfig.includeAttribute(t))
        {
          for (Attribute a : suppressedAttributes.get(t))
          for (Attribute a : entry.getValue())
          {
            writeLDIFLine(a, typesOnly, writer, wrapLines, wrapColumn);
          }
@@ -3813,11 +3818,12 @@
      LDIFExportConfig exportConfig, BufferedWriter writer, int wrapColumn,
      boolean wrapLines) throws IOException
  {
    for (AttributeType attrType : attributes.keySet())
    for (Map.Entry<AttributeType, List<Attribute>> entry : attributes.entrySet())
    {
      AttributeType attrType = entry.getKey();
      if (exportConfig.includeAttribute(attrType))
      {
        List<Attribute> attrList = attributes.get(attrType);
        List<Attribute> attrList = entry.getValue();
        for (Attribute a : attrList)
        {
          if (a.isVirtual() && !exportConfig.includeVirtualAttributes())
@@ -3984,9 +3990,10 @@
  private boolean equals(Map<AttributeType, List<Attribute>> attributes1,
      Map<AttributeType, List<Attribute>> attributes2)
  {
    for (AttributeType at : attributes1.keySet())
    for (Map.Entry<AttributeType, List<Attribute>> entry : attributes1.entrySet())
    {
      List<Attribute> list1 = attributes1.get(at);
      AttributeType at = entry.getKey();
      List<Attribute> list1 = entry.getValue();
      List<Attribute> list2 = attributes2.get(at);
      if (list2 == null || list1.size() != list2.size())
      {
opendj-server-legacy/src/test/java/org/opends/server/TestCaseUtils.java
@@ -1679,9 +1679,10 @@
    System.setOut(originalSystemOut);
    System.setErr(originalSystemErr);
    for (Logger l : disabledLogHandlers.keySet())
    for (Map.Entry<Logger, Handler> entry : disabledLogHandlers.entrySet())
    {
      Handler h = disabledLogHandlers.get(l);
      Logger l = entry.getKey();
      Handler h = entry.getValue();
      l.addHandler(h);
    }
    disabledLogHandlers.clear();
opendj-server-legacy/src/test/java/org/opends/server/controls/PasswordControlTest.java
@@ -12,7 +12,7 @@
 * information: "Portions Copyright [year] [name of copyright owner]".
 *
 * Copyright 2006-2008 Sun Microsystems, Inc.
 * Portions Copyright 2014-2015 ForgeRock AS.
 * Portions Copyright 2014-2016 ForgeRock AS.
 */
package org.opends.server.controls;
@@ -20,6 +20,7 @@
import static org.testng.Assert.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.forgerock.opendj.io.ASN1;
@@ -32,17 +33,12 @@
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
/**
 * Test password control.
 */
/** Test password control. */
@SuppressWarnings("javadoc")
public class PasswordControlTest
    extends ControlsTestCase
{
  /**
   * Create values for PasswordPolicyErrorType.
   */
  /** Create values for PasswordPolicyErrorType. */
  @DataProvider(name = "passwordPolicyErrorTypeData")
  public Object[][] createPasswordPolicyErrorTypeData()
  {
@@ -59,25 +55,20 @@
    return new Object[][] { { values } };
  }
  /**
   * Test if int value are ok.
   */
  /** Test if int value are ok. */
  @Test(dataProvider = "passwordPolicyErrorTypeData")
  public void checkIntValuePasswordPolicyErrorTypeTest(
      HashMap<Integer, String> expectedValues) throws Exception
      Map<Integer, String> expectedValues) throws Exception
  {
    for (Integer i : expectedValues.keySet())
    for (Map.Entry<Integer, String> entry : expectedValues.entrySet())
    {
      PasswordPolicyErrorType val = PasswordPolicyErrorType.valueOf(i);
      String expected = expectedValues.get(i);
      PasswordPolicyErrorType val = PasswordPolicyErrorType.valueOf(entry.getKey());
      String expected = entry.getValue();
      assertEquals(val.toString(), expected);
    }
  }
  /**
   * Test If we have only the required values.
   */
  /** Test If we have only the required values. */
  @Test(dataProvider = "passwordPolicyErrorTypeData")
  public void checkRequiredValuesPasswordPolicyErrorTypeTest(
      HashMap<Integer, String> exceptedValues) throws Exception
@@ -95,9 +86,7 @@
    }
  }
  /**
   * Test invalid int values.
   */
  /** Test invalid int values. */
  @Test(dataProvider = "passwordPolicyErrorTypeData")
  public void checkInvalidIntPasswordPolicyErrorTypeTest(
      HashMap<Integer, String> exceptedValues) throws Exception
@@ -112,9 +101,7 @@
    }
  }
  /**
   * Create correct values.
   */
  /** Create correct values. */
  @DataProvider(name = "passwordPolicyWarningTypeData")
  public Object[][] createPasswordPolicyWarningTypeData()
  {
@@ -124,27 +111,23 @@
    return new Object[][] { { values } };
  }
  /**
   * Test if byte values are ok.
   */
  /** Test if byte values are ok. */
  @Test(dataProvider = "passwordPolicyWarningTypeData")
  public void checkIntValuePasswordPolicyWarningTypeTest(
      HashMap<Byte, String> expectedValues) throws Exception
  {
    for (byte i : expectedValues.keySet())
    for (Map.Entry<Byte, String> entry : expectedValues.entrySet())
    {
      byte i = entry.getKey();
      PasswordPolicyWarningType val = PasswordPolicyWarningType.valueOf(i);
      String expected = expectedValues.get(i);
      String expected = entry.getValue();
      assertEquals(val.toString(), expected);
      assertEquals(i, val.getType());
    }
  }
  /**
   * Test If we have only the required values.
   */
  /** Test If we have only the required values. */
  @Test(dataProvider = "passwordPolicyWarningTypeData")
  public void checkRequiredValuesPasswordPolicyWarningTypeTest(
      HashMap<Byte, String> exceptedValues) throws Exception
@@ -162,9 +145,7 @@
    }
  }
  /**
   * Test invalid int values.
   */
  /** Test invalid int values. */
  @Test(dataProvider = "passwordPolicyWarningTypeData")
  public void checkInvalidIntPasswordPolicyWarningTypeTest(
      HashMap<Integer, String> exceptedValues) throws Exception
@@ -172,7 +153,7 @@
    Set<Integer> keys = exceptedValues.keySet();
    for (int i = 0x70; i < 0x90; i++)
    {
      byte b = new Integer(i).byteValue();
      byte b = Integer.valueOf(i).byteValue();
      if (!keys.contains(b))
      {
        assertNull(PasswordPolicyWarningType.valueOf(b));
@@ -182,9 +163,7 @@
    }
  }
  /**
   * Create values for PasswordExpiredControl.
   */
  /** Create values for PasswordExpiredControl. */
  @DataProvider(name = "passwordExpiredControlData")
  public Object[][] createPasswordExpiredControlData()
  {
@@ -194,9 +173,7 @@
    };
  }
  /**
   * Test OID.
   */
  /** Test OID. */
  @Test
  public void checkPasswordOID() throws Exception
  {
@@ -205,9 +182,7 @@
    //assertEquals(OID_PASSWORD_POLICY_CONTROL, "");
  }
  /**
   * Test "Netscape password expired control" implementation.
   */
  /** Test "Netscape password expired control" implementation. */
  @Test(dataProvider = "passwordExpiredControlData")
  public void passwordExpiredControlTest(
      boolean isCritical) throws Exception
@@ -258,9 +233,7 @@
    assertEquals(pec.getOID(),OID_NS_PASSWORD_EXPIRED);
  }
  /**
   * Create values for PasswordControl.
   */
  /** Create values for PasswordControl. */
  @DataProvider(name = "passwordExpiringControlData")
  public Object[][] createPasswordExpiringControlData()
  {
@@ -270,9 +243,7 @@
    };
  }
  /**
   * Test "Netscape password expired control" implementation.
   */
  /** Test "Netscape password expired control" implementation. */
  @Test(dataProvider = "passwordExpiringControlData")
  public void passwordExpiringControlTest(
      boolean isCritical, int sec) throws Exception
@@ -327,9 +298,7 @@
    assertEquals(pec.getSecondsUntilExpiration(), sec);
  }
  /**
   * Create values for PasswordControl.
   */
  /** Create values for PasswordControl. */
  @DataProvider(name = "passwordPolicyRequestControlData")
  public Object[][] createPasswordPolicyRequestControlData()
  {
@@ -339,9 +308,7 @@
    };
  }
  /**
   * Test PasswordPolicyRequestControl.
   */
  /** Test PasswordPolicyRequestControl. */
  @Test(dataProvider = "passwordPolicyRequestControlData")
  public void passwordPolicyRequestControlTest(
      boolean isCritical) throws Exception
@@ -385,10 +352,7 @@
    assertEquals("PasswordPolicyRequestControl()", pec.toString());
  }
  /**
   * Create values for PasswordControl.
   */
  /** Create values for PasswordControl. */
  @DataProvider(name = "passwordPolicyResponseControl")
  public Object[][] createPasswordPolicyResponseControlData()
  {
@@ -400,9 +364,7 @@
    };
  }
  /**
   * Test PasswordPolicyResponseControl.
   */
  /** Test PasswordPolicyResponseControl. */
   @Test(dataProvider = "passwordPolicyResponseControl")
  public void passwordPolicyResponseControlTest(boolean isCritical, int warningValue)
      throws Exception
@@ -415,7 +377,6 @@
    assertNull(pprc.getWarningType());
    assertNull(pprc.getErrorType());
    // check constructor PasswordPolicyResponseControl
    // (PasswordPolicyWarningType warningType,
    //    int warningValue,
@@ -452,7 +413,6 @@
      }
    }
    // check encode/decode
    ByteStringBuilder bsb = new ByteStringBuilder();
    ASN1Writer writer = ASN1.getWriter(bsb);
@@ -477,7 +437,6 @@
            "PasswordPolicyResponseControl(" + warningType + "=" + warningValue + ", " + errorType + ")" ;
        assertEquals(pprc.toString(), toString);
        // check null value for the control
        try
        {
@@ -489,7 +448,6 @@
        {
        }
        // check null warning type
        bsb.clear();
        control = new PasswordPolicyResponseControl(isCritical,
opendj-server-legacy/src/test/java/org/opends/server/controls/PersistentSearchControlTest.java
@@ -88,10 +88,10 @@
  public void checkIntValueTest(Map<Integer, String> expectedValues)
      throws Exception
  {
    for (Integer i : expectedValues.keySet())
    for (Map.Entry<Integer, String> entry : expectedValues.entrySet())
    {
      PersistentSearchChangeType val = PersistentSearchChangeType.valueOf(i);
      String expected = expectedValues.get(i);
      PersistentSearchChangeType val = PersistentSearchChangeType.valueOf(entry.getKey());
      String expected = entry.getValue();
      assertEquals(val.toString(), expected);
    }
  }
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ReplicationServerLoadBalancingTest.java
@@ -263,7 +263,7 @@
    Iterator<ReplicationServerDomain> rsdIt = rs[rsIndex].getDomainIterator();
    if (rsdIt.hasNext())
    {
      return rsdIt.next().getConnectedDSs().keySet().size();
      return rsdIt.next().getConnectedDSs().size();
    }
    return 0;
  }