From ed699902a89c7be9c46f3c9bb24c33fdee507879 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Thu, 12 Oct 2006 05:27:32 +0000
Subject: [PATCH] Update code in the org.opends.server.util package to use the Validator.ensureNotNull method for arguments that are not allowed to be null, and also update the javadoc for the corresponding @param tags to indicate this.

---
 opends/src/server/org/opends/server/util/ModifyDNChangeRecordEntry.java |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/opends/src/server/org/opends/server/util/ModifyDNChangeRecordEntry.java b/opends/src/server/org/opends/server/util/ModifyDNChangeRecordEntry.java
index e065452..3104374 100644
--- a/opends/src/server/org/opends/server/util/ModifyDNChangeRecordEntry.java
+++ b/opends/src/server/org/opends/server/util/ModifyDNChangeRecordEntry.java
@@ -30,6 +30,7 @@
 
 import static org.opends.server.loggers.Debug.debugConstructor;
 import static org.opends.server.loggers.Debug.debugEnter;
+import static org.opends.server.util.Validator.*;
 
 import org.opends.server.types.DN;
 import org.opends.server.types.RDN;
@@ -63,16 +64,18 @@
    * Creates a new entry with the provided information.
    *
    * @param dn
-   *          The distinguished name for this entry.
-   * @param newSuperiorDN
-   *          The new superior DN.
+   *          The distinguished name for this entry.  It must not be
+   *          <CODE>null</CODE>.
    * @param newRDN
-   *          The new RDN.
+   *          The new RDN.  It must not be <CODE>null</CODE>.
    * @param deleteOldRDN
    *          Delete the old RDN?
+   * @param newSuperiorDN
+   *          The new superior DN.  It may be <CODE>null</CODE> if the entry is
+   *          not to be moved below a new parent.
    */
-  public ModifyDNChangeRecordEntry(DN dn, DN newSuperiorDN,
-      RDN newRDN, boolean deleteOldRDN)
+  public ModifyDNChangeRecordEntry(DN dn, RDN newRDN, boolean deleteOldRDN,
+                                   DN newSuperiorDN)
   {
     super(dn);
     assert debugConstructor(CLASS_NAME, String.valueOf(dn),
@@ -80,6 +83,8 @@
                             String.valueOf(newRDN),
                             String.valueOf(deleteOldRDN));
 
+    ensureNotNull(newRDN);
+
     this.newSuperiorDN = newSuperiorDN;
     this.newRDN = newRDN;
     this.deleteOldRDN = deleteOldRDN;
@@ -102,7 +107,7 @@
   /**
    * Get the new superior DN for the requested modify DN operation.
    *
-   * @return the new superior DN.
+   * @return the new superior DN, or <CODE>null</CODE> if there is none.
    *
    */
   public DN getNewSuperiorDN()

--
Gitblit v1.10.0