A RetroSearch Logo

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

Search Query:

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

[java] SwitchStmtsShouldHaveDefault false-positive with Java 14 switch non-fallthrough branches · Issue #2806 · pmd/pmd · GitHub

Affects PMD Version:

All, including 6.28.0.

Rule: SwitchStmtsShouldHaveDefault

Description:

	public String foo(String foo) {
		switch (foo) {
			case "=" -> foo = "eq";
			case "!=" -> foo = "ne";
			default -> throw new IllegalArgumentException();
		}
		return foo + 'a';
	}

This causes a SwitchStmtsShouldHaveDefault warning.

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

Gradle.


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