« Return to Thread: Problems reading Java Hashtables from Jruby 1.3.1

Problems reading Java Hashtables from Jruby 1.3.1

by Guillermo Acilu-2 :: Rate this Message:

Reply to Author | View in Thread

Problems reading Java Hashtables from Jruby 1.3.1 Hello guys,

I am having a big problem and it looks like a bug in jruby.

I have two java hash tables: hash1 and hash2. Both hashes have the same key but different data. Both hashes are generated in Java classes executed from Ruby code. Then I need to read a process both hashes within the ruby code, so I do the following:

hash1.each { |key, data|
   puts hash2
    puts hash2[key]
}

All the first puts print the complete list of key/value pairs without any problems. The second line is NIL. Why?

Thanks in advance,

GA

 « Return to Thread: Problems reading Java Hashtables from Jruby 1.3.1