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/LocalBackendCompareOperation.java |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendCompareOperation.java b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendCompareOperation.java
index bd4a3ca..d7ca875 100644
--- a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendCompareOperation.java
+++ b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendCompareOperation.java
@@ -205,7 +205,7 @@
               .valueOf(entryDN)));
 
           // See if one of the entry's ancestors exists.
-          findAndSetMatchingDN(entryDN);
+          setMatchedDN(findMatchedDN(entryDN));
           return;
         }
       }
@@ -337,7 +337,7 @@
     }
   }
 
-  private void findAndSetMatchingDN(DN entryDN)
+  private DN findMatchedDN(DN entryDN)
   {
     try
     {
@@ -346,8 +346,7 @@
       {
         if (DirectoryServer.entryExists(matchedDN))
         {
-          setMatchedDN(matchedDN);
-          return;
+          return matchedDN;
         }
 
         matchedDN = matchedDN.getParentDNInSuffix();
@@ -360,6 +359,7 @@
         TRACER.debugCaught(DebugLogLevel.ERROR, e);
       }
     }
+    return null;
   }
 
   /**

--
Gitblit v1.10.0