On Thu, 2 Jun 2022 at 11:07, Gary Gregory <garydgreg...@gmail.com> wrote:
> Albert (and all): > > Do you think this is a false positive: > > <violation beginline="85" endline="85" begincolumn="44" endcolumn="97" > rule="UnnecessaryFullyQualifiedName" ruleset="Code Style" > package="org.apache.commons.text" > class="RandomStringGenerator$Builder" > externalInfoUrl=" > https://pmd.github.io/pmd-6.46.0/pmd_rules_java_codestyle.html#unnecessaryfullyqualifiedname > " > priority="4"> > Unnecessary use of fully qualified name > 'org.apache.commons.text.Builder' due to existing same package import > 'org.apache.commons.text.*' > </violation> > > ? > Yes. PMD is not recognising the type erasure on the Builder<T>. You cannot compile the code if you remove the fully qualified reference to the Builder<T>. This requires a warning suppression which requires a non-default configuration for the PMD plugin. IIRC the alternative is a '// NOPMD' trailing comment on the offending line which is noise in the source code. Alex