--- a/src/hotspot/share/oops/method.cpp Wed Feb 13 12:01:09 2019 +0100
+++ b/src/hotspot/share/oops/method.cpp Tue Feb 26 08:01:20 2019 -0500
@@ -2120,7 +2120,8 @@
// Can't assert the method_holder is the same because the new method has the
// scratch method holder.
assert(resolve_jmethod_id(jmid)->method_holder()->class_loader()
- == new_method->method_holder()->class_loader(),
+ == new_method->method_holder()->class_loader() ||
+ new_method->method_holder()->class_loader() == NULL, // allow Unsafe substitution
"changing to a different class loader");
// Just change the method in place, jmethodID pointer doesn't change.
*((Method**)jmid) = new_method;