|
|
|
Same as
I tried a fix a few weeks ago that stored non-primitive (or primitive wrapper) types in a map on the way out, and reunited them on the way back. The problem was that the map (a standard WeakHashMap) called equals() to compare objects, which sometimes caused objects to be mated with the wrong proxies. Will try again with a map that compares using ==. I'll have a couple of extra days over the holidays, will get to it then. -Bill BTW (just saw Ola's message), the re-wrapping happens in Java.new_instance_for, so there is a single point to catch that. I don't have access to my code right now (on my other computer), but there is also a single point to catch objects on the way out. My fix also gets rid of the JavaObject cache, which serves no purpose.
Where do we stand on this one, gents?
Fixed by recent JI work. Test case now runs as expected.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The argument is converted. The instanceof RubyObject is NOT a Runnable - instead, it's got a proxy inside of it that is unwrapped for the Java method call, and then rewrapped on the way out. The problem is that the rewrapping is really all over the place, so there is no obvious place to keep the association between what goes in and what goes out. But this is really a critical issue - I would imagine that everything that goes in through Java Integration would come out in the same way, not be a totally new thing that doesn't have the same class, the same methods, the same instance variables.
This is seriously broken and needs to be fixed. I'm sad to say the fix would be too large for 1.1. At least in my opinion.
Bill?