Hello List,
I am having problems with jrubyc.
It might be a bug.
I wrote this file:
#!/usr/bin/env jruby
my_class.rb
require ‘java’
class MyClass
def my_fnc(a, b, c)
end
end
I ran jrubyc:
a@z2:/pt/z2/api$
a@z2:/pt/z2/api$ jrubyc --javac my_class.rb
Generating Java class MyClass to /pt/z2/api/MyClass.java
javac -d /pt/z2/api -cp /pt/z2/jruby151/lib/jruby.jar:.
/pt/z2/api/MyClass.java
a@z2:/pt/z2/api$
a@z2:/pt/z2/api$
Then I edited the file and added a 4th argument to method: my_func()
I see this:
a@z2:/pt/z2/api$
a@z2:/pt/z2/api$ cat my_class.rb
#!/usr/bin/env jruby
my_class.rb
require ‘java’
class MyClass
def my_fnc(a, b, c, d)
end
end
a@z2:/pt/z2/api$
a@z2:/pt/z2/api$
a@z2:/pt/z2/api$ jrubyc --javac my_class.rb
Generating Java class MyClass to /pt/z2/api/MyClass.java
javac -d /pt/z2/api -cp /pt/z2/jruby151/lib/jruby.jar:.
/pt/z2/api/MyClass.java
/pt/z2/api/MyClass.java:75: cannot find symbol
symbol : method
invoke(org.jruby.runtime.ThreadContext,MyClass,java.lang.String,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.builtin.IRubyObject)
location: class org.jruby.javasupport.util.RuntimeHelpers
IRubyObject ruby_result =
RuntimeHelpers.invoke(ruby.getCurrentContext(), this, “my_fnc”,
ruby_a, ruby_b, ruby_c, ruby_d);
^
1 error
a@z2:/pt/z2/api$
a@z2:/pt/z2/api$
a@z2:/pt/z2/api$
Then I edited the file and removed the 4th argument from the method:
my_func()
I see this:
a@z2:/pt/z2/api$
a@z2:/pt/z2/api$
a@z2:/pt/z2/api$ cat my_class.rb
#!/usr/bin/env jruby
my_class.rb
require ‘java’
class MyClass
def my_fnc(a, b, c)
end
end
a@z2:/pt/z2/api$
a@z2:/pt/z2/api$
a@z2:/pt/z2/api$ jrubyc --javac my_class.rb
Generating Java class MyClass to /pt/z2/api/MyClass.java
javac -d /pt/z2/api -cp /pt/z2/jruby151/lib/jruby.jar:.
/pt/z2/api/MyClass.java
a@z2:/pt/z2/api$
a@z2:/pt/z2/api$
a@z2:/pt/z2/api$
So, it looks like jrubyc prevents me from having more than 3 arguments
in my function definition.
Here is my JRuby version:
a@z2:/pt/z2/api$
a@z2:/pt/z2/api$ jruby --version
jruby 1.5.1 (ruby 1.8.7 patchlevel 249) (2010-06-06 f3a3480) (Java
HotSpot™ Client VM 1.6.0_21) [i386-java]
a@z2:/pt/z2/api$
a@z2:/pt/z2/api$
I see this behavior on both my Linux box and my Mac.
Is this a known bug?
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email