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

Jean-Noël Rouvignac
09.09.2016 3cc522e06e56a95c9d7ea043b8d97cae8ddb1181
Code cleanup in schema
2 files modified
14 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java
@@ -513,8 +513,7 @@
    {
      for (AVA ava : rdn)
      {
        AttributeType attrType = ava.getAttributeType();
        Attribute attribute = Attributes.create(attrType, ava.getAttributeValue());
        Attribute attribute = Attributes.create(ava.getAttributeType(), ava.getAttributeValue());
        addAttributeToSchemaEntry(attribute, userAttrs, operationalAttrs);
      }
    }
@@ -571,7 +570,7 @@
        Attributes.create(getModifyTimestampAttributeType(), modifyTimestamp), userAttrs, operationalAttrs);
    // Add the extra attributes.
    for (Attribute attribute : DirectoryServer.getSchema().getExtraAttributes().values())
    for (Attribute attribute : DirectoryServer.getSchema().getExtraAttributes())
    {
      addAttributeToSchemaEntry(attribute, userAttrs, operationalAttrs);
    }
@@ -2255,7 +2254,7 @@
    if (FILE_USER_SCHEMA_ELEMENTS.equals(schemaFile))
    {
      for (Attribute attribute : schema.getExtraAttributes().values())
      for (Attribute attribute : schema.getExtraAttributes())
      {
        AttributeType attributeType = attribute.getAttributeDescription().getAttributeType();
        schemaEntry.putAttribute(attributeType, newArrayList(attribute));
opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java
@@ -475,7 +475,8 @@
    AttributeType.Builder b = builder.buildAttributeType(attributeType);
    if (schemaFile != null)
    {
      b.removeExtraProperty(SCHEMA_PROPERTY_FILENAME).extraProperties(SCHEMA_PROPERTY_FILENAME, schemaFile);
      b.removeExtraProperty(SCHEMA_PROPERTY_FILENAME)
       .extraProperties(SCHEMA_PROPERTY_FILENAME, schemaFile);
    }
    if (overwriteExisting)
    {
@@ -1537,9 +1538,9 @@
   *
   * @return  The extraAttributes stored in this schema.
   */
  public Map<String, Attribute> getExtraAttributes()
  public Collection<Attribute> getExtraAttributes()
  {
    return extraAttributes;
    return extraAttributes.values();
  }