Issue Type: Bug Bug
Affects Versions: JRuby 1.7.0.pre1, JRuby 1.7.0.pre2
Assignee: Unassigned
Components: Embedding, Java Integration
Created: 09/Aug/12 5:33 AM
Description:

We register a proc as an onClickListener and if the proc returns nil everything is OK, but if it returns non-nil we get this error:

W/System.err( 1846): org.jruby.exceptions.RaiseException: (TypeError) failed to coerce org.rubototest.multiact.MultiactActivity to void

Downgrading to JRuby 1.6.7.2 works, so I would call it a regression.

A workaround is to add "; nil" to the end of the block.

Here is a stack trace of the call into the proc:

W/System.err( 1914): 	at java.lang.reflect.Constructor.constructNative(Native Method)
W/System.err( 1914): 	at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
W/System.err( 1914): 	at org.jruby.javasupport.JavaConstructor.newInstanceDirect(JavaConstructor.java:275)
W/System.err( 1914): 	at org.jruby.java.invokers.ConstructorInvoker.call(ConstructorInvoker.java:91)
W/System.err( 1914): 	at org.jruby.java.invokers.ConstructorInvoker.call(ConstructorInvoker.java:178)
W/System.err( 1914): 	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:322)
W/System.err( 1914): 	at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:178)
W/System.err( 1914): 	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:182)
W/System.err( 1914): 	at org.jruby.java.proxies.ConcreteJavaProxy$2.call(ConcreteJavaProxy.java:52)
W/System.err( 1914): 	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:322)
W/System.err( 1914): 	at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:178)
W/System.err( 1914): 	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:182)
W/System.err( 1914): 	at org.jruby.RubyClass.newInstance(RubyClass.java:863)
W/System.err( 1914): 	at org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)
W/System.err( 1914): 	at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrOneOrNBlock.call(JavaMethod.java:274)
W/System.err( 1914): 	at org.jruby.java.proxies.ConcreteJavaProxy$3.call(ConcreteJavaProxy.java:148)
W/System.err( 1914): 	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
W/System.err( 1914): 	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
W/System.err( 1914): 	at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
W/System.err( 1914): 	at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
W/System.err( 1914): 	at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
W/System.err( 1914): 	at org.jruby.ast.RescueNode.executeBody(RescueNode.java:226)
W/System.err( 1914): 	at org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:123)
W/System.err( 1914): 	at org.jruby.ast.RescueNode.interpret(RescueNode.java:113)
W/System.err( 1914): 	at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
W/System.err( 1914): 	at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
W/System.err( 1914): 	at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
W/System.err( 1914): 	at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
W/System.err( 1914): 	at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
W/System.err( 1914): 	at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:197)
W/System.err( 1914): 	at org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:128)
W/System.err( 1914): 	at org.jruby.runtime.Block.call(Block.java:89)
W/System.err( 1914): 	at org.jruby.RubyProc.call(RubyProc.java:271)
W/System.err( 1914): 	at org.jruby.RubyProc.call(RubyProc.java:223)
W/System.err( 1914): 	at org.jruby.javasupport.JavaUtil$1.call(JavaUtil.java:237)
W/System.err( 1914): 	at org.jruby.javasupport.util.RuntimeHelpers$MethodMissingMethod.call(RuntimeHelpers.java:489)
W/System.err( 1914): 	at org.jruby.javasupport.util.RuntimeHelpers.callMethodMissing(RuntimeHelpers.java:416)
W/System.err( 1914): 	at org.jruby.RubyClass.finvoke(RubyClass.java:728)
W/System.err( 1914): 	at org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:549)
W/System.err( 1914): 	at org.jruby.javasupport.Java$6.invoke(Java.java:1193)
W/System.err( 1914): 	at $Proxy0.onClick(Native Method)
W/System.err( 1914): 	at android.view.View.performClick(View.java:4084)
W/System.err( 1914): 	at android.view.View$PerformClick.run(View.java:16966)
W/System.err( 1914): 	at android.os.Handler.handleCallback(Handler.java:615)
W/System.err( 1914): 	at android.os.Handler.dispatchMessage(Handler.java:92)
W/System.err( 1914): 	at android.os.Looper.loop(Looper.java:137)
W/System.err( 1914): 	at android.app.ActivityThread.main(ActivityThread.java:4745)
W/System.err( 1914): 	at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err( 1914): 	at java.lang.reflect.Method.invoke(Method.java:511)
W/System.err( 1914): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
W/System.err( 1914): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
W/System.err( 1914): 	at dalvik.system.NativeStart.main(Native Method)

Any help is welcome.

Environment: Only reproduced in Ruboto, yet.
Android 2.3/4.1
Java 6/7
Fix Versions: JRuby 1.7.0.RC1
Project: JRuby
Priority: Major Major
Reporter: Uwe Kubosch
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
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