Rule UseProperClassLoader
Affects PMD Version:
6.32.0 (should be all versions since 3.7)
Make sure, to test with the latest PMD version.
Description:
The UseProperClassLoader will match any method called getClassLoader(), not just java.lang.Class.getClassLoader, e.g. https://javadoc.io/static/io.dropwizard/dropwizard-core/2.0.20/io/dropwizard/setup/Bootstrap.html#getClassLoader--
Steps to reproduce:
Please provide detailed steps for how we can reproduce the bug.
- ... use a dropwizard project, then call
bootstrap.getClassLoader() in the initialize method of a dropwizard app, run pmd on it.
- ... run pmd on the project (maven or command line)
Rule UseProperClassLoader
Affects PMD Version:
6.32.0 (should be all versions since 3.7)
Make sure, to test with the latest PMD version.
Description:
The
UseProperClassLoaderwill match any method calledgetClassLoader(), not justjava.lang.Class.getClassLoader, e.g. https://javadoc.io/static/io.dropwizard/dropwizard-core/2.0.20/io/dropwizard/setup/Bootstrap.html#getClassLoader--Steps to reproduce:
Please provide detailed steps for how we can reproduce the bug.
bootstrap.getClassLoader()in theinitializemethod of a dropwizard app, run pmd on it.