From 6d91a2fe6278feb2c98a90a0a967f16eef82d9e8 Mon Sep 17 00:00:00 2001 From: Benson Margulies Date: Thu, 30 Apr 2015 14:04:58 -0400 Subject: [PATCH] Fix 159: passing the result of autoclass to java.lang.Class parameter. --- jnius/jnius_utils.pxi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jnius/jnius_utils.pxi b/jnius/jnius_utils.pxi index 31bdc6d..2e2b0ae 100644 --- a/jnius/jnius_utils.pxi +++ b/jnius/jnius_utils.pxi @@ -278,6 +278,11 @@ cdef int calculate_score(sign_args, args, is_varargs=False) except *: continue return -1 + # accept an autoclass class for java/lang/Class. + if hasattr(arg, '__javaclass__') and r == 'java/lang/Class': + score += 10 + continue + # if we pass a JavaClass, ensure the definition is matching # XXX FIXME what if we use a subclass or something ? if isinstance(arg, JavaClass):