changeset 55910:bcfd366e2054 records-and-sealed

allow for empty records
author vromero
date Wed, 01 May 2019 13:59:56 -0400
parents 49667f599890
children 0bf9ef1cbd6a 2a2d5280b823
files src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Wed May 01 10:46:37 2019 -0400
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java	Wed May 01 13:59:56 2019 -0400
@@ -3723,6 +3723,11 @@
         ListBuffer<JCVariableDecl> fields = new ListBuffer<>();
         if (token.kind == LPAREN) {
             nextToken();
+            // check for empty record
+            if (token.kind == RPAREN) {
+                nextToken();
+                return List.nil();
+            }
             fields.add(headerField(abstractRecord));
             while (token.kind == COMMA) {
                 nextToken();