You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2023/08/29 18:51:00 UTC
[jira] [Commented] (GROOVY-10861) ListHashMap is not thread-safe
[ https://issues.apache.org/jira/browse/GROOVY-10861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17760102#comment-17760102 ]
Eric Milles commented on GROOVY-10861:
--------------------------------------
I added {{NodeMetaDataHandler#newMetaDataMap}} so that I can provide a synchronized map. https://github.com/apache/groovy/commit/6953697ca27d69bf03271c83cd22348dfc58ea5f
> ListHashMap is not thread-safe
> ------------------------------
>
> Key: GROOVY-10861
> URL: https://issues.apache.org/jira/browse/GROOVY-10861
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
>
> {{org.codehaus.groovy.util.ListHashMap}} is used for AST node metadata. It is not thread-safe when managing the low-size parallel arrays and size counter. If a tool is causing insertion and removal of the same node -- one example of this is in {{StaticTypesMethodReferenceExpressionWriter#writeMethodReferenceExpression}} which stuffs some state in a {{MethodNode}} -- in multiple threads the arrays can get out-of-sync. This resulted in {{NullPointerExceptions}} for me.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)