Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: final modifier

...

Current state: Under Discussion

Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]

JIRA: KAFKA-13285

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

...

Over time a minority of the Result classes have ended up with public constructors. So there is an inconsistency in these classes. This caused a problem in the Kafka 3.0 development cycle because a couple of constructor signatures were changed, but one of those constructors was public, which was missed in the original code review.

...

  • AlterClientQuotasResult
  • AlterUserScramCredentialsResult
  • DeleteRecordsResult
  • DescribeClientQuotasResult
  • DescribeConsumerGroupsResult
  • ListOffsetsResult

Also, remove the final modifier from ElectLeadersResult. This prevents the instantiation of mocks by frameworks such as Mockito, and appear to confer no safety on the use of the result class.

Proposed Changes

Per public interfaces section.

...

  • Do nothing.
  • Achieve consistency by making the constructors public, as proposed by KIP-692, and deal with compatibility problems on a KIP-by-KIP- basis.
  • Provide some other public API for the creation of instances of these classes to address the verbosity of mock creation. Providing a supportable API in the face of changing underlying constructors seems like a lot of work for only marginal benefit.

  • Change the Result classes to interfaces. This would be quite a bit more code, for similar protection as a package-private constructor and not improve the situation for people mocking the Admin client.