diff src/share/vm/code/dependencies.cpp @ 21111:91d70d102132

8069263: assert(fm == NULL || fm->method_holder() == _participants[n]) failed: sanity Summary: default methods added to classes confuse dependency processing Reviewed-by: kvn
author roland
date Thu, 12 Mar 2015 14:15:09 +0100
parents 7848fc12602b
children be896a1983c0
line wrap: on
line diff
--- a/src/share/vm/code/dependencies.cpp	Wed Apr 22 11:38:25 2015 -0700
+++ b/src/share/vm/code/dependencies.cpp	Thu Mar 12 14:15:09 2015 +0100
@@ -1029,7 +1029,13 @@
     assert((uint)n <= (uint)_num_participants, "oob");
     Method* fm = _found_methods[n];
     assert(n == _num_participants || fm != NULL, "proper usage");
-    assert(fm == NULL || fm->method_holder() == _participants[n], "sanity");
+    if (fm != NULL && fm->method_holder() != _participants[n]) {
+      // Default methods from interfaces can be added to classes. In
+      // that case the holder of the method is not the class but the
+      // interface where it's defined.
+      assert(fm->is_default_method(), "sanity");
+      return NULL;
+    }
     return fm;
   }