A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/629 below:

[java] NullAssignment false positive · Issue #629 · pmd/pmd · GitHub

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