RFR: JDK-8246353: Sealed types not supported by jshell

Robert Field robert.field at oracle.com
Thu Jun 4 23:14:22 UTC 2020


In MaskCommentsAndModifiers, it is the right thing to remove "final" 
from IGNORED_MODIFIERS, however it is important that "final" is then 
added to OTHER_MODIFIERS. Otherwise, "final" will prevent subsequent 
ignored modifiers from being ignored.

"final" could, I believe, be added to the before array in to 
ModifiersTest to catch this.

Otherwise looks good.  If those are addressed, I give my thumbs up, 
without a re-review.

Thanks,
Robert

This review covers the JShell portion of the RFR.


On 2020-06-03 03:16, Jan Lahoda wrote:
> Hi,
>
> JShell does not support sealed types yet, this patch attempts to solve 
> it. This patch:
> -adds "permits" clauses to header dependencies of the class that 
> defines it (so that JShell correctly detects the permitted classes 
> must be added before the class is defined)
> -JShell will not clear the final modifier, on any element (class, 
> method, variable) before compiling the snippet
> -javac will not report the "no sealed superclass" error for cases like:
> non-sealed class I extends Undefined {}
> (this makes support for non-sealed in JShell much easier, and is the 
> right thing to do, I believe.)
>
> Proposed webrev:
> http://cr.openjdk.java.net/~jlahoda/8246353/webrev.00/
>
> JBS: https://bugs.openjdk.java.net/browse/JDK-8246353
>
> How does this look?
>
> Thanks,
>    Jan


More information about the kulla-dev mailing list