I'm calling com.rabbitmq.client.ConnectionFactory.newConnection(Address[]) from Clojure 1.4.0, as follows:
(defn connect [#^ConnectionFactory factory, addrs]
(.newConnection factory (into-array Address addrs)))
The call works, but it throws a reflection warning:
call to newConnection can't be resolved.
Reflecting on the ConnectionFactory class, there clearly is a form which takes only a single argument of type com.rabbitmq.client.Address[], and this is exactly what (into-array Address ()) is returning:
com.mefesto.wabbitmq=> (pprint (filter #(.. (.toString %)
(contains "newConnection"))
(seq (.getDeclaredMethods
ConnectionFactory))))
(#<Method public com.rabbitmq.client.Connection
com.rabbitmq.client.ConnectionFactory.newConnection(
com.rabbitmq.client.Address[])
throws java.io.IOException>
#<Method public com.rabbitmq.client.Connection
com.rabbitmq.client.ConnectionFactory.newConnection(
java.util.concurrent.ExecutorService,
com.rabbitmq.client.Address[])
throws java.io.IOException>
#<Method public com.rabbitmq.client.Connection
com.rabbitmq.client.ConnectionFactory.newConnection()
throws java.io.IOException>
#<Method public com.rabbitmq.client.Connection
com.rabbitmq.client.ConnectionFactory.newConnection(
java.util.concurrent.ExecutorService)
throws java.io.IOException>)
com.mefesto.wabbitmq=> (into-array Address ())
#<Address[] [Lcom.rabbitmq.client.Address;@953235f>
What do I need to do to avoid reflection here?