Cannot call a method called "public" on a Java object
-----------------------------------------------------
Key: JRUBY-4198
URL: http://jira.codehaus.org/browse/JRUBY-4198
Project: JRuby
Issue Type: Bug
Components: Java Integration
Affects Versions: JRuby 1.4.0RC3
Reporter: Trejkaz
As posted on the mailing list, I found this when constructing a test case for
other reasons:
{code}
shard:jruby trejkaz$ cat A.java
public class A {
public String getPublic() {
return "public";
}
public String getPublic1() {
return "public";
}
}
shard:jruby trejkaz$ javac A.java
shard:jruby trejkaz$ jar cf a.jar A.class
shard:jruby trejkaz$ java -jar jruby-complete-1.4.0RC3.jar -S irb
irb(main):001:0> require 'a.jar'
=> true
irb(main):002:0> include_class 'A'
=> ["A"]
irb(main):003:0> a = A.new
=> #<Java::Default::A:0x39060b>
irb(main):004:0> a.public
NoMethodError: undefined method `public' for #<Java::Default::A:0x39060b>
from (irb):5
irb(main):005:0> a.public1
=> "public"
irb(main):006:0>
{code}
As 'public' is neither a method on Java objects nor Ruby objects (though it is
one on Ruby modules), it probably should be permitted in this particular
context.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email