Am 03.10.2011 17:35, schrieb Jason Mehrens:
> What's about moving
>
> public boolean equals(Object o) {return o == this || c.equals(o);}
>
> to CheckedCollection and remove it in CheckedSet (L2394),
CheckedList (L2506)
>
> and
>
> public int hashCode() {return c.hashCode();}
>
> to CheckedCollection and remove it in CheckedSet (L2395)
That violates the spec of checkedCollection.
Jason
Sorry missed this. This was an jdk7 javadoc patch. in jdk6 the javadoc
hasn't said anything about this.
I thought about it, but there is not good solution to pass through the
calls of hashCode and equals to the underlying Collection (List / Set /
other custom Collection) without breaking symmetric while having
the Set and List implementations (both check if the other object is also
a Set or List.
And all my other deduplication candidates i have seen are in the same
category.
-- Sebastian