Static final fields are non-modifiable via java.lang.reflect.Field::set.
In JDI, ObjectReference::setValue throws IllegalArgumentException if the given Field is static final field (see ReferenceTypeImpl::validateFieldSet)
Non-static final fields in a hidden class are non-modifiable via java.lang.reflect.Field::set.
ObjectReference::setValue should respect the spec of Field::set that ObjectReference::setValue can change the value of a given Field if it is modifiable.
It's unclear if the spec of ObjectReference::setValue should clarifiy the behavior regardless of the value of the accessible flag of the given Field.
In JDI, ObjectReference::setValue throws IllegalArgumentException if the given Field is static final field (see ReferenceTypeImpl::validateFieldSet)
Non-static final fields in a hidden class are non-modifiable via java.lang.reflect.Field::set.
ObjectReference::setValue should respect the spec of Field::set that ObjectReference::setValue can change the value of a given Field if it is modifiable.
It's unclear if the spec of ObjectReference::setValue should clarifiy the behavior regardless of the value of the accessible flag of the given Field.
- relates to
-
JDK-8280798 com.sun.jdi.ObjectReference::setValue spec should prohibit any final field modification
- Resolved
-
JDK-8238358 Implementation of JEP 371: Hidden Classes
- Resolved
-
JDK-8247444 Trust final fields in records
- Resolved