apache / apache/rocketmq

MQVersion throws ArrayIndexOutOfBoundsException for negative version values

Open Beginner friendly
#10,829 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
22.6k
Forks
12k
Avg merge
3d 1h
Merged PRs (30d)
27

Description

MQVersion.getVersionDesc and value2Version clamp values above the known range, but negative values index the version array directly and throw ArrayIndexOutOfBoundsException. Version values originate from remote client metadata, so malformed or unknown negative values should be handled without crashing callers. Expected behavior: clamp negative values to the earliest known version, consistently with the existing upper-bound handling.

Contributor guide

Open the contributing guide

Research direction

Start by locating the MQVersion class and reading getVersionDesc and value2Version, especially their existing handling of values above the known range. Verify that negative inputs no longer cause an ArrayIndexOutOfBoundsException and instead resolve to the earliest known version, with tests covering both methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.