X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6a7d64f00ba3d28fa6ec6994eea90b456d85be6d..84402e8e2ee2a2d0bef25fdceb0a263ed8b471f6:/src/bindings/java/jmsg_as.cpp diff --git a/src/bindings/java/jmsg_as.cpp b/src/bindings/java/jmsg_as.cpp index 2e08d3b20a..d9fddbd071 100644 --- a/src/bindings/java/jmsg_as.cpp +++ b/src/bindings/java/jmsg_as.cpp @@ -1,6 +1,6 @@ /* Java bindings of the NetZones. */ -/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2020. 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. */ @@ -55,28 +55,28 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_As_nativeInit(JNIEnv* env, jclass cl } JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getName(JNIEnv * env, jobject jas) { - simgrid::s4u::NetZone* as = jnetzone_get_native(env, jas); + const simgrid::s4u::NetZone* as = jnetzone_get_native(env, jas); return env->NewStringUTF(as->get_cname()); } JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getSons(JNIEnv * env, jobject jas) { int index = 0; jobjectArray jtable; - sg_netzone_t self_as = jnetzone_get_native(env, jas); + const simgrid::s4u::NetZone* self_as = jnetzone_get_native(env, jas); jclass cls = env->FindClass("org/simgrid/msg/As"); if (not cls) return nullptr; - jtable = env->NewObjectArray(static_cast(self_as->get_children()->size()), cls, nullptr); + jtable = env->NewObjectArray(static_cast(self_as->get_children().size()), cls, nullptr); if (not jtable) { jxbt_throw_jni(env, "Hosts table allocation failed"); return nullptr; } - for (auto const& tmp_as : *self_as->get_children()) { + for (auto const& tmp_as : self_as->get_children()) { jobject tmp_jas = jnetzone_new_instance(env); if (not tmp_jas) { jxbt_throw_jni(env, "java As instantiation failed"); @@ -96,7 +96,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getSons(JNIEnv * env, job } JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getProperty(JNIEnv *env, jobject jas, jobject jname) { - simgrid::s4u::NetZone* as = jnetzone_get_native(env, jas); + const simgrid::s4u::NetZone* as = jnetzone_get_native(env, jas); if (not as) { jxbt_throw_notbound(env, "as", jas); @@ -121,7 +121,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv * env, jo jobjectArray jtable; jobject jhost; jstring jname; - simgrid::s4u::NetZone* as = jnetzone_get_native(env, jas); + const simgrid::s4u::NetZone* as = jnetzone_get_native(env, jas); jclass cls = jxbt_get_class(env, "org/simgrid/msg/Host"); if (not cls)