Specs update

Gavin Bierman gavin.bierman at oracle.com
Tue Dec 22 11:46:53 UTC 2020


As we rampdown to JDK 16, the three spec bundles have been polished up a little. I’ve updated them all:

* Records: http://cr.openjdk.java.net/~gbierman/jep395/latest/
* Pattern matching for instanceof: http://cr.openjdk.java.net/~gbierman/jep394/latest/
* Sealed Classes: http://cr.openjdk.java.net/~gbierman/jep397/latest/

Nearly all of the changes are just polishing up the language.  However, the pattern matching spec did have a small, significant change: Given that we had already lifted the restriction that pattern variables were always final, we have now decided to allow pattern variables to support a `final` modifier. For example:

if (e instanceof final String s) {
  // s is in scope and final here
  ...
}

You’ll see also in the pattern matching spec that we have taken the opportunity to tidy up the treatment of local variables in various places; this is old technical debt that we are paying down, but given that pattern variables are a subset of local variables we had an opportunity to finally do this. 

As always, further polishing may apply as they get inserted into the actual specs. 

If you have any comments please let me know.

Wishing you all Happy Holidays and a better 2021!

Gavin



More information about the amber-spec-experts mailing list