Repository navigation
Rename unclear variables and private helpers in HexDump - #920
Open
sofialuiza15 wants to merge 1 commit into
Open
sofialuiza15 wants to merge 1 commit into
sofialuiza15 wants to merge 1 commit into
Conversation
Rename chars_read to bytesInLine, display_offset to displayOffset, j to lineStart/digit and k to column. Rename the private dump(StringBuilder, byte|long) helpers to appendHex, since they only append hex digits. Update their Javadoc to state that the long variant writes only the 32 least significant bits. No behavior or public API change. Assisted-By: Claude Sonnet 5.5
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.
Improves naming in
HexDump.dump(byte[], long, Appendable, int, int)and its private helpers. No behavior or public API change.chars_read->bytesInLine(it counts bytes, nothing is "read" there)display_offset->displayOffset(snake_case -> camelCase, as in the rest of the project)j->lineStart,k->columndump(StringBuilder, byte)/dump(StringBuilder, long)->appendHex(...), since they only append hex digits and shared a name with the publicdumpmethodsj->digitin the helpersappendHex(StringBuilder, long)now says it writes only the 32 least significant bits, which is what the code does.Refactoring: Rename Variable / Rename Method. Only private members and local variables are touched, so binary compatibility is unaffected.
Claude Code (Claude Sonnet 5.5) made the code change and drafted this description; I reviewed it and ran the related tests.
mvn; that'smvnon the command line by itself.Validated with mvn -B -ntp (Maven 3.10.0): BUILD SUCCESS.
Not applicable: pure refactoring with no behavioral change. Existing tests cover it and were not modified.