directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r224565 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/FilterGrammar.java
Date Sat, 23 Jul 2005 22:48:08 GMT
Author: elecharny
Date: Sat Jul 23 15:48:05 2005
New Revision: 224565

URL: http://svn.apache.org/viewcvs?rev=224565&view=rev
Log:
- fixed a bug in FilterGrammar, when dealing with simple filters. Their type must be added
to distinguish between them.

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/FilterGrammar.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/FilterGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/FilterGrammar.java?rev=224565&r1=224564&r2=224565&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/FilterGrammar.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/FilterGrammar.java
Sat Jul 23 15:48:05 2005
@@ -24,6 +24,7 @@
 import org.apache.asn1.ber.grammar.IGrammar;
 import org.apache.asn1.ber.tlv.TLV;
 import org.apache.asn1.ber.tlv.Value;
+import org.apache.asn1.ldap.codec.LdapConstants;
 import org.apache.asn1.ldap.codec.LdapMessageContainer;
 import org.apache.asn1.ldap.codec.primitives.LdapString;
 import org.apache.asn1.ldap.codec.utils.IntegerDecoder;
@@ -363,7 +364,7 @@
                 {
                     public void action( IAsn1Container container ) throws DecoderException
                     {
-                        compareFilterAction(container);
+                        compareFilterAction(container, LdapConstants.EQUALITY_MATCH_FILTER);
                     }
                 }); 
                 
@@ -379,7 +380,7 @@
                 {
                     public void action( IAsn1Container container ) throws DecoderException
                     {
-                        compareFilterAction(container);
+                        compareFilterAction(container, LdapConstants.GREATER_OR_EQUAL_FILTER);
                     }
                 } ); 
                 
@@ -395,7 +396,7 @@
                 {
                     public void action( IAsn1Container container ) throws DecoderException
                     {
-                        compareFilterAction(container);
+                        compareFilterAction(container, LdapConstants.LESS_OR_EQUAL_FILTER
);
                     }
                 } ); 
                 
@@ -411,7 +412,7 @@
                 {
                     public void action( IAsn1Container container ) throws DecoderException
                     {
-                        compareFilterAction(container);
+                        compareFilterAction(container, LdapConstants.APPROX_MATCH_FILTER
);
                     }
                 } ); 
                 
@@ -1236,7 +1237,7 @@
      * @param container The LdapContainer
      * @throws DecoderException If any error occurs.
      */
-    private void compareFilterAction( IAsn1Container container ) throws DecoderException
+    private void compareFilterAction( IAsn1Container container , int filterType ) throws
DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer )
             container;
@@ -1247,7 +1248,7 @@
         TLV tlv            = ldapMessageContainer.getCurrentTLV();
 
         // We can allocate the Attribute Value Assertion
-        Filter filter = new AttributeValueAssertionFilter();
+        Filter filter = new AttributeValueAssertionFilter( filterType );
         
         // Get the parent, if any
         Filter currentFilter = searchRequest.getCurrentFilter();
@@ -1262,7 +1263,6 @@
         else
         {
             // No parent. This Filter will become the root.
-            //searchRequest.setCurrentFilter(filter);
             filter.setParent( searchRequest );
             searchRequest.setFilter(filter);
         }



Mime
View raw message