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

matthew_swift
28.47.2010 f2160f4bd1c8ac67e5a86a6710d431e8932877f9
sdk/src/org/opends/sdk/schema/EnumOrderingMatchingRule.java
@@ -28,7 +28,7 @@
import static com.sun.opends.sdk.messages.Messages.*;
import static com.sun.opends.sdk.messages.Messages.WARN_ATTR_SYNTAX_LDAPSYNTAX_ENUM_INVALID_VALUE;
import org.opends.sdk.ByteSequence;
import org.opends.sdk.ByteString;
@@ -39,18 +39,17 @@
/**
 * This class is the ordering matching rule implementation for an enum
 * syntax implmentation. The ordering is determined by the order of the
 * entries in the X-ENUM extension value.
 * This class is the ordering matching rule implementation for an enum syntax
 * implmentation. The ordering is determined by the order of the entries in the
 * X-ENUM extension value.
 */
final class EnumOrderingMatchingRule extends
    AbstractOrderingMatchingRuleImpl
final class EnumOrderingMatchingRule extends AbstractOrderingMatchingRuleImpl
{
  private final EnumSyntaxImpl syntax;
  EnumOrderingMatchingRule(EnumSyntaxImpl syntax)
  EnumOrderingMatchingRule(final EnumSyntaxImpl syntax)
  {
    Validator.ensureNotNull(syntax);
    this.syntax = syntax;
@@ -58,14 +57,14 @@
  public ByteString normalizeAttributeValue(Schema schema,
      ByteSequence value) throws DecodeException
  public ByteString normalizeAttributeValue(final Schema schema,
      final ByteSequence value) throws DecodeException
  {
    final int index = syntax.indexOf(value);
    if (index < 0)
    {
      throw DecodeException.error(
          WARN_ATTR_SYNTAX_LDAPSYNTAX_ENUM_INVALID_VALUE.get(value
      throw DecodeException
          .error(WARN_ATTR_SYNTAX_LDAPSYNTAX_ENUM_INVALID_VALUE.get(value
              .toString(), syntax.getName()));
    }
    return ByteString.valueOf(index);