Laying the groundwork

Brian Goetz brian.goetz at
Fri Dec 6 18:52:48 UTC 2019

With a viable-looking language and VM model on the table, I think its time to look at what we can do to _prepare_ the world for Valhalla.   The Valhalla story will create some disturbance in the force; better to lay the groundwork early.

The most disruptive changes outlined in the recent document will be:

 - Migrating primitive wrappers to interfaces
 - Migrating away from `new Object()`

We can prepare the ground for these early, as follows:

 - Add new interface IdentityObject (JDK)
 - Add new factories in Object: IdentityObject newIdentity()  (JDK)
 - Warn when user says “new Object()”, perhaps translate to factory invocation (Language)
 - Inject IdentityObject into classes as a super interface (JVM)
 - Deprecate for removal wrapper constructors (JDK)
 - Deprecate for “removal” Object constructor (JDK)
 - Warnings when synchronizing on an instance of a wrapper (Language)
 - Support T.default notation (Language)
 - Detect synchronization on wrapper instances and throw (JVM)

Most of these, with the exception of the last, range from simple to trivial.  

More information about the valhalla-spec-observers mailing list