regarmukesh3g opened a new pull request, #23324:
URL: https://github.com/apache/kafka/pull/23324

   ## Description
   
   `GroupListing`'s constructor validates the `type` parameter with
   `Objects.requireNonNull` but not the sibling `groupState` parameter,
   even though both are `Optional<T>` fields used identically throughout
   the class (`toString()`, `equals()`, `hashCode()`, accessors).
   
   The omission was introduced when `groupState` was added alongside the
   pre-existing `type` field in KAFKA-17949 (#17763) — the constructor
   pattern was copied but the `requireNonNull` wrapper on the new field
   was dropped.
   
   For comparison, the equivalent (deprecated) `ConsumerGroupListing`
   class validates both of its analogous `Optional` fields (`groupState`
   and `type`) consistently.
   
   This PR adds the missing `Objects.requireNonNull(groupState)` check
   and adds unit tests covering the null case for both parameters.
   
   ### Validation
   - Compiles cleanly
   - All `GroupListingTest` tests pass (including the two new ones)
   - Verified all existing call sites across `clients`, `tools`, `core`,
     and `connect/mirror` modules always pass `Optional.of(...)` or
     `Optional.empty()`, never a raw `null`, for `groupState` — so this
     change introduces no behavioral regression
   - checkstyle passes


-- 
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