Skip to content

Commit

Permalink
Reinstate WrapperMethod for visibility changes. Fixes #4272.
Browse files Browse the repository at this point in the history
This was introduced via a fix for #3869, to update impl class so
that transplanted methods would super correctly. However, this
logic - which does not want a new impl class - got caught up. The
fix here reverts to using WrapperMethod for now, until we start
managing visibilty more like MRI or come up with a better fix.
  • Loading branch information
headius committed Nov 9, 2016
1 parent cb5a7be commit f2f6c54
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/src/main/java/org/jruby/RubyModule.java
Expand Up @@ -82,6 +82,7 @@
import org.jruby.internal.runtime.methods.Scoping;
import org.jruby.internal.runtime.methods.SynchronizedDynamicMethod;
import org.jruby.internal.runtime.methods.UndefinedMethod;
import org.jruby.internal.runtime.methods.WrapperMethod;
import org.jruby.ir.IRClosure;
import org.jruby.ir.IRMethod;
import org.jruby.ir.runtime.IRRuntimeHelpers;
Expand Down Expand Up @@ -1780,10 +1781,7 @@ public void exportMethod(String name, Visibility visibility) {
if (this == method.getImplementationClass()) {
method.setVisibility(visibility);
} else {
// FIXME: Why was this using a FullFunctionCallbackMethod before that did callSuper?
DynamicMethod newMethod = method.dup();
newMethod.setImplementationClass(this);
newMethod.setVisibility(visibility);
DynamicMethod newMethod = new WrapperMethod(this, method, visibility);

methodLocation.addMethod(name, newMethod);
}
Expand Down

0 comments on commit f2f6c54

Please sign in to comment.