directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject [directory-ldap-api] branch shared-value updated: o When passing byte[] to a Value, without attributeType, make the value non HR o When passing a byte[] to a Value with an HR attributeType, convert the byte[] to a String
Date Fri, 01 Dec 2017 00:21:51 GMT
This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a commit to branch shared-value
in repository https://gitbox.apache.org/repos/asf/directory-ldap-api.git


The following commit(s) were added to refs/heads/shared-value by this push:
     new 16b5e0e  o When passing byte[] to a Value, without attributeType, make the value
non HR o When passing a byte[] to a Value with an HR attributeType, convert the byte[] to
a String
16b5e0e is described below

commit 16b5e0edaec53bc8bbc2eb6598d372f7ef89b046
Author: Emmanuel L├ęcharny <elecharny@symas.com>
AuthorDate: Fri Dec 1 01:05:52 2017 +0100

    o When passing byte[] to a Value, without attributeType, make the value
    non HR
    o When passing a byte[] to a Value with an HR attributeType, convert the
    byte[] to a String
---
 .../main/java/org/apache/directory/api/ldap/model/entry/Value.java | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java
b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java
index 818da76..2660f90 100644
--- a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java
+++ b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java
@@ -138,6 +138,8 @@ public class Value implements Cloneable, Externalizable, Comparable<Value>
         {
             bytes = null;
         }
+        
+        isHR = false;
 
         hashCode();
     }
@@ -159,6 +161,11 @@ public class Value implements Cloneable, Externalizable, Comparable<Value>
         {
             bytes = new byte[upValue.length];
             System.arraycopy( upValue, 0, bytes, 0, upValue.length );
+
+            if ( isHR )
+            {
+                this.upValue = Strings.utf8ToString( upValue );
+            }
         }
         else
         {

-- 
To stop receiving notification emails like this one, please contact
['"commits@directory.apache.org" <commits@directory.apache.org>'].

Mime
View raw message