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/LocalBackendModifyOperation.java | 48 ++++++++++++++++++++++++++----------------------
1 files changed, 26 insertions(+), 22 deletions(-)
diff --git a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
index e4aa570..a1f310b 100644
--- a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
+++ b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
@@ -430,28 +430,7 @@
.get(String.valueOf(entryDN)));
// See if one of the entry's ancestors exists.
- try
- {
- DN parentDN = entryDN.getParentDNInSuffix();
- while (parentDN != null)
- {
- if (DirectoryServer.entryExists(parentDN))
- {
- setMatchedDN(parentDN);
- break;
- }
-
- parentDN = parentDN.getParentDNInSuffix();
- }
- }
- catch (Exception e)
- {
- if (debugEnabled())
- {
- TRACER.debugCaught(DebugLogLevel.ERROR, e);
- }
- }
-
+ findAndSetMatchingDN(entryDN);
return;
}
@@ -650,6 +629,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);
+ }
+ }
+ }
+
/**
* Processes any controls contained in the modify request.
*
--
Gitblit v1.10.0