RFC (csr): 8221528: Introduce compatibility mode with VM option -XX:AllowRedefinitionToAddOrDeleteMethods
Michael Rasmussen
Michael.Rasmussen at roguewave.com
Thu Mar 28 12:25:41 UTC 2019
>> Removing this capability would remove this support. I would assume that would cause users a lot of headache, since from a user's point-of-view, they are just changing the method body, which should be supported!
> It will depend on how the user is generating the modified classfile
> bytes for the redefinition. And we certainly want to hear about such cases.
> David
While I don't have any metrics readily available to back up my claim, my assumption is that users debugging their application via their IDE (be that IntelliJ IDEA, Eclipse, NetBeans, etc), and using its built-in support to recompile and redefine classes, would be one of the biggest use-cases for redefineClass and the adding/removing of private methods due to changing lambdas in method bodies. IDEs generally javac or ecj, or something derived from that, to do the compilation, to generate the bytes to redefine.
Many users are aware of the limitations that you cannot add/remove members of a class (many using tools like JRebel to overcome those limitations), but I doubt many realize that adding/changing a lambda in a method does exactly this!
Removing the capability of adding/removing private methods would thus have an impact on these users.
/Michael
More information about the serviceability-dev
mailing list