{
if (mergeFailed != null)
{
for (ValueData mfvd : mergeFailed.getValues())
{
mergeFailedRefs.add(new TransientValueData(mfvd.getAsByteArray()));
}
mergeFailed =
new TransientPropertyData(mergeFailed.getQPath(), mergeFailed.getIdentifier(),
mergeFailed.getPersistedVersion(), mergeFailed.getType(), mergeFailed.getParentIdentifier(),
mergeFailed.isMultiValued(), mergeFailedRefs);
state = ItemState.UPDATED;
}
else
{
mergeFailed =
TransientPropertyData.createPropertyData((NodeData)getData(), Constants.JCR_MERGEFAILED,
PropertyType.REFERENCE, true, mergeFailedRefs);
state = ItemState.ADDED;
}
nextFail : for (String identifier : failed.keySet())
{
NodeImpl versionable = (NodeImpl)session.getNodeByUUID(identifier);
res.add(versionable);
String offendingIdentifier = failed.get(identifier);
for (ValueData vd : mergeFailedRefs)
{
String mfIdentifier = new String(vd.getAsByteArray());
if (mfIdentifier.equals(offendingIdentifier))
{
// offending version is alredy in jcr:mergeFailed, skip it
continue nextFail;
}
}
mergeFailedRefs.add(new TransientValueData(offendingIdentifier));
}
changes.add(new ItemState(mergeFailed, state, true, getInternalPath(), true));
return res;