Fork me on GitHub
#clojure-dev
<
2019-12-24
>
andy.fingerhut04:12:46

I have been looking at OpenJDK Java source code for java.util.List and java.util.Collection interfaces, and it seems that even though the first interface extends the second one, most of the method signatures in Collection are repeated in List. Does anyone know why they might do it that way? It is redundant to do so, true?

andy.fingerhut04:12:36

Both of those interfaces contain method signatures for equals and hashCode that are required for every Java Object or sub-class (which is all Java objects), which also seems redundant.

andy.fingerhut04:12:18

Perhaps it is done to provide more specific doc strings for those methods in those interfaces?

👍 4
cfleming07:12:24

Almost certainly, I suspect, I can’t think of another reason to do so.

👍 4