directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r328740 - /directory/shared/ldap/branches/shared-ldap-utf8/snacc-provider/src/java/org/apache/ldap/common/berlib/snacc/FilterTransform.java
Date Wed, 26 Oct 2005 21:22:54 GMT
Author: elecharny
Date: Wed Oct 26 14:22:48 2005
New Revision: 328740

URL: http://svn.apache.org/viewcvs?rev=328740&view=rev
Log:
Fixed the Filter transformation to allow UTF-8 strings

Modified:
    directory/shared/ldap/branches/shared-ldap-utf8/snacc-provider/src/java/org/apache/ldap/common/berlib/snacc/FilterTransform.java

Modified: directory/shared/ldap/branches/shared-ldap-utf8/snacc-provider/src/java/org/apache/ldap/common/berlib/snacc/FilterTransform.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/snacc-provider/src/java/org/apache/ldap/common/berlib/snacc/FilterTransform.java?rev=328740&r1=328739&r2=328740&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/snacc-provider/src/java/org/apache/ldap/common/berlib/snacc/FilterTransform.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/snacc-provider/src/java/org/apache/ldap/common/berlib/snacc/FilterTransform.java
Wed Oct 26 14:22:48 2005
@@ -30,6 +30,7 @@
 import java.util.ArrayList ;
 import java.util.Enumeration ;
 
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.filter.ExprNode ;
 import org.apache.ldap.common.filter.LeafNode ;
 import org.apache.ldap.common.filter.BranchNode ;
@@ -233,14 +234,14 @@
     private static SubstringFilter getSubstringFilter( SubstringNode a_node )
     {
         SubstringFilter l_subStrFilter = new SubstringFilter() ;
-        l_subStrFilter.type = a_node.getAttribute().getBytes() ;
+        l_subStrFilter.type = StringUtils.getBytesUtf8( a_node.getAttribute() ) ;
         SubstringFilterSeqOf l_seq = new SubstringFilterSeqOf() ;
         l_subStrFilter.substrings = l_seq ;
 
         SubstringFilterSeqOfChoice l_initial =
             new SubstringFilterSeqOfChoice() ;
         l_initial.choiceId = SubstringFilterSeqOfChoice.INITIAL_CID ;
-        l_initial.initial = a_node.getInitial().getBytes() ;
+        l_initial.initial = StringUtils.getBytesUtf8( a_node.getInitial() ) ;
         l_seq.add( l_initial ) ;
 
         for( int ii = 0; ii < a_node.getAny().size(); ii ++ )
@@ -248,14 +249,14 @@
             SubstringFilterSeqOfChoice l_any =
                 new SubstringFilterSeqOfChoice() ;
             l_any.choiceId = SubstringFilterSeqOfChoice.ANY_CID ;
-            l_any.any = ( ( String ) a_node.getAny().get( ii ) ).getBytes() ;
+            l_any.any = StringUtils.getBytesUtf8( ( ( String ) a_node.getAny().get( ii )
) ) ;
             l_seq.add( l_any ) ;
         }
 
         SubstringFilterSeqOfChoice l_final =
             new SubstringFilterSeqOfChoice() ;
         l_final.choiceId = SubstringFilterSeqOfChoice.FINAL1_CID ;
-        l_final.final1 = a_node.getFinal().getBytes() ;
+        l_final.final1 = StringUtils.getBytesUtf8( a_node.getFinal() ) ;
         l_seq.add( l_final ) ;
 
         return l_subStrFilter ;
@@ -272,9 +273,9 @@
     private static MatchingRuleAssertion getMra( ExtensibleNode a_node )
     {
         MatchingRuleAssertion l_mra = new MatchingRuleAssertion() ;
-        l_mra.type = a_node.getAttribute().getBytes() ;
-        l_mra.matchValue = a_node.getValue().getBytes() ;
-        l_mra.matchingRule = a_node.getMatchingRuleId().getBytes() ;
+        l_mra.type = StringUtils.getBytesUtf8( a_node.getAttribute() ) ;
+        l_mra.matchValue = a_node.getValue() ;
+        l_mra.matchingRule = StringUtils.getBytesUtf8( a_node.getMatchingRuleId() ) ;
         l_mra.dnAttributes = a_node.dnAttributes() ;
 
         return l_mra ;
@@ -292,8 +293,8 @@
         throws ProviderException
     {
         AttributeValueAssertion l_ava = new AttributeValueAssertion() ;
-        l_ava.attributeDesc = a_node.getAttribute().getBytes() ;
-        l_ava.assertionValue = a_node.getValue().getBytes() ;
+        l_ava.attributeDesc = StringUtils.getBytesUtf8( a_node.getAttribute() ) ;
+        l_ava.assertionValue = a_node.getValue();
 
         return l_ava ;
     }
@@ -342,7 +343,7 @@
             case( LeafNode.PRESENCE ):
                 a_filter.choiceId = Filter.PRESENT_CID ;
                 a_filter.present =
-                    ( ( PresenceNode ) a_node ).getAttribute().getBytes() ;
+                    StringUtils.getBytesUtf8( ( ( PresenceNode ) a_node ).getAttribute()
) ;
                 break ;
             case( LeafNode.SUBSTRING ):
                 a_filter.choiceId = Filter.SUBSTRINGS_CID ;



Mime
View raw message