directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r291318 - in /directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar: FilterGrammar.java LdapControlGrammar.java SearchRequestGrammar.java
Date Sat, 24 Sep 2005 15:40:31 GMT
Author: elecharny
Date: Sat Sep 24 08:40:26 2005
New Revision: 291318

URL: http://svn.apache.org/viewcvs?rev=291318&view=rev
Log:
Switched from using IntegerDecoder to BooleanDecoder for boolean BER values.

Modified:
    directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/FilterGrammar.java
    directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/LdapControlGrammar.java
    directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/SearchRequestGrammar.java

Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/FilterGrammar.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/FilterGrammar.java?rev=291318&r1=291317&r2=291318&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/FilterGrammar.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/FilterGrammar.java
Sat Sep 24 08:40:26 2005
@@ -25,6 +25,7 @@
 import org.apache.asn1new.ber.tlv.TLV;
 import org.apache.asn1new.ber.tlv.UniversalTag;
 import org.apache.asn1new.ber.tlv.Value;
+import org.apache.asn1new.util.BooleanDecoder;
 import org.apache.asn1new.util.IntegerDecoder;
 import org.apache.asn1new.primitives.OctetString;
 import org.apache.asn1new.ldap.codec.LdapConstants;
@@ -1158,15 +1159,7 @@
                         // will generate a warning.
                         Value value     = tlv.getValue();
 
-                        int  dnAttributes = IntegerDecoder.parse( value, 0, 255 );
-
-                        extensibleMatchFilter.setDnAttributes( dnAttributes != 0 );
-
-                        if ( ( dnAttributes != 0 ) && (dnAttributes != 255 ) ) 
-                        {
-                            log.warn("A boolean must be encoded with a 0x00 or a 0xFF value");
-                        }
-                        
+                        extensibleMatchFilter.setDnAttributes( BooleanDecoder.parse( value
) );
                     }
                 });
                 

Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/LdapControlGrammar.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/LdapControlGrammar.java?rev=291318&r1=291317&r2=291318&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/LdapControlGrammar.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/LdapControlGrammar.java
Sat Sep 24 08:40:26 2005
@@ -25,6 +25,7 @@
 import org.apache.asn1new.ber.tlv.TLV;
 import org.apache.asn1new.ber.tlv.UniversalTag;
 import org.apache.asn1new.ber.tlv.Value;
+import org.apache.asn1new.util.BooleanDecoder;
 import org.apache.asn1new.util.IntegerDecoder;
 import org.apache.asn1new.primitives.OID;
 import org.apache.asn1new.primitives.OctetString;
@@ -230,14 +231,7 @@
                         // will generate a warning.
                         Value value        = tlv.getValue();
 
-                        int   criticality = IntegerDecoder.parse( value, 0, 255 );
-
-                        control.setCriticality( criticality != 0 );
-
-                        if ( ( criticality != 0 ) && ( criticality != 255 ) )
-                        {
-                            log.warn( "A boolean must be encoded with a 0x00 or a 0xFF value"
);
-                        }
+                        control.setCriticality( BooleanDecoder.parse( value) );
                     }
                 });
 

Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/SearchRequestGrammar.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/SearchRequestGrammar.java?rev=291318&r1=291317&r2=291318&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/SearchRequestGrammar.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/SearchRequestGrammar.java
Sat Sep 24 08:40:26 2005
@@ -25,6 +25,7 @@
 import org.apache.asn1new.ber.tlv.TLV;
 import org.apache.asn1new.ber.tlv.UniversalTag;
 import org.apache.asn1new.ber.tlv.Value;
+import org.apache.asn1new.util.BooleanDecoder;
 import org.apache.asn1new.util.IntegerDecoder;
 import org.apache.asn1new.ldap.codec.LdapConstants;
 import org.apache.asn1new.ldap.codec.LdapMessageContainer;
@@ -371,15 +372,8 @@
                         // will generate a warning.
                         Value value     = tlv.getValue();
 
-                        int  typesOnly = IntegerDecoder.parse( value, 0, 255 );
+                        searchRequest.setTypesOnly( BooleanDecoder.parse( value ) );
 
-                        searchRequest.setTypesOnly( typesOnly != 0 );
-
-                        if ( ( typesOnly != 0 ) && (typesOnly != 255 ) ) 
-                        {
-                            log.warn("A boolean must be encoded with a 0x00 or a 0xFF value");
-                        }
-                        
                         return;
                     }
                 } );



Mime
View raw message