Unfortunately, Method objects are not immutable. Since Java 2, Method extends AccessibleObject , which has a setAccessible(boolean) method.
Thus, not only methods have a mutable property, this flag has security implications that prohibit the sharing of Method objects.
Note that under the hood, Method objects exchange their common immutable state through a delegate object, so what you get from Class.getMethod is just a cheap external object consisting of this mutable flag and a link to the general representation of the canonical method.
source share