From 7a34cefa2a5bbdf339f1a50b856e3d7441006b8d Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Wed, 08 Jun 2011 14:33:10 +0000
Subject: [PATCH] Fix OPENDJ-184: Transient errors when accessing cn=changelog DraftCN DB result in complete shutdown of the replication service

---
 opends/src/server/org/opends/server/replication/server/DraftCNData.java |   21 ++++-----------------
 1 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/DraftCNData.java b/opends/src/server/org/opends/server/replication/server/DraftCNData.java
index fc4c171..47ce17e 100644
--- a/opends/src/server/org/opends/server/replication/server/DraftCNData.java
+++ b/opends/src/server/org/opends/server/replication/server/DraftCNData.java
@@ -23,10 +23,12 @@
  *
  *
  *      Copyright 2009 Sun Microsystems, Inc.
- *      Portions Copyright 2010 ForgeRock AS.
+ *      Portions Copyright 2010-2011 ForgeRock AS.
  */
 package org.opends.server.replication.server;
 
+import static org.opends.server.util.StaticUtils.getBytes;
+
 import java.io.UnsupportedEncodingException;
 
 import org.opends.messages.Message;
@@ -53,29 +55,14 @@
    * @param value The value (cookie).
    * @param serviceID The serviceID (domain DN).
    * @param changeNumber The replication change number.
-   *
-   * @throws UnsupportedEncodingException When the encoding of the message
-   *         failed because the UTF-8 encoding is not supported.
    */
   public DraftCNData(int draftCN, String value,
       String serviceID, ChangeNumber changeNumber)
-  throws UnsupportedEncodingException
   {
     String record = value
                    + FIELD_SEPARATOR + serviceID
                    + FIELD_SEPARATOR + changeNumber;
-
-    byte[] byteValue;
-    try
-    {
-      byteValue = record.getBytes("UTF-8");
-      this.setData(byteValue);
-    }
-    catch (UnsupportedEncodingException e)
-    {
-      // can't happen
-      return;
-    }
+    setData(getBytes(record));
   }
 
   /**

--
Gitblit v1.10.0