Fix missing callMethod override#4642
Fix missing callMethod override#4642headius merged 1 commit intojruby:masterfrom Talkdesk:fix-missing-callmethod-override
Conversation
Although not used by default, the Reificator class at https://github.com/jruby/jruby/blob/9.1.10.0/core/src/main/java/org/jruby/RubyClass.java#L1583 checks which version of callMethod it should use, and needs all three versions: no argument, one argument, and more than one argument. One of these overrides did not exist, and thus would result on a ``` java.lang.NoSuchMethodError: rubyobj.BrokenReify.callMethod( Ljava/lang/String;Lorg/jruby/runtime/builtin/IRubyObject;) Lorg/jruby/runtime/builtin/IRubyObject; ``` when running an example with -Xreify.classes=true ```ruby class BrokenReify def initialize_copy(other) super end end puts BrokenReify.new.clone ``` With this fix, the above example starts instead giving a java.lang.StackOverflowError due to another bug/bad interaction of the reify.classes option, which I'll report separately. Issue #4444
|
👍 was lately thinking about what needs to be done for |
|
also this could than incorporate a test such as the one mentioned in the desc. |
|
I plan to open a separate issue, but when I was looking at the code today to debug this I ended up discovering that
I believe that just having 1) would be extremely valuable. Double so if it was enabled by default. On the other hand, 2) seems to be what mostly limits this feature, and actually is what makes the test above enter an infinite recursion: |
|
This change is good and I'll merge it. We'll continue discussions about fixing/improving reification in other bugs like #4643. |
Although not used by default, the Reificator class at https://github.com/jruby/jruby/blob/9.1.10.0/core/src/main/java/org/jruby/RubyClass.java#L1583 checks which version of callMethod it should use, and needs all three versions: no argument, one argument, and more than one argument.
One of these overrides did not exist, and thus would result on a
when running an example with -Xreify.classes=true
With this fix, the above example starts instead giving a java.lang.StackOverflowError due to another bug/bad interaction of the reify.classes option, which I'll report separately.
Issue #4444