diff src/share/vm/code/dependencies.cpp @ 22940:dc2f15e0caee

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 c4f1e23c4139
children d8f133adf05d
line wrap: on
line diff
--- a/src/share/vm/code/dependencies.cpp	Thu Apr 09 02:41:45 2015 +0000
+++ b/src/share/vm/code/dependencies.cpp	Thu Mar 12 14:15:09 2015 +0100
@@ -811,7 +811,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;
   }