Share your thoughts in the 2024 State of Clojure Survey!

Welcome! Please see the About page for a little more info on how this works.

0 votes
in java.jmx by

The {{clojure.java.jmx/invoke}} function invokes the first method it finds with a matching name, even if that method's signature does not match the type or number of arguments passed to {{invoke}}.

The correct usage is to call {{invoke-signature}}, explicitly specifying which method signature to call.

{{invoke}} could theoretically examine its arguments and guess the correct signature to call. But without that, it is better to have it throw an exception when the method overloading is ambiguous, instead of just taking the first signature.

3 Answers

0 votes
by

Comment made by: stuart.sierra

This appears to be fixed already on {{master}} but not included in a release.

0 votes
by

Comment made by: stuart.sierra

No, it hasn't been fixed. Commit b76f33a improves the situation but it can still occur.

0 votes
by
Reference: https://clojure.atlassian.net/browse/JMX-12 (reported by stuart.sierra)
...