jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r124540 - /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/PersistentNode.java
Date Fri, 07 Jan 2005 17:10:16 GMT
Author: tripod
Date: Fri Jan  7 09:10:15 2005
New Revision: 124540

URL: http://svn.apache.org/viewcvs?view=rev&rev=124540
Log:
- fixing some versioning persistence problems
Modified:
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/PersistentNode.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java
Url: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java?view=diff&rev=124540&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java&r1=124539&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java&r2=124540
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalFrozenNodeImpl.java
Fri Jan  7 09:10:15 2005
@@ -18,11 +18,11 @@
 
 import org.apache.jackrabbit.core.version.*;
 import org.apache.jackrabbit.core.*;
-import org.apache.jackrabbit.core.util.uuid.UUID;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
 import org.apache.jackrabbit.core.nodetype.NodeTypeImpl;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.PropertyState;
+import org.apache.jackrabbit.core.state.ItemStateException;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.PropertyType;
@@ -85,7 +85,12 @@
         this.id = id;
 
         // init the frozen properties
-        PropertyState[] props = node.getProperties();
+        PropertyState[] props = new org.apache.jackrabbit.core.state.PropertyState[0];
+        try {
+            props = node.getProperties();
+        } catch (ItemStateException e) {
+            throw new RepositoryException(e);
+        }
         List propList = new ArrayList();
 
         for (int i = 0; i < props.length; i++) {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/PersistentNode.java
Url: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/PersistentNode.java?view=diff&rev=124540&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/PersistentNode.java&r1=124539&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/PersistentNode.java&r2=124540
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/PersistentNode.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/PersistentNode.java
Fri Jan  7 09:10:15 2005
@@ -113,19 +113,15 @@
      *
      * @return
      */
-    protected PropertyState[] getProperties() {
-        try {
-            List list = nodeState.getPropertyEntries();
-            PropertyState[] props = new PropertyState[list.size()];
-            for (int i = 0; i < list.size(); i++) {
-                NodeState.PropertyEntry entry = (NodeState.PropertyEntry) list.get(i);
-                PropertyId propId = new PropertyId(nodeState.getUUID(), entry.getName());
-                props[i] = (PropertyState) stateMgr.getItemState(propId);
-            }
-            return props;
-        } catch (ItemStateException e) {
-            return null;
+    protected PropertyState[] getProperties() throws ItemStateException {
+        List list = nodeState.getPropertyEntries();
+        PropertyState[] props = new PropertyState[list.size()];
+        for (int i = 0; i < list.size(); i++) {
+            NodeState.PropertyEntry entry = (NodeState.PropertyEntry) list.get(i);
+            PropertyId propId = new PropertyId(nodeState.getUUID(), entry.getName());
+            props[i] = (PropertyState) stateMgr.getItemState(propId);
         }
+        return props;
     }
 
     /**
@@ -227,7 +223,9 @@
             try {
                 PersistentPropertyState propState = (PersistentPropertyState) stateMgr.getItemState(propId);
                 // someone calling this method will always alter the property state, so set
status to modified
-                propState.setStatus(ItemState.STATUS_EXISTING_MODIFIED);
+                if (propState.getStatus()==ItemState.STATUS_EXISTING) {
+                    propState.setStatus(ItemState.STATUS_EXISTING_MODIFIED);
+                }
                 // although this is not quite correct, we mark node as modified aswell
                 if (nodeState.getStatus()==ItemState.STATUS_EXISTING) {
                     nodeState.setStatus(ItemState.STATUS_EXISTING_MODIFIED);

Mime
View raw message