directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r649846 - /directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java
Date Sat, 19 Apr 2008 20:36:55 GMT
Author: akarasulu
Date: Sat Apr 19 13:36:52 2008
New Revision: 649846

URL: http://svn.apache.org/viewvc?rev=649846&view=rev
Log:
fixed bug which incorrectly checks for sibling relationship

Modified:
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java?rev=649846&r1=649845&r2=649846&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java
(original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java
Sat Apr 19 13:36:52 2008
@@ -75,11 +75,13 @@
      * @param name2 the second name
      * @return true if the names are siblings, false otherwise.
      */
-    public static boolean isSibling( Name name1, Name name2 )
+    public static boolean isSibling( Name name1, Name name2 ) throws NamingException
     {
         if ( name1.size() == name2.size() )
         {
-            return name2.startsWith( name1.getPrefix( 1 ) );
+            LdapDN parentDn = ( LdapDN ) name1.clone();
+            parentDn.remove( name1.size() - 1 );
+            return name2.startsWith( parentDn );
         }
 
         return false;



Mime
View raw message