Issue Details (XML | Word | Printable)

Key: HARMONY-4927
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Alexey Varlamov
Reporter: Alexey Varlamov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Harmony

[drlvm][kernel] cannot modify final instance fields via reflection

Created: 11/Oct/07 06:29 AM   Updated: 27/Nov/07 07:09 AM
Return to search
Component/s: DRLVM
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Issue Links:
Duplicate
 

Estimated Complexity: Novice
Resolution Date: 27/Nov/07 07:09 AM


 Description  « Hide
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.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Gregory Shimansky made changes - 15/Oct/07 12:29 PM
Field Original Value New Value
Summary [drlvm][kernel classes] cannot modify final instance fields via reflection [drlvm][kernel] cannot modify final instance fields via reflection
Alexey Varlamov made changes - 27/Nov/07 06:11 AM
Link This issue is duplicated by HARMONY-5199 [ HARMONY-5199 ]
Alexey Varlamov made changes - 27/Nov/07 07:09 AM
Assignee Alexey Varlamov [ varlax ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]