Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bad cast.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 10 Mar 2019 14:34:36 +0000 (15:34 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 10 Mar 2019 16:24:19 +0000 (17:24 +0100)
src/bindings/java/jxbt_utilities.cpp

index d6e18c9..896c622 100644 (file)
@@ -6,6 +6,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "jxbt_utilities.hpp"
+#include "xbt/string.hpp"
 #include "xbt/sysdep.h"
 
 #include <cstdlib> /* abort */
@@ -162,7 +163,7 @@ void jxbt_throw_jni(JNIEnv* env, const std::string& msg)
 void jxbt_throw_notbound(JNIEnv* env, const std::string& kind, void* pointer)
 {
   jxbt_throw_by_name(env, "org/simgrid/msg/JniException",
-                     "Internal error: " + kind + " " + static_cast<const char*>(pointer) + " not bound");
+                     simgrid::xbt::string_printf("Internal error: %s %p not bound", kind.c_str(), pointer));
 }
 
 void jxbt_throw_null(JNIEnv* env, const std::string& msg)