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

Jean-Noel Rouvignac
10.13.2015 c5740d7b39334af983957a9c284ddd792d598f6c
opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java
@@ -397,21 +397,8 @@
      final byte[] encodedAttribute, final String attributeName,
      final Collection<String> attributeOptions)
  {
    final AttributeType type = DirectoryServer.getAttributeType(
        toLowerCase(attributeName), true);
    final Set<String> options;
    switch (attributeOptions.size())
    {
    case 0:
      options = Collections.emptySet();
      break;
    case 1:
      options = Collections.singleton(attributeOptions.iterator().next());
      break;
    default:
      options = new LinkedHashSet<>(attributeOptions);
      break;
    }
    final AttributeType type = DirectoryServer.getAttributeTypeOrDefault(toLowerCase(attributeName));
    final Set<String> options = getOptions(attributeOptions);
    final Entry<AttributeType, Set<String>> ad = new SimpleImmutableEntry<>(type, options);
    final int id = decodeId(encodedAttribute);
    synchronized (adEncodeMap)
@@ -434,7 +421,18 @@
    return ad;
  }
  private Set<String> getOptions(final Collection<String> attributeOptions)
  {
    switch (attributeOptions.size())
    {
    case 0:
      return Collections.emptySet();
    case 1:
      return Collections.singleton(attributeOptions.iterator().next());
    default:
      return new LinkedHashSet<>(attributeOptions);
    }
  }
  /**
   * Loads an encoded object class into this compressed schema. This method may