jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r329224 [2/2] - in /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: state/db/ state/mem/ state/obj/ state/util/ state/xml/ value/
Date Fri, 28 Oct 2005 15:29:20 GMT
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java?rev=329224&r1=329223&r2=329224&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java
Fri Oct 28 08:29:07 2005
@@ -84,6 +84,7 @@
     private static final String NODETYPE_ATTRIBUTE = "nodeType";
     private static final String PARENTUUID_ATTRIBUTE = "parentUUID";
     private static final String DEFINITIONID_ATTRIBUTE = "definitionId";
+    private static final String MODCOUNT_ATTRIBUTE = "modCount";
 
     private static final String MIXINTYPES_ELEMENT = "mixinTypes";
     private static final String MIXINTYPE_ELEMENT = "mixinType";
@@ -209,6 +210,11 @@
         String definitionId = walker.getAttribute(DEFINITIONID_ATTRIBUTE);
         state.setDefinitionId(NodeDefId.valueOf(definitionId));
 
+        // modification count
+        String modCount = walker.getAttribute(MODCOUNT_ATTRIBUTE);
+        // @todo set modCount
+        //state.setModCount(Integer.parseInt(modCount));
+
         // mixin types
         if (walker.enterElement(MIXINTYPES_ELEMENT)) {
             Set mixins = new HashSet();
@@ -285,6 +291,11 @@
         String definitionId = walker.getAttribute(DEFINITIONID_ATTRIBUTE);
         state.setDefinitionId(PropDefId.valueOf(definitionId));
 
+        // modification count
+        String modCount = walker.getAttribute(MODCOUNT_ATTRIBUTE);
+        // @todo set modCount
+        //state.setModCount(Integer.parseInt(modCount));
+
         // values
         ArrayList values = new ArrayList();
         if (walker.enterElement(VALUES_ELEMENT)) {
@@ -505,6 +516,8 @@
                         + UUID_ATTRIBUTE + "=\"" + state.getUUID() + "\" "
                         + PARENTUUID_ATTRIBUTE + "=\"" + (state.getParentUUID() == null ?
"" : state.getParentUUID()) + "\" "
                         + DEFINITIONID_ATTRIBUTE + "=\"" + state.getDefinitionId().toString()
+ "\" "
+                        // @todo store real modCount
+                        + MODCOUNT_ATTRIBUTE + "=\"" + /*state.getModCount()*/ 0 + "\" "
                         + NODETYPE_ATTRIBUTE + "=\"" + Text.encodeIllegalXMLCharacters(state.getNodeTypeName().toString())
+ "\">\n");
 
                 // mixin types
@@ -592,6 +605,8 @@
                         + PARENTUUID_ATTRIBUTE + "=\"" + state.getParentUUID() + "\" "
                         + MULTIVALUED_ATTRIBUTE + "=\"" + Boolean.toString(state.isMultiValued())
+ "\" "
                         + DEFINITIONID_ATTRIBUTE + "=\"" + state.getDefinitionId().toString()
+ "\" "
+                        // @todo store real modCount
+                        + MODCOUNT_ATTRIBUTE + "=\"" + /*state.getModCount()*/ 0 + "\" "
                         + TYPE_ATTRIBUTE + "=\"" + typeName + "\">\n");
                 // values
                 writer.write("\t<" + VALUES_ELEMENT + ">\n");

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/value/BLOBFileValue.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/value/BLOBFileValue.java?rev=329224&r1=329223&r2=329224&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/value/BLOBFileValue.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/value/BLOBFileValue.java
Fri Oct 28 08:29:07 2005
@@ -126,6 +126,7 @@
                     // threshold for keeping data in memory exceeded;
                     // create temp file and spool buffer contents
                     spoolFile = File.createTempFile("bin", null);
+                    // @todo FIXME see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4513817http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4513817
                     spoolFile.deleteOnExit();
                     out = new FileOutputStream(spoolFile);
                     out.write(buffer, 0, len);
@@ -217,33 +218,6 @@
     }
 
     /**
-     * {@inheritDoc}
-     */
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj instanceof BLOBFileValue) {
-            BLOBFileValue other = (BLOBFileValue) obj;
-            return ((file == null ? other.file == null : file.equals(other.file))
-                    && (fsResource == null ? other.fsResource == null : fsResource.equals(other.fsResource))
-                    && Arrays.equals(buffer, other.buffer));
-        }
-        return false;
-    }
-
-    /**
-     * Returns zero to satisfy the Object equals/hashCode contract.
-     * This class is mutable and not meant to be used as a hash key.
-     *
-     * @return always zero
-     * @see Object#hashCode()
-     */
-    public int hashCode() {
-        return 0;
-    }
-
-    /**
      * Returns the length of this <code>BLOBFileValue</code>.
      *
      * @return The length, in bytes, of this <code>BLOBFileValue</code>,
@@ -401,6 +375,33 @@
             // this instance is backed by a in-memory buffer
             return buffer.toString();
         }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof BLOBFileValue) {
+            BLOBFileValue other = (BLOBFileValue) obj;
+            return ((file == null ? other.file == null : file.equals(other.file))
+                    && (fsResource == null ? other.fsResource == null : fsResource.equals(other.fsResource))
+                    && Arrays.equals(buffer, other.buffer));
+        }
+        return false;
+    }
+
+    /**
+     * Returns zero to satisfy the Object equals/hashCode contract.
+     * This class is mutable and not meant to be used as a hash key.
+     *
+     * @return always zero
+     * @see Object#hashCode()
+     */
+    public int hashCode() {
+        return 0;
     }
 
     //----------------------------------------------------------------< Value >



Mime
View raw message