mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8004823: Add VM support for type annotation reflection
Reviewed-by: dholmes, coleenp
This commit is contained in:
parent
9c761152db
commit
6ed6cb5375
22 changed files with 302 additions and 11 deletions
|
@ -771,6 +771,10 @@ oop Reflection::new_method(methodHandle method, bool intern_name, bool for_const
|
|||
typeArrayOop an_oop = Annotations::make_java_array(method->annotation_default(), CHECK_NULL);
|
||||
java_lang_reflect_Method::set_annotation_default(mh(), an_oop);
|
||||
}
|
||||
if (java_lang_reflect_Method::has_type_annotations_field()) {
|
||||
typeArrayOop an_oop = Annotations::make_java_array(method->type_annotations(), CHECK_NULL);
|
||||
java_lang_reflect_Method::set_type_annotations(mh(), an_oop);
|
||||
}
|
||||
return mh();
|
||||
}
|
||||
|
||||
|
@ -849,6 +853,10 @@ oop Reflection::new_field(fieldDescriptor* fd, bool intern_name, TRAPS) {
|
|||
typeArrayOop an_oop = Annotations::make_java_array(fd->annotations(), CHECK_NULL);
|
||||
java_lang_reflect_Field::set_annotations(rh(), an_oop);
|
||||
}
|
||||
if (java_lang_reflect_Field::has_type_annotations_field()) {
|
||||
typeArrayOop an_oop = Annotations::make_java_array(fd->type_annotations(), CHECK_NULL);
|
||||
java_lang_reflect_Field::set_type_annotations(rh(), an_oop);
|
||||
}
|
||||
return rh();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue