Java interface mocking with mocha causes NPE
--------------------------------------------

                 Key: JRUBY-4356
                 URL: http://jira.codehaus.org/browse/JRUBY-4356
             Project: JRuby
          Issue Type: Bug
          Components: Java Integration
    Affects Versions: JRuby 1.5
         Environment: jruby 1.5.0.dev (ruby 1.8.7 patchlevel 174) (2009-12-13 
5b119f3) (Java HotSpot(TM) Client VM 1.6.0_16) [i386-java]
            Reporter: Hiroshi Nakamura
         Attachments: interface_mocking_test.rb

HEAD of JRuby master causes NPE for attached test script.
Followings are my test results for current master (NPE) and 1.4GA (runs without 
problem).
Tests for jruby-openssl depends on this behavior.

NB: org.jruby.ext.openssl.impl.Mime is a Java interface.

----

0% /home/nahi/git/jruby/bin/jruby -v 
-I/home/nahi/git/jruby-openssl/lib:/home/nahi/git/jruby-openssl/mocha/lib 
interface_mocking_test.rb 
jruby 1.5.0.dev (ruby 1.8.7 patchlevel 174) (2009-12-13 5b119f3) (Java 
HotSpot(TM) Client VM 1.6.0_16) [i386-java]
Loaded suite interface_mocking_test
Started
RubyBasicObject.java:587:in `getJavaClass': java.lang.NullPointerException
        from CallableSelector.java:251:in `classHashCode'
        from CallableSelector.java:221:in `argsHashCode'
        from CallableSelector.java:45:in `matchingCallableArityOne'
        from RubyToJavaInvoker.java:100:in `findCallableArityOne'
        from ConstructorInvoker.java:102:in `call'
        from ConstructorInvoker.java:199:in `call'
        from CachingCallSite.java:319:in `cacheAndCall'
        from CachingCallSite.java:157:in `callBlock'
        from CachingCallSite.java:162:in `call'
        from ConcreteJavaProxy.java:43:in `call'
        from CachingCallSite.java:319:in `cacheAndCall'
        from CachingCallSite.java:157:in `callBlock'
        from CachingCallSite.java:162:in `call'
        from RubyClass.java:707:in `call'
        from DynamicMethod.java:186:in `call'
        from CachingCallSite.java:309:in `cacheAndCall'
        from CachingCallSite.java:148:in `call'
        from interface_mocking_test.rb:10:in `method__1$RUBY$test_jruby'
        from interface_mocking_test#test_jruby:-1:in `call'
        from RubyClass.java:430:in `finvoke'
        from RubyObject.java:1437:in `send'
        from org/jruby/RubyObject$i_method_multi$RUBYINVOKER$send.gen:-1:in 
`call'
        from JavaMethod.java:267:in `call'
        from CachingCallSite.java:309:in `cacheAndCall'
        from CachingCallSite.java:148:in `call'
        from FCallOneArgNode.java:36:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from RescueNode.java:225:in `executeBody'
        from RescueNode.java:147:in `interpretWithJavaExceptions'
        from RescueNode.java:110:in `interpret'
        from EnsureNode.java:96:in `interpret'
        from BeginNode.java:83:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from EnsureNode.java:96:in `interpret'
        from BeginNode.java:83:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:192:in `call'
        from DefaultMethod.java:179:in `call'
        from CachingCallSite.java:319:in `cacheAndCall'
        from CachingCallSite.java:157:in `callBlock'
        from CachingCallSite.java:162:in `call'
        from CallOneArgBlockPassNode.java:60:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from InterpretedBlock.java:317:in `evalBlockBody'
        from InterpretedBlock.java:268:in `yield'
        from Block.java:194:in `yield'
        from RubyArray.java:1611:in `eachCommon'
        from RubyArray.java:1618:in `each'
        from org/jruby/RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.gen:-1:in 
`call'
        from CachingCallSite.java:115:in `callBlock'
        from CachingCallSite.java:122:in `call'
        from CallNoArgBlockNode.java:64:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:192:in `call'
        from DefaultMethod.java:179:in `call'
        from CachingCallSite.java:319:in `cacheAndCall'
        from CachingCallSite.java:157:in `callBlock'
        from CachingCallSite.java:162:in `call'
        from CallOneArgBlockPassNode.java:60:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from InterpretedBlock.java:317:in `evalBlockBody'
        from InterpretedBlock.java:268:in `yield'
        from Block.java:194:in `yield'
        from RubyArray.java:1611:in `eachCommon'
        from RubyArray.java:1618:in `each'
        from org/jruby/RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.gen:-1:in 
