//test if we are receiving or sending a task.
jboolean jreceiving = env->GetBooleanField(jcomm, jcomm_field_Comm_receiving);
if (jreceiving == JNI_TRUE) {
//bind the task object.
msg_task_t task = MSG_comm_get_task(comm);
xbt_assert(task != nullptr, "Task is nullptr");
//test if we are receiving or sending a task.
jboolean jreceiving = env->GetBooleanField(jcomm, jcomm_field_Comm_receiving);
if (jreceiving == JNI_TRUE) {
//bind the task object.
msg_task_t task = MSG_comm_get_task(comm);
xbt_assert(task != nullptr, "Task is nullptr");