Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
useless cleanups to the Java bindings
[simgrid.git] / src / bindings / java / jmsg_vm.cpp
index 31a61a6..12d1fe1 100644 (file)
@@ -1,23 +1,19 @@
-/* Functions related to the MSG VM API. */
+/* Functions related to the Virtual Machines.                               */
 
-/* Copyright (c) 2012-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved.          */
 
 /* 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"
-#include "jmsg_process.h"
 #include "jxbt_utilities.h"
-#include "simgrid/msg.h"
-#include <surf/surf_routing.h>
+#include "xbt/ex.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(jmsg);
 
+SG_BEGIN_DECL()
+
 static jfieldID jvm_field_bind;
 
 void jvm_bind(JNIEnv *env, jobject jvm, msg_vm_t vm)
@@ -34,9 +30,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_nativeInit(JNIEnv *env, jclass cl
 {
   jclass jprocess_class_VM = env->FindClass("org/simgrid/msg/VM");
   jvm_field_bind = jxbt_get_jfield(env, jprocess_class_VM, "bind", "J");
-  if (!jvm_field_bind  ) {
-    jxbt_throw_native(env,bprintf("Can't find some fields in Java class. You should report this bug."));
-  }
+  xbt_assert(jvm_field_bind, "Native initialization of msg/VM failed. Please report that bug");
 }
 
 JNIEXPORT jint JNICALL Java_org_simgrid_msg_VM_isCreated(JNIEnv * env, jobject jvm)
@@ -126,3 +120,4 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_resume(JNIEnv *env, jobject jvm)
   MSG_vm_resume(vm);
 }
 
+SG_END_DECL()