A RetroSearch Logo

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

Search Query:

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

False-positive when using `new String(charArray)` · Issue #4874 · pmd/pmd · GitHub

Affects PMD Version:

7.0.0

Rule:

StringInstantiation

Description:

var charArray = new char[] { 'a', 'b' };
var string = new String(charArray);

This gives a warning while it shouldn't.

Code Sample demonstrating the issue:

See above.

Expected outcome:

No violation.

Running PMD through:

Gradle 8.7, JDK 21.0.2, Linux.


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