This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -180,13 +180,19 @@ def classify_parameters
180
180
# aliases to make method names look more Rubyesque). If there is only a
181
181
# single match, we can use that methods arity directly instead of the
182
182
# default -1 arity.
183
+ #
184
+ # This workaround only works for Java proxy methods, and in order to
185
+ # support regular methods and blocks, we need to be careful about calling
186
+ # owner and java_class as they might not be available
183
187
if Java ::JavaLang ::String . instance_method ( :char_at ) . arity == -1
184
188
class MethodSignature < remove_const ( :MethodSignature )
185
189
private
186
190
187
191
def classify_parameters
188
192
super
189
- return unless @method . arity == -1 && @method . owner . respond_to? ( :java_class )
193
+ return unless @method . arity == -1
194
+ return unless @method . respond_to? ( :owner )
195
+ return unless @method . owner . respond_to? ( :java_class )
190
196
java_instance_methods = @method . owner . java_class . java_instance_methods
191
197
compatible_overloads = java_instance_methods . select do |java_method |
192
198
@method == @method . owner . instance_method ( java_method . name )
You can’t perform that action at this time.
0 commit comments