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/MonitorMsg.java | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/protocol/MonitorMsg.java b/opends/src/server/org/opends/server/replication/protocol/MonitorMsg.java
index 470ed18..05a0143 100644
--- a/opends/src/server/org/opends/server/replication/protocol/MonitorMsg.java
+++ b/opends/src/server/org/opends/server/replication/protocol/MonitorMsg.java
@@ -274,7 +274,7 @@
try
{
final ByteArrayBuilder builder = new ByteArrayBuilder();
- builder.append(MSG_TYPE_REPL_SERVER_MONITOR);
+ builder.appendByte(MSG_TYPE_REPL_SERVER_MONITOR);
append(builder, senderID, protocolVersion);
append(builder, destination, protocolVersion);
@@ -298,7 +298,7 @@
if (protocolVersion == ProtocolVersion.REPLICATION_PROTOCOL_V1)
{
// legacy coding mistake
- builder.append((byte) 0);
+ builder.appendByte((byte) 0);
}
return builder.toByteArray();
}
@@ -313,15 +313,15 @@
{
if (protocolVersion == ProtocolVersion.REPLICATION_PROTOCOL_V1)
{
- builder.appendUTF8(data);
+ builder.appendIntUTF8(data);
}
else if (protocolVersion <= ProtocolVersion.REPLICATION_PROTOCOL_V3)
{
- builder.append((short) data);
+ builder.appendShort((short) data);
}
else // protocolVersion >= ProtocolVersion.REPLICATION_PROTOCOL_V4
{
- builder.append(data);
+ builder.appendInt(data);
}
}
--
Gitblit v1.10.0