Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GatewayException.printStackTrace(PrintStream) #763

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

bestbeforetoday
Copy link
Member

The printStackTrace() implementation taking a PrintStream (rather than a PrintWriter) in the Java GatewayException class failed to print output. This was due to the PrinterWriter used to wrap the supplied PrintStream not being flushed.

This change calls the PrintStream overload with unit tests, instead of the PrintWriter overload (to which it defers) to ensure both variants behave correctly. The printStackTrace() implementation is updated to correctly flush the PrintWriter used internally to wrap the supplied PrintStream.

The printStackTrace() implementation taking a PrintStream (rather than a
PrintWriter) in the Java GatewayException class failed to print output.
This was due to the PrinterWriter used to wrap the supplied PrintStream
not being flushed.

This change calls the PrintStream overload with unit tests, instead of
the PrintWriter overload (to which it defers) to ensure both variants
behave correctly. The printStackTrace() implementation is updated to
correctly flush the PrintWriter used internally to wrap the supplied
PrintStream.

Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
@bestbeforetoday bestbeforetoday marked this pull request as ready for review October 17, 2024 20:54
@bestbeforetoday bestbeforetoday requested a review from a team as a code owner October 17, 2024 20:54
@bestbeforetoday bestbeforetoday enabled auto-merge (squash) October 17, 2024 20:55
@bestbeforetoday bestbeforetoday merged commit 102126e into hyperledger:main Oct 18, 2024
30 checks passed
@bestbeforetoday bestbeforetoday deleted the java-stacktrace branch October 18, 2024 07:34
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