jshort index=-1;
jint index=-1;
getAlgIndex(JNIEnv *env, jobject alg){    jclass algClass;	jshort index=-1;    jfieldID indexField;    PR_ASSERT(env!=NULL && alg!=NULL);    algClass = (*env)->GetObjectClass(env, alg);#ifdef DEBUG    /* Make sure this really is an Algorithm. */    {    jclass realClass = ((*env)->FindClass(env, ALGORITHM_CLASS_NAME));    PR_ASSERT( (*env)->IsInstanceOf(env, alg, realClass) );    }#endif    indexField = (*env)->GetFieldID(                                    env,                                    algClass,                                    OID_INDEX_FIELD_NAME,                                    OID_INDEX_FIELD_SIG);    if(indexField==NULL) {        ASSERT_OUTOFMEM(env);        goto finish;    }    index = (*env)->GetShortField(env, alg, indexField);	PR_ASSERT( (index >= 0) && (index < NUM_ALGS) );finish:    return index;}