X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b81fbca63e1c91d6c0084ed124988e4bbbf6d56b..f734ec7475682eb90323e804cbcfddd7e4523992:/src/bindings/java/jmsg_process.cpp diff --git a/src/bindings/java/jmsg_process.cpp b/src/bindings/java/jmsg_process.cpp index 184e259cf5..023e19907f 100644 --- a/src/bindings/java/jmsg_process.cpp +++ b/src/bindings/java/jmsg_process.cpp @@ -9,9 +9,9 @@ #include "jmsg_process.h" -#include "jmsg.h" +#include "jmsg.hpp" #include "jmsg_host.h" -#include "jxbt_utilities.h" +#include "jxbt_utilities.hpp" #include "JavaContext.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java); @@ -101,7 +101,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID(JNIEnv * env, jcl msg_process_t process = MSG_process_from_PID(pid); if (not process) { - jxbt_throw_process_not_found(env, bprintf("PID = %d",static_cast(pid))); + jxbt_throw_process_not_found(env, std::string("PID = ") + std::to_string(static_cast(pid))); return nullptr; } @@ -156,7 +156,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_suspend(JNIEnv * env, jobjec /* try to suspend the process */ msg_error_t rv = MSG_process_suspend(process); - jxbt_check_res("MSG_process_suspend()", rv, MSG_OK, bprintf("unexpected error , please report this bug")); + jxbt_check_res("MSG_process_suspend()", rv, MSG_OK, "unexpected error , please report this bug"); } JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_resume(JNIEnv * env, jobject jprocess) @@ -170,7 +170,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_resume(JNIEnv * env, jobject /* try to resume the process */ msg_error_t res = MSG_process_resume(process); - jxbt_check_res("MSG_process_resume()", res, MSG_OK, bprintf("unexpected error , please report this bug")); + jxbt_check_res("MSG_process_resume()", res, MSG_OK, "unexpected error , please report this bug"); } JNIEXPORT void @@ -217,13 +217,6 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cl if (rv != MSG_OK) { XBT_DEBUG("Something during the MSG_process_sleep invocation was wrong, trigger a HostFailureException"); - //jmsg_throw_status(env,rv); - - // adsein, the code above as been replaced by the code below. Indeed, according to the documentation, a sleep can only - // trigger a host_failure exception. When the sleep crashes due to a host shutdown, the exception thrown by smx_context_java.c - // is a cancelled_error, see bindings/java/smx_context_java.c, function void smx_ctx_java_stop(smx_context_t context) and src/msg/msg_gos.c - // function msg_error_t MSG_process_sleep(double nb_sec) - jxbt_throw_host_failure(env, ""); } }