You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by em...@apache.org on 2021/11/09 15:48:49 UTC

[groovy] branch master updated: GROOVY-10352: class model: load anno enum value as property expression

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

emilles 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 d711be1  GROOVY-10352: class model: load anno enum value as property expression
d711be1 is described below

commit d711be14e2556f437b22b25f3206eba50cc918f4
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Tue Nov 9 09:48:39 2021 -0600

    GROOVY-10352: class model: load anno enum value as property expression
---
 src/main/java/org/codehaus/groovy/vmplugin/v8/Java8.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/main/java/org/codehaus/groovy/vmplugin/v8/Java8.java b/src/main/java/org/codehaus/groovy/vmplugin/v8/Java8.java
index ca32a69..b9e93f2 100644
--- a/src/main/java/org/codehaus/groovy/vmplugin/v8/Java8.java
+++ b/src/main/java/org/codehaus/groovy/vmplugin/v8/Java8.java
@@ -385,6 +385,9 @@ public class Java8 implements VMPlugin {
         if (value instanceof Class)
             return new ClassExpression(ClassHelper.makeWithoutCaching((Class<?>)value));
 
+        if (value instanceof Enum)
+            return new PropertyExpression(new ClassExpression(ClassHelper.makeWithoutCaching(value.getClass())), value.toString());
+
         if (value.getClass().isArray()) {
             ListExpression elementExprs = new ListExpression();
             int len = Array.getLength(value);