Disable Java reflection for the current thread
问题 I need to call some semi-trustworthy Java code and want to disable the ability to use reflection for the duration of that code\'s execution. try{ // disable reflection somehow someObject.method(); } finally{ // enable reflection again } Can this be done with a SecurityManager, and if so, how? Clarification/Context: This is a follow-up to another question about restricting the packages that can be called from JavaScript/Rhino. The accepted answer references a blog entry on how to do that, and