You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2021/09/26 09:05:50 UTC

[groovy] branch master updated: GROOVY-10240: Support record grammar (detect invalid component names - fix for JDK8)

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 283ea3f  GROOVY-10240: Support record grammar (detect invalid component names - fix for JDK8)
283ea3f is described below

commit 283ea3f75b3f49283384127d4f38a3b7f3c2964f
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sun Sep 26 19:05:44 2021 +1000

    GROOVY-10240: Support record grammar (detect invalid component names - fix for JDK8)
---
 src/main/java/org/codehaus/groovy/classgen/Verifier.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/classgen/Verifier.java b/src/main/java/org/codehaus/groovy/classgen/Verifier.java
index 9133f7d..a702223 100644
--- a/src/main/java/org/codehaus/groovy/classgen/Verifier.java
+++ b/src/main/java/org/codehaus/groovy/classgen/Verifier.java
@@ -285,7 +285,8 @@ public class Verifier implements GroovyClassVisitor, Opcodes {
         checkFinalVariables(node);
     }
 
-    private static final List<String> invalidNames = List.of("clone", "finalize", "getClass", "hashCode", "notify", "notifyAll", "toString", "wait");
+    private static final List<String> invalidNames = Arrays.asList("clone", "finalize", "getClass", "hashCode", "notify", "notifyAll", "toString", "wait");
+
     private void detectInvalidRecordComponentNames(ClassNode node) {
         for (FieldNode fn : node.getFields()) {
             if (invalidNames.contains(fn.getName())) {