jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1309922 - in /jackrabbit/branches/2.2: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
Date Thu, 05 Apr 2012 16:20:39 GMT
Author: reschke
Date: Thu Apr  5 16:20:39 2012
New Revision: 1309922

URL: http://svn.apache.org/viewvc?rev=1309922&view=rev
Log:
JCR-3286: enhance error handling for empty predecessors property value (backported to 2.2)

Modified:
    jackrabbit/branches/2.2/   (props changed)
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java

Propchange: jackrabbit/branches/2.2/
------------------------------------------------------------------------------
  Merged /jackrabbit/trunk:r1309908

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java?rev=1309922&r1=1309921&r2=1309922&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
Thu Apr  5 16:20:39 2012
@@ -703,8 +703,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