Author: toad
Date: 2009-04-03 16:48:41 +0000 (Fri, 03 Apr 2009)
New Revision: 26457

Modified:
   trunk/freenet/src/freenet/client/async/SimpleManifestPutter.java
Log:
Activate to full depth to avoid activating to depth 1 on sub-maps


Modified: trunk/freenet/src/freenet/client/async/SimpleManifestPutter.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SimpleManifestPutter.java    
2009-04-03 16:46:11 UTC (rev 26456)
+++ trunk/freenet/src/freenet/client/async/SimpleManifestPutter.java    
2009-04-03 16:48:41 UTC (rev 26457)
@@ -725,11 +725,11 @@
         * @param context
         */
        private void innerGotAllMetadata(ObjectContainer container, 
ClientContext context) {
-               if(persistent()) {
-                       container.activate(putHandlersByName, 2); // depth 2 to 
load elements
-               }
                if(logMINOR) Logger.minor(this, "Got all metadata");
                HashMap<String, Object> namesToByteArrays = new HashMap<String, 
Object>();
+               // We'll end up committing it all anyway, and hash maps in hash 
maps can cause
+               // *severe* problems (see COR-1582), so activate to max depth 
first.
+               if(persistent()) container.activate(putHandlersByName, 
Integer.MAX_VALUE);
                namesToByteArrays(putHandlersByName, namesToByteArrays, 
container);
                if(defaultName != null) {
                        Metadata meta = (Metadata) 
namesToByteArrays.get(defaultName);
@@ -1040,8 +1040,7 @@
                                }
                        } else if(o instanceof HashMap) {
                                HashMap<String,Object> subMap = new 
HashMap<String,Object>();
-                               if(persistent())
-                                       container.activate(o, 2); // Depth 1 
doesn't load the elements...
+                               // Already activated
                                namesToByteArrays.put(name, subMap);
                                if(logMINOR)
                                        Logger.minor(this, "Putting hashmap 
into base metadata: "+name+" size "+((HashMap)o).size()+" active = "+container 
== null ? "null" : Boolean.toString(container.ext().isActive(o)));

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to