mirror of
https://github.com/corda/corda.git
synced 2025-01-23 04:48:09 +00:00
add Field.getDeclaredAnnotations default method for android classpath (fixes Reflection test)
This commit is contained in:
parent
2f7356863b
commit
518f428f13
@ -1968,6 +1968,62 @@ Avian_java_lang_reflect_Method_getDeclaredAnnotations
|
|||||||
0));
|
0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" AVIAN_EXPORT int64_t JNICALL
|
||||||
|
Avian_java_lang_reflect_Field_getDeclaredAnnotations(Thread* t,
|
||||||
|
object,
|
||||||
|
uintptr_t* arguments)
|
||||||
|
{
|
||||||
|
object field = arrayBody(
|
||||||
|
t,
|
||||||
|
classFieldTable(
|
||||||
|
t, jclassVmClass(t, reinterpret_cast<object>(arguments[0]))),
|
||||||
|
arguments[1]);
|
||||||
|
|
||||||
|
object addendum = fieldAddendum(t, field);
|
||||||
|
if (addendum) {
|
||||||
|
object table = addendumAnnotationTable(t, addendum);
|
||||||
|
if (table) {
|
||||||
|
PROTECT(t, field);
|
||||||
|
PROTECT(t, table);
|
||||||
|
|
||||||
|
object array
|
||||||
|
= makeObjectArray(t,
|
||||||
|
resolveClass(t,
|
||||||
|
root(t, Machine::BootLoader),
|
||||||
|
"java/lang/annotation/Annotation"),
|
||||||
|
objectArrayLength(t, table));
|
||||||
|
PROTECT(t, array);
|
||||||
|
|
||||||
|
object get = resolveMethod(t,
|
||||||
|
root(t, Machine::BootLoader),
|
||||||
|
"avian/Classes",
|
||||||
|
"getAnnotation",
|
||||||
|
"(Ljava/lang/ClassLoader;[Ljava/lang/Object;)"
|
||||||
|
"Ljava/lang/annotation/Annotation;");
|
||||||
|
PROTECT(t, get);
|
||||||
|
|
||||||
|
for (unsigned i = 0; i < objectArrayLength(t, table); ++i) {
|
||||||
|
object a
|
||||||
|
= t->m->processor->invoke(t,
|
||||||
|
get,
|
||||||
|
0,
|
||||||
|
classLoader(t, reinterpret_cast<object>(arguments[0])),
|
||||||
|
objectArrayBody(t, table, i));
|
||||||
|
|
||||||
|
set(t, array, ArrayBody + (i * BytesPerWord), a);
|
||||||
|
}
|
||||||
|
|
||||||
|
return reinterpret_cast<uintptr_t>(array);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return reinterpret_cast<uintptr_t>(makeObjectArray(
|
||||||
|
t,
|
||||||
|
resolveClass(
|
||||||
|
t, root(t, Machine::BootLoader), "java/lang/annotation/Annotation"),
|
||||||
|
0));
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" AVIAN_EXPORT int64_t JNICALL
|
extern "C" AVIAN_EXPORT int64_t JNICALL
|
||||||
Avian_java_lang_reflect_Method_getDefaultValue
|
Avian_java_lang_reflect_Method_getDefaultValue
|
||||||
(Thread* t, object, uintptr_t* arguments)
|
(Thread* t, object, uintptr_t* arguments)
|
||||||
|
Loading…
Reference in New Issue
Block a user