RockteMQ-AI commented on issue #11462:
URL: https://github.com/apache/rocketmq/issues/11462#issuecomment-6287433499

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Confirmed**
   
   The reported issue has been verified against the current codebase on the 
`develop` branch.
   
   **Root Cause:** In `BitsArray.toString()` (line 239), the loop start index 
for partial-byte rendering is `j = this.bitLength % Byte.SIZE` instead of `j = 
this.bitLength % Byte.SIZE - 1`. This renders one extra padding bit for 
non-byte-aligned lengths.
   
   **Impact:** `filter` module — `BitsArray.toString()` output is incorrect for 
partial-byte arrays. Full-byte arrays are unaffected. BloomFilter diagnostics 
that rely on this rendering may display misleading output.
   
   **Severity:** Low — utility rendering method, no broker message-path impact.
   
   **Verified reproduction:**
   - `BitsArray.create(1).setBit(0, true).toString()` → `"01\n"` (expected 
`"1\n"`)
   - `BitsArray.create(9)` with bits 0 and 8 set → 10-char output instead of 9
   
   A one-line loop-bound correction at line 239 resolves this. An automated fix 
proposal may be generated. Reply `/approve` to proceed with PR generation.
   
   ---
   *Automated evaluation by RockteMQ-AI*


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to