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_storage.cpp
index 8caed69..71bb29a 100644 (file)
@@ -61,9 +61,9 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getByName(JNIEnv * env, j
   jobject jstorage;
 
   /* get the C string from the java string */
-  if (jname == NULL) {
+  if (jname == nullptr) {
     jxbt_throw_null(env,bprintf("No host can have a null name"));
-    return NULL;
+    return nullptr;
   }
   const char *name = env->GetStringUTFChars(jname, 0);
   storage = MSG_storage_get_by_name(name);
@@ -71,7 +71,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getByName(JNIEnv * env, j
   if (!storage) {                  /* invalid name */
     jxbt_throw_storage_not_found(env, name);
     env->ReleaseStringUTFChars(jname, name);
-    return NULL;
+    return nullptr;
   }
   env->ReleaseStringUTFChars(jname, name);
 
@@ -82,7 +82,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getByName(JNIEnv * env, j
 
     if (!jstorage) {
       jxbt_throw_jni(env, "java storage instantiation failed");
-      return NULL;
+      return nullptr;
     }
 
     /* get a global reference to the newly created storage */
@@ -90,7 +90,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getByName(JNIEnv * env, j
 
     if (!jstorage) {
       jxbt_throw_jni(env, "new global ref allocation failed");
-      return NULL;
+      return nullptr;
     }
     /* Sets the java storage name */
     env->SetObjectField(jstorage, jstorage_field_Storage_name, jname);
@@ -145,13 +145,13 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getProperty(JNIEnv *env,
 
   if (!storage) {
     jxbt_throw_notbound(env, "storage", jstorage);
-    return NULL;
+    return nullptr;
   }
   const char *name = env->GetStringUTFChars((jstring) jname, 0);
 
   const char *property = MSG_storage_get_property_value(storage, name);
   if (!property) {
-    return NULL;
+    return nullptr;
   }
   jobject jproperty = env->NewStringUTF(property);
 
@@ -184,11 +184,11 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getHost(JNIEnv * env,jobj
 
   if (!storage) {
     jxbt_throw_notbound(env, "storage", jstorage);
-    return NULL;
+    return nullptr;
   }
   const char *host_name = MSG_storage_get_host(storage);
   if (!host_name) {
-    return NULL;
+    return nullptr;
   }
   jobject jhost_name = env->NewStringUTF(host_name);
 
@@ -209,14 +209,14 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Storage_all(JNIEnv * env, jc
   jclass cls = jxbt_get_class(env, "org/simgrid/msg/Storage");
 
   if (!cls) {
-    return NULL;
+    return nullptr;
   }
 
-  jtable = env->NewObjectArray((jsize) count, cls, NULL);
+  jtable = env->NewObjectArray((jsize) count, cls, nullptr);
 
   if (!jtable) {
     jxbt_throw_jni(env, "Storages table allocation failed");
-    return NULL;
+    return nullptr;
   }
 
   for (index = 0; index < count; index++) {