History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-1471
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Ola Bini
Reporter: Charles Oliver Nutter
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JRuby

YAML dumping or loading is mucking up object IDs

Created: 25/Oct/07 08:46 AM   Updated: 22/Dec/07 06:26 AM
Component/s: Core Classes/Modules
Affects Version/s: JRuby 1.0.1
Fix Version/s: JRuby 1.0.3, JRuby 1.1RC2

Time Tracking:
Not Specified


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Charles Oliver Nutter - 30/Oct/07 11:18 AM
Bumping off 1.0.2.

Ola Bini - 28/Nov/07 06:19 AM
Fixed on trunk.