I\'m using some annotations to dynamically set values of fields in classes. Since I want to do this regardless of whether it\'s public, protected, or private, I am a calling
The getDeclaredField method has to return a new object each time, exactly because this object has the mutable accessible flag. So there is no need to reset the flag. You can find the full details in this blog post.