
resources.report.rules.pmd.BadComparison.html Maven / Gradle / Ivy
BadComparison
BadComparison
Avoid equality comparisons with Double.NaN - these are likely to be logic errors.
This rule is defined by the following XPath expression:
//EqualityExpression[@Image='==']
/PrimaryExpression/PrimaryPrefix
/Name[@Image='Double.NaN' or @Image='Float.NaN']
Example:
public class Bar {
boolean x = (y == Double.NaN);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy