} else { BpLog.logTrace("skip " + vf.getPath()); }
    public ProcessingItem[] process(final CompileContext compileContext, ProcessingItem[] processingItems) {        // flush messages        m_messageHandler.flush();        // correctly compiled        final List processedItems = new ArrayList();        for (int i = 0; i < processingItems.length; i++) {            final ProcessingItem processingItem = processingItems[i];            try {                // run in an IDEA read action since we access VirtualFiles..                ActionRunner.runInsideReadAction(                        new ActionRunner.InterruptibleRunnable() {                    public void run() throws Exception {                        VirtualFile vf = processingItem.getFile();                        compileContext.addMessage(                                CompilerMessageCategory.INFORMATION,                                "Annotating " + vf.getName(),                                vf.getUrl(),                                -1,                                -1                        );                        final Module module = compileContext.getModuleByFile(vf);                        VirtualFile destDir = compileContext.getModuleOutputDirectory(module);                        // project paths                        ModuleRootManager pathManager = ModuleRootManager.getInstance(module);                        String[] paths = pathManager.getUrls(OrderRootType.CLASSES_AND_OUTPUT);                        URL[] pathsU = new URL[paths.length];                        // IDEA path are URL like and we just need file based path                        for (int j = 0; j < paths.length; j++) {                            if (paths[j].startsWith("file:")) {                                pathsU[j] = new URL(paths[j]);                                paths[j] = paths[j].substring(7);                            } else if (paths[j].startsWith("jar:")) {                                pathsU[j] = new File(paths[j].substring(6, paths[j].length() - 2)).toURL();                                paths[j] = paths[j].substring(6, paths[j].length() - 2);                            } else {                            continue;//TODO ignore ?                            }                        }                        // get the annotation.properties files which must be in module root                        // we do not support discovery thru classloader since it is VERY SLOW [5 s]                        List annotationPropsFileList = new ArrayList();                        VirtualFile[] srcRoots = ModuleRootManager.getInstance(module).getSourceRoots();                        for (int j = 0; j < srcRoots.length; j++) {                            VirtualFile srcRoot = srcRoots[j];                            VirtualFile annoProps = srcRoot.findChild("annotation.properties");                            if (annoProps != null) {                                annotationPropsFileList.add(annoProps.getPath());                                compileContext.addMessage(                                        CompilerMessageCategory.INFORMATION,                                        "Using custom annotations " + annoProps.getPath(),                                        null,                                        -1,                                        -1                                );                            }                        }                        String[] annotationPropsFiles = (String[]) annotationPropsFileList.toArray(new String[]{});                        // do the AnnotationC                        m_messageHandler.currentFile = vf;                        //ClassLoader currentCL = Thread.currentThread().getContextClassLoader();                        try {                            //Thread.currentThread().setContextClassLoader(loader);                            AnnotationC.compile(new String[0],                                    new String[]{vf.getPath()},                                    paths,                                    destDir.getPath(),                                            annotationPropsFiles.length == 0 ? null : annotationPropsFiles,                                    m_messageHandler                            );                        } finally {                            //Thread.currentThread().setContextClassLoader(currentCL);                        }                        // handle error without location as compilation errors                        boolean vfHasError = false;                        for (Iterator iterator = m_messageHandler.vfCompilerExceptions.iterator(                                     ); iterator.hasNext();) {                            BufferedMessageHandler.VfCompilerException vfCompilerException = (BufferedMessageHandler.VfCompilerException) iterator.next(                                    );                            if (vfCompilerException.vf.equals(vf)) {                                vfHasError = true;                                int line = -1;                                if (vfCompilerException.compilerException.getLocation() != null) {                                    line = vfCompilerException.compilerException.getLocation().getLine();                                }                                compileContext.addMessage(                                        CompilerMessageCategory.ERROR,                                        "Annotation: " + vfCompilerException.compilerException.getMessage(),                                        vf.getUrl(),                                        line,                                        -1                                );                            }                        }                        if (!vfHasError) {                            processedItems.add(processingItem);                        }                    }                }                );            } catch (Exception e) {                BpLog.logError("Unexpected", e);            }        }        // return only correctly processed items        return (ProcessingItem[]) processedItems.toArray(new ProcessingItem[]{});    }