@ VisibleForTesting static List < String > tokenizeArguments ( @ Nullable final String args ) { if ( args == null ) { return Collections . emptyList ( ) ; } final Matcher matcher = ARGUMENTS_TOKENIZE_PATTERN . matcher ( args ) ; final List < String > tokens = new ArrayList <> ( ) ; while ( matcher . find ( ) ) { tokens . add ( matcher . group ( ) . trim ( ) . replace ( "\"" , "" ) . replace ( "\'" , "" ) ) ; } return tokens ; }
Takes program arguments as a single string and splits them into a list of string .