Permalink
Browse files

Replace FindClass with GetObjectClass in jnizengarden.cpp. Faster/eas…

…ier operation.
  • Loading branch information...
Martin Roth
Martin Roth committed May 22, 2010
1 parent 5e4823e commit ec5aef7a20ec889fd3f5ec6279cd0f23e6603fb4
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/me/rjdj/zengarden/jnizengarden.cpp
@@ -51,15 +51,15 @@ extern "C" {
switch (function) {
case ZG_PRINT_STD: {
env->CallVoidMethod(zgObject,
- env->GetMethodID(env->FindClass("me/rjdj/zengarden/ZenGarden"), "onPrintStd",
- "(Ljava/lang/String;)V"),
+ env->GetMethodID(env->GetObjectClass(zgObject),
+ "onPrintStd", "(Ljava/lang/String;)V"),
env->NewStringUTF((char *) ptr));
break;
}
case ZG_PRINT_ERR: {
env->CallVoidMethod(zgObject,
- env->GetMethodID(env->FindClass("me/rjdj/zengarden/ZenGarden"), "onPrintErr",
- "(Ljava/lang/String;)V"),
+ env->GetMethodID(env->GetObjectClass(zgObject),
+ "onPrintErr", "(Ljava/lang/String;)V"),
env->NewStringUTF((char *) ptr));
break;
}

0 comments on commit ec5aef7

Please sign in to comment.