Making Object abstract

Brian Goetz brian.goetz at oracle.com
Thu Jun 3 17:17:50 UTC 2021



>> After a few minutes of thought, I think it might be a better fit to put this at Objects::newIdentity.  The methods in Objects are conveniences that users could write themselves, which this basically is -- there's nothing special about this method, other than having a preferred alternative to `new Object()` which users will understand.  So parking this where the Object conveniences go seems slightly lower friction.
> Yes, Objects is a good backup option of we don't like the IdentityObject approach. With the added friction of "import java.util.Objects".

What I like about the Objects placement (thought took me a while to come 
around to this) is that it fits into the other Objects operations, in 
that they are all sugar for code we could write without help.  I don't 
think we need or want a canonical "class of all anonymous identity 
objects" type.


More information about the valhalla-spec-observers mailing list