Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move parts of the kernel to the right subdir
[simgrid.git] / src / bindings / java / jmsg_vm.cpp
index 7ab77aa..063819d 100644 (file)
@@ -6,6 +6,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <xbt/ex.hpp>
+
 #include "jmsg.h"
 #include "jmsg_vm.h"
 #include "jmsg_host.h"
@@ -128,12 +130,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");
   }
 }