Skip to content

Fix GatewayException.printStackTrace(PrintStream)#763

Merged
bestbeforetoday merged 1 commit intohyperledger:mainfrom
bestbeforetoday:java-stacktrace
Oct 18, 2024
Merged

Fix GatewayException.printStackTrace(PrintStream)#763
bestbeforetoday merged 1 commit intohyperledger:mainfrom
bestbeforetoday:java-stacktrace

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