jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1183409 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: VersionManagerImpl.java version/InternalVersionManagerBase.java
Date Fri, 14 Oct 2011 16:19:39 GMT
Author: reschke
Date: Fri Oct 14 16:19:39 2011
New Revision: 1183409

URL: http://svn.apache.org/viewvc?rev=1183409&view=rev
Log:
JCR-3111: enhance error reporting in various cases of inconsistent versioning storage

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/VersionManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/VersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/VersionManagerImpl.java?rev=1183409&r1=1183408&r2=1183409&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/VersionManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/VersionManagerImpl.java
Fri Oct 14 16:19:39 2011
@@ -48,6 +48,7 @@ import org.apache.jackrabbit.core.sessio
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.UpdatableItemStateManager;
+import org.apache.jackrabbit.core.version.InconsistentVersioningState;
 import org.apache.jackrabbit.core.version.InternalActivity;
 import org.apache.jackrabbit.core.version.InternalBaseline;
 import org.apache.jackrabbit.core.version.InternalVersion;
@@ -181,6 +182,9 @@ public class VersionManagerImpl extends 
                     throws RepositoryException {
                 NodeStateEx state = getNodeState(absPath);
                 InternalVersionHistory vh = getVersionHistory(state);
+                if (vh == null) {
+                    throw new InconsistentVersioningState("Couldn't get version history for
node " + state.getNodeId());
+                }
                 return (VersionHistory) session.getNodeById(vh.getId());
             }
             public String toString() {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java?rev=1183409&r1=1183408&r2=1183409&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
Fri Oct 14 16:19:39 2011
@@ -149,6 +149,9 @@ abstract class InternalVersionManagerBas
             NodeStateEx parent = getParentNode(getHistoryRoot(), uuid, null);
             if (parent != null && parent.hasNode(name)) {
                 NodeStateEx history = parent.getNode(name, 1);
+                if (history == null) {
+                    throw new InconsistentVersioningState("Unexpected failure to get child
node " + name + " on parent node" + parent.getNodeId());
+                }
                 return getVersionHistory(history.getNodeId());
             } else {
                 throw new ItemNotFoundException("Version history of node " + id + " not found.");
@@ -315,6 +318,9 @@ abstract class InternalVersionManagerBas
             NodeStateEx parent = getParentNode(getHistoryRoot(), uuid, null);
             if (parent != null && parent.hasNode(name)) {
                 NodeStateEx history = parent.getNode(name, 1);
+                if (history == null) {
+                    throw new InconsistentVersioningState("Unexpected failure to get child
node " + name + " on parent node" + parent.getNodeId());
+                }
                 Name root = NameConstants.JCR_ROOTVERSION;
                 info = new VersionHistoryInfo(
                         history.getNodeId(),



Mime
View raw message