chore: enable PMD GuardLogStatement rule and clean up TODO comments#1284
Draft
joaodinissf wants to merge 8 commits intodsldevkit:masterfrom
Draft
chore: enable PMD GuardLogStatement rule and clean up TODO comments#1284joaodinissf wants to merge 8 commits intodsldevkit:masterfrom
joaodinissf wants to merge 8 commits intodsldevkit:masterfrom
Conversation
…riptions Replace <!--TODO--> on three excluded PMD rules with descriptive comments explaining what needs to happen before each rule can be enabled: - GuardLogStatement: ~35 log calls need parameterized logging - PreserveStackTrace: catch blocks need cause-chaining audit - UseTryWithResources: manual try/finally needs conversion audit Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configure the rule to only flag unguarded debug/trace log calls where arguments involve method calls (eager evaluation). Info/warn/error levels are excluded since those are typically always enabled. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…logging
Replace `+` concatenation and MessageFormat.format/NLS.bind in log
statements with Log4j2 parameterized `{}` placeholders. This avoids
unnecessary string construction when the log level is disabled.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Convert debug/trace log calls to use Log4j2 Supplier overloads (method references and lambdas) for lazy argument evaluation. Remove superfluous isDebugEnabled/isTraceEnabled guards that are no longer needed when all arguments are Suppliers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add NOPMD suppression for SWTBot's SLF4J logger (no Supplier support), ITraceSet.trace() misidentified as a log call, and Log4j2 method-ref Suppliers not recognized by PMD. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Checkstyle MultipleStringLiteralsCheck flagged parameterized log messages that appeared more than once in the same file. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The log4j util.Supplier package is not available in the OSGi test runtime. Use direct parameterized logging instead of lambdas for info-level messages that are almost always evaluated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add org.apache.logging.log4j.util to Import-Package in OSGi manifests so that Supplier lambdas in log calls resolve at runtime. This reverts the de-lambda workaround (318edc2) and fixes the root cause instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GuardLogStatementrule for debug and trace log levels{}placeholders)Supplier/method-refs for debug and trace log arguments where appropriate// NOPMD GuardLogStatementTest plan
mvn compile pmd:pmd pmd:checkpasses with no violations🤖 Generated with Claude Code