@Test void whenNoFilesToAnalyzeThenExecutionSucceedsWithBlankReport() { final Report result = pmdExecutor.execute(); assertThat(result).isNotNull(); assertThat(result.isEmpty()).isTrue(); }
public Report execute() { final Profiler profiler = Profiler.create(LOGGER).startInfo("Execute PMD " + PMDVersion.VERSION); final ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); try (URLClassLoader classLoader = createClassloader()) { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return executePmd(classLoader); } catch (IOException e) { LOGGER.error("Failed to close URLClassLoader.", e); } finally { Thread.currentThread().setContextClassLoader(initialClassLoader); profiler.stopInfo(); } return null; }
PmdExecutor { public Report execute() { final Profiler profiler = Profiler.create(LOGGER).startInfo("Execute PMD " + PMDVersion.VERSION); final ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); try (URLClassLoader classLoader = createClassloader()) { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return executePmd(classLoader); } catch (IOException e) { LOGGER.error("Failed to close URLClassLoader.", e); } finally { Thread.currentThread().setContextClassLoader(initialClassLoader); profiler.stopInfo(); } return null; } }
PmdExecutor { public Report execute() { final Profiler profiler = Profiler.create(LOGGER).startInfo("Execute PMD " + PMDVersion.VERSION); final ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); try (URLClassLoader classLoader = createClassloader()) { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return executePmd(classLoader); } catch (IOException e) { LOGGER.error("Failed to close URLClassLoader.", e); } finally { Thread.currentThread().setContextClassLoader(initialClassLoader); profiler.stopInfo(); } return null; } PmdExecutor(FileSystem fileSystem, ActiveRules rulesProfile,
                       PmdConfiguration pmdConfiguration, JavaResourceLocator javaResourceLocator, Configuration settings); }
PmdExecutor { public Report execute() { final Profiler profiler = Profiler.create(LOGGER).startInfo("Execute PMD " + PMDVersion.VERSION); final ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); try (URLClassLoader classLoader = createClassloader()) { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return executePmd(classLoader); } catch (IOException e) { LOGGER.error("Failed to close URLClassLoader.", e); } finally { Thread.currentThread().setContextClassLoader(initialClassLoader); profiler.stopInfo(); } return null; } PmdExecutor(FileSystem fileSystem, ActiveRules rulesProfile,
                       PmdConfiguration pmdConfiguration, JavaResourceLocator javaResourceLocator, Configuration settings); Report execute(); }
PmdExecutor { public Report execute() { final Profiler profiler = Profiler.create(LOGGER).startInfo("Execute PMD " + PMDVersion.VERSION); final ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); try (URLClassLoader classLoader = createClassloader()) { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return executePmd(classLoader); } catch (IOException e) { LOGGER.error("Failed to close URLClassLoader.", e); } finally { Thread.currentThread().setContextClassLoader(initialClassLoader); profiler.stopInfo(); } return null; } PmdExecutor(FileSystem fileSystem, ActiveRules rulesProfile,
                       PmdConfiguration pmdConfiguration, JavaResourceLocator javaResourceLocator, Configuration settings); Report execute();  }