directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r328723 - /directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/
Date Wed, 26 Oct 2005 20:30:29 GMT
Author: elecharny
Date: Wed Oct 26 13:30:13 2005
New Revision: 328723

URL: http://svn.apache.org/viewcvs?rev=328723&view=rev
Log:
Modified the rules to handle utf-8 strings and byte[] values

Modified:
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ApproxMatchRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/BaseObjectRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/EqualityMatchRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchMatchingRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchTypeRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchValueRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/GreaterOrEqualRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/LessOrEqualRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/NotRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/PresentRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/RequestedAttributesRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ScopeRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SearchRequestProcessing.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SearchResponseEntryDnRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchAnyRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchFinalRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchInitialRule.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchRule.java

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ApproxMatchRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ApproxMatchRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ApproxMatchRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ApproxMatchRule.java
Wed Oct 26 13:30:13 2005
@@ -19,6 +19,7 @@
 
 import org.apache.asn1.ber.TypeClass;
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.berlib.asn1.LdapTag;
 import org.apache.ldap.common.filter.SimpleNode;
 
@@ -39,7 +40,7 @@
 {
     private boolean isEnabled = true ;
     private String name = null ;
-    private String value = null ;
+    private byte[] value = null ;
 
 
     public void tag( int id, boolean isPrimitive, TypeClass typeClass )
@@ -119,6 +120,7 @@
         ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -133,15 +135,11 @@
 
         if ( name == null && value == null )
         {
-            name = new String( octets ) ;
+            name = StringUtils.toUtf8( octets );
         }
-        else if ( name != null && value == null )
+        else if ( ( name != null)  && ( value == null ) )
         {
-            value = new String( octets ) ;
-
-
-            SimpleNode node;
-            node = new SimpleNode( name, value, SimpleNode.APPROXIMATE );
+            SimpleNode node = new SimpleNode( name, octets, SimpleNode.APPROXIMATE );
             getDigester().push( node ) ;
 
             name = null ;

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/BaseObjectRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/BaseObjectRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/BaseObjectRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/BaseObjectRule.java
Wed Oct 26 13:30:13 2005
@@ -19,6 +19,7 @@
 
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
 import org.apache.asn1.ber.primitives.UniversalTag;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.message.SearchRequestImpl;
 
 import java.nio.ByteBuffer;
@@ -38,7 +39,6 @@
         super( UniversalTag.OCTET_STRING ) ;
     }
 
-
     /**
      * Allows the super method to push a ByteBuffer onto the top of the stack
      * which contains the drained contents of the superclass' ByteAccumulator.
@@ -63,6 +63,7 @@
         SearchRequestImpl req = ( SearchRequestImpl ) getDigester().peek( 1 );
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -75,7 +76,7 @@
             buf.get( octets );
         }
 
-        req.setBase( new String( octets ) );
+        req.setBase( StringUtils.toUtf8( octets ) );
         ( ( SearchRequestProcessing ) getDigester().peek() ).next();
     }
 }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/EqualityMatchRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/EqualityMatchRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/EqualityMatchRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/EqualityMatchRule.java
Wed Oct 26 13:30:13 2005
@@ -19,6 +19,7 @@
 
 import org.apache.asn1.ber.TypeClass;
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.berlib.asn1.LdapTag;
 import org.apache.ldap.common.filter.SimpleNode;
 
@@ -41,7 +42,7 @@
 
     private String name = null;
 
-    private String value = null;
+    private byte[] value = null;
 
 
     public void tag( int id, boolean isPrimitive, TypeClass typeClass )
@@ -130,7 +131,6 @@
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
-
             octets = buf.array() ;
         }
         else
@@ -144,20 +144,14 @@
 
         if ( name == null && value == null )
         {
-            name = new String( octets ) ;
+            name = StringUtils.toUtf8( octets ) ;
         }
         else if ( name != null && value == null )
         {
-            value = new String( octets ) ;
-
-            SimpleNode node;
-
-            node = new SimpleNode( name, value, SimpleNode.EQUALITY );
-
+            SimpleNode node = new SimpleNode( name, octets, SimpleNode.EQUALITY );
             getDigester().push( node ) ;
 
             name = null ;
-
             value = null ;
         }
         else

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchMatchingRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchMatchingRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchMatchingRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchMatchingRule.java
Wed Oct 26 13:30:13 2005
@@ -18,6 +18,7 @@
 
 
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.berlib.asn1.LdapTag;
 
 import java.nio.ByteBuffer;
@@ -52,6 +53,7 @@
         ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -65,6 +67,6 @@
         }
 
         ExtensibleMatchRule rule = ( ExtensibleMatchRule ) getDigester().peek();
-        rule.setMatchingRule( new String( octets ) );
+        rule.setMatchingRule( StringUtils.toUtf8( octets ) );
     }
 }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchRule.java
Wed Oct 26 13:30:13 2005
@@ -35,12 +35,16 @@
 public class ExtensibleMatchRule extends AbstractRule
 {
     private boolean isEnabled = true;
+    
     /** optional matching rule property */
     private String matchingRule = null;
+    
     /** optional type property */
     private String type = null;
+    
     /** required matchingValue property */
-    private String value = null;
+    private byte[] value = null;
+    
     /** dnAttributes property that defaults to FALSE */
     private boolean dnAttributes = false;
 
@@ -53,6 +57,7 @@
     {
         // check to see we are within limits - have the right number of tags
         int tagCount = getDigester().getTagCount();
+        
         if ( tagCount < 3 )
         {
             this.isEnabled = false;
@@ -150,7 +155,7 @@
     }
 
 
-    public void setValue( String value )
+    public void setValue( byte[] value )
     {
         this.value = value;
     }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchTypeRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchTypeRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchTypeRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchTypeRule.java
Wed Oct 26 13:30:13 2005
@@ -18,6 +18,7 @@
 
 
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.berlib.asn1.LdapTag;
 
 import java.nio.ByteBuffer;
@@ -52,6 +53,7 @@
         ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -65,6 +67,6 @@
         }
 
         ExtensibleMatchRule rule = ( ExtensibleMatchRule ) getDigester().peek();
-        rule.setType( new String( octets ) );
+        rule.setType( StringUtils.toUtf8( octets ) );
     }
 }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchValueRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchValueRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchValueRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ExtensibleMatchValueRule.java
