# HG changeset patch # User sla # Date 1391437460 -3600 # Node ID fd07a7e4222b9f73ab493f336a5b34bc3931c817 # Parent d1621038becf263e8d82f95a21eb58ac0a0ef4cd 8033126: Can't call default methods from JNI Reviewed-by: dholmes, acorn, kamg diff -r d1621038becf -r fd07a7e4222b src/share/vm/prims/jni.cpp --- a/src/share/vm/prims/jni.cpp Thu Jan 23 09:06:21 2014 +0100 +++ b/src/share/vm/prims/jni.cpp Mon Feb 03 15:24:20 2014 +0100 @@ -1356,9 +1356,13 @@ // interface call KlassHandle h_holder(THREAD, holder); - int itbl_index = m->itable_index(); - Klass* k = h_recv->klass(); - selected_method = InstanceKlass::cast(k)->method_at_itable(h_holder(), itbl_index, CHECK); + if (call_type == JNI_VIRTUAL) { + int itbl_index = m->itable_index(); + Klass* k = h_recv->klass(); + selected_method = InstanceKlass::cast(k)->method_at_itable(h_holder(), itbl_index, CHECK); + } else { + selected_method = m; + } } }