strange YAML::load behaviour
----------------------------

                 Key: JRUBY-2323
                 URL: http://jira.codehaus.org/browse/JRUBY-2323
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1RC3
            Reporter: Jaroslav Libak


I discovered that if I try to create instance from YAML for my custom class 
that doesn't inherit from jruby built in classes, it can be converted back to 
original type.
But if my custom class inherits from built in jruby classes for example 
Exception or String, when I deserialize YAML, I get PrivateType.

require 'yaml'

class Test1
end

class Test2 < Test1
end

puts YAML::load(Test2.new.to_yaml)
#<Test2:0x14f5021>

but:

class Test3 < Exception
end

puts YAML::load(Test3.new.to_yaml)
#<YAML::PrivateType:0xa0ebc2>

If Exception is swapped with String, it doesn't work either.

I need to be able to deserialize class of unknown name that is inherited from 
Exception, and throw it as an exception.


-- 
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


Reply via email to