jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r649276 - in /jackrabbit/trunk: jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/ jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/
Date Thu, 17 Apr 2008 21:19:28 GMT
Author: reschke
Date: Thu Apr 17 14:19:27 2008
New Revision: 649276

URL: http://svn.apache.org/viewvc?rev=649276&view=rev
Log:
JCR-1513: remove support for SPIs not returning the NodeId upon checkin.

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManager.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java
    jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java?rev=649276&r1=649275&r2=649276&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
Thu Apr 17 14:19:27 2008
@@ -767,14 +767,14 @@
         checkIsVersionable();
         checkHasPendingChanges();
         checkIsLocked();
-        NodeEntry newVersion = null;
         if (isCheckedOut()) {
-            newVersion = session.getVersionManager().checkin(getNodeState());
+            NodeEntry newVersion = session.getVersionManager().checkin(getNodeState());
+            return (Version) itemMgr.getItem(newVersion);
         } else {
             // nothing to do
             log.debug("Node " + safeGetJCRPath() + " is already checked in.");
+            return getBaseVersion();
         }
-        return newVersion == null ? getBaseVersion() : (Version) itemMgr.getItem(newVersion);
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManager.java?rev=649276&r1=649275&r2=649276&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManager.java
Thu Apr 17 14:19:27 2008
@@ -41,7 +41,7 @@
 
     /**
      * @param nodeState
-     * @return <code>NodeEntry</code> of newly created version or <code>null</code>
+     * @return <code>NodeEntry</code> of newly created version
      * @throws VersionException
      * @throws UnsupportedRepositoryOperationException
      * @throws InvalidItemStateException

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java?rev=649276&r1=649275&r2=649276&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java
Thu Apr 17 14:19:27 2008
@@ -61,12 +61,7 @@
     public NodeEntry checkin(NodeState nodeState) throws RepositoryException {
         Checkin ci = Checkin.create(nodeState, this);
         workspaceManager.execute(ci);
-        if (ci.getNewVersionId() == null) {
-            return null;
-        }
-        else {
-            return (NodeEntry) workspaceManager.getHierarchyManager().getHierarchyEntry(ci.getNewVersionId());
-        }
+        return (NodeEntry) workspaceManager.getHierarchyManager().getHierarchyEntry(ci.getNewVersionId());
     }
 
     public void checkout(NodeState nodeState) throws RepositoryException {

Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java?rev=649276&r1=649275&r2=649276&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
Thu Apr 17 14:19:27 2008
@@ -584,8 +584,7 @@
      * @throws javax.jcr.lock.LockException
      * @throws javax.jcr.RepositoryException
      * @see javax.jcr.Node#checkin()
-     * @return <code>NodeId</code> of newly created version, or <code>null</code>
-     * when that information is not available
+     * @return <code>NodeId</code> of newly created version
      */
     public NodeId checkin(SessionInfo sessionInfo, NodeId nodeId) throws VersionException,
UnsupportedRepositoryOperationException, InvalidItemStateException, LockException, RepositoryException;
 



Mime
View raw message