src/hotspot/share/oops/method.cpp
changeset 53924 09cba396916f
parent 53838 c8c9bd65c198
child 54042 6dd6f988b4e4
--- 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;