Hello Kafka devs, I would like to start adding a few updates that would update current *Collections.* *and use Java 11+ factory methods. I would replace those parts where is just null risk i.e.,
- Collections.singletonList(x) to List.of(x) - Collections.singletonMap(k, v) to Map.of(k, v) - Collections.singleton(x) to Set.of(x) - Collections.emptyList() to List.of() - Collections.emptyMap() to Map.of() - Collections.emptySet() to Set.of() But here I would check verify such a call site...I would not change Collections.unmodifiableList/Map/Set as they have different semantics and have potential higher risk (i.e., they have copy-vs-wrapper semantic differences and null rejection). I am not sure if this change requires KIP, but I would like to divide this work into smaller PRs, start with small modules i.e., generator, coordinator-common ... and then move to others, but always per module to prevent any big change? WDYT? Best regards, Maros
