You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2021/10/21 23:50:31 UTC

[GitHub] [groovy] danielsun1106 commented on a change in pull request #1645: GROOVY-10298: Refine records to not use system properties

danielsun1106 commented on a change in pull request #1645:
URL: https://github.com/apache/groovy/pull/1645#discussion_r734118172



##########
File path: src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
##########
@@ -1603,21 +1604,18 @@ public ClassNode visitClassDeclaration(final ClassDeclarationContext ctx) {
             this.initUsingGenerics(classNode);
             this.hackMixins(classNode);
 
-        } else if (isEnum) {
+        } else if (isEnum || isRecord) {
             classNode.setInterfaces(this.visitTypeList(ctx.is));
             this.initUsingGenerics(classNode);
+            if (isRecord) {
+                transformRecordHeaderToProperties(ctx, classNode);
+            }
 
         } else if (isAnnotation) {
             classNode.setModifiers(classNode.getModifiers() | Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT | Opcodes.ACC_ANNOTATION);
             classNode.addInterface(ClassHelper.Annotation_TYPE);
             this.hackMixins(classNode);
 
-        } else if (isRecord) {
-            classNode.setModifiers(classNode.getModifiers() | Opcodes.ACC_RECORD | Opcodes.ACC_FINAL);
-            classNode.setRecordComponentNodes(this.transformRecordHeaderToProperties(ctx, classNode));

Review comment:
       `setRecordComponentNodes` is not called in the PR, so no record components are generated in bytecode.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org