directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject [19/20] git commit: Improved teh wayw e build the DN
Date Wed, 05 Nov 2014 17:33:26 GMT
Improved teh wayw e build the DN

Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/commit/24fe48d9
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/24fe48d9
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/24fe48d9

Branch: refs/heads/master
Commit: 24fe48d9bfb6451ccd821ca6ea062a8de4990f2f
Parents: 035ad68
Author: Emmanuel L├ęcharny <elecharny@symas.com>
Authored: Wed Nov 5 18:30:17 2014 +0100
Committer: Emmanuel L├ęcharny <elecharny@symas.com>
Committed: Wed Nov 5 18:30:17 2014 +0100

----------------------------------------------------------------------
 .../fortress/core/ldap/ApacheDsDataProvider.java       | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/24fe48d9/src/main/java/org/apache/directory/fortress/core/ldap/ApacheDsDataProvider.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ldap/ApacheDsDataProvider.java
b/src/main/java/org/apache/directory/fortress/core/ldap/ApacheDsDataProvider.java
index 583e676..4b7591f 100644
--- a/src/main/java/org/apache/directory/fortress/core/ldap/ApacheDsDataProvider.java
+++ b/src/main/java/org/apache/directory/fortress/core/ldap/ApacheDsDataProvider.java
@@ -277,7 +277,6 @@ public abstract class ApacheDsDataProvider
     protected String getRootDn( String contextId, String root )
     {
         String szDn = Config.getProperty( root );
-        StringBuilder dn = new StringBuilder();
 
         // The contextId must not be null, or "HOME" or "null"
         if ( VUtil.isNotNullOrEmpty( contextId ) && !contextId.equalsIgnoreCase(
GlobalIds.NULL ) && !contextId
@@ -288,16 +287,22 @@ public abstract class ApacheDsDataProvider
             if ( idx != -1 )
             {
                 // Found. The DN is ,ou=<contextId>,  
+                StringBuilder dn = new StringBuilder();
+
                 dn.append( szDn.substring( 0, idx - 1 ) ).append( "," ).append( GlobalIds.OU
).append( "=" ).append(
                     contextId ).append( "," ).append( szDn.substring( idx ) );
+                
+                return dn.toString();
+            }
+            else
+            {
+                return "";
             }
         }
         else
         {
-            dn.append( szDn );
+            return szDn;
         }
-
-        return dn.toString();
     }
 
 


Mime
View raw message