@@ -0,0 +1,2604 @@
+/*%0A *  Licensed to the Apache Software Foundation (ASF) under one%0A *  or more contributor license agreements.  See the NOTICE file%0A *  distributed with this work for additional information%0A *  regarding copyright ownership.  The ASF licenses this file%0A *  to you under the Apache License, Version 2.0 (the%0A *  %22License%22); you may not use this file except in compliance%0A *  with the License.  You may obtain a copy of the License at%0A *  %0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *  %0A *  Unless required by applicable law or agreed to in writing,%0A *  software distributed under the License is distributed on an%0A *  %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A *  KIND, either express or implied.  See the License for the%0A *  specific language governing permissions and limitations%0A *  under the License. %0A *  %0A */%0Apackage org.apache.directory.shared.ldap.schema.comparator;%0A%0A%0Aimport java.util.Comparator;%0A%0A/**%0A * A class for the IntegerOrderingComparator matchingRule (RFC 4517, par. 4.2.20)%0A * %0A * @author %3Ca href=%22mailto:dev@directory.apache.org%22%3EApache Directory Project%3C/a%3E%0A * @version $Rev: 437007 $%0A */%0Apublic class IntegerOrderingComparator implements Comparator%3CObject%3E%0A%7B%0A    /**%0A     * Implementation of the Compare method%0A     */%0A    public int compare( Object backendValue, Object assertValue ) %0A    %7B%0A        // First, shortcut the process by comparing%0A        // references. If they are equals, then o1 and o2%0A        // reference the same object%0A        if ( backendValue == assertValue )%0A        %7B%0A            return 0;%0A        %7D%0A        %0A        // Then, deal with one of o1 or o2 being null%0A        // Both can't be null, because then they would %0A        // have been caught by the previous test%0A        if ( ( backendValue == null ) %7C%7C ( assertValue == null ) )%0A        %7B%0A            return ( backendValue == null ? -1 : 1 );%0A        %7D%0A%0A        // Both object must be stored as String for boolean%0A        // values. If this is not the case, we have a pb...%0A        // However, the method will then throw a ClassCastException%0A        int b1 = Integer.parseInt( (String)backendValue );%0A        int b2 = Integer.parseInt( (String)assertValue );%0A        %0A        if ( b1 == b2 )%0A        %7B%0A            return 0;%0A        %7D%0A%0A        // The boolean should have been stored as 'TRUE' or 'FALSE'%0A        // into the server, and the compare method will be called%0A        // with normalized booleans, so no need to uppercase them.%0A        // We don't need to check the assertion value, because we%0A        // are dealing with booleans.%0A        return ( b1 %3E b2 ? 1 : -1 );%0A    %7D%0A%7D%0A

Create a new IntegerOrderingComparator, and injected it into the server MatchingRules