how to retransform a class at runtime
Short Answer Don’t iterate through all the loaded classes from Instrumentation. Instead, just examine the class name passed in to the transformer and if it matches your target class, then transform it. Otherwise, simply return the passed classfileBuffer unmodified. Make the set up calls outside the transformer, (i.e. in your case, do the following from … Read more