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;
}

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 ; }
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
