You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set.remove(o) takes on Object where as Set.add(E) takes generic, this is
because Set.remove() can not damage internals of Set representation even if the
type doesn't match the element. Because only if the element is present it gets
removed.
However in IndexedCollection implementation we pass the object after (an
unchecked cast), to the indices. Now the indices are called even the object is
removed or not. This causes Class Cast Exception. Instead we should check first
if the element is a member only then call index update steps.
More here:
http://smallwig.blogspot.in/2007/12/why-does-setcontains-take-object-not-e.html
Original issue reported on code.google.com by anita.v...@inmobi.com on 9 Nov 2013 at 9:40
Yes, this would be a worthwhile improvement. I'll apply your patch at the
weekend, for inclusion in the next release. I'll make a maintenance release
including the few recent enhancements soon. Thanks!
Original comment by ni...@npgall.com on 13 Nov 2013 at 11:37
Original issue reported on code.google.com by
anita.v...@inmobi.com
on 9 Nov 2013 at 9:40Attachments:
The text was updated successfully, but these errors were encountered: