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

Importing static inner class does not work as expected #933

Closed
ftomassetti opened this issue Aug 1, 2013 · 1 comment
Closed

Importing static inner class does not work as expected #933

ftomassetti opened this issue Aug 1, 2013 · 1 comment

Comments

@ftomassetti
Copy link

I tried to access a static inner class:

require 'the_right_jar.jar'
import 'path.to.Outer'

Outer.inner or Outer::Inner give me an exception (undefined method or undefined constant 'Inner'

However I can import the class using JavaUtilities.get_proxy_class('path.to.Outer$Inner')

@kares
Copy link
Member

kares commented Sep 16, 2015

sorry for the very late response, but if I was to guess Inner was not a public class/interface and this is how it works in JRuby. but since in Ruby there's really no such thing as "private" I'll open another issue for having Outer::Inner feature working similar to a private_constant ...

@kares kares closed this as completed Sep 16, 2015
@kares kares added this to the Invalid or Duplicate milestone Sep 16, 2015
kares added a commit that referenced this issue Sep 16, 2015
* jruby-1_7:
  spec how non-public inner classes currently behave on the Ruby constant level (#933)
  delegate java_send with 1-3 args.length to overloaded versions - less array mangling
  [find-bugs] do no ask for getMethodsForWrite() twice esp. since its synchronized
  [find-bugs] avoid potentially creating the same File instance twice
  [find-bugs] avoid unnecessary calling getRuntime() and getCurrentContext() twice
  [find-bugs] use local map instead of calling the same method again in ScriptingContainer
  [find-bugs] avoid calling same method twice - keep module.getClass(Type) locally
  [find-bugs] avoid string concatenation while using a StringBuilder + guess size
  [find-bugs] avoid using a ternary operator to cast a boolean to true/false
  [find-bugs] inefficient string buffering - avoid passing concatenating string to builder
  [find-bugs] inner private classes can be made static
  [find-bugs] equalsIgnoreCase with "" (empty string) passed
  [find-bugs] avoid some String instances of length == 1 in favor of chars
  [find-bugs] use System.arraycopy instead of manual array-copy (of stack-traces)
  [find-bugs] (private) inner classes that can be mate static
  Fix java_implements for multiple interfaces
  Remove redundant test-jruby-jars (complete tests same stuff).
  Fix jruby versions in antlib/extra.xml.
  [build] use yecht-1.1-SNAPSHOT
  Update to jnr-ffi-2.0.4-SNAPSHOT for #3258.

Conflicts:
	.travis.yml
	antlib/extra.xml
	core/pom.xml
	core/src/main/java/org/jruby/Ruby.java
	core/src/main/java/org/jruby/RubyClassPathVariable.java
	core/src/main/java/org/jruby/RubyDir.java
	core/src/main/java/org/jruby/RubyModule.java
	core/src/main/java/org/jruby/RubyProc.java
	core/src/main/java/org/jruby/java/proxies/JavaProxy.java
	core/src/main/java/org/jruby/javasupport/JavaSupport.java
	core/src/main/java/org/jruby/runtime/ThreadContext.java
	lib/ruby/shared/jruby/compiler/java_class.rb
	spec/java_integration/jrubyc/java/implements_spec.rb
	spec/java_integration/types/retrieval_spec.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants