src/share/vm/runtime/reflection.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8014013 Sdiff src/share/vm/runtime

src/share/vm/runtime/reflection.cpp

Print this page




 935         // resolve interface call
 936         if (ReflectionWrapResolutionErrors) {
 937           // new default: 6531596
 938           // Match resolution errors with those thrown due to reflection inlining
 939           // Linktime resolution & IllegalAccessCheck already done by Class.getMethod()
 940           method = resolve_interface_call(klass, reflected_method, target_klass, receiver, THREAD);
 941           if (HAS_PENDING_EXCEPTION) {
 942           // Method resolution threw an exception; wrap it in an InvocationTargetException
 943             oop resolution_exception = PENDING_EXCEPTION;
 944             CLEAR_PENDING_EXCEPTION;
 945             JavaCallArguments args(Handle(THREAD, resolution_exception));
 946             THROW_ARG_0(vmSymbols::java_lang_reflect_InvocationTargetException(),
 947                 vmSymbols::throwable_void_signature(),
 948                 &args);
 949           }
 950         } else {
 951           method = resolve_interface_call(klass, reflected_method, target_klass, receiver, CHECK_(NULL));
 952         }
 953       }  else {
 954         // if the method can be overridden, we resolve using the vtable index.

 955         int index  = reflected_method->vtable_index();
 956         method = reflected_method;
 957         if (index != Method::nonvirtual_vtable_index) {
 958           // target_klass might be an arrayKlassOop but all vtables start at
 959           // the same place. The cast is to avoid virtual call and assertion.
 960           InstanceKlass* inst = (InstanceKlass*)target_klass();
 961           method = methodHandle(THREAD, inst->method_at_vtable(index));
 962         }
 963         if (!method.is_null()) {
 964           // Check for abstract methods as well
 965           if (method->is_abstract()) {
 966             // new default: 6531596
 967             if (ReflectionWrapResolutionErrors) {
 968               ResourceMark rm(THREAD);
 969               Handle h_origexception = Exceptions::new_exception(THREAD,
 970                      vmSymbols::java_lang_AbstractMethodError(),
 971                      Method::name_and_sig_as_C_string(target_klass(),
 972                      method->name(),
 973                      method->signature()));
 974               JavaCallArguments args(h_origexception);




 935         // resolve interface call
 936         if (ReflectionWrapResolutionErrors) {
 937           // new default: 6531596
 938           // Match resolution errors with those thrown due to reflection inlining
 939           // Linktime resolution & IllegalAccessCheck already done by Class.getMethod()
 940           method = resolve_interface_call(klass, reflected_method, target_klass, receiver, THREAD);
 941           if (HAS_PENDING_EXCEPTION) {
 942           // Method resolution threw an exception; wrap it in an InvocationTargetException
 943             oop resolution_exception = PENDING_EXCEPTION;
 944             CLEAR_PENDING_EXCEPTION;
 945             JavaCallArguments args(Handle(THREAD, resolution_exception));
 946             THROW_ARG_0(vmSymbols::java_lang_reflect_InvocationTargetException(),
 947                 vmSymbols::throwable_void_signature(),
 948                 &args);
 949           }
 950         } else {
 951           method = resolve_interface_call(klass, reflected_method, target_klass, receiver, CHECK_(NULL));
 952         }
 953       }  else {
 954         // if the method can be overridden, we resolve using the vtable index.
 955         assert(!reflected_method->has_itable_index(), "");
 956         int index = reflected_method->vtable_index();
 957         method = reflected_method;
 958         if (index != Method::nonvirtual_vtable_index) {
 959           // target_klass might be an arrayKlassOop but all vtables start at
 960           // the same place. The cast is to avoid virtual call and assertion.
 961           InstanceKlass* inst = (InstanceKlass*)target_klass();
 962           method = methodHandle(THREAD, inst->method_at_vtable(index));
 963         }
 964         if (!method.is_null()) {
 965           // Check for abstract methods as well
 966           if (method->is_abstract()) {
 967             // new default: 6531596
 968             if (ReflectionWrapResolutionErrors) {
 969               ResourceMark rm(THREAD);
 970               Handle h_origexception = Exceptions::new_exception(THREAD,
 971                      vmSymbols::java_lang_AbstractMethodError(),
 972                      Method::name_and_sig_as_C_string(target_klass(),
 973                      method->name(),
 974                      method->signature()));
 975               JavaCallArguments args(h_origexception);


src/share/vm/runtime/reflection.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File