svn commit: r750560 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r750560 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java

jonesde
Author: jonesde
Date: Thu Mar  5 19:33:46 2009
New Revision: 750560

URL: http://svn.apache.org/viewvc?rev=750560&view=rev
Log:
Fixed issue (I think what Jacques was referring to) where makeMapSerializable was removing everything that wasn't a ServletContext because of bad logic; note that this causes the session attribute to not be seializable, resulting in shutdown and startup error messages, still working on that

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java?rev=750560&r1=750559&r2=750560&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilMisc.java Thu Mar  5 19:33:46 2009
@@ -212,17 +212,22 @@
             Object entryValue = mapEntry.getValue();
             if (entryValue != null && !(entryValue instanceof Serializable)) {
                 keysToRemove.add(mapEntry.getKey());
-                //Debug.logInfo("Found Map value that is not Serializable: " + mapEntry.getKey() + "=" + mapEntry.getValue(), module);
+                Debug.logInfo("Found Map value that is not Serializable: " + mapEntry.getKey() + "=" + mapEntry.getValue(), module);
             }
             // this is very admittedly a hack, but this object seems to implement Serializable and may not really be, without this keep getting the error: "java.io.NotSerializableException: org.apache.catalina.core.ApplicationContextFacade"
-            if (entryValue != null && !(entryValue instanceof ServletContext)) {
+            if (entryValue instanceof ServletContext) {
                 keysToRemove.add(mapEntry.getKey());
+                Debug.logInfo("Found Map value that is a ServletContext: " + mapEntry.getKey() + "=" + mapEntry.getValue(), module);
             }            
         }
         for (K keyToRemove: keysToRemove) { map.remove(keyToRemove); }
         //if (!(map instanceof Serializable)) {
         //    Debug.logInfo("Parameter Map is not Serializable!", module);
         //}
+        
+        //for (Map.Entry<K, V> mapEntry: map.entrySet()) {
+        //    Debug.logInfo("Entry in Map made serializable: " + mapEntry.getKey() + "=" + mapEntry.getValue(), module);
+        //}
     }
 
     /**