[exo-jcr-commits] exo-jcr SVN: r1185 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Dec 25 09:25:13 EST 2009


Author: areshetnyak
Date: 2009-12-25 09:25:12 -0500 (Fri, 25 Dec 2009)
New Revision: 1185

Modified:
   jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/PersistedNodeData.java
Log:
EXOJCR-327 : The serialization PersistentNodeData was changed ( checking if acl is null).

Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/PersistedNodeData.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/PersistedNodeData.java	2009-12-25 13:45:08 UTC (rev 1184)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/PersistedNodeData.java	2009-12-25 14:25:12 UTC (rev 1185)
@@ -49,6 +49,10 @@
     * serialVersionUID to serialization. 
     */
    private static final long serialVersionUID = 3033563403958948338L;
+   
+   private static final int ACL_IS_NULL = -1;
+   
+   private static final int ACL_IS_NOT_NULL = 1;
 
    //TODO remove final
    protected int orderNumber;
@@ -64,7 +68,6 @@
    public PersistedNodeData()
    {
       super();
-      this.acl = new AccessControlList();
    }
 
    public PersistedNodeData(String id, QPath qpath, String parentId, int version, int orderNumber,
@@ -207,7 +210,11 @@
       }
 
       // acl
-      acl.readExternal(in);
+      if (in.readInt() == ACL_IS_NOT_NULL)
+      {
+         acl = new AccessControlList();
+         acl.readExternal(in);
+      }
       
    }
 
@@ -231,7 +238,15 @@
          out.write(buf);
       }
 
-      acl.writeExternal(out);
+      if (acl == null)
+      {
+         out.writeInt(ACL_IS_NULL);
+      } 
+      else
+      {
+         out.writeInt(ACL_IS_NOT_NULL);
+         acl.writeExternal(out);
+      }
    }
 
 }



More information about the exo-jcr-commits mailing list