natVMProxy.cc (run_proxy): Use _Jv_LookupProxyMethod to find the Method.
2007-04-02 Andrew Haley <aph@redhat.com> * java/lang/reflect/natVMProxy.cc (run_proxy): Use _Jv_LookupProxyMethod to find the Method. If parameter_types->length == 0, pass a null paramameter list, not a zero-length parameter list. * java/lang/natClass.cc (_Jv_LookupProxyMethod): New function. * java/lang/Class.h (_Jv_LookupProxyMethod): Declare. From-SVN: r123431
This commit is contained in:
parent
e6c45b1e34
commit
a0036853d2
7 changed files with 67 additions and 7 deletions
|
@ -29,6 +29,7 @@ details. */
|
|||
#include <java/lang/reflect/Member.h>
|
||||
#include <java/lang/reflect/Method.h>
|
||||
#include <java/lang/reflect/Field.h>
|
||||
#include <java/lang/reflect/Proxy.h>
|
||||
#include <java/lang/reflect/Constructor.h>
|
||||
#include <java/lang/AbstractMethodError.h>
|
||||
#include <java/lang/ArrayStoreException.h>
|
||||
|
@ -1652,6 +1653,39 @@ _Jv_LookupDeclaredMethod (jclass klass, _Jv_Utf8Const *name,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
// The rules for finding proxy methods are different: first we search
|
||||
// the interfaces implemented by a proxy, then the methods declared in
|
||||
// class Proxy.
|
||||
|
||||
java::lang::reflect::Method *
|
||||
_Jv_LookupProxyMethod (jclass proxyClass, _Jv_Utf8Const *name,
|
||||
_Jv_Utf8Const *signature)
|
||||
{
|
||||
using namespace java::lang::reflect;
|
||||
jclass declaringClass;
|
||||
_Jv_Method * m;
|
||||
|
||||
for (int i = 0; i < proxyClass->interface_count; i++)
|
||||
{
|
||||
declaringClass = proxyClass->interfaces[i];
|
||||
m = _Jv_GetMethodLocal (declaringClass, name, signature);
|
||||
if (m)
|
||||
break;
|
||||
}
|
||||
if (!m)
|
||||
m = _Jv_LookupDeclaredMethod (&Proxy::class$,
|
||||
name,
|
||||
signature,
|
||||
&declaringClass);
|
||||
|
||||
Method *rmethod = new Method ();
|
||||
rmethod->offset = (char*) m - (char*) declaringClass->methods;
|
||||
rmethod->declaringClass = declaringClass;
|
||||
return rmethod;
|
||||
}
|
||||
|
||||
|
||||
|
||||
java::lang::reflect::Method *
|
||||
_Jv_GetReflectedMethod (jclass klass, _Jv_Utf8Const *name,
|
||||
_Jv_Utf8Const *signature)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue