[External] : Re: Making Object abstract
daniel.smith at oracle.com
Mon Jun 7 15:13:45 UTC 2021
> On Jun 5, 2021, at 9:21 AM, Brian Goetz <brian.goetz at oracle.com> wrote:
> Rampdown is next week; time is fleeting.
> I think the path of adding Objects::newIdentity in 17 seems the best alternative. If there are objections, make them now.
I still think that's a second-best option. Utility classes were all the rage 20 years ago. Default/static interface methods have largely replaced them.
Aesthetics aside, in the Objects approach, what's the return type? It would have to be Object. But then we're going to want to turn around and make it IdentityObject—a binary incompatible change.
And there's also some uncertainty about whether we're going to want to come up with some sort of factory method feature as we iterate on primitive objects through the preview process. Maybe this whole conversation will become moot.
On the other side, I'm not that persuaded by the argument for urgency. We want to encourage a slow migration from 'new Object()' to 'SomeClass.newIdentity()'. It's not going to be completed for a number of years. We can start that migration in 17, or wait another release or two. What's the rush?
More information about the valhalla-spec-observers