X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/88f49b34e91fe95b712d1545ae71a0896f5466c1..7e34d26dd133ad8707b8322995fe7164d96a406b:/src/bindings/java/jxbt_utilities.cpp diff --git a/src/bindings/java/jxbt_utilities.cpp b/src/bindings/java/jxbt_utilities.cpp index 9eb4936451..2d61bc3e1f 100644 --- a/src/bindings/java/jxbt_utilities.cpp +++ b/src/bindings/java/jxbt_utilities.cpp @@ -1,6 +1,6 @@ /* Various JNI helper functions */ -/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2021. 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. */ @@ -9,8 +9,6 @@ #include "xbt/string.hpp" #include "xbt/sysdep.h" -#include /* abort */ - jclass jxbt_get_class(JNIEnv * env, const char *name) { jclass cls = env->FindClass(name); @@ -33,7 +31,7 @@ jmethodID jxbt_get_jmethod(JNIEnv * env, jclass cls, const char *name, const cha if (not id) { jmethodID tostr_id = env->GetMethodID(cls, "getName", "()Ljava/lang/String;"); - jstring jclassname = (jstring) env->CallObjectMethod(cls, tostr_id, nullptr); + auto jclassname = (jstring)env->CallObjectMethod(cls, tostr_id, nullptr); const char* classname = env->GetStringUTFChars(jclassname, nullptr); env->ReleaseStringUTFChars(jclassname, classname); @@ -55,7 +53,7 @@ jmethodID jxbt_get_static_jmethod(JNIEnv * env, jclass cls, const char *name, co if (not id) { jmethodID tostr_id = env->GetMethodID(cls, "getName", "()Ljava/lang/String;"); - jstring jclassname = (jstring) env->CallObjectMethod(cls, tostr_id, nullptr); + auto jclassname = (jstring)env->CallObjectMethod(cls, tostr_id, nullptr); const char* classname = env->GetStringUTFChars(jclassname, nullptr); env->ReleaseStringUTFChars(jclassname, classname); @@ -114,7 +112,7 @@ jfieldID jxbt_get_jfield(JNIEnv * env, jclass cls, const char *name, const char if (not id) { jmethodID getname_id = env->GetMethodID(cls, "getName", "()Ljava/lang/String;"); - jstring jclassname = (jstring) env->CallObjectMethod(cls, getname_id, nullptr); + auto jclassname = (jstring)env->CallObjectMethod(cls, getname_id, nullptr); const char* classname = env->GetStringUTFChars(jclassname, nullptr); env->ReleaseStringUTFChars(jclassname, classname); @@ -180,11 +178,6 @@ void jxbt_throw_host_not_found(JNIEnv* env, const std::string& invalid_name) jxbt_throw_by_name(env, "org/simgrid/msg/HostNotFoundException", "No such host: " + invalid_name); } -void jxbt_throw_storage_not_found(JNIEnv* env, const std::string& invalid_name) -{ - jxbt_throw_by_name(env, "org/simgrid/msg/StorageNotFoundException", "No such storage: " + invalid_name); -} - void jxbt_throw_process_not_found(JNIEnv* env, const std::string& invalid_name) { jxbt_throw_by_name(env, "org/simgrid/msg/ProcessNotFoundException", "No such process: " + invalid_name);