Reputation: 836
Does anyone know if Field.getDouble(Object) boxes and unboxes a double internally?
Thanks, RB
Upvotes: 1
Views: 346
Reputation: 1932
Per the Sun/Oracle Reflection API tutorial:
When using reflection, type checking only occurs at runtime so there is no opportunity to box the value. ...To eliminate this exception, the problematic line should be replaced by the following invocation of Field.set(Object obj, Object value): f.set(ft, new Integer(43));
Upvotes: 0
Reputation: 533710
If you use Field.getDouble() on a double
field, there is no auto boxing/unboxing. This method existed long before this was available.
Upvotes: 1