From 8d363b60e9cb04609592c2368f550c2ea8a6ab34 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Fri, 07 Dec 2007 17:36:12 +0000
Subject: [PATCH] This relates to issue 2661 "public APIs must not reference private classes".

---
 opendj-sdk/opends/src/messages/src/org/opends/messages/Message.java |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/opendj-sdk/opends/src/messages/src/org/opends/messages/Message.java b/opendj-sdk/opends/src/messages/src/org/opends/messages/Message.java
index 7240bea..e060b6f 100644
--- a/opendj-sdk/opends/src/messages/src/org/opends/messages/Message.java
+++ b/opendj-sdk/opends/src/messages/src/org/opends/messages/Message.java
@@ -45,7 +45,13 @@
  *
  * @see org.opends.messages.MessageDescriptor
  */
-public class Message implements CharSequence, Formattable, Comparable {
+@org.opends.server.types.PublicAPI(
+    stability=org.opends.server.types.StabilityLevel.UNCOMMITTED,
+    mayInstantiate=true,
+    mayExtend=false,
+    mayInvoke=true)
+public final class Message implements CharSequence, Formattable,
+    Comparable<Message> {
 
   /** Represents an empty message string. */
   public static final Message EMPTY = Message.raw("");
@@ -149,10 +155,10 @@
   }
 
   /** Descriptor of this message. */
-  protected MessageDescriptor descriptor;
+  private final MessageDescriptor descriptor;
 
   /** Values used to replace argument specifiers in the format string. */
-  protected Object[] args;
+  private final Object[] args;
 
   /**
    * Gets the string representation of this message.
@@ -387,13 +393,9 @@
    * @param   o the object to be compared.
    * @return  a negative integer, zero, or a positive integer as this object
    *          is less than, equal to, or greater than the specified object.
-   *
-   * @throws ClassCastException if the specified object's type prevents it
-   *         from being compared to this object.
    */
-  public int compareTo(Object o) throws ClassCastException {
-    Message thatMessage = (Message)o;
-    return toString().compareTo(thatMessage.toString());
+  public int compareTo(Message o) {
+    return toString().compareTo(o.toString());
   }
 
   /**

--
Gitblit v1.10.0