JEP 359: Records

John Rose john.r.rose at oracle.com
Fri Oct 11 19:25:18 UTC 2019


On Oct 11, 2019, at 12:14 PM, Jonathan Rosenne <jr at qsm.co.il> wrote:
> 
> So will classes such as Integer and other suitable classes in the JDK be upgraded to records?

If it makes sense.  And not, if it doesn’t.

> Can they?

Of course there’s no general answer to this question.  “It depends…”  Also “I hope so, in many cases."

> And what about existing classes in the code base that no one wants to touch? The IDE only does things to classes you edit.

Again “it depends.”  If no one wants to touch them, presumably there are good reasons for leaving them alone.

An old Sun colleague, Jim Kempf, used to say, “If you touch it it will break.”  I think of this as “Kempf’s Law
of Software Development.”  Any observable change of behavior has the potential to break somebody’s
code downstream.  And the JDK is upstream of lots of people.  We have learned by bitter experience
that the safest default is maximum backward compatibility, which means invisible optimizations are
OK (if you didn’t break the optimizer), and everything else has to be approach carefully and explicitly.
Having a machine do your edits for you invisibly doesn’t prevent Kempf-style bugs; it just makes it harder
to find out what broke.



More information about the amber-dev mailing list