Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / src / bindings / java / jmsg_vm.cpp
index 608d9f8..8ce32c8 100644 (file)
@@ -100,7 +100,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm,
   // disk_path = (*env)->GetStringUTFChars(env, jdiskpath, 0);
   // disk_path = xbt_strdup(disk_path);
 
-  msg_vm_t vm = MSG_vm_create(host, name, (int) jncore, (int) jramsize, (int) jnetcap, NULL, (int) jdisksize,
+  msg_vm_t vm = MSG_vm_create(host, name, (int) jncore, (int) jramsize, (int) jnetcap, nullptr, (int) jdisksize,
                               (int) jmig_netspeed, (int) jdp_intensity);
 
   jvm_bind(env,jvm,vm);
@@ -128,12 +128,11 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_internalmig(JNIEnv *env, jobject
 {
   msg_vm_t vm = jvm_get_native(env,jvm);
   msg_host_t host = jhost_get_native(env, jhost);
-  xbt_ex_t e;
-  TRY{
+  try {
     MSG_vm_migrate(vm,host);
-  } CATCH(e){
-     XBT_VERB("CATCH EXCEPTION MIGRATION %s",e.msg);
-     xbt_ex_free(e);
+  }
+  catch(xbt_ex& e){
+     XBT_VERB("CATCH EXCEPTION MIGRATION %s",e.what());
      jxbt_throw_host_failure(env, (char*)"during migration");
   }
 }