jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r702426 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
Date Tue, 07 Oct 2008 10:21:56 GMT
Author: jukka
Date: Tue Oct  7 03:21:53 2008
New Revision: 702426

URL: http://svn.apache.org/viewvc?rev=702426&view=rev
Log:
JCR-1775: Transaction-safe versioning

Inlined BatchedItemOperations.getOrCreateVersionHistory as it was already reduced to a single
statement.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java?rev=702426&r1=702425&r2=702426&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
Tue Oct  7 03:21:53 2008
@@ -1913,17 +1913,21 @@
                      * copied properties declared by mix:versionable need to be
                      * adjusted accordingly.
                      */
+                    VersionManager manager = session.getVersionManager();
                     if (propName.equals(NameConstants.JCR_VERSIONHISTORY)) {
                         // jcr:versionHistory
-                        VersionHistory vh = getOrCreateVersionHistory(newState);
+                        VersionHistory vh =
+                            manager.getVersionHistory(session, newState);
                         newChildState.setValues(new InternalValue[]{InternalValue.create(new
UUID(vh.getUUID()))});
                     } else if (propName.equals(NameConstants.JCR_BASEVERSION)) {
                         // jcr:baseVersion
-                        VersionHistory vh = getOrCreateVersionHistory(newState);
+                        VersionHistory vh =
+                            manager.getVersionHistory(session, newState);
                         newChildState.setValues(new InternalValue[]{InternalValue.create(new
UUID(vh.getRootVersion().getUUID()))});
                     } else if (propName.equals(NameConstants.JCR_PREDECESSORS)) {
                         // jcr:predecessors
-                        VersionHistory vh = getOrCreateVersionHistory(newState);
+                        VersionHistory vh =
+                            manager.getVersionHistory(session, newState);
                         newChildState.setValues(new InternalValue[]{InternalValue.create(new
UUID(vh.getRootVersion().getUUID()))});
                     } else if (propName.equals(NameConstants.JCR_ISCHECKEDOUT)) {
                         // jcr:isCheckedOut
@@ -1994,19 +1998,6 @@
     }
 
     /**
-     * Returns the version history of the given node state. A new
-     * version history will be created if doesn't exist yet.
-     *
-     * @param node node state
-     * @return the version history of the target node state
-     * @throws RepositoryException if an error occurs
-     */
-    private VersionHistory getOrCreateVersionHistory(NodeState node)
-            throws RepositoryException {
-        return session.getVersionManager().getVersionHistory(session, node);
-    }
-
-    /**
      * Check that the updatable item state manager is in edit mode.
      *
      * @throws IllegalStateException if it isn't



Mime
View raw message