question: private static Permission [ ] flatten ( Permission [ ] pa ) { List l = new ArrayList ( pa . length ) ; for ( int i = 0 ; i < pa . length ; i ++ ) { Permission p = pa [ i ] ; if ( p instanceof GrantPermission ) { l . addAll ( Arrays . asList ( ( ( GrantPermission ) p ) . grants ) ) ; } else { l . add ( p ) ; } } return ( Permission [ ] ) l . toArray ( new Permission [ l . size ( ) ] ) ; }
target:  Returns an array containing all non-GrantPermission permissions in the given permission array, including those contained in nested GrantPermissions in the array.