--- old/src/hotspot/share/classfile/classLoaderData.cpp 2020-08-05 15:53:48.130153192 -0700 +++ new/src/hotspot/share/classfile/classLoaderData.cpp 2020-08-05 15:53:47.770139640 -0700 @@ -968,3 +968,12 @@ } return false; } + +InstanceKlass* ClassLoaderData::replace_class(Symbol* class_name, InstanceKlass* k) { + assert_locked_or_safepoint(SystemDictionary_lock); + Dictionary* dict = dictionary(); + unsigned hash = dict->compute_hash(class_name); + int index = dict->hash_to_index(hash); + + return dict->replace_class(index, hash, class_name, k); +}