public List < ComponentDto > selectAncestors ( DbSession dbSession , ComponentDto component ) { if ( component . isRoot ( ) ) { return Collections . emptyList ( ) ; } List < String > ancestorUuids = component . getUuidPathAsList ( ) ; List < ComponentDto > ancestors = selectByUuids ( dbSession , ancestorUuids ) ; return Ordering . explicit ( ancestorUuids ) . onResultOf ( ComponentDto :: uuid ) . immutableSortedCopy ( ancestors ) ; }
List of ancestors ordered from root to parent . The list is empty if the component is a tree root . Disabled components are excluded by design as tree represents the more recent analysis .