Add PythonJavaClass special case to subclasscheck.

This commit is contained in:
Dan 2017-12-13 09:42:16 -05:00
parent 50b66da8d4
commit de76124bfc
1 changed files with 9 additions and 1 deletions

View File

@ -128,7 +128,15 @@ class MetaJavaClass(MetaJavaBase):
if jcs is not None: if jcs is not None:
obj = jcs.j_cls obj = jcs.j_cls
if NULL != obj: if NULL == obj:
if isinstance(value, PythonJavaClass):
for interface in getattr(value, '__javainterfaces__', []):
obj = j_env[0].FindClass(j_env, interface)
if obj == NULL:
j_env[0].ExceptionClear(j_env)
elif 0 != j_env[0].IsAssignableFrom(j_env, obj, me.j_cls):
return True
else:
if 0 != j_env[0].IsAssignableFrom(j_env, obj, me.j_cls): if 0 != j_env[0].IsAssignableFrom(j_env, obj, me.j_cls):
return True return True