private ItemData updatePathIfNeeded ( ItemData data ) throws IllegalPathException { if ( data == null || changesLog . getAllPathsChanged ( ) == null ) return data ; List < ItemState > states = changesLog . getAllPathsChanged ( ) ; for ( int i = 0 , length = states . size ( ) ; i < length ; i ++ ) { ItemState state = states . get ( i ) ; if ( data . getQPath ( ) . isDescendantOf ( state . getOldPath ( ) ) ) { data = updatePath ( state . getOldPath ( ) , state . getData ( ) . getQPath ( ) , data ) ; } } return data ; }
Updates the path if needed and gives the updated item data if an update was needed or the provided item data otherwise