/** * Performs validation of the input source files. * * @param sources Input source files. * @param path Base path. */ @SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops") public void validate(final Collection<DataSource> sources, final String path) { this.config.setRuleSets("com/qulice/pmd/ruleset.xml"); final Report report = new Report(); report.addListener(this.listener); this.context.setReport(report); for (final DataSource source : sources) { final String name = source.getNiceFileName(false, path); this.context.setSourceCodeFilename(name); this.context.setSourceCodeFile(new File(name)); this.validateOne(source); } }