...
Ignoring method return values can lead to unexpected program behavior.
Rule | Severity | Likelihood |
|---|
Detectable | Repairable | Priority | Level |
|---|---|---|---|
EXP00-J | Medium | Probable |
Yes | No | P8 | L2 |
Automated Detection
Tool | Version | Checker | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| CodeSonar |
| JAVA.NULL.RET.UNCHECKED | Call Might Return Null (Java) | ||||||
| Coverity | 7.5 | CHECKED_RETURN | Implemented | ||||||
| Klocwork |
| RI.IGNOREDCALL RR.IGNORED | |||||||
| Parasoft Jtest |
| CERT.EXP00.NASSIG CERT.EXP00.AECB | Ensure method and constructor return values are used Avoid "try", "catch" and "finally" blocks with empty bodies | |||||||
| PVS-Studio |
| V6010, V6101 | |||||||
| SonarQube |
|
|
| Return values from functions without side effects should not be ignored Return values should not be ignored when they contain the operation status code |
| SpotBugs |
| RV_RETURN_VALUE_IGNORED | Implemented |
Related Guidelines
VOID EXP12-CPP. Do not ignore values returned by functions or methods | |
| ISO/IEC TR 24772:2010 | Passing Parameters and Return Values [CSJ] |
CWE-252, Unchecked Return Value |
Bibliography
[API 2006] | |
Misusing | |
| [Seacord 2015] |
...
...