Making Object abstract
    Dan Smith 
    daniel.smith at oracle.com
       
    Thu Jun  3 17:02:48 UTC 2021
    
    
  
> On Jun 2, 2021, at 8:57 AM, Brian Goetz <brian.goetz at oracle.com> wrote:
> 
> A minor bikeshed comment: We're asking users to change their `new Object()` to `IdentityObject.newIdentity()`, and they may ask "why do I have to say 'Identity' twice"?  (And by ask, I mean grumble, because we're already asking them to change their working code.)
Possibly addressed with a different name. (Maybe something like 'make'? Do we have a consistent standard for the equivalent of an 'of' method, but with no parameters?)
> 
> 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".
    
    
More information about the valhalla-spec-experts
mailing list