jOOQ / jOOR

jOOR - Fluent Reflection in Java jOOR is a very simple fluent API that gives access to your Java Class structures in a more intuitive way. The JDK's reflection APIs are hard and verbose to use. Other languages have much simpler constructs to access type meta information at runtime. Let us make Java reflection better.
http://www.jooq.org/products
Apache License 2.0
2.81k stars 376 forks source link

Support setting values on final fields #32

Closed JakubGorski closed 7 years ago

lukaseder commented 7 years ago

Thank you very much for your suggestion. I will comment on the different commits

JakubGorski commented 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.

lukaseder commented 7 years ago

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.

lukaseder commented 7 years ago

Nice idea with the nested properties in testFinalFieldAdvanced(), btw

lukaseder commented 7 years ago

Will also add a fat disclaimer in the Javadoc about this: http://pveentjer.blogspot.co.at/2017/01/final-static-boolean-jit.html