-
Notifications
You must be signed in to change notification settings - Fork 424
Open
Description
我的代码修改如下
@native_method
def get_superclass(self, uc, env, clazz_idx):
"""
If clazz represents any class other than the class Object, then this function returns the object that represents the superclass of the class specified by clazz.
If clazz specifies the class Object, or clazz represents an interface, this function returns NULL.
"""
clazz = self.get_reference(clazz_idx)
if not isinstance(clazz, jclass):
raise ValueError('Expected a jclass.')
# pony modfy start
# Create class instance.
class_obj = clazz.value
pyclass = class_obj
logger.debug("JNIEnv->GetSuperClass (%s) is called, index %d" % (pyclass.jvm_name, clazz_idx) )
pyclazz_super = pyclass.jvm_super
if (not pyclazz_super):
raise RuntimeError("super class for %s is None!!! you should at least inherit Object!!!")
#
logger.debug("JNIEnv->GetSuperClass (%s) return (%s)"%(pyclass.jvm_name, pyclazz_super.jvm_name))
# clazz_super_object = pyclazz_super.class_object
return self.add_local_reference(jclass(pyclazz_super))
# pony modfy end
Metadata
Metadata
Assignees
Labels
No labels