src/share/vm/oops/klassVtable.cpp

Print this page

        

@@ -1230,12 +1230,18 @@
   itableMethodEntry* ime = method_entry(0);
   for (int i = 0; i < _size_method_table; i++) {
     Method* m = ime->method();
     if (m != NULL &&
         (NOT_PRODUCT(!m->is_valid() ||) m->is_old() || m->is_obsolete())) {
+      if (m->method_holder() != SystemDictionary::misc_Unsafe_klass() ||
+          m->name() != vmSymbols::throwIllegalAccessError_name()) {
       return false;
     }
+      // replace the old Unsafe.throwIllegalAccessError() method
+      // with the latest version
+      ime->initialize(Universe::throw_illegal_access_error());
+    }
     ime++;
   }
   return true;
 }