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);
if (!storage) { /* invalid name */
jxbt_throw_storage_not_found(env, name);
env->ReleaseStringUTFChars(jname, name);
- return NULL;
+ return nullptr;
}
env->ReleaseStringUTFChars(jname, name);
if (!jstorage) {
jxbt_throw_jni(env, "java storage instantiation failed");
- return NULL;
+ return nullptr;
}
/* get a global reference to the newly created storage */
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);
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);
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);
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++) {