RFR; JDK-8235338: test jdk/jshell/CompletenessTest.java fails for records

Robert Field robert.field at oracle.com
Thu Dec 5 19:23:55 UTC 2019


Maybe it is just me, but adding support for records in JShell as well as 
seemingly correcting the compiler's processing of records under a bug 
for a JShell test failure seems inappropriate. Probably could be 
addressed by creating a RFE that covers it.

I assume the CSR needs to be approved before this is pushed.  The CSR 
has the same naming issue.

Otherwise looks fine.

-Robert


On 12/5/19 7:59 AM, Jan Lahoda wrote:
> Hi,
>
> This is a patch to improve the behavior of jshell w.r.t. records, 
> including fixing the recently problem-listed CompletenessTest.java.
>
> Notes on the patch:
> -added jdk.jshell.Snippet.SubKind.RECORD_SUBKIND, similar to 
> ENUM_SUBKIND. CSR for this change for review is here:
> https://bugs.openjdk.java.net/browse/JDK-8235421
> -moved setting the record final from JavacParsert to Check.checkFlags 
> (as jshell was struggling with the modifier being set in parser, and 
> checkFlags seems to be a better place anyway)
> -improved JavacParser.isRecordStart to take EOF into account - this 
> could be moved to jshell if too dangerous, but might be good for javac 
> for error recovery
> -Pretty (JCClassDecl.toString()) should now print records as records 
> instead of classes.
>
> Proposed patch:
> http://cr.openjdk.java.net/~jlahoda/8235338/webrev.00/
>
> JBS: https://bugs.openjdk.java.net/browse/JDK-8235338
>
> How does this look?
>
> Thanks,
>     Jan


More information about the compiler-dev mailing list