jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1177249 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
Date Thu, 29 Sep 2011 10:14:00 GMT
Author: reschke
Date: Thu Sep 29 10:14:00 2011
New Revision: 1177249

URL: http://svn.apache.org/viewvc?rev=1177249&view=rev
Log:
JCR-3085: better diagnostics when version storage is broken (produce a RepositoryException
instead of a NPE, including the nodeId)

Modified:
    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/version/InternalVersionManagerBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java?rev=1177249&r1=1177248&r2=1177249&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
Thu Sep 29 10:14:00 2011
@@ -681,6 +681,13 @@ abstract class InternalVersionManagerBas
         } else {
             // 1. search a predecessor, suitable for generating the new name
             InternalValue[] values = node.getPropertyValues(NameConstants.JCR_PREDECESSORS);
+
+            if (values == null) {
+                String message = "Mandatory jcr:predecessors property missing on node " +
node.getNodeId();
+                log.error(message);
+                throw new VersionException(message);
+            }
+
             for (InternalValue value: values) {
                 InternalVersion pred = history.getVersion(value.getNodeId());
                 if (best == null



Mime
View raw message