JNI field validation?

Bryce McKinlay bryce@albatross.co.nz
Wed Mar 21 21:17:00 GMT 2001


"Marcus G. Daniels" wrote:

> In jni.cc, in the function _Jv_JNI_GetAnyFieldID, there's a check to see
> if the field type requested matches the one found while iterating
> through the fields.  To do this it calls _Jv_FindClassFromSignature, but
> that doesn't handle array signatures like "[java/lang/Class;".

Well, it appears that it should:

jclass
_Jv_FindClassFromSignature (char *sig, java::lang::ClassLoader *loader)
{
  switch (*sig)
    {
       ....
    case '[':
      return _Jv_GetArrayClass (_Jv_FindClassFromSignature (&sig[1],
loader),
    loader);

Or are you saying that it needs to substitute "/" for "." somewhere?

regards

  [ bryce ]




More information about the Java mailing list