hi 

IIRC, we have had similar PRs before, so please feel free to submit them. You 
can ping me as a reviewer

Plus, it is hard to give a simple yes or no to this kind of replacement. It 
depends. Therefore, please start the PR with small module. For example, “MINOR: 
use modern collection for xxx module”

Best,
Chia-Ping

> Maroš Orsák <[email protected]> 於 2026年2月26日 下午5:32 寫道:
> 
> 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

Reply via email to