It's because of the lazy loading of methods!!! Huzzah! I knew this one would come around to bite us eventually.
Because we rely on method_missing to trigger Java methods to be loaded, if Object has a method that we want to use in an included Java class, we'll never reach it. We will search all the way to the top of the JavaProxy's hierarchy and eventually find the real method before we ever trigger method_missing.
SO. We need to fix it. The solution Tom and I kicked around was to take the list of methods from the Java class and load some faux methods into the list, so that "methods" returns an appropriate list and so that we don't depend on method_missing tricks. When we do actually call those methods, we'll prime them then.
Until then I'm not sure there's an easy fix...
- Charlie
On 3/14/06, David Corbin <[EMAIL PROTECTED]
> wrote:
The arity for list.add is coming from ModA#add, without any real reason to be.
I'm not sure if this is "special case for the 'default' object", or not.
---cut----
require 'java'
include_class 'java.util.ArrayList'
module ModA
def add a,b,c
end
end
include ModB
list = ArrayList.new
list.add "Foo"
---end---
--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ jruby.sourceforge.net
Application Architect @ www.ventera.com
