question: private static String [ ] splitComponents ( String str ) { List < String > l = new ArrayList < > ( ) ; int last = 0 ; int depth = 0 ; char [ ] chars = str . toCharArray ( ) ; for ( int i = 0 ; i < chars . length ; i ++ ) { switch ( chars [ i ] ) { case '(' : depth ++ ; break ; case ')' : depth -- ; break ; case ',' : if ( depth == 0 ) { String s = str . substring ( last , i ) ; l . add ( s ) ; last = i + 1 ; } break ; default : } } String s = str . substring ( last ) ; if ( s . length ( ) != 0 ) { l . add ( s ) ; } String [ ] rc = new String [ l . size ( ) ] ; l . toArray ( rc ) ; return rc ; }
target:  Given the inner portion of a composite URI, split and return each inner URI as a string element in a new String array.