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

2645 printing byte array #2799

Merged
merged 10 commits into from
Jan 19, 2024

Conversation

levBagryansky
Copy link
Member

@levBagryansky levBagryansky commented Jan 18, 2024

Closes #2645


PR-Codex overview

This PR focuses on improving the readability and logging of error messages in the code.

Detailed summary

  • Updated the Main.java file to log the app dataization result in a more readable format.
  • Added a new VerboseBytesAsString class to convert byte arrays into a string representation.
  • Updated the EOerror.java file to use the VerboseBytesAsString class for error message logging.
  • Added unit tests for the VerboseBytesAsString class.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@levBagryansky
Copy link
Member Author

@maxonfjvipon please check

Copy link
Member

@maxonfjvipon maxonfjvipon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@levBagryansky good one, just one comment from my side

*
* @since 0.36
*/
public final class ToStringVerbose implements Function<byte[], String> {
Copy link
Member

@maxonfjvipon maxonfjvipon Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@levBagryansky I think we should use a noun for the name of the class. May be something like VerboseBytesAaString that would accept bytes in constructor and would have method toString?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maxonfjvipon made it Supplier


@Override
public String get() {
final Bytes bytes = new BytesOf(this.data);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@levBagryansky I can see that this variable is used only in case 8:, I think it would be better to move it there


/**
* Makes a String from byte array that can represent bool,
* double, int or {@link String}.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@levBagryansky something is wrong with indentation here

@levBagryansky
Copy link
Member Author

@maxonfjvipon please check

@levBagryansky
Copy link
Member Author

@yegor256 please check

@yegor256
Copy link
Member

@rultor merge

@rultor
Copy link
Contributor

rultor commented Jan 19, 2024

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit e6d8c0c into objectionary:master Jan 19, 2024
12 checks passed
@rultor
Copy link
Contributor

rultor commented Jan 19, 2024

@rultor merge

@yegor256 Done! FYI, the full log is here (took me 26min)

@levBagryansky levBagryansky deleted the 2645_printing_byte_array branch January 19, 2024 11:02
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.

Main.java:174-176: Make type casting when logging an app...
5 participants