> De: "John Rose" <[email protected]> > À: "Brian Goetz" <[email protected]> > Cc: "Remi Forax" <[email protected]>, "valhalla-spec-experts" > <[email protected]> > Envoyé: Samedi 7 Décembre 2019 02:31:48 > Objet: Re: IdentityObject and InlineObject
> On Dec 6, 2019, at 2:28 PM, Brian Goetz < [ mailto:[email protected] | > [email protected] ] > wrote: >> public class IdentityHashMap<E extends Object&IdentityObject> { ... } > (There’s your erasure trick, Remi, used against you. Brian has no mercy!) No, it's actually a good question ! First, it only works for one of the 3 examples I have given. Then i've found that using this trick useful on generic static method and far less useful on generic classes because those can have subclasses. By example, in the case of IdentityHashMap, you only delay the issue because any classes that inherits from IdentityHashMap<IdentityObject, ...> (and IdentityHashMap with the (first) type argument specified) is not binary backward compatible. Rémi
