42
42
*/
43
43
public class AliasMethod extends DynamicMethod {
44
44
private DynamicMethod oldMethod ;
45
- private String oldName ;
46
45
47
46
public AliasMethod (RubyModule implementationClass , DynamicMethod oldMethod , String oldName ) {
48
- super (implementationClass , oldMethod .getVisibility ());
47
+ super (implementationClass , oldMethod .getVisibility (), oldName );
49
48
50
- this .oldName = oldName ;
51
49
this .oldMethod = oldMethod ;
52
50
}
53
51
54
52
@ Override
55
- public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String name ) {
56
- return oldMethod .call (context , self , klazz , oldName );
53
+ public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String unused ) {
54
+ return oldMethod .call (context , self , klazz , name );
57
55
}
58
56
59
57
@ Override
60
- public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String name , IRubyObject arg ) {
61
- return oldMethod .call (context , self , klazz , oldName , arg );
58
+ public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String unused , IRubyObject arg ) {
59
+ return oldMethod .call (context , self , klazz , name , arg );
62
60
}
63
61
64
62
@ Override
65
- public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String name , IRubyObject arg1 , IRubyObject arg2 ) {
66
- return oldMethod .call (context , self , klazz , oldName , arg1 , arg2 );
63
+ public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String unused , IRubyObject arg1 , IRubyObject arg2 ) {
64
+ return oldMethod .call (context , self , klazz , name , arg1 , arg2 );
67
65
}
68
66
69
67
@ Override
70
- public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String name , IRubyObject arg1 , IRubyObject arg2 , IRubyObject arg3 ) {
71
- return oldMethod .call (context , self , klazz , oldName , arg1 , arg2 , arg3 );
68
+ public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String unused , IRubyObject arg1 , IRubyObject arg2 , IRubyObject arg3 ) {
69
+ return oldMethod .call (context , self , klazz , name , arg1 , arg2 , arg3 );
72
70
}
73
71
74
72
@ Override
75
- public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String name , IRubyObject [] args ) {
76
- return oldMethod .call (context , self , klazz , oldName , args );
73
+ public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String unused , IRubyObject [] args ) {
74
+ return oldMethod .call (context , self , klazz , name , args );
77
75
}
78
76
79
77
@ Override
80
- public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String name , Block block ) {
81
- return oldMethod .call (context , self , klazz , oldName , block );
78
+ public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String unused , Block block ) {
79
+ return oldMethod .call (context , self , klazz , name , block );
82
80
}
83
81
84
82
@ Override
85
- public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String name , IRubyObject arg1 , Block block ) {
86
- return oldMethod .call (context , self , klazz , oldName , arg1 , block );
83
+ public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String unused , IRubyObject arg1 , Block block ) {
84
+ return oldMethod .call (context , self , klazz , name , arg1 , block );
87
85
}
88
86
89
87
@ Override
90
- public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String name , IRubyObject arg1 , IRubyObject arg2 , Block block ) {
91
- return oldMethod .call (context , self , klazz , oldName , arg1 , arg2 , block );
88
+ public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String unused , IRubyObject arg1 , IRubyObject arg2 , Block block ) {
89
+ return oldMethod .call (context , self , klazz , name , arg1 , arg2 , block );
92
90
}
93
91
94
92
@ Override
95
- public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String name , IRubyObject arg1 , IRubyObject arg2 , IRubyObject arg3 , Block block ) {
96
- return oldMethod .call (context , self , klazz , oldName , arg1 , arg2 , arg3 , block );
93
+ public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String unused , IRubyObject arg1 , IRubyObject arg2 , IRubyObject arg3 , Block block ) {
94
+ return oldMethod .call (context , self , klazz , name , arg1 , arg2 , arg3 , block );
97
95
}
98
96
99
97
@ Override
100
- public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String name , IRubyObject [] args , Block block ) {
101
- return oldMethod .call (context , self , klazz , oldName , args , block );
98
+ public IRubyObject call (ThreadContext context , IRubyObject self , RubyModule klazz , String unused , IRubyObject [] args , Block block ) {
99
+ return oldMethod .call (context , self , klazz , name , args , block );
102
100
}
103
101
104
102
public DynamicMethod dup () {
105
- return new AliasMethod (implementationClass , oldMethod , oldName );
103
+ return new AliasMethod (implementationClass , oldMethod , name );
106
104
}
107
105
108
106
@ Override
@@ -111,7 +109,7 @@ public Arity getArity(){
111
109
}
112
110
113
111
public String getOldName () {
114
- return oldName ;
112
+ return name ;
115
113
}
116
114
117
115
@ Override
0 commit comments