Setting a class field array via reflection

Actually… it does work!

I read the exception more carefully… how could it think I was trying to assign a string to the float array?

D’OH! Because I was using the wrong parm in field.set()!

I was passing in the attr as the first parm, not the class. :crazy_face: I’ll blame my oversight on tiredness and age.

// wrongBad: field.set(attr, arr);
field.set(tmp, arr); // rightGood

Sorry for distracting you from your other matters. Thank you again, GTL, for your customary willingness to help someone in need!

1 Like