jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1309908 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
Date Thu, 05 Apr 2012 15:50:40 GMT
Author: reschke
Date: Thu Apr  5 15:50:39 2012
New Revision: 1309908

URL: http://svn.apache.org/viewvc?rev=1309908&view=rev
Log:
JCR-3286: enhance error handling for empty predecessors property value

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=1309908&r1=1309907&r2=1309908&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 Apr  5 15:50:39 2012
@@ -708,8 +708,13 @@ abstract class InternalVersionManagerBas
             // 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();
+            if (values == null || values.length == 0) {
+                String message;
+                if (values == null) {
+                    message = "Mandatory jcr:predecessors property missing on node " + node.getNodeId();
+                } else {
+                    message = "Mandatory jcr:predecessors property is empty on node " + node.getNodeId();
+                }
                 log.error(message);
                 throw new VersionException(message);
             }



Mime
View raw message