ClassDefinition[] definitions = new ClassDefinition[reloadMap.size()];
String[] classNames = new String[reloadMap.size()];
int i = 0;
for (Map.Entry<Class<?>, byte[]> entry : reloadMap.entrySet()) {
classNames[i] = entry.getKey().getName();
definitions[i++] = new ClassDefinition(entry.getKey(), entry.getValue());
}
try {
LOGGER.reload("Reloading classes {} (autoHotswap)", Arrays.toString(classNames));
instrumentation.redefineClasses(definitions);
LOGGER.debug("... reloaded classes {} (autoHotswap)", Arrays.toString(classNames));