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



##########
File path: src/main/java/groovy/lang/GString.java
##########
@@ -276,4 +309,16 @@ public Pattern negate() {
     public byte[] getBytes(String charset) throws UnsupportedEncodingException 
{
         return toString().getBytes(charset);
     }
+
+    private boolean checkValuesImmutable() {
+        for (Object value : values) {
+            if (null == value) continue;
+            if (!(IMMUTABLE_TYPE_LIST.contains(value.getClass())

Review comment:
       enum's `toString` may return different string literal for each time they 
are called, e.g.
   ```groovy
   enum Color {
       RED, GREEN, BLUE
       
       String toString() {
           return "${new Date()}"
       }
   }
   println Color.RED
   ```




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to