`call'
        from CachingCallSite.java:299:in `cacheAndCall'
        from CachingCallSite.java:117:in `callBlock'
        from CachingCallSite.java:122:in `call'
        from CallNoArgBlockNode.java:64:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:192:in `call'
        from DefaultMethod.java:179:in `call'
        from CachingCallSite.java:319:in `cacheAndCall'
        from CachingCallSite.java:157:in `callBlock'
        from CachingCallSite.java:162:in `call'
        from CallOneArgBlockNode.java:60:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:136:in `call'
        from DefaultMethod.java:155:in `call'
        from CachingCallSite.java:289:in `cacheAndCall'
        from CachingCallSite.java:108:in `call'
        from CallNoArgNode.java:61:in `interpret'
        from ReturnNode.java:88:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from InterpretedMethod.java:136:in `call'
        from DefaultMethod.java:155:in `call'
        from CachingCallSite.java:289:in `cacheAndCall'
        from CachingCallSite.java:108:in `call'
        from VCallNode.java:85:in `interpret'
        from ReturnNode.java:88:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:136:in `call'
        from DefaultMethod.java:155:in `call'
        from CachingCallSite.java:289:in `cacheAndCall'
        from CachingCallSite.java:108:in `call'
        from CallNoArgNode.java:61:in `interpret'
        from ReturnNode.java:88:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from InterpretedMethod.java:210:in `call'
        from DefaultMethod.java:187:in `call'
        from CachingCallSite.java:329:in `cacheAndCall'
        from CachingCallSite.java:188:in `call'
        from CallTwoArgNode.java:59:in `interpret'
        from CallNoArgNode.java:61:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:136:in `call'
        from DefaultMethod.java:155:in `call'
        from CachingCallSite.java:289:in `cacheAndCall'
        from CachingCallSite.java:108:in `call'
        from CallNoArgNode.java:61:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:136:in `call'
        from DefaultMethod.java:155:in `call'
        from CachingCallSite.java:289:in `cacheAndCall'
        from CachingCallSite.java:108:in `call'
        from CallNoArgNode.java:61:in `interpret'
        from FCallOneArgNode.java:36:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from IfNode.java:119:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from InterpretedBlock.java:317:in `evalBlockBody'
        from InterpretedBlock.java:305:in `yield'
        from BlockBody.java:72:in `call'
        from BlockBody.java:78:in `call'
        from Block.java:89:in `call'
        from RubyProc.java:221:in `call'
        from RubyProc.java:204:in `call'
        from Ruby.java:2657:in `tearDown'
        from Main.java:274:in `run'
        from Main.java:117:in `run'
        from Main.java:97:in `main'

% /home/nahi/java/jruby-1.4.0/bin/jruby -v 
-I/home/nahi/git/jruby-openssl/lib:/home/nahi/git/jruby-openssl/mocha/lib 
interface_mocking_test.rb 
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java HotSpot(TM) 
Client VM 1.6.0_16) [i386-java]
/home/nahi/git/jruby-openssl/lib/openssl.rb:17 warning: no super class for 
`OpenSSL::Digest', Object assumed
Loaded suite interface_mocking_test
Started
.
Finished in 0.101 seconds.

1 tests, 0 assertions, 0 failures, 0 errors
0% 


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