rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

Replace byte array zeroing loop with Arrays.fill and specify charset in String construction

Open cat-and-tomato opened this issue 5 months ago • 3 comments

Which Issue(s) This PR Fixes

Fixes #9460

Brief Description

This PR improves code readability and portability by replacing manual byte array zeroing and by explicitly specifying a charset when converting bytes to string.

How Did You Test This Change?

These changes are refactorings that do not alter functionality. Existing unit tests continue to pass. Manual testing was also performed to ensure behavior remains consistent.

cat-and-tomato avatar Jun 09 '25 11:06 cat-and-tomato

It would be better to create an issue first and link it to the PR. Additionally, it is recommended to write the title in English and follow the specified format.

RongtongJin avatar Jun 10 '25 06:06 RongtongJin

It would be better to create an issue first and link it to the PR. Additionally, it is recommended to write the title in English and follow the specified format.

Thanks for your guidance!

cat-and-tomato avatar Jun 10 '25 07:06 cat-and-tomato

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 48.00%. Comparing base (53a3f69) to head (aa6586c).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #9458      +/-   ##
=============================================
- Coverage      48.11%   48.00%   -0.11%     
+ Complexity     12015    11989      -26     
=============================================
  Files           1308     1308              
  Lines          92253    92252       -1     
  Branches       11808    11807       -1     
=============================================
- Hits           44385    44288      -97     
- Misses         42373    42454      +81     
- Partials        5495     5510      +15     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Jun 11 '25 03:06 codecov-commenter