protected boolean isPredecessor ( NodeData mergeVersion , NodeData corrVersion ) throws RepositoryException { SessionDataManager mergeDataManager = mergeSession . getTransientNodesManager ( ) ; PropertyData predecessorsProperty = ( PropertyData ) mergeDataManager . getItemData ( mergeVersion , new QPathEntry ( Constants . JCR_PREDECESSORS , 0 ) , ItemType . PROPERTY ) ; if ( predecessorsProperty != null ) { for ( ValueData pv : predecessorsProperty . getValues ( ) ) { String pidentifier = ValueDataUtil . getString ( pv ) ; if ( pidentifier . equals ( corrVersion . getIdentifier ( ) ) ) { return true ; // got it } // search in predecessors of the predecessor NodeData predecessor = ( NodeData ) mergeDataManager . getItemData ( pidentifier ) ; if ( predecessor != null ) { if ( isPredecessor ( predecessor , corrVersion ) ) { return true ; } } else { throw new RepositoryException ( "Merge. Predecessor is not found by uuid " + pidentifier + ". Version " + mergeSession . getLocationFactory ( ) . createJCRPath ( mergeVersion . getQPath ( ) ) . getAsString ( false ) ) ; } } // else it's a root version } return false ; }
Is a predecessor of the merge version