JRuby

YAML dumping or loading is mucking up object IDs

Details

  • Number of attachments :
    0

Description

Run the following snippit and see that JRuby reconstitutes the objects with the same object ID:

require 'yaml'

class YamlTest
	def initialize()
		@test = Hash.new
		@test["hello"] = "foo"
	end
end

list = Array.new
list << YamlTest.new
list << YamlTest.new
list << YamlTest.new

list.each do |x|
	p x.object_id
end

ylist = YAML.dump(list)

yamlstr = YAML.load(ylist)

yamlstr.each do |x|
	p x.object_id
end

In MRI, they come back with different IDs.

Activity

Hide
Charles Oliver Nutter added a comment -

Bumping off 1.0.2.

Show
Charles Oliver Nutter added a comment - Bumping off 1.0.2.
Hide
Ola Bini added a comment -

Fixed on trunk.

Show
Ola Bini added a comment - Fixed on trunk.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: