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 2022/01/30 20:43:24 UTC

[groovy] 02/04: 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 GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit f08dc2f59c8a915455649c81d9f70c929c1a8778
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 73b3833..6700777 100644
--- a/src/main/java/org/codehaus/groovy/vmplugin/v8/Java8.java
+++ b/src/main/java/org/codehaus/groovy/vmplugin/v8/Java8.java
@@ -399,6 +399,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);