- msg_comm_t comm = (msg_comm_t) (long) (*env)->GetLongField(env, jcomm, jcomm_field_Comm_bind);
- //test if we are receiving or sending a task.
- jboolean jreceiving = (*env)->GetBooleanField(env, jcomm, jcomm_field_Comm_receiving);
- if (jreceiving == JNI_TRUE) {
- //bind the task object.
- m_task_t task = MSG_comm_get_task(comm);
- xbt_assert(task != NULL, "Task is NULL");
- jobject jtask_global = MSG_task_get_data(task);
- //case where the data has already been retrieved
- if (jtask_global == NULL) {
- return;
- }
-
- //Make sure the data will be correctly gc.
- jobject jtask_local = (*env)->NewLocalRef(env, jtask_global);
- (*env)->DeleteGlobalRef(env, jtask_global);
-
- (*env)->SetObjectField(env, jcomm, jtask_field_Comm_task, jtask_local);
-
- MSG_task_set_data(task, NULL);
- }
+ msg_comm_t comm = (msg_comm_t) (long) (*env)->GetLongField(env, jcomm, jcomm_field_Comm_bind);
+ //test if we are receiving or sending a task.
+ jboolean jreceiving = (*env)->GetBooleanField(env, 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 != NULL, "Task is NULL");
+ jobject jtask_global = MSG_task_get_data(task);
+ //case where the data has already been retrieved
+ if (jtask_global == NULL) {
+ return;
+ }
+
+ //Make sure the data will be correctly gc.
+ jobject jtask_local = (*env)->NewLocalRef(env, jtask_global);
+ (*env)->DeleteGlobalRef(env, jtask_global);
+
+ (*env)->SetObjectField(env, jcomm, jtask_field_Comm_task, jtask_local);
+
+ MSG_task_set_data(task, NULL);
+ }