YAML does not properly reinitializes self references in Array
-------------------------------------------------------------
Key: JRUBY-5575
URL: http://jira.codehaus.org/browse/JRUBY-5575
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.6RC3
Environment: JRuby 1.6RC3 in 1.9 mode
Ubuntu 10.04 LTS
2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 21:21:01 UTC 2011 i686 GNU/Linux
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.5) (6b20-1.9.5-0ubuntu1~10.04.1)
OpenJDK Server VM (build 19.0-b09, mixed mode)
Reporter: Robert Pankowecki
Assignee: Thomas E Enebo
JRuby 1.6RC3 in 1.9 :
require 'yaml'
class Foo
attr_accessor :nodes
def initialize
self.nodes = [self]
end
end
x = Foo.new
dump = YAML::dump(x)
y = YAML::load(dump)
=> #<Foo:0x56acfa @nodes=[nil]>
MRI:
ruby-1.9.2-p136 :011 > y = YAML::load(dump)
#<Foo:0x94e961c @nodes=[#<Foo:0x94e961c ...>]>
As you can see @nodes should contain an instance of Foo but it does not.
The generated dump looks good but is not loaded properly.
--
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