directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1749571 - /directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/FilterParser.java
Date Tue, 21 Jun 2016 16:43:51 GMT
Author: elecharny
Date: Tue Jun 21 16:43:51 2016
New Revision: 1749571

URL: http://svn.apache.org/viewvc?rev=1749571&view=rev
Log:
o Store the value as a byte[] when we aren't schema aware

Modified:
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/FilterParser.java

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/FilterParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/FilterParser.java?rev=1749571&r1=1749570&r2=1749571&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/FilterParser.java
(original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/filter/FilterParser.java
Tue Jun 21 16:43:51 2016
@@ -369,7 +369,10 @@ public final class FilterParser
 
                 if ( attributeType == null )
                 {
-                    return new Value( Strings.utf8ToString( value, current ) );
+                    byte[] bytes = new byte[current];
+                    System.arraycopy( value, 0, bytes, 0, current );
+                    
+                    return new Value( bytes );
                 }
 
                 if ( attributeType.getSyntax().isHumanReadable() )
@@ -386,7 +389,10 @@ public final class FilterParser
             }
             else
             {
-                return new Value( Strings.utf8ToString( value, current ) );
+                byte[] bytes = new byte[current];
+                System.arraycopy( value, 0, bytes, 0, current );
+                
+                return new Value( bytes );
             }
         }
         else
@@ -712,7 +718,7 @@ public final class FilterParser
                         }
                         else
                         {
-                            return new EqualityNode( attribute, value.getValue() );
+                            return new EqualityNode( attribute, value.getBytes() );
                         }
                         
                     case '*' :
@@ -1001,7 +1007,6 @@ public final class FilterParser
                 // This is an item
                 node = parseItem( schemaManager, filterBytes, pos, b, relaxed );
                 break;
-
         }
 
         return node;



Mime
View raw message