diff src/share/vm/classfile/defaultMethods.cpp @ 13414:379f11bc04fc

8028438: static superclass method masks default methods Reviewed-by: hseigel, lfoltan, coleenp
author acorn
date Tue, 03 Dec 2013 11:13:14 -0800
parents fce21ac5968d
children 02f27ecb4f3a 2353011244bd
line wrap: on
line diff
--- a/src/share/vm/classfile/defaultMethods.cpp	Tue Dec 03 08:36:15 2013 -0800
+++ b/src/share/vm/classfile/defaultMethods.cpp	Tue Dec 03 11:13:14 2013 -0800
@@ -625,13 +625,13 @@
   while (super != NULL) {
     for (int i = 0; i < super->methods()->length(); ++i) {
       Method* m = super->methods()->at(i);
-      if (m->is_overpass()) {
+      if (m->is_overpass() || m->is_static()) {
         // m is a method that would have been a miranda if not for the
         // default method processing that occurred on behalf of our superclass,
         // so it's a method we want to re-examine in this new context.  That is,
         // unless we have a real implementation of it in the current class.
         Method* impl = klass->lookup_method(m->name(), m->signature());
-        if (impl == NULL || impl->is_overpass()) {
+        if (impl == NULL || impl->is_overpass() || impl->is_static()) {
           if (!already_in_vtable_slots(slots, m)) {
             slots->append(new EmptyVtableSlot(m));
           }
@@ -648,7 +648,7 @@
         // so it's a method we want to re-examine in this new context.  That is,
         // unless we have a real implementation of it in the current class.
         Method* impl = klass->lookup_method(m->name(), m->signature());
-        if (impl == NULL || impl->is_overpass()) {
+        if (impl == NULL || impl->is_overpass() || impl->is_static()) {
           if (!already_in_vtable_slots(slots, m)) {
             slots->append(new EmptyVtableSlot(m));
           }