if ( debug ) { settings.put( CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE ); }  if ( source14 ) { settings.put( CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4 ); }  if ( target14 ) { settings.put( CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4 ); }  IProblemFactory problemFactory = new DefaultProblemFactory( Locale.getDefault() );  ICompilerRequestor requestor = new EclipseCompilerICompilerRequestor( config.getOutputLocation(), errors, warnings );  List compilationUnits = new ArrayList();  for ( Iterator it = config.getSourceLocations().iterator(); it.hasNext(); ) { String sourceRoot = (String) it.next();  Set sources = getSourceFilesForSourceRoot( config, sourceRoot );  for ( Iterator it2 = sources.iterator(); it2.hasNext(); ) { String source = (String) it2.next();  CompilationUnit unit = new CompilationUnit( source, makeClassName( source, sourceRoot ), errors );  compilationUnits.add( unit ); } }  Compiler compiler = new Compiler( env, policy, settings, requestor, problemFactory );  ICompilationUnit[] units = (ICompilationUnit[]) compilationUnits.toArray( new ICompilationUnit[ compilationUnits.size() ] );  compiler.compile( units );
    public List compile( CompilerConfiguration config )        throws Exception    {        String[] sourceFiles = getSourceFiles( config );        List errors = new LinkedList();        for ( int i = 0; i < sourceFiles.length; i++ )        {            String sourceFile = sourceFiles[ i ];            compile( sourceFile,                     (String) config.getSourceLocations().get( 0 ),                     config.getOutputLocation(),                     errors );        }        return errors;    }