All -
I'm trying to get a particular constructor overload in order to call it. The one I want takes a byte [] as its sole parameter.
For some reason, the 'constructor' method doesn't find it, but iterating over the list returned by 'constructors' and checking the params myself works:
byte_array_class = java.lang.Class.forName('[B')
# This doesn't find the constructor:
constructor = Message.java_class.constructor(byte_array_class)
# But this does!:
constructor = Message.java_class.constructors.detect do |c|
c.parameter_types == [byte_array_class]
end
Anyone have any idea why the first approach doesn't work?
- Keith