
org.sonar.l10n.pmd.rules.pmd.MisplacedNullCheck.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-pmd-plugin Show documentation
Show all versions of sonar-pmd-plugin Show documentation
PMD is a tool that looks for potential problems like possible bugs, dead code, suboptimal code, overcomplicated expressions or duplicate code.
The null check here is misplaced. if the variable is null you'll get a NullPointerException.
Either the check is useless (the variable will never be null) or it's incorrect.
Example :
if (object1!=null && object2.equals(object1)) {
...
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy