directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r643572 - /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Date Tue, 01 Apr 2008 21:09:59 GMT
Author: elecharny
Date: Tue Apr  1 14:09:48 2008
New Revision: 643572

URL: http://svn.apache.org/viewvc?rev=643572&view=rev
Log:
Fixed the 3 flaws I found in the PartitionLookupTree synchronization  :
o moved the Node currentNode = partitionLookupTree line into the synchronized block
o synchronized on partitionLookupTree in getpartition() method, instead of using the partitionLookupTreeLock
object
o removed the partitionLookupTreeLock object

Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=643572&r1=643571&r2=643572&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Tue Apr  1 14:09:48 2008
@@ -147,7 +147,6 @@
     
     /** The OID registry */
     private OidRegistry oidRegistry;
-    private Object partitionLookupTreeLock = new Object();
 
 
     /**
@@ -1115,12 +1114,13 @@
     public Partition getPartition( LdapDN dn ) throws NamingException
     {
         Enumeration<String> rdns = dn.getAll();
-        Node currentNode = partitionLookupTree;
         
         // This is synchronized so that we can't read the
         // partitionList when it is modified.
-        synchronized ( partitionLookupTreeLock )
+        synchronized ( partitionLookupTree )
         {
+            Node currentNode = partitionLookupTree;
+
             // Iterate through all the RDN until we find the associated partition
             while ( rdns.hasMoreElements() )
             {
@@ -1137,6 +1137,7 @@
                 }
 
                 BranchNode currentBranch = ( BranchNode ) currentNode;
+                
                 if ( currentBranch.contains( rdn ) )
                 {
                     currentNode = currentBranch.getChild( rdn );



Mime
View raw message