A RetroSearch Logo

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

Search Query:

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

[java] AssertJ SimplifyStartsWith false-positive · Issue #2712 · pmd/pmd · GitHub

Affects PMD Version: 6.26

Rule: SimplifyStartsWith

Description:

When using assertJ like so:

assertThat(someStringValue).startsWith("a");

PMD is flagging this with:

Rule:SimplifyStartsWith Priority:3 This call to String.startsWith can be rewritten using String.charAt(0).

This feels like it's a false-positive, even though one could make it be:

assertThat(someStringValue.charAt(0)).isEqualTo("a");

it feels much less idiomatic use of the library's API


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