This rule seems like it should only apply to String, based on the error message. But it complains about this code:
boolean showPMDbug(Integer a, List<integer> b)
{
return a.equals(b.get(0));
}</integer>
This does not:
boolean showPMDbug(Integer a, List<integer> b)
{
return b.get(0).equals(a);
}</integer>
I am using pmd-maven-plugin version 2.2 to run PMD.
Seems to be no file patch nor solution proposal, more like a but report to me...
This is indeed a bug report. But maybe it's just a documentation issue. According to the documentation here (http://pmd.sourceforge.net/rules/design.html), this should apply to String comparisons.
Is this rule being triggered because the Integer parameter may be null? Maybe this rule is just misnamed if it's tryig to detect potential NullPointerExceptions.