GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [java] InvalidLogMessageFormat false positive on externally formatted strings · Issue #4172 · pmd/pmd

[java] InvalidLogMessageFormat false positive on externally formatted strings #4172

New issue
Copy link
New issue
Copy link
Closed
#4213
Closed
[java] InvalidLogMessageFormat false positive on externally formatted strings#4172
#4213
Copy link
Labels
a:false-positivePMD flags a piece of code that is not problematic
Milestone
6.52.0

Description

@ctoomey
ctoomey
opened on Oct 21, 2022
Issue body actions

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

Activity

  1. ctoomey
    added
    a:false-positivePMD flags a piece of code that is not problematic
    on Oct 21, 2022
  2. adangel
    added a commit that references this issue on Nov 12, 2022

    [java] InvalidLogMessageFormat - check for formatted calls

    This issue will close once commit 69ccb69 is merged into the 'main' branch.
    69ccb69
  3. adangel
    added this to the 6.52.0 milestone on Nov 12, 2022
  4. adangel
    closed this as completedin #4213on Nov 25, 2022
  5. ctoomey commented on Nov 26, 2022

    @ctoomey
    ctoomey
    on Nov 26, 2022
    Author
    More actions

    Thanks @adangel !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:false-positivePMD flags a piece of code that is not problematic

    Type

    No type

    Projects

    No projects

      Milestone

      • 6.52.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.