Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add missing class initializer for VM.java.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 13 Feb 2013 09:19:10 +0000 (10:19 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 13 Feb 2013 09:59:40 +0000 (10:59 +0100)
src/bindings/java/jmsg_vm.c
src/bindings/java/jmsg_vm.h
src/bindings/java/org/simgrid/msg/VM.java

index 626afd5..0980d90 100644 (file)
@@ -11,6 +11,8 @@
 #include "msg/msg.h"
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(jmsg);
 
+static jfieldID jvm_field_bind;
+
 void jvm_bind(JNIEnv *env, jobject jvm, msg_vm_t vm) {
   (*env)->SetLongField(env, jvm, jvm_field_bind, (intptr_t)vm);
 }
index 4933969..b0146de 100644 (file)
@@ -12,8 +12,6 @@
 #include <jni.h>
 #include "msg/msg.h"
 
-jfieldID jvm_field_bind;
-
 void jvm_bind(JNIEnv *env, jobject jvm, msg_vm_t vm);
 msg_vm_t jvm_get_native(JNIEnv *env, jobject jvm);
 
index 785c3df..13fa595 100644 (file)
@@ -95,4 +95,12 @@ public class VM {
        public String getName() {
                return name;
        }               
+
+       /**
+        * Class initializer, to initialize various JNI stuff
+        */
+       public static native void nativeInit();
+       static {
+               nativeInit();
+       }
 }