UseAssertSameInsteadOfAssertTrue false +
A source code analyzer
Brought to you by:
adangel,
juansotuyo
The following snippet of code produces a false positive:
assertTrue("Crypted password should be 54 = 40 + 14 characters in length", saltedPassword.length() == 54);
These values are primitive types, and assertSame only works with Objects.
Perhaps the rule needs to instead suggest use assertSame or assertEquals as appopriate?
Logged In: YES
user_id=1983058
Originator: NO
This bug could be a Java 5.0 migration problem.
PMD might be mistaking the primitive types below for java.lang.Integer as a result of autoboxing.
saltedPassword.length() == 54
I have noticed the same problem, and it makes this particular check unusable.