Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 383b4f9

Browse files
committed
Add explanatory comment from @grddev.
[ci skip]
1 parent 9ab1620 commit 383b4f9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/rspec/support/method_signature_verifier.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,13 @@ def classify_parameters
173173
end
174174
end
175175

176-
# JRuby used to always report -1 arity for Java proxy methods
176+
# JRuby used to always report -1 arity for Java proxy methods.
177+
# The workaround essentially makes use of Java's introspection to figure
178+
# out matching methods (which could be more than one partly because Java
179+
# supports multiple overloads, and partly because JRuby introduces
180+
# aliases to make method names look more Rubyesque). If there is only a
181+
# single match, we can use that methods arity directly instead of the
182+
# default -1 arity.
177183
if Java::JavaLang::String.instance_method(:char_at).arity == -1
178184
class MethodSignature < remove_const(:MethodSignature)
179185
private

0 commit comments

Comments
 (0)