[OPNFLWPLUG-1066] Inappropriate use of Objects.isNull() and Objects.nonNull() Created: 07/Mar/19  Updated: 11/Apr/19  Resolved: 11/Apr/19

Status: Resolved
Project: OpenFlowPlugin
Component/s: General
Affects Version/s: None
Fix Version/s: Sodium

Type: Improvement Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The codebase currently uses the following idiom

Object foo;
if (Objects.isNull(foo)) {
    // ...
}

While this works, it is a misuse of these two methods, which are documented as:

API Note:
This method exists to be used as a Predicate, filter(Objects::isNull)

It also has two down sides:

 


Generated at Wed Feb 07 20:34:06 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.