changeset 5892:fd07a7e4222b

8033126: Can't call default methods from JNI Reviewed-by: dholmes, acorn, kamg
author sla
date Mon, 03 Feb 2014 15:24:20 +0100
parents d1621038becf
children d69952503db0
files src/share/vm/prims/jni.cpp
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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;
+      }
     }
   }