question: private VirtualFile [ ] expandLocaleToken ( String [ ] pathlist , String [ ] locales , ConfigurationValue cv ) throws ConfigurationException { ArrayList < VirtualFile > list = new ArrayList < VirtualFile > ( pathlist . length ) ; for ( int i = 0 ; i < pathlist . length ; i ++ ) { String pathElement = pathlist [ i ] ; int localeTokenIndex = pathElement . indexOf ( LOCALE_TOKEN ) ; if ( localeTokenIndex != - 1 ) { for ( int j = 0 ; j < locales . length ; j ++ ) { String pathElementWithSubstitution = StringUtils . substitute ( pathElement , LOCALE_TOKEN , locales [ j ] ) ; addPathElementToListAsVirtualFile ( pathElementWithSubstitution , list , cv ) ; } } else { addPathElementToListAsVirtualFile ( pathElement , list , cv ) ; } } VirtualFile [ ] vfa = new VirtualFile [ list . size ( ) ] ; list . toArray ( vfa ) ; return vfa ; }
target:  Expands the {locale} token in a list of path elements for the source-path or library-path, and converts each path element from a String to a VirtualFile. The treatment of a path element containing "{locale}" depends on whether we are processing a source-path or a library-path, and on whether we are compiling for a single locale, multiple locales, or no locale: -source-path=foo,bar/{locale},baz -locale=en_US -> foo,bar/en_US,baz -source-path=foo,bar/{locale},baz -locale=en_US,ja_JP -> foo,bar/en_US,bar/ja_JP,baz -source-path=foo,bar/{locale},baz -locale= -> foo,baz -library-path=foo,bar/{locale},baz -locale=en_US -> foo,bar/en_US,baz -library-path=foo,bar/{locale},baz -locale=en_US,ja_JP -> foo,bar/en_US,bar/ja_JP,baz -library-path=foo,bar/{locale},baz -locale= -> foo,baz