jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r631560 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeTypeCacheImpl.java
Date Wed, 27 Feb 2008 11:40:33 GMT
Author: stefan
Date: Wed Feb 27 03:40:25 2008
New Revision: 631560

URL: http://svn.apache.org/viewvc?rev=631560&view=rev
Log:
JJCR-1423:  [PATCH] fix clone implementation

found more in core

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeTypeCacheImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeTypeCacheImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeTypeCacheImpl.java?rev=631560&r1=631559&r2=631560&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeTypeCacheImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/EffectiveNodeTypeCacheImpl.java
Wed Feb 27 03:40:25 2008
@@ -163,10 +163,15 @@
      * {@inheritDoc}
      */
     public Object clone() {
-        EffectiveNodeTypeCacheImpl clone = new EffectiveNodeTypeCacheImpl();
-        clone.sortedKeys.addAll(sortedKeys);
-        clone.aggregates.putAll(aggregates);
-        return clone;
+        try {
+            EffectiveNodeTypeCacheImpl clone = (EffectiveNodeTypeCacheImpl) super.clone();
+            clone.sortedKeys.addAll(sortedKeys);
+            clone.aggregates.putAll(aggregates);
+            return clone;
+        } catch (CloneNotSupportedException e) {
+            // won't happen
+            throw new InternalError("Failed to clone EffectiveNodeTypeCacheImpl object");
+        }
     }
 
     //-------------------------------------------------------------< Dumpable >



Mime
View raw message