Conversation
Assisted-by: OpenAI Codex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
SimpleTextOutputStream.write(-0.5)produces0.500: casting the value tolongloses the sign when the integer part is zero. The formatter is shared by stats and Prometheus output, so negative fractional values can be reported as positive.Modifications
Write the minus sign when a negative value has a zero integer part. Keep the existing fractional precision and truncation, and add cases covering negative fractions, positive fractions, and values that truncate to zero.
Verifying this change
SimpleTextOutputStreamTestpass after the fix, compiled with JDK 21 (--release 17) and run directly with TestNG 7.12.0 and cached Netty 4.2.16.Final dependencies. The full broker module suite was not run../gradlew quickCheckpasses.git diff --checkpasses.Does this pull request potentially affect one of the following parts:
Assisted by OpenAI Codex.