jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r376756 - in /incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype: EffectiveNodeTypeCache.java NodeTypeRegistry.java
Date Fri, 10 Feb 2006 16:25:44 GMT
Author: stefan
Date: Fri Feb 10 08:25:42 2006
New Revision: 376756

URL: http://svn.apache.org/viewcvs?rev=376756&view=rev
Log:
NodeTypeRegistry: more cleaning up of implementation

Modified:
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeTypeCache.java
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeTypeCache.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeTypeCache.java?rev=376756&r1=376755&r2=376756&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeTypeCache.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeTypeCache.java
Fri Feb 10 08:25:42 2006
@@ -30,7 +30,7 @@
 /**
  * <code>EffectiveNodeTypeCache</code> ...
  */
-class EffectiveNodeTypeCache implements Dumpable {
+class EffectiveNodeTypeCache implements Cloneable, Dumpable {
     /** ordered set of keys */
     final TreeSet sortedKeys;
     /** cache of pre-built aggregations of node types */
@@ -41,11 +41,6 @@
         aggregates = new HashMap();
     }
 
-    EffectiveNodeTypeCache(EffectiveNodeTypeCache entCache) {
-        sortedKeys = new TreeSet(entCache.sortedKeys);
-        aggregates = new HashMap(entCache.aggregates);
-    }
-
     void put(EffectiveNodeType ent) {
         // we define the weight as the total number of included node types
         // (through aggregation and inheritance)
@@ -118,6 +113,14 @@
      */
     Set keySet() {
         return Collections.unmodifiableSet(sortedKeys);
+    }
+
+    //-------------------------------------------< java.lang.Object overrides >
+    public Object clone() {
+        EffectiveNodeTypeCache clone = new EffectiveNodeTypeCache();
+        clone.sortedKeys.addAll(sortedKeys);
+        clone.aggregates.putAll(aggregates);
+        return clone;
     }
 
     //-------------------------------------------------------------< Dumpable >

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java?rev=376756&r1=376755&r2=376756&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
Fri Feb 10 08:25:42 2006
@@ -265,7 +265,7 @@
         // @todo review
 
         // cache of pre-built aggregations of node types
-        EffectiveNodeTypeCache anEntCache = new EffectiveNodeTypeCache(entCache);
+        EffectiveNodeTypeCache anEntCache = (EffectiveNodeTypeCache) entCache.clone();
 
         // map of node type names and node type definitions
         Map aRegisteredNTDefCache = new HashMap(registeredNTDefs);
@@ -292,6 +292,8 @@
             // store new effective node type instance
             anEntCache.put(ent);
         }
+
+        // todo add newly created ENTs to entCache
 
         // since no exception was thrown so far the definitions are assumed to be valid
         for (Iterator iter = ntDefs.iterator(); iter.hasNext();) {



Mime
View raw message