directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r628407 - in /directory/apacheds/branches/bigbang: core-entry/src/main/java/org/apache/directory/server/core/entry/ObjectClassAttribute.java core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java
Date Sun, 17 Feb 2008 01:58:01 GMT
Author: elecharny
Date: Sat Feb 16 17:58:00 2008
New Revision: 628407

URL: http://svn.apache.org/viewvc?rev=628407&view=rev
Log:
Another improvement : the mayList and mustList are created only once, instead of being created
each time.
Fixed some typo in JavaDoc

Modified:
    directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ObjectClassAttribute.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java

Modified: directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ObjectClassAttribute.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ObjectClassAttribute.java?rev=628407&r1=628406&r2=628407&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ObjectClassAttribute.java
(original)
+++ directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ObjectClassAttribute.java
Sat Feb 16 17:58:00 2008
@@ -146,7 +146,7 @@
                     
                         try
                         {
-                            // Fond the objectClass and update the internal structures
+                            // Found the objectClass and update the internal structures
                             ObjectClass objectClass =  registries.getObjectClassRegistry().lookup(
objectClassName );
 
                             addObjectClass( objectClass );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java?rev=628407&r1=628406&r2=628407&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java
Sat Feb 16 17:58:00 2008
@@ -47,11 +47,16 @@
 
     private ObjectClassTypeEnum objectClassType;
     private ObjectClass[] superClasses;
+
+    private String[] mayListOids;
     private AttributeType[] mayList = EMPTY_AT_ARRAY;
+    private boolean mayListReloaded;
+    
+    private String[] mustListOids;
     private AttributeType[] mustList = EMPTY_AT_ARRAY;
+    private boolean mustListReloaded;
+
     private String[] superClassOids;
-    private String[] mayListOids;
-    private String[] mustListOids;
     
     
     protected ObjectClassImpl( String oid, Registries registries )
@@ -91,59 +96,73 @@
         {
             return EMPTY_AT_ARRAY;
         }
-        
-        for ( int ii = 0; ii < mayListOids.length; ii++ )
+
+        if ( mayListReloaded )
         {
-            mayList[ii] = registries.getAttributeTypeRegistry().lookup( mayListOids[ii] );
+            for ( int ii = 0; ii < mayListOids.length; ii++ )
+            {
+                mayList[ii] = registries.getAttributeTypeRegistry().lookup( mayListOids[ii]
);
+            }
+            
+            mayListReloaded = false;
         }
-        
+
         return mayList;
     }
     
     
-    public void setMayListOids( String[] mayListOids )
+    public void setMayListOids( String[] mayListOids ) throws NamingException
     {
         if ( mayListOids == null )
         {
             this.mayListOids = EMPTY_STR_ARRAY;
-            this.mayList = EMPTY_AT_ARRAY;
+            mayList = EMPTY_AT_ARRAY;
         }
         else
         {
             this.mayListOids = mayListOids;
-            this.mayList = new AttributeType[mayListOids.length];
+            mayList = new AttributeType[mayListOids.length];
         }
+
+        mayListReloaded = true;
     }
 
 
     public AttributeType[] getMustList() throws NamingException
     {
-        if ( this.mustListOids == null )
+        if ( mustListOids == null )
         {
             return EMPTY_AT_ARRAY;
         }
         
-        for ( int ii = 0; ii < mustListOids.length; ii++ )
+        if ( mustListReloaded )
         {
-            mustList[ii] = registries.getAttributeTypeRegistry().lookup( mustListOids[ii]
);
+            for ( int ii = 0; ii < mustListOids.length; ii++ )
+            {
+                mustList[ii] = registries.getAttributeTypeRegistry().lookup( mustListOids[ii]
);
+            }
+            
+            mustListReloaded = false;
         }
         
         return mustList;
     }
     
     
-    public void setMustListOids( String[] mustListOids )
+    public void setMustListOids( String[] mustListOids ) throws NamingException
     {
         if ( mustListOids == null )
         {
             this.mustListOids = EMPTY_STR_ARRAY;
-            this.mustList = EMPTY_AT_ARRAY;
+            mustList = EMPTY_AT_ARRAY;
         }
         else
         {
             this.mustListOids = mustListOids;
-            this.mustList = new AttributeType[mustListOids.length];
+            mustList = new AttributeType[mustListOids.length];
         }
+        
+        mustListReloaded = true;
     }
 
 



Mime
View raw message