Adding comment to a single node ends up adding it to every node
---------------------------------------------------------------
Key: JRUBY-3603
URL: http://jira.codehaus.org/browse/JRUBY-3603
Project: JRuby
Issue Type: Bug
Components: Parser
Affects Versions: JRuby 1.2
Reporter: Chris Williams
Assignee: Thomas E Enebo
Attachments: jruby_1.2.0_node_comments.patch
The implementation of addComment on Node class results in adding the comment to
a shared static list. The shared static list is meant to be an untouchable
empty list shared across all nodes not containing comments (99.9% of them) I'm
assuming for memory reasons. The issue is that the addComment implementation
checks the ISourcePosition's comment list for null, not against this shared
empty list as well, so comments are getting added to this globally shared list
and then all nodes that were supposed to have no comments have the same
comments.
Attached is the simple fix: check the local comment list for null and against
the global empty list. If either, then lazily generate a new list for this node
and it's potion and then add the comments to it.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email