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] If report is written to stdout, stdout should not be closed · Issue #4031 · pmd/pmd

[core] If report is written to stdout, stdout should not be closed #4031

New issue
Copy link
New issue
Copy link
Closed
#4032
Closed
[core] If report is written to stdout, stdout should not be closed#4031
#4032
Copy link
Assignees
adangel
Labels
a:bugPMD crashes or fails to analyse a file.
Milestone
6.48.0

Description

@adangel
adangel
opened on Jun 30, 2022
Issue body actions

Description:

Found in #4023 (comment) and #4023 (comment)

I've added a report output file as otherwise we report to stdout.
And we close the report files afterwards - which is why we close stdout.
We have a outStreamCaptor active, however, the close is delegated to the original stdout stream.
Closing stdout in a unit test is not good for IntelliJ IDEA, as IntelliJ IDEA uses this channel
to communicate test progress etc...

I think we should never close stdout,,, We should use something similar to https://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/output/CloseShieldWriter.html

This might be a problem, when PMD is integrated as a library (e.g. just calling PMD.run(...)) and no report file given. Then PMD will write the report to stdout and close it afterwards... and the calling process now has a closed stdout.

Activity

  1. adangel
    added
    a:bugPMD crashes or fails to analyse a file.
    on Jun 30, 2022
  2. adangel
    added this to the 6.48.0 milestone on Jun 30, 2022
  3. adangel
    self-assigned this
    on Jun 30, 2022
  4. adangel
    added a commit that references this issue on Jun 30, 2022

    [core] If report is written to stdout, stdout should not be closed

    This issue will close once commit 157e623 is merged into the 'main' branch.
    157e623
  5. oowekyala
    closed this as completedin 157e623on Jul 16, 2022
  6. oowekyala
    closed this as completedin #4032on Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @adangel
    adangel

Labels

a:bugPMD crashes or fails to analyse a file.

Type

No type

Projects

No projects

    Milestone

    • 6.48.0

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.