directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject [directory-mavibot] branch single-value updated: Fixed a bug in the serializer
Date Tue, 02 Jan 2018 22:36:24 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/single-value by this push:
     new f265716  Fixed a bug in the serializer
f265716 is described below

commit f265716f635a81b9b7fe6947531daf25ee2fbefd
Author: Emmanuel L├ęcharny <elecharny@symas.com>
AuthorDate: Tue Jan 2 23:36:23 2018 +0100

    Fixed a bug in the serializer
---
 .../directory/mavibot/btree/RevisionNameSerializer.java    | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionNameSerializer.java
b/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionNameSerializer.java
index e932e9d..a2b0b67 100644
--- a/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionNameSerializer.java
+++ b/mavibot/src/main/java/org/apache/directory/mavibot/btree/RevisionNameSerializer.java
@@ -35,7 +35,15 @@ import org.apache.directory.mavibot.btree.util.Strings;
 
 /**
  * A serializer for the RevisionName object. The RevisionName will be serialized
- * as a long (the revision), followed by the String.
+ * as a long (the revision), followed by the String :
+ * <pre>
+ *  +---+---+---+---+---+---+---+---+
+ *  | Revision, 8 bytes             |
+ *  +---+---+---+---+---+---+---+---+
+ *  | String length | 4 bytes. 0xFFFFFFFF if null
+ *  +---+---+---+---+
+ *  | String value...
+ *  +----------------
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -152,7 +160,7 @@ import org.apache.directory.mavibot.btree.util.Strings;
             else
             {
                 // The empty name
-                IntSerializer.serialize( result, 4,  0 );
+                IntSerializer.serialize( result, 8,  0 );
             }
         }
         else
@@ -164,7 +172,7 @@ import org.apache.directory.mavibot.btree.util.Strings;
             
             
             // The null name
-            IntSerializer.serialize( result, 4, 0xFFFFFFFF );
+            IntSerializer.serialize( result, 8, 0xFFFFFFFF );
         }
 
         return result;

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

Mime
View raw message