Skip to content

[GR-42804] Disallow System.err and printStackTrace().#12854

Closed
graalvmbot wants to merge 7 commits into
masterfrom
fniephaus/GR-42804/disallow-stderr-v2
Closed

[GR-42804] Disallow System.err and printStackTrace().#12854
graalvmbot wants to merge 7 commits into
masterfrom
fniephaus/GR-42804/disallow-stderr-v2

Conversation

@graalvmbot
Copy link
Copy Markdown
Collaborator

This PR adds two new checkstyle rules: one that disallows the use of System.err and one to disallow Throwable.printStackTrace() in the SVM code base.

The Native Image builder itself should always print into stdout to ensure that warnings and errors are captured together with the build output. In general, the use of System.err should be explicitly signed off with a comment when required.

Similarly, we use printStackTrace(PrintStream s) over printStackTrace() to ensure that the output stream is explicitly chosen. This PR also fixes some places where we printed something to stdout, and then called printStackTrace() which prints to stderr.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 23, 2026
@graalvmbot graalvmbot closed this Jan 23, 2026
@graalvmbot graalvmbot deleted the fniephaus/GR-42804/disallow-stderr-v2 branch January 23, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants