link-grammar-5.8.0/bindings/java-jni/jni-client.c
/* message: The string is encoded in modified UTF-8, per JNI 1.5 spec. */
The string is encoded in modified UTF-8, per JNI 1.5 spec.
The string is encoded in modified UTF - 8 per JNI 1 . 5 spec .
static void throwException(JNIEnv *env, const char* message)
{
	char *msg;
	jclass exceptionClazz;
	if ((*env)->ExceptionOccurred(env) != NULL) return;
	msg = (char *) malloc(50+strlen(message));
	strcpy(msg, "link-grammar JNI:\n");
	strcat(msg, message);
	exceptionClazz = (*env)->FindClass(env, "java/lang/RuntimeException");
	if ((*env)->ThrowNew(env, exceptionClazz, msg) != 0)
		(*env)->FatalError(env, "Fatal: link-grammar JNI: Cannot throw");
	free(msg);
}
static void throwException ( JNIEnv * env , const char * message ) { char * msg ; jclass exceptionClazz ; if ( ( * env ) -> ExceptionOccurred ( env ) != NULL ) return ; msg = ( char * ) malloc ( 50 + strlen ( message ) ) ; strcpy ( msg , " \n " ) ; strcat ( msg , message ) ; exceptionClazz = ( * env ) -> FindClass ( env , " " ) ; if ( ( * env ) -> ThrowNew ( env , exceptionClazz , msg ) != 0 ) ( * env ) -> FatalError ( env , " " ) ; free ( msg ) ; }
message: The string is encoded in modified UTF-8, per JNI 1.5 spec.
message : The string is encoded in modified UTF - 8 per JNI 1 . 5 spec .
// I'm confused. Apparently Java exceptions return ??