Affects PMD Version:
6.26.0
Rule:
CompareObjectsWithEquals
Description:
With #885 this rule was fixed to not show a false-positive violation when comparing enums with '=='.
However there is still a way to get a false-positive.
Code Sample demonstrating the issue:
public class EnumTest {
enum Type {
A, B;
}
private final Type type = Type.A;
public String isTypeA(Type param) {
return param == type ? "Yes" : "No";
}
}
Expected outcome:
No violation -> false-positive
Running PMD through: Eclipse
Affects PMD Version:
6.26.0
Rule:
CompareObjectsWithEquals
Description:
With #885 this rule was fixed to not show a false-positive violation when comparing enums with '=='.
However there is still a way to get a false-positive.
Code Sample demonstrating the issue:
Expected outcome:
No violation -> false-positive
Running PMD through: Eclipse