[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:
|