errors.add( handleError( name, problem.getSourceLineNumber(), -1, problem.getMessage() ) );
if ( problem.isWarning() ) { warnings.add( handleWarning( problem ) ); } else { errors.add( handleError( name, problem.getSourceLineNumber(), -1, problem.getMessage() ) ); }
        public void acceptResult( CompilationResult result )        {            if ( result.hasProblems() )            {                IProblem[] problems = result.getProblems();                for ( int i = 0; i < problems.length; i++ )                {                    IProblem problem = problems[ i ];                    String name = new String( problems[ i ].getOriginatingFileName() );                    errors.add( handleError( name, problem.getSourceLineNumber(), -1, problem.getMessage() ) );                }            }            else            {                ClassFile[] classFiles = result.getClassFiles();                for ( int i = 0; i < classFiles.length; i++ )                {                    ClassFile classFile = classFiles[ i ];                    char[][] compoundName = classFile.getCompoundName();                    String className = "";                    String sep = "";                    for ( int j = 0; j < compoundName.length; j++ )                    {                        className += sep;                        className += new String( compoundName[ j ] );                        sep = ".";                    }                    byte[] bytes = classFile.getBytes();                    File outFile = new File( destinationDirectory, className.replace( '.', '/' ) + ".class" );                    if ( !outFile.getParentFile().exists() )                    {                        outFile.getParentFile().mkdirs();                    }                    FileOutputStream fout = null;                    try                    {                        fout = new FileOutputStream( outFile );                        BufferedOutputStream bos = new BufferedOutputStream( fout );                        bos.write( bytes );                    }                    catch ( FileNotFoundException e )                    {                        errors.add( handleError( className, -1, -1, e.getMessage() ) );                    }                    catch ( IOException e )                    {                        errors.add( handleError( className, -1, -1, e.getMessage() ) );                    }                    finally                    {                        IOUtil.close( fout );                    }                }            }        }