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

Jean-Noël Rouvignac
07.38.2016 b5e0d239808a91f2e480876c9ff9be1be6c5419d
SchemaBackend.java: code cleanup
2 files modified
26 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java 22 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java
@@ -635,7 +635,7 @@
    attrs.add(attribute);
  }
  private void buildSchemaAttribute(Collection<?> elements,
  private void buildSchemaAttribute(Collection<? extends SchemaElement> elements,
      Map<AttributeType, List<Attribute>> userAttrs,
      Map<AttributeType, List<Attribute>> operationalAttrs,
      AttributeType schemaAttributeType, boolean includeSchemaFile,
@@ -648,18 +648,10 @@
    }
    AttributeBuilder builder = new AttributeBuilder(schemaAttributeType);
    for (Object element : elements)
    for (SchemaElement element : elements)
    {
      /* Add the file name to the description of the element if this was requested by the caller. */
      String value;
      if (includeSchemaFile && element instanceof SchemaElement)
      {
        value = getDefinitionWithFileName((SchemaElement) element);
      }
      else
      {
        value = element.toString();
      }
      String value = includeSchemaFile ? getDefinitionWithFileName(element) : element.toString();
      if (stripSyntaxMinimumUpperBound && value.indexOf('{') != -1)
      {
        // Strip the minimum upper bound value from the attribute value.
@@ -669,15 +661,15 @@
    }
    Attribute attribute = builder.toAttribute();
    ArrayList<Attribute> attrList = newArrayList(attribute);
    if (attribute.getAttributeDescription().getAttributeType().isOperational()
    AttributeType attrType = attribute.getAttributeDescription().getAttributeType();
    if (attrType.isOperational()
        && (ignoreShowAllOption || !showAllAttributes))
    {
      operationalAttrs.put(attribute.getAttributeDescription().getAttributeType(), attrList);
      operationalAttrs.put(attrType, newArrayList(attribute));
    }
    else
    {
      userAttrs.put(attribute.getAttributeDescription().getAttributeType(), attrList);
      userAttrs.put(attrType, newArrayList(attribute));
    }
  }
opendj-server-legacy/src/main/java/org/opends/server/types/Schema.java
@@ -637,7 +637,7 @@
   */
  public boolean hasObjectClass(String nameOrOid)
  {
    return getSchemaNG().hasObjectClass(nameOrOid);
    return schemaNG.hasObjectClass(nameOrOid);
  }
@@ -652,7 +652,7 @@
   */
  public ObjectClass getObjectClass(String nameOrOid)
  {
    return getSchemaNG().getObjectClass(nameOrOid);
    return schemaNG.getObjectClass(nameOrOid);
  }
  /**