Wed Oct 26 13:30:13 2005
@@ -52,6 +52,7 @@
         ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -65,6 +66,6 @@
         }
 
         ExtensibleMatchRule rule = ( ExtensibleMatchRule ) getDigester().peek();
-        rule.setValue( new String( octets ) );
+        rule.setValue( octets );
     }
 }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/GreaterOrEqualRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/GreaterOrEqualRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/GreaterOrEqualRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/GreaterOrEqualRule.java
Wed Oct 26 13:30:13 2005
@@ -19,6 +19,7 @@
 
 import org.apache.asn1.ber.TypeClass;
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.filter.SimpleNode;
 
 import java.nio.ByteBuffer;
@@ -38,7 +39,7 @@
 {
     private boolean isEnabled = true ;
     private String name = null ;
-    private String value = null ;
+    private byte[] value = null ;
 
 
     public void tag( int id, boolean isPrimitive, TypeClass typeClass )
@@ -98,6 +99,7 @@
         ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -112,15 +114,11 @@
 
         if ( name == null && value == null )
         {
-            name = new String( octets ) ;
+            name = StringUtils.toUtf8( octets );
         }
         else if ( name != null && value == null )
         {
-            value = new String( octets ) ;
-
-
-            SimpleNode node;
-            node = new SimpleNode( name, value, SimpleNode.GREATEREQ );
+            SimpleNode node = new SimpleNode( name, octets, SimpleNode.GREATEREQ );
             getDigester().push( node ) ;
 
             name = null ;

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/LessOrEqualRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/LessOrEqualRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/LessOrEqualRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/LessOrEqualRule.java
Wed Oct 26 13:30:13 2005
@@ -19,6 +19,7 @@
 
 import org.apache.asn1.ber.TypeClass;
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.filter.SimpleNode;
 
 import java.nio.ByteBuffer;
@@ -38,7 +39,7 @@
 {
     private boolean isEnabled = true ;
     private String name = null ;
-    private String value = null ;
+    private byte[] value = null ;
 
 
     public void tag( int id, boolean isPrimitive, TypeClass typeClass )
@@ -98,6 +99,7 @@
         ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -112,15 +114,11 @@
 
         if ( name == null && value == null )
         {
-            name = new String( octets ) ;
+            name = StringUtils.toUtf8( octets );
         }
         else if ( name != null && value == null )
         {
-            value = new String( octets ) ;
-
-
-            SimpleNode node;
-            node = new SimpleNode( name, value, SimpleNode.LESSEQ );
+            SimpleNode node = new SimpleNode( name, octets, SimpleNode.LESSEQ );
             getDigester().push( node ) ;
 
             name = null ;

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/NotRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/NotRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/NotRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/NotRule.java
Wed Oct 26 13:30:13 2005
@@ -51,6 +51,7 @@
     {
         // check to see we are within limits - have the right number of tags
         int tagCount = getDigester().getTagCount();
+        
         if ( tagCount < 3 )
         {
             this.isEnabled = false;

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/PresentRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/PresentRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/PresentRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/PresentRule.java
Wed Oct 26 13:30:13 2005
@@ -19,6 +19,7 @@
 
 import org.apache.asn1.ber.TypeClass;
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.berlib.asn1.LdapTag;
 import org.apache.ldap.common.filter.PresenceNode;
 
@@ -47,6 +48,7 @@
     {
         // check to see we are within limits - have the right number of tags
         int tagCount = getDigester().getTagCount();
+        
         if ( tagCount < 3 )
         {
             this.isEnabled = false;
@@ -117,6 +119,7 @@
             ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
 
             byte[] octets = null ;
+            
             if ( buf.limit() == buf.capacity() && buf.hasArray() )
             {
                 // use the backing store
@@ -129,7 +132,7 @@
                 buf.get( octets );
             }
 
-            getDigester().push( new PresenceNode( new String( octets ) ) );
+            getDigester().push( new PresenceNode( StringUtils.toUtf8( octets ) ) );
         }
 
         isEnabled = true ;

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/RequestedAttributesRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/RequestedAttributesRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/RequestedAttributesRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/RequestedAttributesRule.java
Wed Oct 26 13:30:13 2005
@@ -19,6 +19,7 @@
 
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
 import org.apache.asn1.ber.primitives.UniversalTag;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.message.SearchRequestImpl;
 
 import java.nio.ByteBuffer;
@@ -63,6 +64,7 @@
         SearchRequestImpl req = ( SearchRequestImpl ) getDigester().peek( 1 );
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -75,6 +77,6 @@
             buf.get( octets );
         }
 
-        req.addAttribute( new String( octets ) );
+        req.addAttribute( StringUtils.toUtf8( octets ) );
     }
 }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ScopeRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ScopeRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ScopeRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/ScopeRule.java
Wed Oct 26 13:30:13 2005
@@ -131,12 +131,15 @@
             case 0:
                 getRequest().setScope( ScopeEnum.BASEOBJECT );
                 break;
+                
             case 1:
                 getRequest().setScope( ScopeEnum.SINGLELEVEL );
                 break;
+                
             case 2:
                 getRequest().setScope( ScopeEnum.WHOLESUBTREE );
                 break;
+                
             default:
                 throw new IllegalStateException(
                         "expected 0, 1, or 2 for scope but got " + numba ) ;

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SearchRequestProcessing.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SearchRequestProcessing.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SearchRequestProcessing.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SearchRequestProcessing.java
Wed Oct 26 13:30:13 2005
@@ -32,49 +32,52 @@
 
     /** state for filling in the baseObject field */
     public final State BASE_OBJECT_STATE = new BaseObjectState() ;
+    
     /** state for filling in the scope field */
     public final State SCOPE_STATE = new ScopeState() ;
+    
     /** state for filling in the derefAliases field */
     public final State DEREF_ALIAS_STATE = new DerefAliasState() ;
+    
     /** state for filling in the sizeLimit field */
     public final State SIZE_LIMIT_STATE = new SizeLimitState() ;
+    
     /** state for filling in the timeLimit field */
     public final State TIME_LIMIT_STATE = new TimeLimitState() ;
+    
     /** state for filling in the typesOnly field */
     public final State TYPES_ONLY_STATE = new TypesOnlyState() ;
+    
     /** state for filling in the filter field */
     public final State FILTER_STATE = new FilterState() ;
+    
     /** state for filling in the attributes field */
     public final State ATTRIBUTES_STATE = new AttributesState() ;
+    
     /** state for filling in the controls field */
     public final State CONTROLS_STATE = new ControlsState() ;
-
-
+    
     /** the current request processing state */
     private State state = BASE_OBJECT_STATE ;
 
-
     /** gets the state of SearchRequest processing */
     public State getState()
     {
         return state;
     }
 
-
     /** resets state to the start state */
     public void reset()
     {
         state = BASE_OBJECT_STATE ;
     }
 
-
     /** sets the state to the next in line or back to the start state */
     public void next()
     {
         state.next() ;
     }
 
-
     /**
      * State base class.
      */
@@ -83,7 +86,6 @@
         protected abstract void next() ;
     }
 
-
     /**
      * State class for filling in the baseObject field.
      */
@@ -100,7 +102,6 @@
         }
     }
 
-
     /**
      * State class for filling in the scope field.
      */
@@ -117,7 +118,6 @@
         }
     }
 
