GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing github.com — [java] Fix #7216: GuardLogStatement: accept logstash structured arguments by princejain756 · Pull Request #7225 · pmd/pmd Conversation
Contributor
Describe the PR
The rule now treats any argument of type A test-scoped Related issuesReady?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
zbynek
requested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not clear to me how pedantic this rule should be -- calling a constructor for even a lightweight object still creates overhead. Assuming we're okay with that constructor call (as the linked issue suggests), the rule should still not allow
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
zbynek
approved these changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logic looks good now, thanks. Please resolve the release notes merge conflict.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
Compared to main: (comment created at 2026-11-08 20:35:49+00:00 for c20c126) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
2fc01cb to
cf5e380
Compare
) log.debug("user={}", value("user", user)) was flagged although its argument cost is the same as plain parameter substitution: the logstash helper call returns a StructuredArgument whose string rendering is deferred to the encoder. Treat arguments of type net.logstash.logback.argument.StructuredArgument as low overhead, covering value, keyValue, entries and user helpers returning the same type. Arbitrary method calls still require a guard. Adds logstash-logback-encoder as a test-scoped dependency so the regression test resolves the argument type.
cf5e380 to
39f72b0
Compare
(excluding indirect recursion)
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[java] GuardLogStatement: False positive on SLF4J parameterised calls whose arguments are wrapped with logstashvalue(...)
There was an error while loading. Please reload this page.