[ https://issues.apache.org/jira/browse/GROOVY-11294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811533#comment-17811533 ]
ASF GitHub Bot commented on GROOVY-11294: ----------------------------------------- eric-milles commented on PR #2044: URL: https://github.com/apache/groovy/pull/2044#issuecomment-1913181493 Adding reliance on the runtime library (`InvokerHelper` and `VMPlugin`) means a record can no longer be tagged `@POJO` and used in a vanilla java environment. And though an immutable retval could be cached, it isn't here. So what is the primary benefit? It looks like a pound of cure for an ounce of problem. > Make generated toList() and toMap() methods on records return immutable > collections > ----------------------------------------------------------------------------------- > > Key: GROOVY-11294 > URL: https://issues.apache.org/jira/browse/GROOVY-11294 > Project: Groovy > Issue Type: Improvement > Components: record > Affects Versions: 5.x > Reporter: Oscar N > Priority: Minor > > With records having strong immutability guarantees, I believe it would make > sense to also have the collections returned by `toList()` and `toMap()` be > immutable as well. -- This message was sent by Atlassian Jira (v8.20.10#820010)