From 59685c84348f8d71dc3bbd3513c5eb10cc738a8e Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Fri, 03 Nov 2006 16:39:22 +0000
Subject: [PATCH] Refactor DN and RDN classes and improve their test coverage.

---
 opends/src/server/org/opends/server/core/SimpleSubtreeSpecification.java |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/SimpleSubtreeSpecification.java b/opends/src/server/org/opends/server/core/SimpleSubtreeSpecification.java
index cfb7673..b548c3d 100644
--- a/opends/src/server/org/opends/server/core/SimpleSubtreeSpecification.java
+++ b/opends/src/server/org/opends/server/core/SimpleSubtreeSpecification.java
@@ -390,7 +390,7 @@
       this.chopBefore = new TreeMap<DN, DN>();
 
       for (DN localName : chopBefore) {
-        this.chopBefore.put(new DN(baseDN, localName), localName);
+        this.chopBefore.put(baseDN.concat(localName), localName);
       }
     } else {
       // No chop before specifications.
@@ -402,7 +402,7 @@
       this.chopAfter = new TreeMap<DN, DN>();
 
       for (DN localName : chopAfter) {
-        this.chopAfter.put(new DN(baseDN, localName), localName);
+        this.chopAfter.put(baseDN.concat(localName), localName);
       }
     } else {
       // No chop after specifications.
@@ -428,10 +428,10 @@
     }
 
     // Check minimum and maximum depths.
-    int baseRDNCount = baseDN.getRDNComponents().length;
+    int baseRDNCount = baseDN.getNumComponents();
 
     if (minimumDepth > 0) {
-      int entryRDNCount = dn.getRDNComponents().length;
+      int entryRDNCount = dn.getNumComponents();
 
       if (entryRDNCount - baseRDNCount < minimumDepth) {
         return false;
@@ -439,7 +439,7 @@
     }
 
     if (maximumDepth >= 0) {
-      int entryRDNCount = dn.getRDNComponents().length;
+      int entryRDNCount = dn.getNumComponents();
 
       if (entryRDNCount - baseRDNCount > maximumDepth) {
         return false;

--
Gitblit v1.10.0