X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fjava.c;h=c8d70f516dbbba9f030a691a1499b5a52541fd86;hp=3089a5337fdc4b21b5c592d06185789da8e72107;hb=633c3966f770e4d46651a2fe219a18d8a9907a9f;hpb=853b3da5d4c6614d7db4093f57b1ca4f57b6c485 diff --git a/src/java.c b/src/java.c index 3089a533..c8d70f51 100644 --- a/src/java.c +++ b/src/java.c @@ -17,7 +17,7 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Authors: - * Florian octo Forster + * Florian octo Forster * Justo Alonso Achaques **/ @@ -906,7 +906,7 @@ static jobject ctoj_notification (JNIEnv *jvm_env, /* {{{ */ #undef SET_STRING /* Set the `time' member. Java stores time in milliseconds. */ - status = ctoj_long (jvm_env, ((jlong) n->time) * ((jlong) 1000), + status = ctoj_long (jvm_env, (jlong) CDTIME_T_TO_MS (n->time), c_notification, o_notification, "setTime"); if (status != 0) { @@ -1306,7 +1306,7 @@ static int jtoc_notification (JNIEnv *jvm_env, notification_t *n, /* {{{ */ return (-1); } /* Java measures time in milliseconds. */ - n->time = (time_t) (tmp_long / ((jlong) 1000)); + n->time = MS_TO_CDTIME_T(tmp_long); status = jtoc_int (jvm_env, &tmp_int, class_ptr, object_ptr, "getSeverity"); @@ -1932,7 +1932,9 @@ static int cjni_init_native (JNIEnv *jvm_env) /* {{{ */ api_class_ptr = (*jvm_env)->FindClass (jvm_env, "org/collectd/api/Collectd"); if (api_class_ptr == NULL) { - ERROR ("cjni_init_native: Cannot find API class `org/collectd/api/Collectd'."); + ERROR ("cjni_init_native: Cannot find the API class \"org.collectd.api" + ".Collectd\". Please set the correct class path " + "using 'JVMArg \"-Djava.class.path=...\"'."); return (-1); } @@ -2254,7 +2256,6 @@ static int cjni_config_plugin_block (oconfig_item_t *ci) /* {{{ */ cjni_callback_info_t *cbi; jobject o_ocitem; const char *name; - int status; size_t i; jclass class; @@ -2309,7 +2310,7 @@ static int cjni_config_plugin_block (oconfig_item_t *ci) /* {{{ */ method = (*jvm_env)->GetMethodID (jvm_env, class, "config", "(Lorg/collectd/api/OConfigItem;)I"); - status = (*jvm_env)->CallIntMethod (jvm_env, + (*jvm_env)->CallIntMethod (jvm_env, cbi->object, method, o_ocitem); (*jvm_env)->DeleteLocalRef (jvm_env, o_ocitem); @@ -2435,7 +2436,7 @@ static void cjni_callback_info_destroy (void *arg) /* {{{ */ cbi = (cjni_callback_info_t *) arg; - /* This condition can occurr when shutting down. */ + /* This condition can occur when shutting down. */ if (jvm == NULL) { sfree (cbi); @@ -3078,9 +3079,8 @@ static int cjni_init (void) /* {{{ */ if (config_block != NULL) { - int status; - status = cjni_config_perform (config_block); + cjni_config_perform (config_block); oconfig_free (config_block); config_block = NULL; }