From db77f058c92ee3d0b531c474093d6a3d1d81cd25 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 26 May 2014 12:17:41 +0000
Subject: [PATCH] Ensured no accidental protocol break can happen by renaming all ByteArrayBuilder.append*() methods and getting rid of all method overloading.

---
 opends/src/server/org/opends/server/replication/protocol/AddMsg.java |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/protocol/AddMsg.java b/opends/src/server/org/opends/server/replication/protocol/AddMsg.java
index fea3de7..ab5c770 100644
--- a/opends/src/server/org/opends/server/replication/protocol/AddMsg.java
+++ b/opends/src/server/org/opends/server/replication/protocol/AddMsg.java
@@ -188,8 +188,8 @@
   public byte[] getBytes_V1()
   {
     final ByteArrayBuilder builder = encodeHeader_V1(MSG_TYPE_ADD_V1);
-    builder.append(parentEntryUUID);
-    builder.append(encodedAttributes);
+    builder.appendString(parentEntryUUID);
+    builder.appendByteArray(encodedAttributes);
     return builder.toByteArray();
   }
 
@@ -199,8 +199,8 @@
   {
     final ByteArrayBuilder builder =
         encodeHeader(MSG_TYPE_ADD, ProtocolVersion.REPLICATION_PROTOCOL_V3);
-    builder.append(parentEntryUUID);
-    builder.append(encodedAttributes);
+    builder.appendString(parentEntryUUID);
+    builder.appendByteArray(encodedAttributes);
     return builder.toByteArray();
   }
 
@@ -210,11 +210,11 @@
   {
     final ByteArrayBuilder builder =
         encodeHeader(MSG_TYPE_ADD, protocolVersion);
-    builder.append(parentEntryUUID);
-    builder.appendUTF8(encodedAttributes.length);
-    builder.appendZeroTerminated(encodedAttributes);
-    builder.appendUTF8(encodedEclIncludes.length);
-    builder.appendZeroTerminated(encodedEclIncludes);
+    builder.appendString(parentEntryUUID);
+    builder.appendIntUTF8(encodedAttributes.length);
+    builder.appendZeroTerminatedByteArray(encodedAttributes);
+    builder.appendIntUTF8(encodedEclIncludes.length);
+    builder.appendZeroTerminatedByteArray(encodedEclIncludes);
     return builder.toByteArray();
   }
 

--
Gitblit v1.10.0