JDK 8 Code Review Request for 5029031 (coll) Collections.checkedQueue(Queue<T>, Class) is missing
Sebastian Sickelmann
sebastian.sickelmann at gmx.de
Mon Oct 3 19:39:41 UTC 2011
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
More information about the core-libs-dev
mailing list