Invoking private/protected java no-args method with null argument leads to NPE
------------------------------------------------------------------------------

                 Key: JRUBY-4599
                 URL: http://jira.codehaus.org/browse/JRUBY-4599
             Project: JRuby
          Issue Type: Bug
          Components: Java Integration
    Affects Versions: JRuby 1.4
            Reporter: Vladimir Sizikov


We have java integration specs for that, but the failures were hidden by RSpec 
1.2.9 bug. Upgrade to 1.3.0 to see the crashes.

Alternatively, here's the standalone example (it assumes that the file is in 
the root of JRuby repo and jruby-test-classes.jar is already build via ant spec 
or similar):

{code}
require 'java'
require File.dirname(__FILE__) + '/build/jruby-test-classes.jar'
import 'java_integration.fixtures.PackageStaticMethod'

method = PackageStaticMethod.java_class.declared_method_smart 
:thePackageScopeMethod
method.accessible = true    
method.invoke Java.ruby_to_java(nil)
{code}

{noformat}
jruby spec-t.rb
JavaMethod.java:232:in `invoke': java.lang.NullPointerException
        from 
org/jruby/javasupport/JavaMethod$i_method_0_0$RUBYINVOKER$invoke.gen:-1:in 
`call'
        from JavaMethod.java:630:in `call'
        from DynamicMethod.java:186:in `call'
        from CachingCallSite.java:309:in `cacheAndCall'
        from CachingCallSite.java:148:in `call'
        from spec-t.rb:7:in `__file__'
        from spec-t.rb:-1:in `load'
        from Ruby.java:651:in `runScript'
        from Ruby.java:569:in `runNormally'
        from Ruby.java:415:in `runFromMain'
        from Main.java:275:in `run'
        from Main.java:117:in `run'
        from Main.java:97:in `main'
{noformat}

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