From fff28547081591b9b506c43b2df646dea3a32405 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 15 Jul 2013 15:24:47 +0000
Subject: [PATCH] Extracted several time the method findAndSetMatchingDN(). We should look at moving this code to a single reusable place.
---
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendCompareOperation.java | 49 ++++++++++++++++++++++++++-----------------------
1 files changed, 26 insertions(+), 23 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 48a1fbf..bd4a3ca 100644
--- a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendCompareOperation.java
+++ b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendCompareOperation.java
@@ -205,29 +205,7 @@
.valueOf(entryDN)));
// See if one of the entry's ancestors exists.
- DN parentDN = entryDN.getParentDNInSuffix();
- while (parentDN != null)
- {
- try
- {
- if (DirectoryServer.entryExists(parentDN))
- {
- setMatchedDN(parentDN);
- break;
- }
- }
- catch (Exception e)
- {
- if (debugEnabled())
- {
- TRACER.debugCaught(DebugLogLevel.ERROR, e);
- }
- break;
- }
-
- parentDN = parentDN.getParentDNInSuffix();
- }
-
+ findAndSetMatchingDN(entryDN);
return;
}
}
@@ -359,6 +337,31 @@
}
}
+ private void findAndSetMatchingDN(DN entryDN)
+ {
+ try
+ {
+ DN matchedDN = entryDN.getParentDNInSuffix();
+ while (matchedDN != null)
+ {
+ if (DirectoryServer.entryExists(matchedDN))
+ {
+ setMatchedDN(matchedDN);
+ return;
+ }
+
+ matchedDN = matchedDN.getParentDNInSuffix();
+ }
+ }
+ catch (Exception e)
+ {
+ if (debugEnabled())
+ {
+ TRACER.debugCaught(DebugLogLevel.ERROR, e);
+ }
+ }
+ }
+
/**
* Performs any processing required for the controls included in the request.
*
--
Gitblit v1.10.0