Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

KIP-692 proposed to make all these constructors public, using the rationale that it simplifies the creation of mock Admin clients for testing. Note that when the vote for KIP-692 was called it was done on the
[DISCUSS] thread, so the lack of votes might not be an sure indication of how the community feels about it.

...

  • While the creation of Admin mocks with package constructors is not _ergonomic_, it is _possible_. The example code in KIP-692 requires two line of codes for each result instance.
  • Having public constructors can hinder the evolution of the Admin client. A number of these constructors have changed their signature during the life of the Admin client. Further change can never be discounted.
    Sometimes these changes have been non-trivial. For example, while it's easy to overload a constructor (e.g. to add an extra future in a compatible way), overloading can't be used for making compatible changes when a
    generic type argument needs to be changed. Since we can't anticipate how the Admin Result classes might need to evolve in the future it's simpler and safer to avoid exposing these constructors than it is to need to reason  reason about making source and binary compatible changes.

...