A RetroSearch Logo

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

Search Query:

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

[java] InvalidLogMessageFormat false positive on externally formatted strings · Issue #4172 · pmd/pmd · GitHub

Affects PMD Version: 6.49.0

Rule: InvalidLogMessageFormat

Description:

Incorrectly flags the following LOGGER line with error "InvalidLogMessageFormat: Missing arguments, expected 2 arguments but have 0"

Code Sample demonstrating the issue:

    String msg = "Got kafka msg, headers=%s, body=%s".formatted(headers, new String(body, UTF_8));
    LOGGER.info(msg);
    return msg;

Expected outcome:

PMD reports a violation at line 2, but that's wrong. That's a false positive.

Running PMD through: 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