From 11dbb6598b00c6ef4b5e48ae85210ced425826a5 Mon Sep 17 00:00:00 2001
From: lutoff <lutoff@localhost>
Date: Tue, 05 Jun 2007 15:28:25 +0000
Subject: [PATCH] Remove hardcoded message id inside code

---
 opends/src/ads/org/opends/admin/ads/DsServiceCliReturnCode.java |    6 +++---
 opends/src/server/org/opends/server/messages/AdminMessages.java |    8 ++++++++
 opends/src/ads/org/opends/admin/ads/DsServiceCliMain.java       |    2 +-
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/opends/src/ads/org/opends/admin/ads/DsServiceCliMain.java b/opends/src/ads/org/opends/admin/ads/DsServiceCliMain.java
index fe33fb7..445e51d 100644
--- a/opends/src/ads/org/opends/admin/ads/DsServiceCliMain.java
+++ b/opends/src/ads/org/opends/admin/ads/DsServiceCliMain.java
@@ -261,7 +261,7 @@
       }
     }
     else
-    if (msgID != -1)
+    if (msgID != MSGID_ADMIN_NO_MESSAGE)
     {
       message = getMessage(MSGID_ADMIN_ERROR);
       message = message + getMessage(msgID);
diff --git a/opends/src/ads/org/opends/admin/ads/DsServiceCliReturnCode.java b/opends/src/ads/org/opends/admin/ads/DsServiceCliReturnCode.java
index 12bbcab..0f4f005 100644
--- a/opends/src/ads/org/opends/admin/ads/DsServiceCliReturnCode.java
+++ b/opends/src/ads/org/opends/admin/ads/DsServiceCliReturnCode.java
@@ -53,16 +53,16 @@
     /**
      * Unable to initialze arguments.
      */
-    CANNOT_INITIALIZE_ARGS(1, -1),
+    CANNOT_INITIALIZE_ARGS(1, MSGID_ADMIN_NO_MESSAGE),
 
     /**
      * Cannot parse argument.
      */
-    ERROR_PARSING_ARGS(2, -1),
+    ERROR_PARSING_ARGS(2, MSGID_ADMIN_NO_MESSAGE),
     /**
      * Return code: Cannot get the connection to the ADS.
      */
-    CANNOT_CONNECT_TO_ADS(3, -1),
+    CANNOT_CONNECT_TO_ADS(3, MSGID_ADMIN_NO_MESSAGE),
 
     /**
      * The host name is missing.
diff --git a/opends/src/server/org/opends/server/messages/AdminMessages.java b/opends/src/server/org/opends/server/messages/AdminMessages.java
index cbea170..0e01e35 100644
--- a/opends/src/server/org/opends/server/messages/AdminMessages.java
+++ b/opends/src/server/org/opends/server/messages/AdminMessages.java
@@ -448,6 +448,13 @@
   public static final int MSGID_ADMIN_SUCCESSFUL_NOP=
     CATEGORY_MASK_ADMIN | SEVERITY_MASK_INFORMATIONAL | 51;
 
+  /**
+   * The message ID which indicate that no message is required.
+   */
+  public static final int MSGID_ADMIN_NO_MESSAGE =
+    CATEGORY_MASK_ADMIN | SEVERITY_MASK_SEVERE_ERROR | 52;
+
+
 
   // Prevent instantiation.
   private AdminMessages() {
@@ -612,5 +619,6 @@
     registerMessage(MSGID_ADMIN_SUCCESSFUL_NOP,
        "The operation has been successfully completed, "+
        "but no action was required");
+    registerMessage(MSGID_ADMIN_NO_MESSAGE,"");
   }
 }

--
Gitblit v1.10.0