Rule: NullAssignment (java, errorprone)
Type type = condition ? something() : null;
This, according to NullAssignment
's documentation, should not give the warning but it does.
PMD version 5.8.1.
P.S. Another false positive is:
String key; if (a) { key = "a"; } else if (b) { key = "b"; } else { key = null; }
This also should not give the warning.
P.S. Third example:
Type result = someHash.computeIfAbsent(a, _unused -> test ? truthy : null);
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4