When calling methods in java from jruby where the same method has multiple signatures, it would be useful to have a way to pass a "typed" null object.
For example if I have 2 methods in java:
doSomething(Frame f, int i)
doSomething(Component c, int i)
and I want to make sure I call the second method but with a null component then in java I do this:
But in jruby I haven't found a convinient way to do this. My current solution is to use reflection something like this:
method = obj.java_class.declared_method(:doSomething, Component, int)
method.invoke( obj, Java.primitive_to_java(nil), 0 )
If instead there was something like a null method on wrapped java classes this would be much nicer:
The null method could return an special object that the jruby Java method finding code could use to find the correct method in java.