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

some array factories do not work #2749

Closed
kares opened this issue Mar 24, 2015 · 1 comment
Closed

some array factories do not work #2749

kares opened this issue Mar 24, 2015 · 1 comment

Comments

@kares
Copy link
Member

kares commented Mar 24, 2015

  • proxy class new_array :
jruby-1.7.19 :049 > arr = java.lang.String.new_array 1
 => #<Java::JavaLang::String:0x5087e6b4> 
jruby-1.7.19 :050 > arr
 => #<Java::JavaLang::String:0x5087e6b4> 
jruby-1.7.19 :051 > arr.length
TypeError: for method String.length expected []; got: []; error: object is not an instance of declaring class
    from (irb):51:in `evaluate'
    from org/jruby/RubyKernel.java:1107:in `eval'
    from org/jruby/RubyKernel.java:1507:in `loop'
    from org/jruby/RubyKernel.java:1270:in `catch'
    from org/jruby/RubyKernel.java:1270:in `catch'
    from /opt/local/rvm/rubies/jruby-1.7.19/bin/jirb:13:in `(root)'
  • proxy creator's [] for multi-dimensional arrays :
jruby-1.7.19 :054 >   Java::int[1]
 => #<ArrayJavaProxyCreator:0x6c2a4727> 
jruby-1.7.19 :055 > Java::int[1][2]
NoMethodError: undefined method `[]' for #<ArrayJavaProxyCreator:0x66406fee>
    from (irb):55:in `evaluate'
    from org/jruby/RubyKernel.java:1107:in `eval'
    from org/jruby/RubyKernel.java:1507:in `loop'
    from org/jruby/RubyKernel.java:1270:in `catch'
    from org/jruby/RubyKernel.java:1270:in `catch'
    from /opt/local/rvm/rubies/jruby-1.7.19/bin/jirb:13:in `(root)'
@kares kares self-assigned this Mar 24, 2015
@kares kares added this to the JRuby 1.7.20 milestone Mar 24, 2015
kares added a commit to kares/jruby that referenced this issue Mar 24, 2015
kares added a commit to kares/jruby that referenced this issue Mar 26, 2015
kares added a commit to kares/jruby that referenced this issue Mar 26, 2015
* jruby-1_7: (34 commits)
  test `[].copy_data` addon - also added alias so it can be used with 2 args as well
  cleanup and add tests from Java array addons ...  seems a litle strange
  move Java array assertions around from equality test
  should override proxy implemented call() with block as well
  export void early on with other (primitives) and test it's behaviour
  DRY-up interface-template impl ... (extracted some anonymous into inner classes)
  handle nested array.to_java conversion where element is already an array + cleanup
  implement array.component_type helper on the Ruby side + test how [].to_java works
  fix array factories `Java::int[1][2].new` as well as `Java::byte.new_array(3)` (jruby#2749)
  unify and test the no-matching-callable raised error messages / hints
  handle yet another unnecessary "ambiguous Java methods found" warning
  add a JI test - setting a security manager created in Ruby
  use `getArity()` in favor of `getParameterTypes().length`
  use IntHashMap as callable cache for `__jcreate!` method and share a new-cache helper
  the intention here was to "use the lowest-arity non-overload" and we're finally there!
  as (most) Java invokers will not have overrides - they won't use the internal cache ... for loading up JRuby's built-in JI classes this saves up allocating > 2100 maps
  explicit inspect() method for JavaProxyConstructor + annotate with JRubyClass
  a working inspect for Java proxy methods
  empty class array count-- and make sure correct name is annotated with @JRubyClass
  JavaProxyClass - use toRubyArray + delay resolving constructors + re-arrange internals
  ...

Conflicts:
	core/pom.xml
	core/src/main/java/org/jruby/java/invokers/StaticMethodInvoker.java
	core/src/main/java/org/jruby/javasupport/JavaMethod.java
	core/src/main/java/org/jruby/javasupport/JavaSupport.java
	core/src/main/java/org/jruby/javasupport/JavaUtil.java
	test/test_higher_javasupport.rb
kares added a commit to kares/jruby that referenced this issue Mar 26, 2015
* jruby-1_7: (35 commits)
  align added JavaSupport method name with convention
  test `[].copy_data` addon - also added alias so it can be used with 2 args as well
  cleanup and add tests from Java array addons ...  seems a litle strange
  move Java array assertions around from equality test
  should override proxy implemented call() with block as well
  export void early on with other (primitives) and test it's behaviour
  DRY-up interface-template impl ... (extracted some anonymous into inner classes)
  handle nested array.to_java conversion where element is already an array + cleanup
  implement array.component_type helper on the Ruby side + test how [].to_java works
  fix array factories `Java::int[1][2].new` as well as `Java::byte.new_array(3)` (jruby#2749)
  unify and test the no-matching-callable raised error messages / hints
  handle yet another unnecessary "ambiguous Java methods found" warning
  add a JI test - setting a security manager created in Ruby
  use `getArity()` in favor of `getParameterTypes().length`
  use IntHashMap as callable cache for `__jcreate!` method and share a new-cache helper
  the intention here was to "use the lowest-arity non-overload" and we're finally there!
  as (most) Java invokers will not have overrides - they won't use the internal cache ... for loading up JRuby's built-in JI classes this saves up allocating > 2100 maps
  explicit inspect() method for JavaProxyConstructor + annotate with JRubyClass
  a working inspect for Java proxy methods
  empty class array count-- and make sure correct name is annotated with @JRubyClass
  ...

Conflicts:
	core/pom.xml
	core/src/main/java/org/jruby/java/invokers/StaticMethodInvoker.java
	core/src/main/java/org/jruby/javasupport/JavaMethod.java
	core/src/main/java/org/jruby/javasupport/JavaSupport.java
	core/src/main/java/org/jruby/javasupport/JavaUtil.java
	test/test_higher_javasupport.rb
@kares
Copy link
Member Author

kares commented Mar 26, 2015

working since 55a98cc

@kares kares closed this as completed Mar 26, 2015
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

1 participant