return null from JNIEnv::GetSuperclass for interfaces per spec

This commit is contained in:
Joel Dice 2012-09-28 15:03:14 -06:00
parent 23ea8f7d76
commit 1d4c9d32fb
2 changed files with 15 additions and 10 deletions

View File

@ -2378,10 +2378,13 @@ extern "C" JNIEXPORT int64_t JNICALL
Avian_java_lang_Class_getSuperclass
(Thread* t, object, uintptr_t* arguments)
{
object super = classSuper
(t, jclassVmClass(t, reinterpret_cast<object>(arguments[0])));
return super ? reinterpret_cast<int64_t>(getJClass(t, super)) : 0;
object class_ = jclassVmClass(t, reinterpret_cast<object>(arguments[0]));
if (classFlags(t, class_) & ACC_INTERFACE) {
return 0;
} else {
object super = classSuper(t, class_);
return super ? reinterpret_cast<int64_t>(getJClass(t, super)) : 0;
}
}
extern "C" JNIEXPORT void

View File

@ -431,12 +431,14 @@ GetObjectClass(Thread* t, jobject o)
uint64_t
getSuperclass(Thread* t, uintptr_t* arguments)
{
jclass c = reinterpret_cast<jclass>(arguments[0]);
object super = classSuper(t, jclassVmClass(t, *c));
return super ? reinterpret_cast<uint64_t>
(makeLocalReference(t, getJClass(t, super))) : 0;
object class_ = jclassVmClass(t, *reinterpret_cast<jclass>(arguments[0]));
if (classFlags(t, class_) & ACC_INTERFACE) {
return 0;
} else {
object super = classSuper(t, class_);
return super ? reinterpret_cast<uint64_t>
(makeLocalReference(t, getJClass(t, super))) : 0;
}
}
jclass JNICALL