Before Creating the Bug Report
Runtime platform environment
macOS (Darwin), reproduced with an isolated local unit test.
RocketMQ version
Branch: develop
Git commit: fd0c959
JDK Version
Zulu OpenJDK 8 (8.94.0.17)
Describe the Bug
BrokerIdentityInfo supports partial identities: RaftReplicasInfoManager creates instances with null clusterName and brokerId. However, equals calls equals directly on every field, so comparing two valid partial identities throws NullPointerException. hashCode is already null-safe.
Steps to Reproduce
- Create two BrokerIdentityInfo instances with null clusterName, brokerName set, and null brokerId.
- Call equals between them.
- Observe NullPointerException.
What Did You Expect to See?
Two equivalent partial identities should compare equal and remain consistent with hashCode.
What Did You See Instead?
equals dereferences nullable fields and throws NullPointerException.
Additional Context
Complete identities, partial identities, and differing fields can all be covered with a small unit test.
Before Creating the Bug Report
Runtime platform environment
macOS (Darwin), reproduced with an isolated local unit test.
RocketMQ version
Branch: develop
Git commit: fd0c959
JDK Version
Zulu OpenJDK 8 (8.94.0.17)
Describe the Bug
BrokerIdentityInfo supports partial identities: RaftReplicasInfoManager creates instances with null clusterName and brokerId. However, equals calls equals directly on every field, so comparing two valid partial identities throws NullPointerException. hashCode is already null-safe.
Steps to Reproduce
What Did You Expect to See?
Two equivalent partial identities should compare equal and remain consistent with hashCode.
What Did You See Instead?
equals dereferences nullable fields and throws NullPointerException.
Additional Context
Complete identities, partial identities, and differing fields can all be covered with a small unit test.