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

Jean-Noël Rouvignac
03.30.2016 5ba2e67db7381e849d1e0d2a3a6c2c874c9bf219
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/task/NewSchemaElementsTask.java
@@ -16,6 +16,7 @@
 */
package org.opends.guitools.controlpanel.task;
import static org.forgerock.opendj.ldap.ModificationType.*;
import static org.forgerock.util.Utils.*;
import static org.opends.messages.AdminToolMessages.*;
@@ -38,9 +39,9 @@
import javax.swing.SwingUtilities;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.opendj.ldap.ModificationType;
import org.forgerock.opendj.ldap.schema.AttributeType;
import org.forgerock.opendj.ldap.schema.MatchingRule;
import org.forgerock.opendj.ldap.schema.ObjectClass;
import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo;
import org.opends.guitools.controlpanel.datamodel.SomeSchemaElement;
import org.opends.guitools.controlpanel.ui.ColorAndFontConstants;
@@ -48,6 +49,7 @@
import org.opends.guitools.controlpanel.util.Utilities;
import org.opends.server.config.ConfigConstants;
import org.opends.server.core.DirectoryServer;
import org.opends.server.types.Attribute;
import org.opends.server.types.Attributes;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Entry;
@@ -55,7 +57,6 @@
import org.opends.server.types.LDIFExportConfig;
import org.opends.server.types.LDIFImportConfig;
import org.opends.server.types.Modification;
import org.forgerock.opendj.ldap.schema.ObjectClass;
import org.opends.server.types.OpenDsException;
import org.opends.server.util.LDIFReader;
import org.opends.server.util.LDIFWriter;
@@ -266,11 +267,7 @@
  private List<SomeSchemaElement> get(Map<String, List<SomeSchemaElement>> hmElems, String fileName)
  {
    List<SomeSchemaElement> elems = hmElems.get(fileName);
    if (elems != null)
    {
      return elems;
    }
    return Collections.emptyList();
    return elems != null ? elems : Collections.<SomeSchemaElement> emptyList();
  }
  private Map<String, List<SomeSchemaElement>> copy(Set<SomeSchemaElement> elemsToAdd)
@@ -746,9 +743,8 @@
  {
    for (SomeSchemaElement schemaElement : schemaElements)
    {
      final Modification mod = new Modification(ModificationType.ADD,
          Attributes.create(schemaElement.getAttributeName().toLowerCase(), getValueOffline(schemaElement)));
      schemaEntry.applyModification(mod);
      Attribute attr = Attributes.create(schemaElement.getAttributeName(), getValueOffline(schemaElement));
      schemaEntry.applyModification(new Modification(ADD, attr));
    }
  }