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

#3239: BytesOf refactoring #3259

Merged
merged 3 commits into from
Jul 12, 2024

Conversation

levBagryansky
Copy link
Member

@levBagryansky levBagryansky commented Jul 8, 2024

Closes #3239

Now BytesOf keeps functionality of both generic ctor and methods' implementation. I transferred methods' implementation to separate class BytesRaw


PR-Codex overview

The focus of this PR is to refactor the BytesOf class by introducing a new BytesRaw class and updating the constructor and method implementations.

Detailed summary

  • Introduces BytesRaw class for byte array operations
  • Refactors BytesOf class constructor and methods to use BytesRaw
  • Removes PMD rule suppressions
  • Improves code readability and maintainability

The following files were skipped due to too many changes: eo-runtime/src/main/java/org/eolang/BytesRaw.java

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

@levBagryansky
Copy link
Member Author

@c71n93 please approve

Comment on lines +33 to +36
* @todo #3239:90min Method {@link BytesOf#shift} should be refactored to get rid of
* {@code @SuppressWarnings("PMD.CognitiveComplexity")} warning. You can
* check description of this rules here
* <a href="https://pmd.github.io/pmd/pmd_rules_java_design">pmd.github.io</a>
Copy link
Member

Choose a reason for hiding this comment

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

@levBagryansky Since this todo now related only to shift method, you can move todo closer to it.

Copy link
Member Author

Choose a reason for hiding this comment

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

@c71n93 I cannot, Override methods does not have commentary

Copy link
Member

Choose a reason for hiding this comment

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

@levBagryansky understandable

Copy link
Member

@c71n93 c71n93 left a comment

Choose a reason for hiding this comment

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

@levBagryansky nice one! Just one little comment from me.

Copy link
Member

@c71n93 c71n93 left a comment

Choose a reason for hiding this comment

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

@levBagryansky one moment, why BytesRaw is no longer a "GodClass"? I don't see any differences between old BytesOf class and current BytesRaw.

@c71n93
Copy link
Member

c71n93 commented Jul 9, 2024

@levBagryansky one moment, why BytesRaw is no longer a "GodClass"? I don't see any differences between old BytesOf class and current BytesRaw.

@levBagryansky never mind, I figured out.

@levBagryansky
Copy link
Member Author

@c71n93 please approve

@levBagryansky
Copy link
Member Author

@yegor256 please take a look

@levBagryansky
Copy link
Member Author

@yegor256 please check

1 similar comment
@levBagryansky
Copy link
Member Author

@yegor256 please check

@yegor256
Copy link
Member

@rultor merge

@rultor
Copy link
Contributor

rultor commented Jul 11, 2024

@rultor merge

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

@rultor
Copy link
Contributor

rultor commented Jul 11, 2024

@rultor merge

@levBagryansky @yegor256 Oops, I failed. You can see the full log here (spent 42min)

@levBagryansky
Copy link
Member Author

@yegor256 let's try again, looks like something with rultor here

@yegor256 yegor256 merged commit fd8a063 into objectionary:master Jul 12, 2024
22 checks passed
@yegor256
Copy link
Member

@levBagryansky thanks!

@0crat
Copy link

0crat commented Jul 12, 2024

@c71n93 Thanks for the review! You've earned +72 points for this (+25 as a basis, +40 for 433 hits-of-code, +7 for 7 comments).

@0crat
Copy link

0crat commented Jul 12, 2024

@levBagryansky Thanks for the contribution! You've earned +47 points for this (+20 as a basis, +40 for 433 hits-of-code, -13 for 13 comments). Please, keep them coming.

@levBagryansky levBagryansky deleted the 3239-BytesRefactoring branch July 15, 2024 12:28
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.

BytesOf.java:34-38: This class requires refactoring. As a...
5 participants