A RetroSearch Logo

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

Search Query:

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

[java] NullAssignment - FP with ternary and null as method argument · Issue #2320 · pmd/pmd · GitHub

Affects PMD Version:
6.20

Rule: NullAssignment
Description:

Code Sample demonstrating the issue:

public String methodOne(String one, String two) {
        return "test";
    }
public String methodTwo(String one, String two) {
        List<String> strings = new ArrayList<>();
->>        return methodOne("one", strings.isEmpty() ? null : "two");
    }

Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
Programmatically


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