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

Jan Lahoda jan.lahoda at oracle.com
Thu Dec 5 15:59:37 UTC 2019


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