Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
-
Novice
Description
Accidentally I spotted the following minor misbehavior of reflection in DRLVM, it does not allow to modify final instance fields. The 1.5 spec of j.l.reflect.Field.set() reads:
"If the underlying field is final, the method throws an IllegalAccessException unless setAccessible(true) has succeeded for this field and this field is non-static. Setting a final field in this way is meaningful only during deserialization or reconstruction of instances of classes with blank final fields, before they are made available for access by other parts of a program. Use in any other context may have unpredictable effects, including cases in which other parts of a program continue to use the original value of this field."
BTW, I'd suggest to add a testcase for this to kernel tests rather than to regression suite.
Attachments
Issue Links
- is duplicated by
-
HARMONY-5199 [drlvm][kernel] final fields cannot be set accessible
- Closed