Can't reopen java module and add new nested classes or modules
--------------------------------------------------------------
Key: JRUBY-5626
URL: http://jira.codehaus.org/browse/JRUBY-5626
Project: JRuby
Issue Type: Bug
Components: Java Integration
Affects Versions: JRuby 1.6
Environment: Windows
Reporter: Jeff Solomon
Priority: Minor
Hi,
First off, thanks to the JRuby folks! We're switching over from MRI Ruby and
have been happy with everything we're seeing. We're a Windows shop and we have
1.6 installed.
Here is our issue. I searched the docs and the current bug database and I
couldn't find an answer to this question.
We have our own java in jars. The pacakge path is something like
'com.mycompany.foo'. Underneath this package path would be our java classes
like Bar or Baz.
In my jruby file, I say:
require 'mycompany-foo.jar'
Foo = 'com.mycompany.foo'
so that I can say 'Foo::Bar' or 'Foo::Baz'. I don't say:
java_import 'com.mycompany.foo.bar'
Bar...
because I want everything prefixed with Foo::.
OK, so far so good. The problem arises when I want to reopen the Foo module and
nest other ruby modules and classes underneath it that don't exist in java.
Because you can reopen and modify pre-existing java classes, I would think that
this would be supported. I cannot, for example, say:
module Foo::Biff
end
or:
class Foo::Bonk
end
Both of the above declaration cause jruby to look for the eponymously named
class in java, which of course doesn't exist.
Is what I'm trying to do actively unsupported? an oversight and therefore a
bug? bad style?
Thanks!
Jeff
--
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