Skip to content

refactor: convert log calls to parameterized logging in test utilities#1305

Merged
joaodinissf merged 1 commit into
dsldevkit:masterfrom
joaodinissf:chore/pmd-guard-log/test-utilities
May 19, 2026
Merged

refactor: convert log calls to parameterized logging in test utilities#1305
joaodinissf merged 1 commit into
dsldevkit:masterfrom
joaodinissf:chore/pmd-guard-log/test-utilities

Conversation

@joaodinissf
Copy link
Copy Markdown
Collaborator

@joaodinissf joaodinissf commented Apr 6, 2026

Replaces string concatenation in LOGGER.x(...) calls with parameterized {} placeholders, using Supplier lambdas for lazy argument evaluation. Adds NOPMD suppressions where the call site uses SwtBot's SLF4J logger (not Log4j) so the rule doesn't fire there, and adds org.apache.logging.log4j.util to the OSGi manifests of test.core and test.ui for the Supplier import.

🤖 Generated with Claude Code

@joaodinissf joaodinissf force-pushed the chore/pmd-guard-log/test-utilities branch from faba54c to 99f9599 Compare April 6, 2026 20:42
@joaodinissf joaodinissf force-pushed the chore/pmd-guard-log/test-utilities branch 2 times, most recently from 732bc16 to 23f155d Compare April 20, 2026 08:21
@joaodinissf joaodinissf force-pushed the chore/pmd-guard-log/test-utilities branch from 23f155d to 4631685 Compare May 6, 2026 23:26
@joaodinissf joaodinissf marked this pull request as ready for review May 6, 2026 23:27
@joaodinissf joaodinissf force-pushed the chore/pmd-guard-log/test-utilities branch from 4631685 to 3d67160 Compare May 6, 2026 23:46
@Override
public SwtBotButton click() {
log.debug("Clicking on {}", SWTUtils.getText(widget)); //$NON-NLS-1$
log.debug("Clicking on {}", SWTUtils.getText(widget)); //$NON-NLS-1$ // NOPMD GuardLogStatement
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this and the next should be lamdas, right?

Copy link
Copy Markdown
Collaborator Author

@joaodinissf joaodinissf May 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this .debug() doesn't offer this signature, unfortunately. We can go with the if guard.

@joaodinissf joaodinissf force-pushed the chore/pmd-guard-log/test-utilities branch from 3d67160 to 7b00dae Compare May 19, 2026 08:41
rubenporras
rubenporras previously approved these changes May 19, 2026
@joaodinissf joaodinissf enabled auto-merge (rebase) May 19, 2026 08:43
Replace string concatenation in `LOGGER.x(...)` calls with parameterized `{}` placeholders, using `Supplier` lambdas for lazy argument evaluation. Adds NOPMD suppressions where the call site uses SwtBot's SLF4J logger (not Log4j) so the rule doesn't fire there, and adds `org.apache.logging.log4j.util` to the OSGi manifests of `test.core` and `test.ui` for the `Supplier` import.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@joaodinissf joaodinissf force-pushed the chore/pmd-guard-log/test-utilities branch from 7b00dae to 1341011 Compare May 19, 2026 08:56
@joaodinissf joaodinissf merged commit 5f4a815 into dsldevkit:master May 19, 2026
4 checks passed
@joaodinissf joaodinissf deleted the chore/pmd-guard-log/test-utilities branch May 19, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants