From 92b8b0e66ec0c29c0e020c9b4aa7680ba4732f9d Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 16 Jul 2013 07:57:52 +0000
Subject: [PATCH] Respected the Single Responsibility Principle by splitting findAndSetMatchingDN() method into findMatchedDN() and setMatchedDN() methods.

---
 opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java
index 36f96fa..1a468a7 100644
--- a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java
+++ b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java
@@ -383,7 +383,7 @@
       if (getOriginalEntry() == null)
       {
         // See if one of the entry's ancestors exists.
-        findAndSetMatchingDN(entryDN);
+        setMatchedDN(findMatchedDN(entryDN));
 
         setResultCode(ResultCode.NO_SUCH_OBJECT);
         appendErrorMessage(ERR_MODDN_NO_CURRENT_ENTRY.get(String
@@ -573,7 +573,7 @@
     }
   }
 
-  private void findAndSetMatchingDN(DN entryDN)
+  private DN findMatchedDN(DN entryDN)
   {
     try
     {
@@ -582,8 +582,7 @@
       {
         if (DirectoryServer.entryExists(matchedDN))
         {
-          setMatchedDN(matchedDN);
-          return;
+          return matchedDN;
         }
 
         matchedDN = matchedDN.getParentDNInSuffix();
@@ -596,6 +595,7 @@
         TRACER.debugCaught(DebugLogLevel.ERROR, e);
       }
     }
+    return null;
   }
 
   /**

--
Gitblit v1.10.0