Become_java! does behave differently between jruby-1.5.x and jruby-1.6.0.RCX

the following snippet works nice in jruby-1.5.6 and this allows to use
such classes in libraries (hibernate) which load the classes from the
context_classloader. with 1.6.0 the classname changed from ruby.A to
rubyobj.A and cannot be found with the context classloader. bug or
feature ? how can I achieve the same functionality with 1.6.0 again ?

require ‘jruby/core_ext’

class A; end

#make a java class out of the ruby class
AA = A.become_java!
p AA.get_name

load the java class from the classloader

cl = java.lang.Thread.current_thread.getContextClassLoader
p cl.load_class AA.get_name

thanx in advance, Kristian

I would say so since it breaks existing code :wink: Kristian

On Mon, Mar 7, 2011 at 3:42 PM, Piotr Gęga [email protected] wrote:

linkedin: http://pl.linkedin.com/in/piotrgega
goldenline: http://www.goldenline.pl/piotr-gega


Kristian Meier + Sanuka Meier
Vadakkethu House,
Edayanmula West PO - 689532,
Pathanamthitta District, Kerala, INDIA

tel: +91 468 2319577

protect your privacy while searching the net: www.ixquick.com

         _=_
       q(-_-)p
        '_) (_`
        /__/  \
     _(<_   / )_
  (__\_\_|_/__)