-
     /**
      * State class for filling in the derefAliases field.
      */
@@ -134,7 +134,6 @@
         }
     }
 
-
     /**
      * State class for filling in the sizeLimit field.
      */
@@ -151,7 +150,6 @@
         }
     }
 
-
     /**
      * State class for filling in the timeLimit field.
      */
@@ -168,7 +166,6 @@
         }
     }
 
-
     /**
      * State class for filling in the typesOnly field.
      */
@@ -185,7 +182,6 @@
         }
     }
 
-
     /**
      * State class for filling in the filter.
      */
@@ -202,7 +198,6 @@
         }
     }
 
-
     /**
      * State class for filling in the attributes.
      */
@@ -218,7 +213,6 @@
             return "Attributes";
         }
     }
-
 
     /**
      * State class for filling in the controls.

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SearchResponseEntryDnRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SearchResponseEntryDnRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SearchResponseEntryDnRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SearchResponseEntryDnRule.java
Wed Oct 26 13:30:13 2005
@@ -19,6 +19,7 @@
 
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
 import org.apache.asn1.ber.primitives.UniversalTag;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.message.SearchResponseEntry;
 
 import java.nio.ByteBuffer;
@@ -64,6 +65,7 @@
         SearchResponseEntry req = ( SearchResponseEntry ) getDigester().peek() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -76,6 +78,6 @@
             buf.get( octets ) ;
         }
 
-        req.setObjectName( new String( octets ) ) ;
+        req.setObjectName( StringUtils.toUtf8( octets ) ) ;
     }
 }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchAnyRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchAnyRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchAnyRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchAnyRule.java
Wed Oct 26 13:30:13 2005
@@ -18,6 +18,7 @@
 
 
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.berlib.asn1.LdapTag;
 
 import java.nio.ByteBuffer;
@@ -51,6 +52,7 @@
         ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -64,6 +66,6 @@
         }
 
         SubstringMatchRule rule = ( SubstringMatchRule ) getDigester().peek() ;
-        rule.addAny( new String( octets ) );
+        rule.addAny( StringUtils.toUtf8( octets ) );
     }
 }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchFinalRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchFinalRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchFinalRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchFinalRule.java
Wed Oct 26 13:30:13 2005
@@ -18,6 +18,7 @@
 
 
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.berlib.asn1.LdapTag;
 
 import java.nio.ByteBuffer;
@@ -52,6 +53,7 @@
         ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -65,6 +67,6 @@
         }
 
         SubstringMatchRule rule = ( SubstringMatchRule ) getDigester().peek() ;
-        rule.setFinalStr( new String( octets ) );
+        rule.setFinalStr( StringUtils.toUtf8( octets ) );
     }
 }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchInitialRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchInitialRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchInitialRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchInitialRule.java
Wed Oct 26 13:30:13 2005
@@ -18,6 +18,7 @@
 
 
 import org.apache.asn1.ber.digester.rules.PrimitiveOctetStringRule;
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.berlib.asn1.LdapTag;
 
 import java.nio.ByteBuffer;
@@ -52,6 +53,7 @@
         ByteBuffer buf = ( ByteBuffer ) getDigester().pop() ;
 
         byte[] octets = null ;
+        
         if ( buf.limit() == buf.capacity() && buf.hasArray() )
         {
             // use the backing store
@@ -65,6 +67,6 @@
         }
 
         SubstringMatchRule rule = ( SubstringMatchRule ) getDigester().peek() ;
-        rule.setInitial( new String( octets ) );
+        rule.setInitial( StringUtils.toUtf8( octets ) );
     }
 }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchRule.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchRule.java?rev=328723&r1=328722&r2=328723&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchRule.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache-provider/src/java/org/apache/ldap/common/berlib/asn1/decoder/search/SubstringMatchRule.java
Wed Oct 26 13:30:13 2005
@@ -45,10 +45,14 @@
 public class SubstringMatchRule extends AbstractRule
 {
     private boolean isEnabled = true;
+    
     /** the initial substring gotten from the stack */
     private String type = null;
+    
     private String initialStr = null;
+    
     private String finalStr = null;
+    
     private ArrayList any = new ArrayList();
 
 



Mime
View raw message