Yes, good spot Tagir. I’ll update.

Thanks,
Gavin

> On 9 Jan 2021, at 11:31, Tagir Valeev <amae...@gmail.com> wrote:
> 
> Hello, Gavin!
> 
> Thank you for spec update. A minor nitpick regarding pattern-matching spec:
> http://cr.openjdk.java.net/~gbierman/jep394/jep394-20210108/specs/patterns-instanceof-jls.html#jls-14.20.3
> 
> As resource variable is now a local variable declaration, probably,
> the following statement is redundant and should be removed?
> 
>> It is a compile-time error if final appears more than once as a modifier for 
>> each variable declared in a resource specification.
> 
> With best regards,
> Tagir Valeev.
> 
> On Tue, Dec 22, 2020 at 6:47 PM Gavin Bierman <gavin.bier...@oracle.com> 
> wrote:
>> 
>> 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
>> 

Reply via email to