From 42bd7a7bd312ebe1193e8e40e73fc2fb377e3663 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 08 Aug 2016 08:05:17 +0000
Subject: [PATCH] replication protocol: Code cleanup + use class' simple name in toString()

---
 opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/MonitorMsg.java        |   20 +++++---------------
 opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/MonitorRequestMsg.java |   22 ++++------------------
 opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/RoutableMsg.java       |    7 +------
 3 files changed, 10 insertions(+), 39 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/MonitorMsg.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/MonitorMsg.java
index 8027038..647387a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/MonitorMsg.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/MonitorMsg.java
@@ -12,7 +12,7 @@
  * information: "Portions Copyright [year] [name of copyright owner]".
  *
  * Copyright 2009 Sun Microsystems, Inc.
- * Portions Copyright 2013-2015 ForgeRock AS.
+ * Portions Copyright 2013-2016 ForgeRock AS.
  */
 package org.opends.server.replication.protocol;
 
@@ -37,22 +37,14 @@
  */
 public class MonitorMsg extends ReplicationMsg
 {
-  /**
-   * The destination server or servers of this message.
-   */
+  /** The destination server or servers of this message. */
   private final int destination;
-
-  /**
-   * The serverID of the server that sends this message.
-   */
+  /** The serverID of the server that sends this message. */
   private final int senderID;
 
-
-
   /**
    * Data structure to manage the state and the approximation of the data of the
-   * first missing change for each LDAP server connected to a Replication
-   * Server.
+   * first missing change for each LDAP server connected to a Replication Server.
    */
   private static class ServerData
   {
@@ -255,7 +247,6 @@
     }
   }
 
-  /** {@inheritDoc} */
   @Override
   public byte[] getBytes(short protocolVersion)
   {
@@ -393,7 +384,6 @@
     return senderID;
   }
 
-  /** {@inheritDoc} */
   @Override
   public String toString()
   {
@@ -418,7 +408,7 @@
             .append(sd.state).append("]").append(" afmd=")
             .append(sd.approxFirstMissingDate).append("]");
     }
-    return getClass().getCanonicalName() +
+    return getClass().getSimpleName() +
     "[ sender=" + this.senderID +
     " destination=" + this.destination +
     " data=[" + stateS + "]" +
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/MonitorRequestMsg.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/MonitorRequestMsg.java
index 46ef81e..f31f040 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/MonitorRequestMsg.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/MonitorRequestMsg.java
@@ -12,7 +12,7 @@
  * information: "Portions Copyright [year] [name of copyright owner]".
  *
  * Copyright 2008-2009 Sun Microsystems, Inc.
- * Portions copyright 2013-2014 ForgeRock AS.
+ * Portions copyright 2013-2016 ForgeRock AS.
  */
 package org.opends.server.replication.protocol;
 
@@ -25,14 +25,9 @@
  */
 public class MonitorRequestMsg extends ReplicationMsg
 {
-  /**
-   * The destination server or servers of this message.
-   */
+  /** The destination server or servers of this message. */
   private final int destination;
-
-  /**
-   * The serverID of the server that sends this message.
-   */
+  /** The serverID of the server that sends this message. */
   private final int senderID;
 
   /**
@@ -49,8 +44,6 @@
     this.destination = destination;
   }
 
-
-
   /**
    * Creates a new message by decoding the provided byte array.
    *
@@ -72,7 +65,6 @@
     this.destination = scanner.nextIntUTF8();
   }
 
-  /** {@inheritDoc} */
   @Override
   public byte[] getBytes(short protocolVersion)
   {
@@ -103,15 +95,9 @@
     return senderID;
   }
 
-  /**
-   * Returns a string representation of the message.
-   *
-   * @return the string representation of this message.
-   */
   @Override
   public String toString()
   {
-    return "[" + getClass().getCanonicalName() + " sender=" + senderID
-        + " destination=" + destination + "]";
+    return "[" + getClass().getSimpleName() + " sender=" + senderID + " destination=" + destination + "]";
   }
 }
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/RoutableMsg.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/RoutableMsg.java
index 2466a7e..68efbeb 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/RoutableMsg.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/RoutableMsg.java
@@ -80,15 +80,10 @@
     return this.senderID;
   }
 
-  /**
-   * Returns a string representation of the message.
-   *
-   * @return the string representation of this message.
-   */
   @Override
   public String toString()
   {
-    return "[" + getClass().getCanonicalName() +
+    return "[" + getClass().getSimpleName() +
       " sender=" + this.senderID +
       " destination=" + this.destination + "]";
   }

--
Gitblit v1.10.0