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 — [core] Fix #7306: Don't close System.out in DeterministicOutputListenerWrapperTest by UncleOwen · Pull Request #7346 · pmd/pmd

Conversation

@UncleOwen

@UncleOwen UncleOwen commented Nov 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Describe the PR

DeterministicOutputListenerWrapperTest passes the global System.out as the renderer writer:

setWriter(new PrintWriter(System.out));

At the end of PmdAnalysis.performAnalysis(), the renderer listener is closed and AbstractRenderer.flush() closes its writer. That closes the JVM-global System.out for the rest of the process.
With Maven/Surefire this is harmless, because test results are reported over Surefire's own channel. In IntelliJ, however, the JUnit runner relies on the output stream and can no longer report results once it is closed: the test and all subsequent tests in the same fork are marked as "terminated"/aborted (see IDEA-120628).
This change uses a throwaway StringWriter instead, so the test no longer touches global state. The test logic itself is unchanged.

Related issues

  • Fix [core] IntelliJ and DeterministicOutputListenerWrapperTest #7306
  • Would allow me to review [core] Fix #6869: Don't hide analysis Error behind AssertionError #7296
  • JetBrains bug: IDEA-120628 — closing System.out breaks the IntelliJ JUnit runner

Ready?

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
UncleOwen added 3 commits November 13, 2026 23:10
@UncleOwen
Fix test execution in IntelliJ.
673929e
Replace the PrintWriter in MyRendererSpy with a StringWriter, so that
System.out doesn't get closed.
@UncleOwen
[docs] Update release notes
cf576f3
@UncleOwen
checkstyle
c1ccf10
@pmd-actions-helper

pmd-actions-helper Bot commented Nov 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Documentation Preview

No relevant source code has been changed, pmdtester skipped.

(comment created at 2026-11-27 19:35:21+00:00 for 102ec28)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@UncleOwen
Merge branch 'main' into issue-7306-dont-close-system-out
102ec28
# Conflicts:
#	docs/pages/release_notes.md

This branch has not been deployed

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[core] IntelliJ and DeterministicOutputListenerWrapperTest

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@UncleOwen
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.
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.