Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c827260

Browse files
committedJan 25, 2018
Attempt to remove WrapperMethod again.
1 parent 82fe95d commit c827260

File tree

4 files changed

+9
-123
lines changed

4 files changed

+9
-123
lines changed
 

‎core/src/main/java/org/jruby/RubyMethod.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.jruby.internal.runtime.methods.DynamicMethod;
3838
import org.jruby.internal.runtime.methods.IRMethodArgs;
3939
import org.jruby.internal.runtime.methods.ProcMethod;
40-
import org.jruby.internal.runtime.methods.WrapperMethod;
4140
import org.jruby.runtime.ArgumentDescriptor;
4241
import org.jruby.runtime.Block;
4342
import org.jruby.runtime.ClassIndex;
@@ -252,7 +251,7 @@ public IRubyObject inspect() {
252251
RubyModule definedClass;
253252
RubyModule mklass = originModule;
254253

255-
if (method instanceof AliasMethod || method instanceof WrapperMethod) {
254+
if (method instanceof AliasMethod) {
256255
definedClass = method.getRealMethod().getDefinedClass();
257256
}
258257
else {

‎core/src/main/java/org/jruby/RubyModule.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
import org.jruby.internal.runtime.methods.ProcMethod;
8080
import org.jruby.internal.runtime.methods.SynchronizedDynamicMethod;
8181
import org.jruby.internal.runtime.methods.UndefinedMethod;
82-
import org.jruby.internal.runtime.methods.WrapperMethod;
8382
import org.jruby.ir.IRClosure;
8483
import org.jruby.ir.IRMethod;
8584
import org.jruby.ir.runtime.IRRuntimeHelpers;
@@ -1838,7 +1837,7 @@ public void exportMethod(String name, Visibility visibility) {
18381837
if (this == method.getImplementationClass()) {
18391838
method.setVisibility(visibility);
18401839
} else {
1841-
DynamicMethod newMethod = new WrapperMethod(this, method, visibility);
1840+
DynamicMethod newMethod = new AliasMethod(this, visibility, method);
18421841

18431842
methodLocation.addMethod(name, newMethod);
18441843
}

‎core/src/main/java/org/jruby/internal/runtime/methods/AliasMethod.java

+7
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.jruby.runtime.Arity;
3535
import org.jruby.runtime.Block;
3636
import org.jruby.runtime.ThreadContext;
37+
import org.jruby.runtime.Visibility;
3738
import org.jruby.runtime.builtin.IRubyObject;
3839

3940
/**
@@ -49,6 +50,12 @@ public AliasMethod(RubyModule implementationClass, DynamicMethod oldMethod, Stri
4950
this.oldMethod = oldMethod;
5051
}
5152

53+
public AliasMethod(RubyModule implementationClass, Visibility visiblity, DynamicMethod oldMethod) {
54+
super(implementationClass, visiblity, oldMethod.getName());
55+
56+
this.oldMethod = oldMethod;
57+
}
58+
5259
@Override
5360
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name) {
5461
return oldMethod.call(context, self, klazz, name);

‎core/src/main/java/org/jruby/internal/runtime/methods/WrapperMethod.java

-119
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.