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

Matthew Swift
16.27.2013 57b00681701801377def8f1fa89b4db315ab5c6a
Minor refactoring: rename MatchingRule.getAssertion() for substrings to MatchingRule.getSubstringAssertion().
6 files modified
44 ■■■■ changed files
opendj-core/src/main/java/org/forgerock/opendj/ldap/Matcher.java 2 ●●● patch | view | raw | blame | history
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AbstractMatchingRuleImpl.java 2 ●●● patch | view | raw | blame | history
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AbstractSubstringMatchingRuleImpl.java 6 ●●●● patch | view | raw | blame | history
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRule.java 14 ●●●● patch | view | raw | blame | history
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRuleImpl.java 12 ●●●● patch | view | raw | blame | history
opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/SubstringMatchingRuleTest.java 8 ●●●● patch | view | raw | blame | history
opendj-core/src/main/java/org/forgerock/opendj/ldap/Matcher.java
@@ -481,7 +481,7 @@
            }
            try {
                assertion = rule.getAssertion(initialSubstring, anySubstrings, finalSubstring);
                assertion = rule.getSubstringAssertion(initialSubstring, anySubstrings, finalSubstring);
            } catch (final DecodeException de) {
                // TODO: I18N
                DEFAULT_LOG.warn("The substring assertion values contain an invalid value", de);
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AbstractMatchingRuleImpl.java
@@ -77,7 +77,7 @@
        return new DefaultEqualityAssertion(normalizeAttributeValue(schema, value));
    }
    public Assertion getAssertion(final Schema schema, final ByteSequence subInitial,
    public Assertion getSubstringAssertion(final Schema schema, final ByteSequence subInitial,
            final List<? extends ByteSequence> subAnyElements, final ByteSequence subFinal)
            throws DecodeException {
        return UNDEFINED_ASSERTION;
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/AbstractSubstringMatchingRuleImpl.java
@@ -144,7 +144,7 @@
        final String valueString = value.toString();
        if (valueString.length() == 1 && valueString.charAt(0) == '*') {
            return getAssertion(schema, initialString, anyStrings, finalString);
            return getSubstringAssertion(schema, initialString, anyStrings, finalString);
        }
        final char[] escapeChars = new char[] { '*' };
@@ -178,11 +178,11 @@
            }
        }
        return getAssertion(schema, initialString, anyStrings, finalString);
        return getSubstringAssertion(schema, initialString, anyStrings, finalString);
    }
    @Override
    public Assertion getAssertion(final Schema schema, final ByteSequence subInitial,
    public Assertion getSubstringAssertion(final Schema schema, final ByteSequence subInitial,
            final List<? extends ByteSequence> subAnyElements, final ByteSequence subFinal)
            throws DecodeException {
        final ByteString normInitial =
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRule.java
@@ -290,7 +290,7 @@
    /**
     * Returns the normalized form of the provided assertion value, which is
     * best suite for efficiently performing matching operations on that value.
     * best suited for efficiently performing matching operations on that value.
     * The assertion value is guaranteed to be valid against this matching
     * rule's assertion syntax.
     *
@@ -306,7 +306,7 @@
    /**
     * Returns the normalized form of the provided assertion substring values,
     * which is best suite for efficiently performing matching operations on
     * which is best suited for efficiently performing matching operations on
     * that value.
     *
     * @param subInitial
@@ -322,15 +322,15 @@
     * @throws DecodeException
     *             if the syntax of the value is not valid.
     */
    public Assertion getAssertion(final ByteSequence subInitial,
    public Assertion getSubstringAssertion(final ByteSequence subInitial,
            final List<? extends ByteSequence> subAnyElements, final ByteSequence subFinal)
            throws DecodeException {
        return impl.getAssertion(schema, subInitial, subAnyElements, subFinal);
        return impl.getSubstringAssertion(schema, subInitial, subAnyElements, subFinal);
    }
    /**
     * Returns the normalized form of the provided assertion value, which is
     * best suite for efficiently performing greater than or equal ordering
     * best suited for efficiently performing greater than or equal ordering
     * matching operations on that value. The assertion value is guaranteed to
     * be valid against this matching rule's assertion syntax.
     *
@@ -346,7 +346,7 @@
    /**
     * Returns the normalized form of the provided assertion value, which is
     * best suite for efficiently performing greater than or equal ordering
     * best suited for efficiently performing greater than or equal ordering
     * matching operations on that value. The assertion value is guaranteed to
     * be valid against this matching rule's assertion syntax.
     *
@@ -459,7 +459,7 @@
    /**
     * Returns the normalized form of the provided attribute value, which is
     * best suite for efficiently performing matching operations on that value.
     * best suited for efficiently performing matching operations on that value.
     *
     * @param value
     *            The attribute value to be normalized.
opendj-core/src/main/java/org/forgerock/opendj/ldap/schema/MatchingRuleImpl.java
@@ -51,7 +51,7 @@
    /**
     * Retrieves the normalized form of the provided assertion value, which is
     * best suite for efficiently performing matching operations on that value.
     * best suited for efficiently performing matching operations on that value.
     * The assertion value is guarenteed to be valid against this matching
     * rule's assertion syntax.
     *
@@ -67,7 +67,7 @@
    /**
     * Retrieves the normalized form of the provided assertion substring values,
     * which is best suite for efficiently performing matching operations on
     * which is best suited for efficiently performing matching operations on
     * that value.
     *
     * @param schema
@@ -85,13 +85,13 @@
     * @throws DecodeException
     *             if an syntax error occured while parsing the value.
     */
    public Assertion getAssertion(Schema schema, ByteSequence subInitial,
    public Assertion getSubstringAssertion(Schema schema, ByteSequence subInitial,
            List<? extends ByteSequence> subAnyElements, ByteSequence subFinal)
            throws DecodeException;
    /**
     * Retrieves the normalized form of the provided assertion value, which is
     * best suite for efficiently performing greater than or equal matching
     * best suited for efficiently performing greater than or equal matching
     * operations on that value. The assertion value is guarenteed to be valid
     * against this matching rule's assertion syntax.
     *
@@ -108,7 +108,7 @@
    /**
     * Retrieves the normalized form of the provided assertion value, which is
     * best suite for efficiently performing greater than or equal matching
     * best suited for efficiently performing greater than or equal matching
     * operations on that value. The assertion value is guarenteed to be valid
     * against this matching rule's assertion syntax.
     *
@@ -125,7 +125,7 @@
    /**
     * Retrieves the normalized form of the provided attribute value, which is
     * best suite for efficiently performing matching operations on that value.
     * best suited for efficiently performing matching operations on that value.
     *
     * @param schema
     *            The schema in which this matching rule is defined.
opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/SubstringMatchingRuleTest.java
@@ -94,7 +94,7 @@
        // normalize the 2 provided values and check that they are equals
        final ByteString normalizedValue = rule.normalizeAttributeValue(ByteString.valueOf(value));
        if (rule.getAssertion(null, null, ByteString.valueOf(finalValue)).matches(normalizedValue) != result
        if (rule.getSubstringAssertion(null, null, ByteString.valueOf(finalValue)).matches(normalizedValue) != result
                || rule.getAssertion(ByteString.valueOf("*" + finalValue)).matches(normalizedValue) != result) {
            fail("final substring matching rule " + rule + " does not give expected result ("
                    + result + ") for values : " + value + " and " + finalValue);
@@ -112,7 +112,7 @@
        // normalize the 2 provided values and check that they are equals
        final ByteString normalizedValue = rule.normalizeAttributeValue(ByteString.valueOf(value));
        if (rule.getAssertion(ByteString.valueOf(initial), null, null).matches(normalizedValue) != result
        if (rule.getSubstringAssertion(ByteString.valueOf(initial), null, null).matches(normalizedValue) != result
                || rule.getAssertion(ByteString.valueOf(initial + "*")).matches(normalizedValue) != result) {
            fail("initial substring matching rule " + rule + " does not give expected result ("
                    + result + ") for values : " + value + " and " + initial);
@@ -133,7 +133,7 @@
        for (final String middleSub : anys) {
            anyList.add(ByteString.valueOf(middleSub));
        }
        rule.getAssertion(subInitial == null ? null : ByteString.valueOf(subInitial), anyList,
        rule.getSubstringAssertion(subInitial == null ? null : ByteString.valueOf(subInitial), anyList,
                subFinal == null ? null : ByteString.valueOf(subFinal));
    }
@@ -182,7 +182,7 @@
            middleList.add(ByteString.valueOf(middleSub));
        }
        if (rule.getAssertion(null, middleList, null).matches(normalizedValue) != result
        if (rule.getSubstringAssertion(null, middleList, null).matches(normalizedValue) != result
                || rule.getAssertion(ByteString.valueOf(printableMiddleSubs)).matches(
                        normalizedValue) != result) {
            fail("middle substring matching rule " + rule + " does not give expected result ("