@Test public void invalid_classpath_element() throws Exception { File invalidFile = mock(File.class); when(invalidFile.toURI()).thenReturn(URI.create("x: when(javaResourceLocator.classpath()).thenReturn(ImmutableList.of(invalidFile)); try { pmdExecutor.execute(); Assert.fail(); } catch (IllegalStateException e) { assertThat(e.getMessage()).containsIgnoringCase("classpath"); } }
public Report execute() { TimeProfiler profiler = new TimeProfiler().start("Execute PMD " + PmdVersion.getVersion()); ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); URLClassLoader classLoader = createClassloader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return executePmd(classLoader); } finally { Closeables.closeQuietly(classLoader); Thread.currentThread().setContextClassLoader(initialClassLoader); profiler.stop(); } }
PmdExecutor implements BatchExtension { public Report execute() { TimeProfiler profiler = new TimeProfiler().start("Execute PMD " + PmdVersion.getVersion()); ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); URLClassLoader classLoader = createClassloader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return executePmd(classLoader); } finally { Closeables.closeQuietly(classLoader); Thread.currentThread().setContextClassLoader(initialClassLoader); profiler.stop(); } } }
PmdExecutor implements BatchExtension { public Report execute() { TimeProfiler profiler = new TimeProfiler().start("Execute PMD " + PmdVersion.getVersion()); ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); URLClassLoader classLoader = createClassloader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return executePmd(classLoader); } finally { Closeables.closeQuietly(classLoader); Thread.currentThread().setContextClassLoader(initialClassLoader); profiler.stop(); } } PmdExecutor(FileSystem fileSystem, RulesProfile rulesProfile, PmdProfileExporter pmdProfileExporter,
					   PmdConfiguration pmdConfiguration, JavaResourceLocator javaResourceLocator, Settings settings); }
PmdExecutor implements BatchExtension { public Report execute() { TimeProfiler profiler = new TimeProfiler().start("Execute PMD " + PmdVersion.getVersion()); ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); URLClassLoader classLoader = createClassloader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return executePmd(classLoader); } finally { Closeables.closeQuietly(classLoader); Thread.currentThread().setContextClassLoader(initialClassLoader); profiler.stop(); } } PmdExecutor(FileSystem fileSystem, RulesProfile rulesProfile, PmdProfileExporter pmdProfileExporter,
					   PmdConfiguration pmdConfiguration, JavaResourceLocator javaResourceLocator, Settings settings); Report execute(); Iterable<File> javaFiles(Type fileType); Iterable<File> xmlFiles(Type fileType); void executeRules(PmdTemplate pmdFactory, RuleContext ruleContext, Iterable<File> files, String repositoryKey); void executeXmlRules(PmdTemplate pmdFactory, RuleContext ruleContext, Iterable<File> files, String repositoryKey); }
PmdExecutor implements BatchExtension { public Report execute() { TimeProfiler profiler = new TimeProfiler().start("Execute PMD " + PmdVersion.getVersion()); ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); URLClassLoader classLoader = createClassloader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return executePmd(classLoader); } finally { Closeables.closeQuietly(classLoader); Thread.currentThread().setContextClassLoader(initialClassLoader); profiler.stop(); } } PmdExecutor(FileSystem fileSystem, RulesProfile rulesProfile, PmdProfileExporter pmdProfileExporter,
					   PmdConfiguration pmdConfiguration, JavaResourceLocator javaResourceLocator, Settings settings); Report execute(); Iterable<File> javaFiles(Type fileType); Iterable<File> xmlFiles(Type fileType); void executeRules(PmdTemplate pmdFactory, RuleContext ruleContext, Iterable<File> files, String repositoryKey); void executeXmlRules(PmdTemplate pmdFactory, RuleContext ruleContext, Iterable<File> files, String repositoryKey);  }