NullPointerException when converting an Array of Ruby that includes an instance 
of java primitive class.
--------------------------------------------------------------------------------------------------------

                 Key: JRUBY-2671
                 URL: http://jira.codehaus.org/browse/JRUBY-2671
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.1.2
         Environment: ruby 1.8.6 (2008-05-28 rev 6586) [i386-jruby1.1.2]


            Reporter: Tooru TAKAHASHI
            Assignee: Thomas E Enebo


NullPointerException when running next script:
{code}
require 'java'

java.util.ArrayList.new([java.lang.Integer.new(1)])
{code}

{quote}
% jruby-1.1.2/bin/jruby -rjava -e 
'java.util.ArrayList.new([java.lang.Integer.new(1)])'
java.lang.NullPointerException
        at org.jruby.javasupport.JavaUtil.primitiveToWrapper(JavaUtil.java:426)
        at org.jruby.javasupport.JavaUtil.convertArgument(JavaUtil.java:465)
        at org.jruby.javasupport.JavaUtil.convertRubyToJava(JavaUtil.java:176)
        at org.jruby.javasupport.JavaUtil.convertRubyToJava(JavaUtil.java:66)
        at org.jruby.RubyArray.toArray(RubyArray.java:2374)
        at java.util.ArrayList.<init>(ArrayList.java:136)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at 
org.jruby.javasupport.JavaConstructor.new_instance(JavaConstructor.java:195)
        at 
org.jruby.javasupport.JavaConstructorInvoker$new_instance_method_0_0.call(Unknown
 Source)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:261)
        at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:670)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:324)
        at 
org.jruby.evaluator.ASTInterpreter.setupArgs(ASTInterpreter.java:2173)
        at 
org.jruby.evaluator.ASTInterpreter.attrAssignNode(ASTInterpreter.java:571)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:309)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:620)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:318)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:170)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:174)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:150)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:204)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:107)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:264)
        at 
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1134)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:370)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:170)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:174)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:150)
        at org.jruby.RubyClass.invoke(RubyClass.java:238)
        at 
org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:271)
        at org.jruby.RubyObject.callMethod(RubyObject.java:717)
        at org.jruby.RubyClass.newInstance(RubyClass.java:273)
        at org.jruby.RubyClassInvoker$newInstance_method_0_0.call(Unknown 
Source)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:66)
        at 
org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:76)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:107)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:264)
        at 
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1134)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:370)
        at 
org.jruby.evaluator.ASTInterpreter.localAsgnNode(ASTInterpreter.java:1295)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:403)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:620)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:318)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:170)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:174)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:150)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:267)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:155)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:332)
        at ruby.__dash_e__.__file__(-e:1)
        at ruby.__dash_e__.__file__(-e)
        at ruby.__dash_e__.load(-e)
        at org.jruby.Ruby.runScript(Ruby.java:512)
        at org.jruby.Ruby.runNormally(Ruby.java:432)
        at org.jruby.Ruby.runFromMain(Ruby.java:312)
        at org.jruby.Main.run(Main.java:144)
        at org.jruby.Main.run(Main.java:89)
        at org.jruby.Main.main(Main.java:80)
{quote}

Thanks in advance.


-- 
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


Reply via email to