Skip to content

KAFKA-20894: Make StreamsGroupDescription.toString null-safe - #23083

Open
Gimini-3 wants to merge 1 commit into
apache:trunkfrom
Gimini-3:streams-group-description-null-safe
Open

KAFKA-20894: Make StreamsGroupDescription.toString null-safe#23083
Gimini-3 wants to merge 1 commit into
apache:trunkfrom
Gimini-3:streams-group-description-null-safe

Conversation

@Gimini-3

@Gimini-3 Gimini-3 commented Aug 5, 2026

Copy link
Copy Markdown

KAFKA-20894

DescribeStreamsGroupsOptions omits authorized operations by default. The omitted response value is converted to null, which is a documented valid state for StreamsGroupDescription.authorizedOperations(). However, StreamsGroupDescription.toString() unconditionally called stream() on that nullable set, so logging or otherwise rendering a successfully described group could throw NullPointerException.

This change renders omitted authorized operations as null while preserving the existing output format for populated sets. It also extends the existing AdminClient test for an omitted authorized-operations response to verify that the resulting description can be converted to a string and includes authorizedOperations=null.

Testing:

  • DOCKER_API_VERSION=1.40 ./gradlew clients:test
  • ./gradlew clients:test --tests org.apache.kafka.clients.admin.KafkaAdminClientTest.testDescribeStreamsGroupsWithAuthorizedOperationsOmitted --tests org.apache.kafka.clients.admin.internals.DescribeStreamsGroupsHandlerTest
  • ./gradlew spotlessCheck
  • ./gradlew clients:spotbugsMain clients:spotbugsTest -x test

The full clients test suite, targeted regression tests, Checkstyle, SpotBugs main analysis, and Spotless checks passed. clients:spotbugsTest was skipped by the build configuration.

@github-actions github-actions Bot added triage PRs from the community clients small Small PRs labels Aug 5, 2026
@Gimini-3
Gimini-3 marked this pull request as ready for review August 5, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients small Small PRs triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant