...
Code Block | ||
---|---|---|
| ||
public Node updateNode(int id, int newValue) throws NodeNotFoundException {
Node current = root;
while(current != null){
if(current.getId() == id){
current.setValue(newValue);
return current;
}
current = current.next;
}
throw new NodeNotFoundException();
}
|
Applicability
Failure to provide appropriate feedback through return values, error codes, and exceptions can lead to inconsistent object state and unexpected program behavior.
Related Guidelines
[MITRE 2009] | CWE | ID 393, "Return of Wrong Status Code"CWE ID 389, "Error Conditions, Return Values, Status Codes" | -389, Error conditions, return values, status codes CWE-393, Return of wrong status code |
Bibliography
...