Evolution of records spec

Tagir Valeev amaembo at gmail.com
Tue Nov 26 08:12:24 UTC 2019


Hello!

The current spec draft [1] tells nothing about the possibility to
migrate an existing class to the record or vice versa. I believe such
a migration could be safe, taking into account all the implicit
declarations the records have. E.g. if I linked before to a library
final class named Point, called a constructor like Point(int, int) and
used equals/hashCode/toString, then converting it to the record
Point(int x, int y) in the library would not break my client code.
Should not we have some kind of explicit statement about
record<=>class binary compatibility?

With best regards,
Tagir Valeev.

[1] http://cr.openjdk.java.net/~gbierman/jep359/jep359-20191125/specs/records-jls.html#jls-13.4.27


More information about the amber-spec-experts mailing list