1.1 --- a/src/share/vm/prims/jvmtiClassFileReconstituter.cpp Wed May 01 09:00:39 2013 -0700 1.2 +++ b/src/share/vm/prims/jvmtiClassFileReconstituter.cpp Fri May 03 12:24:11 2013 +0200 1.3 @@ -513,6 +513,11 @@ 1.4 AnnotationArray* param_anno = method->parameter_annotations(); 1.5 AnnotationArray* default_anno = method->annotation_default(); 1.6 1.7 + // skip generated default interface methods 1.8 + if (method->is_overpass()) { 1.9 + return; 1.10 + } 1.11 + 1.12 write_u2(access_flags.get_flags() & JVM_RECOGNIZED_METHOD_MODIFIERS); 1.13 write_u2(const_method->name_index()); 1.14 write_u2(const_method->signature_index()); 1.15 @@ -619,8 +624,19 @@ 1.16 HandleMark hm(thread()); 1.17 Array<Method*>* methods = ikh()->methods(); 1.18 int num_methods = methods->length(); 1.19 + int num_overpass = 0; 1.20 1.21 - write_u2(num_methods); 1.22 + // count the generated default interface methods 1.23 + // these will not be re-created by write_method_info 1.24 + // and should not be included in the total count 1.25 + for (int index = 0; index < num_methods; index++) { 1.26 + Method* method = methods->at(index); 1.27 + if (method->is_overpass()) { 1.28 + num_overpass++; 1.29 + } 1.30 + } 1.31 + 1.32 + write_u2(num_methods - num_overpass); 1.33 if (JvmtiExport::can_maintain_original_method_order()) { 1.34 int index; 1.35 int original_index;