Closed JakubGorski closed 7 years ago
The only reason I had for implementing the new method was to protect users from their own mistakes - not let them change the final variables unless they consciously use the new method. But I agree such approach may not be needed.
Thanks for the update. I see your point, although, jOOR is a library that allows users to do precisely these things, including setting private
members (things that probably won't work with Java 9 and/or a proper SecurityManager
).
Since these things are possible to do with the reflection API, they should be possible to do with jOOR, too.
Nice idea with the nested properties in testFinalFieldAdvanced()
, btw
Will also add a fat disclaimer in the Javadoc about this: http://pveentjer.blogspot.co.at/2017/01/final-static-boolean-jit.html
Thank you very much for your suggestion. I will comment on the different commits