On Sun, 27 Nov 2011 14:20:17 +0100, Ben Schulz <[email protected]> wrote:
As far as I am aware there is no (Java-standard-compliant) way to
change the value of static final fields (excepting of course the
previously noted System.in, out and err). And as far as the JVM is
concerned the same holds true for non-static final fields. Just
recently Cliff Click wrote two blog posts about that[1,2].
With kind regards
Ben
[1]:
http://www.azulsystems.com/blog/cliff/2011-10-17-writing-to-final-fields-via-reflection
[2]: http://www.azulsystems.com/blog/cliff/2011-10-27-final-fields-part-2
Some people argue the opposite:
http://stackoverflow.com/questions/2474017/using-reflection-to-change-static-final-file-separatorchar-for-unit-testing
Didn't find the time to try it, though.
--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
[email protected]
http://tidalwave.it - http://fabriziogiudici.it
--
You received this message because you are subscribed to the Google Groups "The Java
Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/javaposse?hl=en.