Created
August 29, 2008 07:37
-
-
Save nicksieger/7932 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/org/jruby/javasupport/JavaUtil.java b/src/org/jruby/javasupport/JavaUtil.java | |
index e8de4c4..eb0842e 100644 | |
--- a/src/org/jruby/javasupport/JavaUtil.java | |
+++ b/src/org/jruby/javasupport/JavaUtil.java | |
@@ -868,6 +868,8 @@ public class JavaUtil { | |
public static Object convertArgumentToType(ThreadContext context, IRubyObject arg, Class target) { | |
if (arg instanceof JavaObject) { | |
return coerceJavaObjectToType(context, ((JavaObject)arg).getValue(), target); | |
+ } else if (arg.respondsTo("java_object")) { | |
+ return convertArgumentToType(context, arg.callMethod(context, "java_object"), target); | |
} else if (arg.dataGetStruct() instanceof JavaObject) { | |
JavaObject innerWrapper = (JavaObject)arg.dataGetStruct(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment