Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#name method on java classes strips the outer class #1117

Closed
wdomburg opened this Issue Oct 11, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@wdomburg
Copy link

wdomburg commented Oct 11, 2013

irb(main):002:0> Java::ComZimbraCsZclient::ZMessage::ZMimePart.name
=> "Java::ComZimbraCsZclient::ZMimePart"
irb(main):003:0> Java::ComZimbraCsZclient::ZMimePart.name
NameError: cannot load Java class com.zimbra.cs.zclient.ZMimePart
        from org/jruby/javasupport/JavaClass.java:1227:in `for_name'
        from org/jruby/javasupport/JavaUtilities.java:34:in `get_proxy_class'
        from file:/opt/jruby-1.7.2/lib/jruby.jar!/jruby/java/java_package_module_template.rb:4:in `const_missing'
        from (irb):3:in `evaluate'
        from org/jruby/RubyKernel.java:1066:in `eval'
        from org/jruby/RubyKernel.java:1392:in `loop'
        from org/jruby/RubyKernel.java:1174:in `catch'
        from org/jruby/RubyKernel.java:1174:in `catch'
        from /opt/jruby/bin/jirb:13:in `(root)'
irb(main):004:0> Java::ComZimbraCsZclient::ZMessage::ZMimePart.java_class
=> class com.zimbra.cs.zclient.ZMessage$ZMimePart
@headius

This comment has been minimized.

Copy link
Member

headius commented Oct 21, 2013

More specifically, this affects inner classes; they do not show the outer class in their #name, which causes errors if you attempt to use that name to access them.

In the reported case, the name should be Java::ComZimbraCsZclient::ZMessage::ZMimePart.

@headius headius closed this in 58c6a27 Oct 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.