Skip to content

[java] chore: Add test for ReportStatsListener - #6863

Merged
adangel merged 3 commits into
pmd:mainfrom
UncleOwen:add-test-for-ReportStatsListener
Jul 22, 2026
Merged

adangel merged 3 commits into
pmd:mainfrom
UncleOwen:add-test-for-ReportStatsListener

Conversation

@UncleOwen

Copy link
Copy Markdown
Member

Describe the PR

This PR does 2 things:

  • Add a test that exercises ReportStatsListener using multiple threads. The class is intended to be used from multiple threads. The implementation is kinda-simple - but it's still better to have a test.
  • Add a note to BaseResultProducingCloseable (the base class for ReportStatsListener), explaining why it shouldn't be AutoCloseable. Actually removing implements AutoCloseable would be a breaking change, so this has to wait until PMD 8.

Related issues

  • None

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

This test makes sure that ReportStatsListener is working correctly if
called from multiple threads.
@pmd-actions-helper

pmd-actions-helper Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Documentation Preview

Compared to main:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
There are 0 changed duplications, 0 new duplications and 0 removed duplications.
There are 0 changed CPD errors, 0 new CPD errors and 0 removed CPD errors.

Regression Tester Report

(comment created at 2026-07-22 14:53:27+00:00 for aafbcef)

@adangel adangel changed the title [java] Add test for ReportStatsListener [java] chore: Add test for ReportStatsListener Jul 22, 2026
@adangel adangel added this to the 7.27.0 milestone Jul 22, 2026

@adangel adangel left a comment

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.

Thanks, makes sense.

We seem to suppress the CloseResource rule on these a couple of times... e.g.

@SuppressWarnings("PMD.CloseResource")

@adangel
adangel merged commit fc90e8e into pmd:main Jul 22, 2026
2 checks passed
@UncleOwen
UncleOwen deleted the add-test-for-ReportStatsListener branch July 22, 2026 16:14
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