mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8247444: Trust final fields in records
Co-authored-by: Christoph Dreis <christoph.dreis@freenet.de> Reviewed-by: jrose, dholmes, forax, coleenp, vlivanov
This commit is contained in:
parent
983e012c9f
commit
f2b191a6e9
26 changed files with 227 additions and 49 deletions
|
@ -897,6 +897,9 @@ oop Reflection::new_field(fieldDescriptor* fd, TRAPS) {
|
|||
java_lang_reflect_Field::set_slot(rh(), fd->index());
|
||||
java_lang_reflect_Field::set_name(rh(), name());
|
||||
java_lang_reflect_Field::set_type(rh(), type());
|
||||
if (fd->is_trusted_final()) {
|
||||
java_lang_reflect_Field::set_trusted_final(rh());
|
||||
}
|
||||
// Note the ACC_ANNOTATION bit, which is a per-class access flag, is never set here.
|
||||
java_lang_reflect_Field::set_modifiers(rh(), fd->access_flags().as_int() & JVM_RECOGNIZED_FIELD_MODIFIERS);
|
||||
java_lang_reflect_Field::set_override(rh(), false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue