JRuby can't access nested Java classes if those classes aren't valid ruby
constants (i.e., start with a lowercase letter)
-------------------------------------------------------------------------------------------------------------------------
Key: JRUBY-4666
URL: http://jira.codehaus.org/browse/JRUBY-4666
Project: JRuby
Issue Type: Bug
Components: Embedding
Affects Versions: JRuby 1.4
Environment: Seen on Android using Ruboto IRB containing JRuby 1.4,
attempting to include standard Android resources e.g.
android.R.layout.simple_list_item_1
Reporter: Scott Moyer
Priority: Minor
java_import android.R # works fine
R::layout # Layout is the nested class) undefined method
R::Layout " constant missing
I ran a test by adding two nested classes to an object that I control:
public class test1 {
public static final int test11 = 1;
}
public class Test2 {
public static final int test22 = 2;
}
Loaded this onto a device, and ran the following code:
java_import org.jruby.ruboto.IRB # loads the class
IRB::test1 # => undefined method test 1
IRB::Test1 # => constant_missing
IRB::Test2 # => Jave::OrgJrubyRuboto::IRB::Test2 (returns the class as
expected)
IRB::Test2::test22 # => 2
I'm not sure if there is another way to get to the class test1, or perhaps it's
there under another name format. My guess is that it will have to be forced
into a valid ruby constant (probably Test1).
--
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