String [ ] concatenateExtends ( String [ ] selectors , boolean isReference ) { selectorList . clear ( ) ; for ( String selector : selectors ) { concatenateExtendsRecursive ( selector , isReference , selector ) ; } if ( isReference ) { return selectorList . toArray ( new String [ selectorList . size ( ) ] ) ; } if ( selectorList . size ( ) > 0 ) { for ( String selector : selectors ) { selectorList . remove ( selector ) ; // remove duplicates } if ( selectorList . size ( ) > 0 ) { int off = selectors . length ; selectors = Arrays . copyOf ( selectors , off + selectorList . size ( ) ) ; for ( String str : selectorList ) { selectors [ off ++ ] = str ; } } } return selectors ; }
Add to the given selectors all possible extends and return the resulting selectors .