changeset 22737:c2f6dd6c9628

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 6c317cced072
children e2e6f03308f9
files hotspot/src/share/vm/prims/jni.cpp
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/share/vm/prims/jni.cpp	Mon Feb 03 13:41:26 2014 +0100
+++ b/hotspot/src/share/vm/prims/jni.cpp	Mon Feb 03 15:24:20 2014 +0100
@@ -1320,9 +1320,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;
+      }
     }
   }