1.1 --- a/src/share/vm/prims/jvmtiRedefineClasses.cpp Sun Oct 06 16:13:50 2013 +0200 1.2 +++ b/src/share/vm/prims/jvmtiRedefineClasses.cpp Mon Oct 07 12:20:28 2013 -0400 1.3 @@ -2755,13 +2755,26 @@ 1.4 // InstanceKlass around to hold obsolete methods so we don't have 1.5 // any other InstanceKlass embedded vtables to update. The vtable 1.6 // holds the Method*s for virtual (but not final) methods. 1.7 - if (ik->vtable_length() > 0 && ik->is_subtype_of(_the_class_oop)) { 1.8 + // Default methods, or concrete methods in interfaces are stored 1.9 + // in the vtable, so if an interface changes we need to check 1.10 + // adjust_method_entries() for every InstanceKlass, which will also 1.11 + // adjust the default method vtable indices. 1.12 + // We also need to adjust any default method entries that are 1.13 + // not yet in the vtable, because the vtable setup is in progress. 1.14 + // This must be done after we adjust the default_methods and 1.15 + // default_vtable_indices for methods already in the vtable. 1.16 + if (ik->vtable_length() > 0 && (_the_class_oop->is_interface() 1.17 + || ik->is_subtype_of(_the_class_oop))) { 1.18 // ik->vtable() creates a wrapper object; rm cleans it up 1.19 ResourceMark rm(_thread); 1.20 ik->vtable()->adjust_method_entries(_matching_old_methods, 1.21 _matching_new_methods, 1.22 _matching_methods_length, 1.23 &trace_name_printed); 1.24 + ik->adjust_default_methods(_matching_old_methods, 1.25 + _matching_new_methods, 1.26 + _matching_methods_length, 1.27 + &trace_name_printed); 1.28 } 1.29 1.30 // If the current class has an itable and we are either redefining an