river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [River Wiki] Update of "Serialization" by PeterFirmstone
Date Fri, 07 Oct 2011 01:14:31 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "River Wiki" for change notification.

The "Serialization" page has been changed by PeterFirmstone:
http://wiki.apache.org/river/Serialization?action=diff&rev1=9&rev2=10

  {{{
  class SerializationBuilderImp extends Builder implements Serializable {
  
+     // use a data object to hold the serial state to keep it simple, otherwise
+     // create a separate serializable private static class to hold it.
      private Map mutableMap = new HashMap();
+     // the built target object to work around readResolve issue.
      private transient Map serialBuilt = null;
      
      public Object put(Object key, Object value){
@@ -155, +158 @@

      
      private void writeObject(ObjectOutputStream out) throws IOException {
          out.defaultWriteObject();
+     }
+ 
+     private Object writeReplace() {
+         if ( serialBuilt != null ) return serialBuilt;
+         return this;
      }
  
      private Object readResolve(){

Mime
View raw message