Files
rocketmq/filter
KaiQuan Chen 4082e31d88 [ISSUE #8262]Fix bitsarray off by one (#10506)
* Update ACL mqadmin commands in Chinese doc Section 7

Replace five outdated commands (updateAclConfig, deleteAccessConfig,
updateGlobalWhiteAddr, clusterAclConfigVersion, getAclConfig) with
the six commands available in RocketMQ 5.5.0:

  createAcl, updateAcl, deleteAcl, getAcl, listAcl, copyAcl

Verified: all five old commands return 'sub command not exist' on
RocketMQ 5.5.0. Each new command documented with parameters and
usage examples from actual mqadmin -h output.

Fixes #10502

* Fix off-by-one in BitsArray boundary checks and add unit tests

**Bug fix**
checkBytePosition and checkBitPosition used '>' instead of '>=',
allowing positions equal to array length to pass validation and
cause ArrayIndexOutOfBoundsException instead of the intended
IllegalArgumentException.

**Production impact if not fixed**
Minimal. getByte/setByte are only called internally by xor/or/and
with safe bounds. getBit/setBit positions come from BloomFilterData
hash functions which always produce in-range values. The incorrect
check has no known production trigger.

**Impact of fix**
Zero negative impact. All valid positions (0 to length-1) unchanged.
Edge case now correctly throws IllegalArgumentException instead of
ArrayIndexOutOfBoundsException.

**Tests added**
- BitsArrayTest: 27 tests covering create, bit/byte ops, boundary,
  including regression tests for the fixed checks
- PlainAccessConfigTest: 12 tests for getters/setters, equals/hashCode

References #8262

* Remove self-comparison assertion flagged as error by CI
2026-06-15 20:23:50 +08:00
..