Search in sources :

Example 1 with PMDGargoyleThreadProcessor

use of com.kyj.fx.voeditor.visual.component.pmd.PMDGargoyleThreadProcessor in project Gargoyle by callakrsos.

the class DoPMD method processFiles.

/**
	 * Run PMD on a list of files using multiple threads - if more than one is available
	 *
	 * @param configuration
	 *            Configuration
	 * @param ruleSetFactory
	 *            RuleSetFactory
	 * @param files
	 *            List<DataSource>
	 * @param ctx
	 *            RuleContext
	 * @param renderers
	 *            List<Renderer>
	 */
public void processFiles(final GargoylePMDConfiguration configuration, final RuleSetFactory ruleSetFactory, final List<DataSource> files, final RuleContext ctx, final List<Renderer> renderers) {
    sortFiles(configuration, files);
    /*
		 * Check if multithreaded support is available. ExecutorService can also
		 * be disabled if threadCount is not positive, e.g. using the
		 * "-threads 0" command line option.
		 */
    //			if (SystemUtils.MT_SUPPORTED && configuration.getThreads() > 0) {
    //				MultiThreadProcessor multiThreadProcessor = new MultiThreadProcessor(configuration);
    //				multiThreadProcessor.processFiles(ruleSetFactory, files, ctx, renderers);
    //			} else {
    pmdGargoyleThreadProcessor = new PMDGargoyleThreadProcessor(configuration);
    pmdGargoyleThreadProcessor.processFiles(ruleSetFactory, files, ctx, renderers);
    if (configuration.getClassLoader() instanceof ClasspathClassLoader) {
        IOUtil.tryCloseClassLoader(configuration.getClassLoader());
    }
}
Also used : PMDGargoyleThreadProcessor(com.kyj.fx.voeditor.visual.component.pmd.PMDGargoyleThreadProcessor) ClasspathClassLoader(net.sourceforge.pmd.util.ClasspathClassLoader)

Aggregations

PMDGargoyleThreadProcessor (com.kyj.fx.voeditor.visual.component.pmd.PMDGargoyleThreadProcessor)1 ClasspathClassLoader (net.sourceforge.pmd.util.ClasspathClassLoader)1