I suggested this. While it is normally better to use an interface on the LHS, it should only be done if the interface provides the correct semantics. I.e., you should be able to swap out any two implementations of the interface and maintain correct behavior.
Normally, when we work with Maps or Sets, we do indeed need just the semantics they promise (i.e., a k/v mapping, or the set property), and we could in theory use any implementation without changing the correctness of the program. But in this case, it seemed like the correct behavior of this class depends on maintaining these collections in insertion order. Unfortunately, Java does not have an interface for an ordered Map or Set. Therefore, the most general "interface" that provides the correct semantics is actually just the implicit interface of LinkedHashMap/Set itself. [ Full content available at: https://github.com/apache/kafka/pull/5709 ] This message was relayed via gitbox.apache.org for [email protected]
