jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: rev 47283 - in incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: . nodetype
Date Mon, 27 Sep 2004 09:30:57 GMT
Author: tripod
Date: Mon Sep 27 02:30:56 2004
New Revision: 47283

Modified:
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml
Log:
jcr:mergeFailed propertydef missing in mix:versionable

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java	(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java	Mon Sep 27
02:30:56 2004
@@ -2397,17 +2397,11 @@
 	    // thus determining the result of a merge is non-trivial.
 	    if (bestEffort) {
 		// add 'offending' version to jcr:mergeFailed property
-		if (hasProperty(ItemImpl.PROPNAME_MERGE_FAILED)) {
-		    Value[] values = getProperty(ItemImpl.PROPNAME_MERGE_FAILED).getValues();
-		    Value[] newValues = new Value[values.length + 1];
-		    System.arraycopy(values, 0, newValues, 0, values.length);
-		    newValues[values.length] = new ReferenceValue(vp);
-		    setProperty(ItemImpl.PROPNAME_MERGE_FAILED, newValues);
-		} else {
-		    Value[] newValues = new Value[1];
-		    newValues[0] = new ReferenceValue(vp);
-		    setProperty(ItemImpl.PROPNAME_MERGE_FAILED, newValues);
-		}
+		List values = hasProperty(ItemImpl.PROPNAME_MERGE_FAILED)
+			? Arrays.asList(getProperty(ItemImpl.PROPNAME_MERGE_FAILED).getValues())
+			: new ArrayList();
+		values.add(new ReferenceValue(vp));
+		setProperty(ItemImpl.PROPNAME_MERGE_FAILED, (Value[]) values.toArray(new Value[values.size()]));
 		return null;
 	    } else {
 		String msg = "Unable to merge nodes. Violating versions. " + safeGetJCRPath();

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml
Mon Sep 27 02:30:56 2004
@@ -274,5 +274,10 @@
 		<valueConstraint>nt:version</valueConstraint>
 	    </valueConstraints>
 	</propertyDef>
+	<propertyDef name="jcr:mergeFailed" type="Reference" autoCreate="false" mandatory="false"
onParentVersion="IGNORE" protected="false" primaryItem="false" multiple="true">
+	    <valueConstraints>
+		<valueConstraint>nt:version</valueConstraint>
+	    </valueConstraints>
+	</propertyDef>
     </nodeType>
 </nodeTypes>

Mime
View raw message