de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/js/common/SettingsHelper.java
Null is returned but a "Boolean" is expected. Open
Open
return null;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
While null
is technically a valid Boolean
value, that fact, and the distinction between Boolean
and
boolean
is easy to forget. So returning null
from a Boolean
method is likely to cause problems with callers'
code.
Noncompliant Code Example
public Boolean isUsable() { // ... return null; // Noncompliant }
See
- MITRE CWE-476 - NULL Pointer Dereference
- CERT, EXP01-J. - Do not use a null in a case where an object is required