[External] : Re: Making Object abstract

Dan Smith daniel.smith at oracle.com
Mon Jun 7 19:00:05 UTC 2021


> On Jun 7, 2021, at 9:13 AM, Dan Smith <daniel.smith at oracle.com> wrote:
> 
> 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?

Just to clarify this, because I know, when it comes to compatibility impact, adoption patterns will tend to have quantum leaps between LTS releases—from 11 to 17 to 26. It's potentially meaningful that "17" is a number in that set.

However: in some future day (when we're all running Java in our self-driving electric cars), we will decide the time has come to turn 'new Object()' from a warning into an error. At that point, we will want to consider the body of source code that plans to compile with --release NN (NN >> 26), and how much of that source code still has lingering 'new Object()' uses. This universe of source code i) is comfortable with all the Valhalla features, and ii) does not intend to run on any pre-NN JVMs. Where there are a few lingering 'new Object()' uses, presumably there will be tooling in place to quickly fix them up.

Meanwhile, there's no impact in Java NN on legacy binaries (the JVM will indefinitely support 'new java/lang/Object'), and there's no impact on sources compiled with --release 17 or --release 26, etc.

I hope NN is a relatively small number, but... shrug. We'll get there when we get there. There are no downstream dependencies.

Nor do I expect an API point available in 17 to hasten this much, because there won't be any *push* to change source code until JEP 401 comes along with a warning about 'new Object()'.



More information about the valhalla-spec-observers mailing list